Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qdialog_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QDIALOG_P_H
6
#
define
QDIALOG_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtWidgets
/
private
/
qtwidgetsglobal_p
.
h
>
20
#
include
"private/qwidget_p.h"
21
#
include
"QtCore/qeventloop.h"
22
#
include
"QtCore/qpointer.h"
23
#
include
"QtWidgets/qdialog.h"
24
#
if
QT_CONFIG
(
pushbutton
)
25
#
include
"QtWidgets/qpushbutton.h"
26
#
endif
27
#
include
<
qpa
/
qplatformdialoghelper
.
h
>
28
29
QT_REQUIRE_CONFIG(dialog);
30
31
QT_BEGIN_NAMESPACE
32
33
class
QSizeGrip;
34
35
class
Q_WIDGETS_EXPORT
QDialogPrivate
:
public
QWidgetPrivate
36
{
37
Q_DECLARE_PUBLIC(QDialog)
38
public
:
39
40
QDialogPrivate()
41
:
42
#
if
QT_CONFIG
(
pushbutton
)
43
mainDef(
nullptr
),
44
#
endif
45
orientation(Qt::Horizontal),extension(
nullptr
), doShowExtension(
false
),
46
#
if
QT_CONFIG
(
sizegrip
)
47
resizer(
nullptr
),
48
sizeGripEnabled(
false
),
49
#
endif
50
rescode(0), resetModalityTo(-1), wasModalitySet(
true
), eventLoop(
nullptr
),
51
nativeDialogInUse(
false
), m_platformHelper(
nullptr
), m_platformHelperCreated(
false
)
52
{}
53
~QDialogPrivate();
54
55
void
setVisible(
bool
visible) override;
56
57
QWindow *transientParentWindow()
const
;
58
bool
setNativeDialogVisible(
bool
visible);
59
QVariant styleHint(QPlatformDialogHelper::StyleHint hint)
const
;
60
61
#
if
QT_CONFIG
(
pushbutton
)
62
QPointer<QPushButton> mainDef;
63
#
endif
64
Qt::Orientation orientation;
65
QWidget *extension;
66
bool
doShowExtension;
67
QSize size, min, max;
68
#
if
QT_CONFIG
(
sizegrip
)
69
QSizeGrip *resizer;
70
bool
sizeGripEnabled;
71
#
endif
72
QPoint lastRMBPress;
73
74
#
if
QT_CONFIG
(
pushbutton
)
75
void
setDefault(QPushButton *);
76
void
setMainDefault(QPushButton *);
77
void
hideDefault();
78
#
endif
79
void
resetModalitySetByOpen();
80
81
int
rescode;
82
int
resetModalityTo;
83
bool
wasModalitySet;
84
85
QPointer<QEventLoop> eventLoop;
86
87
bool
nativeDialogInUse;
88
QPlatformDialogHelper *platformHelper()
const
;
89
virtual
bool
canBeNativeDialog()
const
;
90
91
void
close(
int
resultCode);
92
93
void
recreate() override;
94
95
protected
:
96
virtual
int
dialogCode()
const
{
return
rescode; }
97
98
private
:
99
virtual
void
initHelper(QPlatformDialogHelper *) {}
100
virtual
void
helperPrepareShow(QPlatformDialogHelper *) {}
101
virtual
void
helperDone(QDialog::DialogCode, QPlatformDialogHelper *) {}
102
103
mutable
QPlatformDialogHelper *m_platformHelper;
104
mutable
bool
m_platformHelperCreated;
105
};
106
107
template
<
typename
T>
108
class
QAutoPointer
{
109
QPointer<T> o;
110
public
:
111
Q_NODISCARD_CTOR
QAutoPointer
() =
default
;
112
Q_NODISCARD_CTOR
QAutoPointer
(
std
::
nullptr_t
)
noexcept
:
QAutoPointer
() {}
113
Q_NODISCARD_CTOR
explicit
QAutoPointer
(
T
*
t
)
noexcept
:
o
(
t
) {}
114
Q_NODISCARD_CTOR
QAutoPointer
(
QAutoPointer
&&
other
)
noexcept
115
:
o
{
std
::
exchange
(
other
.
o
,
nullptr
)}
116
{}
117
~
QAutoPointer
() {
delete
o; }
118
119
void
swap
(
QAutoPointer
&other)
noexcept
{ o.swap(other.o); }
120
friend
void
swap
(
QAutoPointer
&lhs,
QAutoPointer
&rhs)
noexcept
{ lhs
.
swap
(
rhs
)
; }
121
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP
(
QAutoPointer
)
122
123
T *
operator
->()
const
noexcept
{
return
get
(
)
; }
124
T *
get
()
const
noexcept
{
return
o; }
125
T &
operator
*()
const
{
return
*
get
(
)
; }
126
explicit
operator
bool
()
const
noexcept
{
return
!o.isNull(); }
127
bool
operator
!()
const
noexcept
{
return
!o; }
128
private
:
129
Q_DISABLE_COPY
(
QAutoPointer
);
130
};
131
132
QT_END_NAMESPACE
133
134
#
endif
// QDIALOG_P_H
QAutoPointer
Definition
qdialog_p.h:108
QAutoPointer::operator bool
operator bool() const noexcept
Definition
qdialog_p.h:126
QAutoPointer::operator*
T & operator*() const
Definition
qdialog_p.h:125
QAutoPointer::operator!
bool operator!() const noexcept
Definition
qdialog_p.h:127
QAutoPointer::get
T * get() const noexcept
Definition
qdialog_p.h:124
QAutoPointer::operator->
T * operator->() const noexcept
Definition
qdialog_p.h:123
QAutoPointer::~QAutoPointer
~QAutoPointer()
Definition
qdialog_p.h:117
QAutoPointer::swap
void swap(QAutoPointer &other) noexcept
Definition
qdialog_p.h:119
QAutoPointer::swap
friend void swap(QAutoPointer &lhs, QAutoPointer &rhs) noexcept
Definition
qdialog_p.h:120
QCheckBox
The QCheckBox widget provides a checkbox with a text label.
Definition
qcheckbox.h:20
QDialogPrivate
Definition
qdialog_p.h:36
QErrorMessagePrivate
Definition
qerrormessage.cpp:33
QErrorMessagePrivate::helperPrepareShow
void helperPrepareShow(QPlatformDialogHelper *) override
Definition
qerrormessage.cpp:80
QErrorMessagePrivate::nextPending
bool nextPending()
Definition
qerrormessage.cpp:350
QErrorMessagePrivate::currentMessage
QString currentMessage
Definition
qerrormessage.cpp:48
QErrorMessagePrivate::errors
QTextEdit * errors
Definition
qerrormessage.cpp:43
QErrorMessagePrivate::retranslateStrings
void retranslateStrings()
Definition
qerrormessage.cpp:438
QErrorMessagePrivate::currentType
QString currentType
Definition
qerrormessage.cpp:49
QErrorMessagePrivate::initHelper
void initHelper(QPlatformDialogHelper *) override
Definition
qerrormessage.cpp:63
QErrorMessagePrivate::icon
QLabel * icon
Definition
qerrormessage.cpp:44
QErrorMessagePrivate::isMessageToBeShown
bool isMessageToBeShown(const QString &message, const QString &type) const
Definition
qerrormessage.cpp:344
QErrorMessagePrivate::ok
QPushButton * ok
Definition
qerrormessage.cpp:41
QErrorMessagePrivate::again
QCheckBox * again
Definition
qerrormessage.cpp:42
QErrorMessagePrivate::pending
std::queue< Message > pending
Definition
qerrormessage.cpp:45
QErrorMessagePrivate::setVisible
void setVisible(bool) override
Definition
qerrormessage.cpp:409
QErrorMessage
The QErrorMessage class provides an error message display dialog.
Definition
qerrormessage.h:19
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
msgType2i18nString
static QString msgType2i18nString(QtMsgType t)
Definition
qerrormessage.cpp:167
metFatal
static bool metFatal
Definition
qerrormessage.cpp:165
deleteStaticcQErrorMessage
static void deleteStaticcQErrorMessage()
Definition
qerrormessage.cpp:157
qtMessageHandler
static QErrorMessage * qtMessageHandler
Definition
qerrormessage.cpp:155
originalMessageHandler
static QtMessageHandler originalMessageHandler
Definition
qerrormessage.cpp:189
jump
static void jump(QtMsgType t, const QMessageLogContext &context, const QString &m)
Definition
qerrormessage.cpp:191
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(errormessage)
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(liburing)
qtbase
src
widgets
dialogs
qdialog_p.h
Generated on
for Qt by
1.18.0