Results 1 to 9 of 9

Thread: QWizard

  1. #1
    Join Date
    Feb 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Smile QWizard

    Hello,
    I am a new Qt programmer,
    I defined QWizard to display the wizard page i created.
    I want to mention that i didn't create the wizard in Qt designer.
    I want to hide the next button and i didn't suceed.
    I tried all sort of options, I know there is a function called buttons() in QWizard that returns the QAbstarctButton* and the programmer can manipulate this button by using the function setHidden(),setVisible() but nothing works.
    i realy appreciate quick answer.
    Bests
    Tamar

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QWizard

    just set the buttons you want via setButton().
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWizard

    I did it also.
    it doesnt hide the "next" button

    Bests
    Tamar

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QWizard

    Please show your code.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Feb 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWizard

    Qt Code:
    1. CFillTheBox::CFillTheBox()
    2. :QWizard()
    3. {
    4.  
    5. setPage(FillTheBoxPage_Intro, &mIntroPage);
    6. setPage(FillTheBoxPage_iTunes,&miTunesPage);
    7. setPage(FillTheBoxPage_Scan, &mSearchPage);
    8. setOption(QWizard::NoBackButtonOnStartPage,true);
    9. setStartId(FillTheBoxPage_Intro);
    10. setWindowTitle(tr("Fill the box"));
    11. QAbstractButton* nextButton = button(QWizard::NextButton);
    12. nextButton->setHidden(true);
    13. setButton(QWizard::NextButton,nextButton);
    14. }
    To copy to clipboard, switch view to plain text mode 

    I want to mention that CFillTheBox is a class that inherite from QWizard.
    and what you see here is the constructor of CFillTheBox.

    Bests
    Tamar
    Last edited by high_flyer; 22nd February 2011 at 09:06. Reason: code tags

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QWizard

    it doesnt hide the "next" button
    Sure it doesn't since you are explicitly setting it!
    See line 13 in your posted code!
    You don't need to hide buttons, you just set the ones you want.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Feb 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWizard

    I did what you said and it doesnt work either
    Qt Code:
    1. CFillTheBox::CFillTheBox()
    2. :QWizard()
    3. {
    4.  
    5. setPage(FillTheBoxPage_Intro, &mIntroPage);
    6. setPage(FillTheBoxPage_iTunes,&miTunesPage);
    7. setPage(FillTheBoxPage_Scan, &mSearchPage);
    8. setOption(QWizard::NoBackButtonOnStartPage,true);
    9. setStartId(FillTheBoxPage_Intro);
    10. setWindowTitle(tr("Fill the box"));
    11. setButton(QWizard::BackButton,new QPushButton("back"));
    12. setButton(QWizard::CancelButton,new QPushButton("cancel"));
    13. setButton(QWizard::FinishButton,new QPushButton("finish"));
    14. }
    To copy to clipboard, switch view to plain text mode 
    It still shows the "next" button
    The Qwizard has default buttons and all the default buttons are shown in the Qwizard as defult, the setButton function just create different buttons to the one that exists or create other buttons that dont exists as default in the Qwizard but doesnt hide the next button i dont want to show.
    anyway I found a way to hide the next button:

    QList<QWizard::WizardButton> layout;
    layout << QWizard::Stretch << QWizard::BackButton << QWizard::CancelButton << QWizard::FinishButton;
    setButtonLayout(layout);
    Last edited by high_flyer; 22nd February 2011 at 11:33. Reason: code tags

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QWizard

    Set the wizard option QWizard::NoDefaultButton.
    http://doc.trolltech.com/4.7/qwizard...ardOption-enum
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  9. #9
    Join Date
    Feb 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWizard

    doesnt work again.
    i used both function:
    setOption(QWizard::NoDefaultButton,true); and
    setOptions(QWizard::NoDefaultButton);

    Tamar

Similar Threads

  1. QWizard fit
    By baray98 in forum Qt Programming
    Replies: 7
    Last Post: 14th November 2010, 16:27
  2. QWizard
    By rmagro in forum Qt Programming
    Replies: 1
    Last Post: 20th October 2009, 16:12
  3. Help with QWizard
    By afflictedd2 in forum Qt Programming
    Replies: 3
    Last Post: 14th April 2009, 21:23
  4. QWizard
    By rmagro in forum Qt Programming
    Replies: 8
    Last Post: 26th September 2008, 20:41
  5. QWizard
    By steg90 in forum Qt Programming
    Replies: 6
    Last Post: 14th December 2007, 09:37

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.