cpp file doesn't see the changes of the ui file
-
Qt 6.8.1 - Mingw 13.1.0 - Windows 11 .
Hello everyone. I had a dialog (generalita) with a buttonbox, connected to the accepted and rejected signals, that worked, but not as I intended. Then in the dialog I deleted the buttonbox and inserted two pushbuttons (pushButton_ok and pushButton_cancel). Now (after using run qmake, rebuild), I still don't see the pushbuttons:
I:\xxx\Gestione_turni\generalita.cpp:9: error: 'class Ui::Generalita' has no member named 'pushButton_ok'
....\generalita.cpp:9:18: error: 'class Ui::Generalita' has no member named 'pushButton_ok'
In UI_generalita.h the change is there:
pushButton_ok = new QPushButton(Generalita);
pushButton_ok->setObjectName("pushButton_ok");
pushButton_cancel = new QPushButton(General);
pushButton_cancel->setObjectName("pushButton_cancel");
but in generalita.cpp it is not received.
What can I do, please? -
@gisac59
First thing to make sure is thatUI_generalita.h
is (a) being regenerated and (b) exists only in the build output directory and not in the source directory. So where is it? Delete it and ensureuic
is being run and generates it in right directory. -
Qt 6.8.1 - Mingw 13.1.0 - Windows 11 .
Hello everyone. I had a dialog (generalita) with a buttonbox, connected to the accepted and rejected signals, that worked, but not as I intended. Then in the dialog I deleted the buttonbox and inserted two pushbuttons (pushButton_ok and pushButton_cancel). Now (after using run qmake, rebuild), I still don't see the pushbuttons:
I:\xxx\Gestione_turni\generalita.cpp:9: error: 'class Ui::Generalita' has no member named 'pushButton_ok'
....\generalita.cpp:9:18: error: 'class Ui::Generalita' has no member named 'pushButton_ok'
In UI_generalita.h the change is there:
pushButton_ok = new QPushButton(Generalita);
pushButton_ok->setObjectName("pushButton_ok");
pushButton_cancel = new QPushButton(General);
pushButton_cancel->setObjectName("pushButton_cancel");
but in generalita.cpp it is not received.
What can I do, please? -
@jsulm
Done. Here's result:
I:\programmi per Qt\Gestione_turni\generalita.cpp:9: error: 'class Ui::Generalita' has no member named 'pushButton_ok'
....\generalita.cpp: In constructor 'Generalita::Generalita(QWidget*, int, QString)':
....\generalita.cpp:9:18: error: 'class Ui::Generalita' has no member named 'pushButton_ok' -
@jsulm
Done. Here's result:
I:\programmi per Qt\Gestione_turni\generalita.cpp:9: error: 'class Ui::Generalita' has no member named 'pushButton_ok'
....\generalita.cpp: In constructor 'Generalita::Generalita(QWidget*, int, QString)':
....\generalita.cpp:9:18: error: 'class Ui::Generalita' has no member named 'pushButton_ok' -
@gisac59
First thing to make sure is thatUI_generalita.h
is (a) being regenerated and (b) exists only in the build output directory and not in the source directory. So where is it? Delete it and ensureuic
is being run and generates it in right directory. -
-
-
@JonB Bingo! A copy of all ui_* files were in the source directory. Deleted these files, all ok.
Thanks!!!