Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_gui_dialogs_qwizard.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include <QWidget>
5#include <QWizard>
6
7class LicenseWizard : public QWizard
8{
10
11public:
14
15 int nextId() const override;
16};
17
18//! [0]
20{
21 switch (currentId()) {
22 case Page_Intro:
23 if (field("intro.evaluate").toBool()) {
24 return Page_Evaluate;
25 } else {
26 return Page_Register;
27 }
28 case Page_Evaluate:
29 return Page_Conclusion;
30 case Page_Register:
31 if (field("register.upgradeKey").toString().isEmpty()) {
32 return Page_Details;
33 } else {
34 return Page_Conclusion;
35 }
36 case Page_Details:
37 return Page_Conclusion;
38 case Page_Conclusion:
39 default:
40 return -1;
41 }
42}
43//! [0]
44
45class MyWizard : public QWizard
46{
48public:
49 MyWizard(QWidget *parent = nullptr);
50};
51
52//! [1]
53MyWizard::MyWizard(QWidget *parent)
54 : QWizard(parent)
55{
56 //...
57 QList<QWizard::WizardButton> layout;
58 layout << QWizard::Stretch << QWizard::BackButton << QWizard::CancelButton
59 << QWizard::NextButton << QWizard::FinishButton;
60 setButtonLayout(layout);
61 //...
62}
63//! [1]
int nextId() const override
[0]