Results 1 to 20 of 20

Thread: Need a working example of promoting QWizardPage in Qt Designer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2012
    Location
    The land of pain (NY)
    Posts
    99
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default Need a working example of promoting QWizardPage in Qt Designer

    I have been unsuccessful trying to promote QWizardPages created in Qt Designer. I can't seem to get pointed answers. Additionally this is something that is not well covered in any of the docs or any of the forums out there. Qt Designer creates as many of the pages needed. Any and all objects are only accessible from the ui object created in the one class associated with the project created.

    I very much am in need of the simplest case that initially creates a multi page wizard in the designer and allows a class to promote one (or more) of a QWizardPage to.

    Please help.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Need a working example of promoting QWizardPage in Qt Designer

    Quote Originally Posted by astodolski View Post
    I have been unsuccessful trying to promote QWizardPages created in Qt Designer. I can't seem to get pointed answers. Additionally this is something that is not well covered in any of the docs or any of the forums out there. Qt Designer creates as many of the pages needed. Any and all objects are only accessible from the ui object created in the one class associated with the project created.

    I very much am in need of the simplest case that initially creates a multi page wizard in the designer and allows a class to promote one (or more) of a QWizardPage to.
    Start Designer, choose QWizard, right click on the form (or in the object hierarchy pane on one of the pages), choose the page from the popup menu and choose "Promote". Enter desired data in the dialog, confirm and you're done.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2012
    Location
    The land of pain (NY)
    Posts
    99
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default Re: Need a working example of promoting QWizardPage in Qt Designer

    Quote Originally Posted by wysota View Post
    Start Designer, choose QWizard, right click on the form (or in the object hierarchy pane on one of the pages), choose the page from the popup menu and choose "Promote". Enter desired data in the dialog, confirm and you're done.
    I know it should be that easy - especially in light of the steps you placed. However there's one thing that's unclear. Since I already have a app that is a Wizard with multiple pages in a ui file. All objects are referenced from there and the ui object gets created from the main class. If I add wizard page classes to the main wizard class header file, I then promote each page in designer to the class name I created and reference the same header file. It's the only one anyway. The files in the project are: wizard.cpp, wizard.h, ui_wizard.h, wizard.ui. These are what was created in Qt Creator new project "wizard".

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Need a working example of promoting QWizardPage in Qt Designer

    Quote Originally Posted by astodolski View Post
    I know it should be that easy - especially in light of the steps you placed. However there's one thing that's unclear. Since I already have a app that is a Wizard with multiple pages in a ui file. All objects are referenced from there and the ui object gets created from the main class. If I add wizard page classes to the main wizard class header file, I then promote each page in designer to the class name I created and reference the same header file. It's the only one anyway. The files in the project are: wizard.cpp, wizard.h, ui_wizard.h, wizard.ui. These are what was created in Qt Creator new project "wizard".
    If you already have the pages, I don't see why you want to assemble the wizard in Designer again.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Need a working example of promoting QWizardPage in Qt Designer

    Also see the answer in the antique thread you also reopened with this question.

  6. #6
    Join Date
    Oct 2012
    Location
    The land of pain (NY)
    Posts
    99
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default Re: Need a working example of promoting QWizardPage in Qt Designer

    Quote Originally Posted by wysota View Post
    If you already have the pages, I don't see why you want to assemble the wizard in Designer again.
    I need to re-implement functions of the individual pages and access any widgets placed in those pages. What's your suggestion to do that? The only other way I see to do that is to access them from the ui object defined in the base class. How does one observe modular designs? Do you put all code in one class? So, I hope I was clearer.

    I approached wizard design by creating an app which contains QWizard as the main class. Five files are created: main.cpp, wizard.cpp, wizard.h ui_wizard.h, wizard.ui. The individual wizard pages are contained as objects from within the .ui file. I wanted to access those pages similar to the way the example wizards are designed in the examples of Qt distributions but my wizard is created in the designer.

    I hope that is clearer.

    Thanks for any help.


    Added after 22 minutes:


    Quote Originally Posted by ChrisW67 View Post
    Also see the answer in the antique thread you also reopened with this question.
    Antique indeed. It's a unique issue, not getting a lot of attention on the Qt forums out there. I suppose most prefer to build interfaces solely in code rather than use the designer.
    Last edited by astodolski; 26th October 2012 at 02:38.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Need a working example of promoting QWizardPage in Qt Designer

    Quote Originally Posted by astodolski View Post
    I need to re-implement functions of the individual pages and access any widgets placed in those pages.
    You won't be able to do that from Designer. It's for making widgets layouts, not reimplementing classes.

    What's your suggestion to do that?
    Subclass or otherwise modify the class you wish to change.

    I suppose most prefer to build interfaces solely in code rather than use the designer.
    When it comes to QWizard, there is not much to gain from using Designer to assemble it. There are more benefits if you implement each page in Designer and then put them together in code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Oct 2012
    Location
    The land of pain (NY)
    Posts
    99
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default Re: Need a working example of promoting QWizardPage in Qt Designer

    Quote Originally Posted by wysota View Post
    You won't be able to do that from Designer. It's for making widgets layouts, not reimplementing classes.


    Subclass or otherwise modify the class you wish to change.


    When it comes to QWizard, there is not much to gain from using Designer to assemble it. There are more benefits if you implement each page in Designer and then put them together in code.
    It may be I'm not properly explaining my goal. I ONLY want to use designer to perform layout and re-implement objects of such a layout in code. It's not covered in either the docs or examples how users re-implemented page methods as you described.

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Need a working example of promoting QWizardPage in Qt Designer

    Quote Originally Posted by astodolski View Post
    It may be I'm not properly explaining my goal. I ONLY want to use designer to perform layout and re-implement objects of such a layout in code. It's not covered in either the docs or examples how users re-implemented page methods as you described.
    I think you need to say what you mean by "re-implement objects" and "re-implemented page". Reimplement from where?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Oct 2012
    Location
    The land of pain (NY)
    Posts
    99
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default Re: Need a working example of promoting QWizardPage in Qt Designer

    Quote Originally Posted by wysota View Post
    I think you need to say what you mean by "re-implement objects" and "re-implemented page". Reimplement from where?
    OK, if it will help get to a solution. Objects for a wizard are defined (.h) (.ui) and implemented (.cpp) in the code files that are created in the new project designer. Accessing is through the pointer to Ui::WizardClass. Any overrides or sub-classing or reimplementing is through promoting to new classes.

    OK?

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Need a working example of promoting QWizardPage in Qt Designer

    Quote Originally Posted by astodolski View Post
    that are created in the new project designer.
    Do you mean Qt Creator's new project wizard?

    Accessing is through the pointer to Ui::WizardClass. Any overrides or sub-classing or reimplementing is through promoting to new classes.
    You can't do that in Qt Designer. The latter operates on UI files only. If you already have C++ classes that you wish to change then subclass them or simply change them and adjust their UI incarnation by changing the promotion class in Designer.

    Or maybe I just fail to see your problem.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 4
    Last Post: 25th October 2012, 18:29
  2. Qt Designer Eclipse Qt designer not working
    By vertmont in forum Qt Tools
    Replies: 0
    Last Post: 12th April 2011, 22:03
  3. Promoting widget in Designer
    By evident in forum Qt Programming
    Replies: 5
    Last Post: 24th July 2010, 22:06
  4. Replies: 3
    Last Post: 10th December 2009, 22:53
  5. Qwt plugin not working in Designer
    By Tiansen in forum Qwt
    Replies: 5
    Last Post: 9th March 2008, 16:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.