Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

Adding widgets using successor



  • I am trying to add widgets using class, which is successor of another class. Code:
    @class1:class1(QMainWindow *parent):QMainWindow(parent){
    QWidget *window = new QWidget();
    //Adding widgets
    }@
    @class2:class2(class1 *parent):class1(parent) {
    //Adding other widgets to the same QWidget
    }@
    @int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    class1 w;
    if(w.getCmbName()=="foo") //reading current value of combobox. It was created in class1
    class2 l;
    w.show();
    return a.exec();
    }@
    I have no errors but widgets from class2 are not appear. What am I doing wrong?


Log in to reply