impeteperry
16th April 2007, 17:15
I have a QListWidget "lwlistData" and I want the text of the third item in the list . (n = 3);
I assume I should use
QListWidgetItem * QListWidget::item ( int row ) const
Returns the item that occupies the given row in the list if one has been set; otherwise returns 0. when I use
QString t = lwDataList->item(n - 1); I get
dlgmain.cpp:1067: error: invalid conversion from 'QListWidgetItem*' to 'char'
dlgmain.cpp:1067: error: initializing argument 1 of 'QString& QString::operator=(char)'
Please show what the command should be.
I have been using Qt3 and now Ot4 since it came out and I still have MAJOR trouble deciphering this stuff. I go to "more" and there is all kind of help for inserting items, but none that I can find on getting an item.
If for each command there was a simple example of it's use as there is on some of the commands, it would be wonderful for "stupid" people like me.
Thanks
I assume I should use
QListWidgetItem * QListWidget::item ( int row ) const
Returns the item that occupies the given row in the list if one has been set; otherwise returns 0. when I use
QString t = lwDataList->item(n - 1); I get
dlgmain.cpp:1067: error: invalid conversion from 'QListWidgetItem*' to 'char'
dlgmain.cpp:1067: error: initializing argument 1 of 'QString& QString::operator=(char)'
Please show what the command should be.
I have been using Qt3 and now Ot4 since it came out and I still have MAJOR trouble deciphering this stuff. I go to "more" and there is all kind of help for inserting items, but none that I can find on getting an item.
If for each command there was a simple example of it's use as there is on some of the commands, it would be wonderful for "stupid" people like me.
Thanks