Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWizard!!!
Qt 6.11 is out! See what's new in the release blog

QWizard!!!

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pedro_Monteiro
    wrote on last edited by Pedro_Monteiro
    #1

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

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      P 1 Reply Last reply
      0
      • mrjjM mrjj

        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.

        P Offline
        P Offline
        Pedro_Monteiro
        wrote on last edited by
        #3

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

        mrjjM 1 Reply Last reply
        0
        • P Pedro_Monteiro

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

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @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

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved