Results 1 to 7 of 7

Thread: QWizard Backbutton Ui issue

  1. #1
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QWizard Backbutton Ui issue

    Hi again!
    I'm making a little application. I've do it with QWizard and QWizardPages. I Have added 2 CustomButtons to the wizard so it has 5 buttons down: ButA, ButB, Back, Next/Finish, and Cancel.

    ButA and ButB don't have to appear in all WizardPages.
    Eg: WP0: just ButB
    WP1: ButA and ButB

    To do that, I have:

    Qt Code:
    1. void WP0::initializePage()
    2. {
    3. wizard()->button(QWizard::CustomButton1)->setVisible(false);
    4. }
    To copy to clipboard, switch view to plain text mode 
    With that when the app starts, you can't see butA. BUT if you go to the next page (where you see ButA and ButB) and then you click on BackButton, then you see ButA in WP0. I supose that then you click on BackButton there is no call to WP0::initializePage() so my question is: how or where should I call that wizard()->button(QWizard::CustomButton1)->setVisible(false);
    to never see ButA on WP0 ? Or what should I do?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QWizard Backbutton Ui issue

    One option would be to connect to the currentIdChanged() signal and do the button setup there.

    Cheers,
    _

  3. #3
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QWizard Backbutton Ui issue

    Hi,

    Do you mean to connect wp1 currentIdChanged() to wp0 custombutton ???

    I'm still trying to understand how connect works

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QWizard Backbutton Ui issue

    That is a signal of QWizard, not of the pages.

    You connect it to a slot, ideally in the class that adds the two additional buttons, and in that slot you change the button visibility based on which page is currently active.

    Cheers,
    _

  5. #5
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QWizard Backbutton Ui issue

    Hi,

    I think I understand what you mean. How should I construct that connect? If I am in Wizard class which has the buttons:

    connect(?,SIGNAL(currentIdChanged(int)),this,SLOT( ConfigMyButtons(int))

    and then make the function like:

    void Wizard::ConfigMyButtons(int i)
    {
    switch (i)
    [...]
    }
    Last edited by roseicollis; 18th December 2014 at 15:59.

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QWizard Backbutton Ui issue

    Quote Originally Posted by roseicollis View Post
    I don't know the qmake version but I'm working with Qt5 if that helps.
    Hmm? I didn't mention qmake or requested a Qt version, did I?

    Quote Originally Posted by roseicollis View Post
    I think I understand what you mean. How should I construct that connect? If I am in Wizard class which has the buttons:

    connect(?,SIGNAL(currentIdChanged(int)),this,SLOT( ConfigMyButtons(int))
    You are in the wizard class, this is a signal of QWizard, so the sender object is "this"

    Cheers,
    _

  7. #7
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QWizard Backbutton Ui issue

    Srry it was an answer to another post and I don't know how did I put it here, I already edited it.

    okok hank you!

Similar Threads

  1. QWizard
    By Tamar in forum Newbie
    Replies: 8
    Last Post: 22nd February 2011, 13:01
  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, QComboBox and registerField() issue
    By RThaden in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2008, 12:18
  5. QWizard
    By steg90 in forum Qt Programming
    Replies: 6
    Last Post: 14th December 2007, 09:37

Tags for this Thread

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.