hi d_stranz,
I already have all the pages in the *.ui file
do not need to call QWizard::addPage() to do what already is in the *.ui file
how can I use the pages for QWizard from the *.ui file?
Thanks
hi d_stranz,
I already have all the pages in the *.ui file
do not need to call QWizard::addPage() to do what already is in the *.ui file
how can I use the pages for QWizard from the *.ui file?
Thanks
Maybe this previous post will help you. I do not know which version of Qt it uses; if it is Qt 4, then some of the include files and modules in the .pro file might have changed.
If you created a wizard in designer, i.e. you have a single .ui file and that contains all pages of the wizard, then you do the same thing you would do for any normal dialog or widget.
E.g. create a QWizard derived class, add the generated class as a member and call "setupUi(this)" in the constructor.
Cheers,
_
@anda_skoa
I have tried your recommendation, yet there is error:
.../widget.cpp:9: error: no matching function for call to 'Ui::Widget::setupUi(Widget* const)'
ui->setupUi(this);
^
I have done just that: create new Widget project and add and change the *.ui file with QWizard
I am sorry, I have no idea what I am missing,
Can you please give me some hint? Thanks
This is from memory so forgive me if it is not perfect
Pro file
Wizard.hQt Code:
... HEADERS += wizard.h SOURCES += wizard.cpp FORMS += wizard.ui ...To copy to clipboard, switch view to plain text mode
Wizard.cppQt Code:
... namespace Ui { class Wizard; }; class Wizard: public QWizard { Q_OBJECT public: ~Wizard(); ... private: Ui::Wizard *ui; }To copy to clipboard, switch view to plain text mode
Qt Code:
#include "wizard.cpp" #include "ui_wizard.h" QWizard(p), ui(new Ui::Wizard) { ui->setupUi(this); } ~Wizard() { delete ui; }To copy to clipboard, switch view to plain text mode
"We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.
Thank you very much @ChrisW67 !!!
Just to save some little debugging to the future,
here is tested code fore someone else just to copy & paste.
wizadr.h
Qt Code:
#include <QWizard> namespace Ui { class Widget; } class Wizard : public QWizard { Q_OBJECT public: ~Wizard(); private: Ui::Widget *ui; };To copy to clipboard, switch view to plain text mode
wizard.cpp
Qt Code:
#include "wizard.h" #include "ui_wizard.h" QWizard(parent), ui(new Ui::Widget) { ui->setupUi(this); } Wizard::~Wizard() { delete ui; }To copy to clipboard, switch view to plain text mode
Thanks again everyone for help.
Bookmarks