Qt Creator: Widgets are not added to h file



  • Hello,

    I created a "Qt Gui Application" project with Qt creator 2.3.1

    The project creates: main.cpp, mainwindow (cpp+h).

    I added a "List Widget" to mainwindow.ui.

    After saving and rebuild, the "List Widget" object is not added to mainwindow.h

    Same with "Push Button" or any other widget.

    I created a signal+slot that were not added to mainwindow.h.

    I had to add them manually.

    What is the reason for this ?

    Thanks,
    Zvika.



  • the widgets are added to your ui class, you can access them via the ui pointer or member variable:

    @
    // pointer
    ui->pushButton->setText("bla");

    // member variable
    ui.listWidget->clear();
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.