QWizard!!!



  • Hello, how can I omit the back button of a specific QwizardPage, and in others not omit it?
    Thanks.


  • Qt Champions 2017

    Hi
    if you remove all the buttons , how would user navigate?
    If you are just after having Pages, then a stacked widget does just that.



  • @mrjj I edited the post. The question was wrong.


  • Qt Champions 2017

    @Pedro_Monteiro
    Hi you can use setButtonLayout
    http://doc.qt.io/qt-5.5/qwizard.html#setButtonLayout
    but using it on a page by page basis might be klunky.
    Can I ask why back is not allowed on some?
    To use it.
    Define a slot in your own QWizard. ( or mainwindow)

    
    class ClassWizard : public QWizard
    {
        Q_OBJECT
    public slots:
    // called when page is changed. here we just add next.
        void PageChanged(int p) { 
            QList<QWizard::WizardButton> layout;
              layout << QWizard::Stretch << QWizard::NextButton;
              setButtonLayout(layout);
        }
    public:
        ClassWizard(QWidget *parent = 0);   
    };
    
    and hook signal up in 
    ClassWizard::ClassWizard(QWidget *parent)
        : QWizard(parent)
    {
    connect(this,&QWizard::currentIdChanged, this, &ClassWizard::PageChanged);
    }
    

    Then when page change you can add / remove buttons as you like.

    You can call
    void QWizard::next()
    to go to next page


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.