Access MainWindow from different class
I do have the following classes:
int main(int argc, char *argv)
QApplication a(argc, argv);
wtr = new WindowTitleReader();
this->setWindowTitle("Selected Window Title Demo");
In WindowTitleReader i would like to add a QComboBox to MainWindow.
I tried this Code:
@ MainWindow * win = (MainWindow *) QApplication::activeWindow();
QComboBox * combo = new QComboBox(win);@
But it doesn't add my QComboBox to MainWindow.
SGaist Lifetime Qt Champion last edited by
You are taking the wrong approach, please have a look at the examples and demos that comes with Qt. They'll show in details how to build a GUI