Hi,
I have created a new widget and called it MyWidget (it includes some qcomboboxes and some qlabels); then I have created a QList like this:
QList<QWidget *> myList;
QList<QWidget *> myList;
To copy to clipboard, switch view to plain text mode
and appended 2 myWidget:
myWidget_1 = new MyWidget;
myWidget_2 = new MyWidget;
myList.append(myWidget_1);
myList.append(myWidget_2);
myWidget_1 = new MyWidget;
myWidget_2 = new MyWidget;
myList.append(myWidget_1);
myList.append(myWidget_2);
To copy to clipboard, switch view to plain text mode
Now, how can i access a combobox in one of myWidget? The following code gives error during compilation (error: ‘class QWidget’ has no member named ‘comboBox’):
int index = myList.at(0)->comboBox->currentIndex();
int index = myList.at(0)->comboBox->currentIndex();
To copy to clipboard, switch view to plain text mode
Regards
Bookmarks