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 | |
4 | #ifndef QPUSHBUTTON_P_H |
5 | #define QPUSHBUTTON_P_H |
6 | |
7 | #include <QtWidgets/private/qtwidgetsglobal_p.h> |
8 | #include "private/qabstractbutton_p.h" |
9 | |
10 | QT_REQUIRE_CONFIG(pushbutton); |
11 | |
12 | // |
13 | // W A R N I N G |
14 | // ------------- |
15 | // |
16 | // This file is not part of the Qt API. It exists purely as an |
17 | // implementation detail. This header file may change from version to |
18 | // version without notice, or even be removed. |
19 | // |
20 | // We mean it. |
21 | // |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | class QDialog; |
26 | class QPushButton; |
27 | |
28 | class QPushButtonPrivate : public QAbstractButtonPrivate |
29 | { |
30 | Q_DECLARE_PUBLIC(QPushButton) |
31 | public: |
32 | enum AutoDefaultValue { Off = 0, On = 1, Auto = 2 }; |
33 | |
34 | QPushButtonPrivate() |
35 | : QAbstractButtonPrivate(QSizePolicy::PushButton), autoDefault(Auto), |
36 | defaultButton(false), flat(false), menuOpen(false), hovering(false), |
37 | lastAutoDefault(false) |
38 | {} |
39 | |
40 | void init(); |
41 | static QPushButtonPrivate* get(QPushButton *b) { return b->d_func(); } |
42 | #if QT_CONFIG(menu) |
43 | QPoint adjustedMenuPosition(); |
44 | #endif |
45 | void resetLayoutItemMargins(); |
46 | void _q_popupPressed(); |
47 | #if QT_CONFIG(dialog) |
48 | QDialog *dialogParent() const; |
49 | #else |
50 | QDialog *dialogParent() const { return nullptr; } |
51 | #endif |
52 | |
53 | QPointer<QMenu> menu; |
54 | uint autoDefault : 2; |
55 | uint defaultButton : 1; |
56 | uint flat : 1; |
57 | uint menuOpen : 1; |
58 | uint hovering : 1; |
59 | mutable uint lastAutoDefault : 1; |
60 | }; |
61 | |
62 | QT_END_NAMESPACE |
63 | |
64 | #endif // QPUSHBUTTON_P_H |
65 |