My guess is you added the "Q_OBJECT" macro to an existing file and you didn't rerun qmake afterwards.
My guess is you added the "Q_OBJECT" macro to an existing file and you didn't rerun qmake afterwards.
My guess is more fundamental: The declaration of those slots in the Dialog class are commented out and there is no implementation of them at all. Since the parent class (QDialog) also has no slots of those names that you inherit you get the warnings when the Designer Ui code tries to connect.
I thought i know enough to start qt, but i was wrong. But i want to finish this program. I've uncomment slots and tried with moving declaration to dialog.h and dialog.cpp. Now the problem is undefined reference to Dialog::decChanged(QString const&) and others slots in moc_dialog.cpp. Please give me instructions what to do and i will be back much more experienced...
Of course i did. Several times.
Hi,
I'm new to Qt and C++ so I'm asking questions about this problem to learn and test my knowledge. Unfortunately I don't have the "for sure" answer.
I'm not familiar with the book you are using. Does it have you modify the ui_... .h file?
I would try uncommenting the slot declarations in the dialog.h file, then add the slot functions to the dialog.cpp file e.g.
Qt Code:
{ bool ok; int num = newValue.toInt(&ok); if (ok) { } else { hexEdit->setText("0"); binEdit->setText("0"); } }To copy to clipboard, switch view to plain text mode
Bookmarks