PDA

View Full Version : A QWidgetList passed to a function does not offer the QWidgetList methods



tonnot
19th April 2011, 11:50
I have
void A_table::w_inform(QWidgetList *lista);I write lista->additem("hello");

And compiler tells me that QWidgetList has no member 'additem' ?????
Moreover, the combo does not offer me the methods for a QWidgetList ????
(It happens that it is as I pass A QList ???)
Any idea ?

Solved: it is QListWidget not QWidgetList .......
Please delete this post ....... and excuse me

Archa4
19th April 2011, 11:59
I can't understand why would u like to do that? I mean *lista is a parameter that u will use in some way, but why would u change it? U should change something that u create in your function.
But I may be wrong...

Zlatomir
19th April 2011, 12:02
QWidgetList (http://doc.qt.nokia.com/4.7/qwidget.html#QWidgetList-typedef) is a tydef for QList<QWidget*>

Is not a QListWidget (http://doc.qt.nokia.com/latest/qlistwidget.html#details).

So in the lista you can add pointers to some QWidgets, not QStrings that get converted to items (http://doc.qt.nokia.com/latest/qlistwidgetitem.html).

Archa4
19th April 2011, 12:05
XD just figured the same thing :)

tonnot
19th April 2011, 12:08
Is it possible to delete or close posts ???

wysota
19th April 2011, 12:57
Is it possible to delete or close posts ???

No, you have to bear your shame :)