1

Topic: QWizard and QWizardPage

Kind time of days, dear colleagues! A question enough simple - as in a wizard, applying QWizard and QWizardPage, to reach displays of the element shown in a picture? How it is correctly named? In the examples delivered with Qt, the given element ignored. In advance I thank, for any helps!

2

Re: QWizard and QWizardPage

Hello, AlexGin, you wrote: AG> the Question enough simple - as in a wizard, applying QWizard and QWizardPage, to reach displays of the element shown in a picture? AG> in the examples delivered with Qt, the given element ignored. It is not absolutely clear that you wanted to tell. "Ignored" - in sense in examples is not present QWizard and QWizardPage with similar functionality, or they are, but there is no that description how it is made? It can all the same something "hands" , instead of standard of delivery Qt? p.s. And the screenshot itself whence is taken? Here was: QWizard:: setSideWidget (QWidget * widget); how-to-show-steps-in-the-qwizard

3

Re: QWizard and QWizardPage

Hello, AlexGin, you wrote: AG> Kind time of days, dear colleagues! AG> a question enough simple - as in a wizard, applying QWizard and QWizardPage, to reach displays of the element shown in a picture? AG> as it is correctly named? AG> Image: wzrd1.jpg AG> in the examples delivered with Qt, the given element ignored. AG> in advance I thank, for any helps! Looks as normal QListView. Though it is possible also pens, through QVBoxLayout + QLabel to make. Anything difficult, on a floor of hour a maximum.

4

Re: QWizard and QWizardPage

Hello, Nikolaz, you wrote: N> Hello, AlexGin, you wrote: AG>> the Question enough simple - as in a wizard, applying QWizard and QWizardPage, to reach displays of the element shown in a picture? AG>> in the examples delivered with Qt, the given element ignored. N> it is not absolutely clear that you wanted to tell. N> "ignored" - in sense in examples is not present QWizard and QWizardPage with similar functionality, or they are, but there is no that description how it is made? Application QWizard and QWizardPage - in examples is. But the given functional - is not supported. N> it can all the same something "hands" , instead of standard of delivery Qt? N> p.s. And the screenshot itself whence is taken? QtCreator 4.3.1 (Based on Qt 5.9.1 (MSVC 2015, 32 bit); Built on Jun 29 2017 4:14:35 AM) N> Here was: N> QWizard:: setSideWidget (QWidget * widget); N> how-to-show-steps-in-the-qwizard Unfortunately QWizard does not provide a default way to show steps or any other kind of progress information. Using setSideWidget () seems to be the simplest way to implement this behavior. Implementing a custom widget to display the steps and highlight the current one should not be much work... That is - any the

5

Re: QWizard and QWizardPage

Hello, AlexGin, you wrote: AG> That is - any the  So after all enough simple. As there is a support of the embedding  through QWizard:: setSideWidget (QWidget * widget); And as told above, finished QListView quite approaches. Everything that is necessary: - to walk on all pages of a wizard and to add in this QListView their titles; - to interpose QListView into a wizard with the help setSideWidget (); - to trace change of the active page in a wizard and to adjust state QListView; Here  for 15 minutes

6

Re: QWizard and QWizardPage

Hello, Nikolaz, you wrote: N> Hello, AlexGin, you wrote: AG>> That is - any the  N> So after all enough simple. As there is a support of the embedding  through QWizard:: setSideWidget (QWidget * widget); in general - yes, certain simple "". N> And as told above, finished QListView quite approaches. Or, as variant QListWidget. N> everything that is necessary: N> - to walk on all pages of a wizard and to add in this QListView their titles;> - to interpose QListView into a wizard with the help setSideWidget (); N> - to trace change of the active page in a wizard and to adjust state QListView; to Trace change of the active page - IMHO through the redefined virtual method: void QWizard:: initializePage (int id); N> Here  for 15 minutes Probably

7

Re: QWizard and QWizardPage

Hello, AlexGin, you wrote: AG> to Trace change of the active page - IMHO through the redefined virtual method: AG> void QWizard:: initializePage (int id); you pure OOP-eshnik. Use signals! QWizard signal: currentIdChanged (int id)

8

Re: QWizard and QWizardPage

Hello, Nikolaz, you wrote: AG>> void QWizard:: initializePage (int id); N> you pure OOP-eshnik. Use signals! N> QWizard signal: currentIdChanged (int id) +100500 by the way yes, it works Actually here is how turned out:  a wizard: class Wizard1: public QWizard {Q_OBJECT public: explicit Wizard1 (QWidget *parent = 0); ~Wizard1 (); private: QListView* m_pListView; private: Ui:: Wizard1 *ui; public slots: void OnInitializePage (int iRow);} ; The designer of a wizard: Wizard1:: Wizard1 (QWidget *parent): QWizard (parent), ui (new Ui:: Wizard1) {ui-> setupUi (this); m_pListView = new QListView (this); QStringList pages; pages <<"Main" <<"Local" <<"Ready";//Names of pages QStringListModel* pModel = new QStringListModel (pages); m_pListView-> setModel (pModel); m_pListView-> setEditTriggers (QAbstractItemView:: NoEditTriggers);//Set read-only mode setSideWidget (m_pListView); QList <QWizard:: WizardButton> layout; layout <<QWizard:: BackButton <<QWizard:: NextButton <<QWizard:: CancelButton <<QWizard:: FinishButton; setButtonLayout (layout); WizardPageMain *pPageM = new WizardPageMain (this); addPage (pPageM); WizardPageLocal *pPageL = new WizardPageLocal (this); addPage (pPageL); WizardPageReady *pPageR = new WizardPageReady (this); addPage (pPageR); connect (this, SIGNAL (currentIdChanged (int)), this, SLOT (OnInitializePage (int)));} the Slot-output agent of change of page: void Wizard1:: OnInitializePage (int iRow) {QStringListModel* pModel = dynamic_cast <QStringListModel *> (m_pListView-> model ()); if (pModel) {QModelIndex modelIndex = pModel-> index (iRow); m_pListView-> setCurrentIndex (modelIndex);}}