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
qabstractbutton_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 QABSTRACTBUTTON_P_H
6#define QABSTRACTBUTTON_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>
21
22#include "QtCore/qbasictimer.h"
23#include "private/qwidget_p.h"
24#include "QtWidgets/qstyle.h"
25
26#include <chrono>
27
28QT_BEGIN_NAMESPACE
29
30class QAbstractButtonPrivate : public QWidgetPrivate
31{
32 Q_DECLARE_PUBLIC(QAbstractButton)
33public:
34 QAbstractButtonPrivate(QSizePolicy::ControlType type = QSizePolicy::DefaultType);
35
36 QString text;
37 QIcon icon;
38 QSize iconSize;
39#ifndef QT_NO_SHORTCUT
40 QKeySequence shortcut;
41 int shortcutId;
42#endif
43 uint checkable :1;
44 uint checked :1;
45 uint autoRepeat :1;
46 uint autoExclusive :1;
47 uint down :1;
48 uint blockRefresh :1;
49 uint pressed : 1;
50
51#if QT_CONFIG(buttongroup)
52 QButtonGroup* group;
53#endif
54 QBasicTimer repeatTimer;
55 QBasicTimer animateTimer;
56
57 std::chrono::milliseconds autoRepeatDelay, autoRepeatInterval;
58
59 QSizePolicy::ControlType controlType;
60 mutable QSize sizeHint;
61
62 void init();
63 void click();
64 void refresh();
65
66 QList<QAbstractButton *>queryButtonList() const;
67 QAbstractButton *queryCheckedButton() const;
68 void notifyChecked();
69 void moveFocus(int key);
70 void fixFocusPolicy();
71
72 void emitPressed();
73 void emitReleased();
74 void emitClicked();
75 void emitToggled(bool checked);
76
77 // ### Qt7: add a public virtual initStyleOption()
78 // returns additional button states for QStyleOption
79 virtual QStyle::State styleButtonState(QStyle::State state) const;
80};
81
82QT_END_NAMESPACE
83
84#endif // QABSTRACTBUTTON_P_H
friend class QWidget
Definition qpainter.h:432
static constexpr auto AUTO_REPEAT_INTERVAL
static QT_BEGIN_NAMESPACE constexpr auto AUTO_REPEAT_DELAY
Q_WIDGETS_EXPORT bool qt_tab_all_widgets()