You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Saturday, May 21st 2005, 4:58pm

insert listviewItem in another widget

Hello,
i put a text in a lineEdit in another widget(this work)
i want to put some values in the listview but it dont work..

what is wrong in this line here:

Quoted


ergebnis->ergebnis_lv->insertItem(
new QListViewItem (ergebnis->ergebnis_lv, mitarbeiter));
}
}



code:

Quoted


#include"ergebnise_form.h"

void Abfrage::openErgebnis()
{
Ergebnise_wt *ergebnis = new Ergebnise_wt;
ergebnis->show();


QString a = "abc";
ergebnis->lineEdit->setText(a);

QSqlQuery select = (" select mitarbeiter from mitarbeiter_tbl");
while(select.next())
{
QString mitarbeiter = select.value(0).toString();
ergebnis->ergebnis_lv->insertItem(
new QListViewItem (ergebnis->ergebnis_lv, mitarbeiter));
}
}
believe in yourself

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

2

Saturday, May 21st 2005, 5:09pm

RE: insert listviewItem in another widget

Try:

Source code

1
2
3
4
5
QSqlQuery select = (" select mitarbeiter from mitarbeiter_tbl");
while(select.next()) {    
   QString mitarbeiter = select.value(0).toString();
   new QListViewItem(ergebnis->ergebnis_lv, mitarbeiter));	
}

3

Saturday, May 21st 2005, 5:17pm

ERROR: "QListViweItem" Class have Konstruktors

Whats his??
believe in yourself

4

Saturday, May 21st 2005, 5:20pm

your sendet code is the same like mine!
believe in yourself

5

Saturday, May 21st 2005, 5:22pm

no, sorry its not the same...:)

But the same error
believe in yourself

6

Saturday, May 21st 2005, 5:24pm

Sorry this is the error:
ERROR: "QListViweItem" Class have "NO" Konstruktors
believe in yourself

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

7

Saturday, May 21st 2005, 6:57pm

Quoted

Originally posted by raphaelf
Sorry this is the error:
ERROR: "QListViweItem" Class have "NO" Konstruktors

  1. read that error message carefully,
  2. if you don't know how to fix the error, go to point 1.

8

Saturday, May 21st 2005, 7:19pm

ok :)

ERROR: "QListViweItem" Class have NO Konstruktors
believe in yourself

9

Tuesday, May 24th 2005, 5:44pm

Can nobody help me?
believe in yourself

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

10

Tuesday, May 24th 2005, 5:48pm

Could you post the exact error message and the corresponding line from your program?

11

Tuesday, May 24th 2005, 5:56pm

line:

Quoted


new QListViewItem(ergebnis->ergebnis_lv, mitarbeiter);


Error:
"QListViweItem" Class have "NO" Konstruktors
believe in yourself

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

12

Tuesday, May 24th 2005, 6:03pm

Quoted

Originally posted by raphaelf
line:

Quoted


new QListViewItem(ergebnis->ergebnis_lv, mitarbeiter);


Error:
"QListViweItem" Class have "NO" Konstruktors

Do you see the difference? Check the types of all objects in this statement.

13

Tuesday, May 24th 2005, 6:07pm

error:"QListViewItem" Class have "NO" Konstruktors

sorry
believe in yourself

14

Tuesday, May 24th 2005, 6:09pm

my code again:

Quoted


void Abfrage::openErgebnis()
{
Ergebnise_wt *ergebnis = new Ergebnise_wt;
ergebnis->show();


QString a = "abc";

//this work
ergebnis->lineEdit->setText(a);

QSqlQuery select = (" select mitarbeiter from mitarbeiter_tbl");
while(select.next())
{
QString mitarbeiter = select.value(0).toString();

//This not work
new QListViewItem(ergebnis->ergebnis_lv, mitarbeiter);

}
}

believe in yourself

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

15

Tuesday, May 24th 2005, 6:13pm

Try adding "#include <qlistviewitem.h>".

16

Tuesday, May 24th 2005, 6:17pm

thank you very much...

"#include <qlistview.h>"

not
"#include <qlistviewitem.h>".
believe in yourself

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

17

Tuesday, May 24th 2005, 6:51pm

Did it help?

18

Tuesday, May 24th 2005, 7:36pm

of course you are the best!
believe in yourself