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 QABSTRACTBUTTON_P_H
5#define QABSTRACTBUTTON_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtWidgets/private/qtwidgetsglobal_p.h>
19#include "qabstractbutton.h"
20
21#include "QtCore/qbasictimer.h"
22#include "private/qwidget_p.h"
23
24QT_BEGIN_NAMESPACE
25
26class QAbstractButtonPrivate : public QWidgetPrivate
27{
28 Q_DECLARE_PUBLIC(QAbstractButton)
29public:
30 QAbstractButtonPrivate(QSizePolicy::ControlType type = QSizePolicy::DefaultType);
31
32 QString text;
33 QIcon icon;
34 QSize iconSize;
35#ifndef QT_NO_SHORTCUT
36 QKeySequence shortcut;
37 int shortcutId;
38#endif
39 uint checkable :1;
40 uint checked :1;
41 uint autoRepeat :1;
42 uint autoExclusive :1;
43 uint down :1;
44 uint blockRefresh :1;
45 uint pressed : 1;
46
47#if QT_CONFIG(buttongroup)
48 QButtonGroup* group;
49#endif
50 QBasicTimer repeatTimer;
51 QBasicTimer animateTimer;
52
53 int autoRepeatDelay, autoRepeatInterval;
54
55 QSizePolicy::ControlType controlType;
56 mutable QSize sizeHint;
57
58 void init();
59 void click();
60 void refresh();
61
62 QList<QAbstractButton *>queryButtonList() const;
63 QAbstractButton *queryCheckedButton() const;
64 void notifyChecked();
65 void moveFocus(int key);
66 void fixFocusPolicy();
67
68 void emitPressed();
69 void emitReleased();
70 void emitClicked();
71 void emitToggled(bool checked);
72};
73
74QT_END_NAMESPACE
75
76#endif // QABSTRACTBUTTON_P_H
77

source code of qtbase/src/widgets/widgets/qabstractbutton_p.h