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
7
class
LicenseWizard
:
public
QWizard
8
{
9
Q_OBJECT
10
11
public
:
12
enum
{
Page_Intro
,
Page_Evaluate
,
Page_Register
,
Page_Details
,
13
Page_Conclusion
};
14
15
int
nextId
()
const
override
;
16
};
17
18
//! [0]
19
int
LicenseWizard
::
nextId
()
const
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
45
class
MyWizard
:
public
QWizard
46
{
47
Q_OBJECT
48
public
:
49
MyWizard
(
QWidget
*
parent
=
nullptr
);
50
};
51
52
//! [1]
53
MyWizard
::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]
LicenseWizard
Definition
src_gui_dialogs_qwizard.cpp:8
LicenseWizard::nextId
int nextId() const override
[0]
Definition
src_gui_dialogs_qwizard.cpp:19
MyWizard
[0]
Definition
src_gui_dialogs_qwizard.cpp:46
qtbase
src
widgets
doc
snippets
code
src_gui_dialogs_qwizard.cpp
Generated on
for Qt by
1.14.0