[Solved] using customized QPushButton on QWizard
-
when the connection fails the reason will be printed to the console.
Also you can check the boolean return value of the connect-statement indicating if it failed or succeeded. -
Thanks for the response. On the Application Output console, this is what I get:
@Object::connect: No such slot QWizardPage::connectionTest() in ../smif/setupwizard.cpp:272@ -
you're missing the Q_OBJECT macro ;)
@
class DatabasePage : public QWizardPage
{
Q_OBJECT
....
}
@ -
Hi,
You are missing the Q_OBJECT macro in your DatabasePage declaration
-
Thanks for pointing this out. Initially I had this macro and the error was the same.
-
Where do you declare your DatabasePage class ?
-
I have declared it in my setupWizard header file. This is how I have done it:
@
class setUpWizard : public QWizard
{
public:
enum { Page_Intro, Page_Admin, Page_School, Page_Subjects,
Page_Database, Page_Conclusion };
setUpWizard();
protected:private slots:
void showHelp();};
class DatabasePage : public QWizardPage
{public:
DatabasePage();int nextId() const;
private slots:
void connectionTest();private:
QPushButton *testConnBttn;
};@I get the following error when I assign Q_OBJECT macro to both setUPWizard class and DatabasePage class
@
C:\Users\GORDON\project\smif-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug..\smif\setupwizard.cpp:202: error: undefined reference to `vtable for DatabasePage'
@ -
This error usually appears when you didn't re-run qmake after adding/removing Q_OBJECT
-
thanks I re-run qmake and it is now working.....I glad for your help
-
You're welcome :)
Since it's working, you can update the thread's title by prepending [solved] so other forum users will know a solution has been found :)