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 ?


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

    // pointer

    // member variable

Log in to reply