Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickabstractbutton_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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 QQUICKABSTRACTBUTTON_P_P_H
5#define QQUICKABSTRACTBUTTON_P_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 <QtQuickTemplates2/private/qquickabstractbutton_p.h>
19#include <QtQuickTemplates2/private/qquickcontrol_p_p.h>
20#if QT_CONFIG(shortcut)
21# include <QtGui/qkeysequence.h>
22#endif
23
24#include <QtCore/qpointer.h>
25
27
28class QQuickAction;
30
31class Q_QUICKTEMPLATES2_EXPORT QQuickAbstractButtonPrivate : public QQuickControlPrivate
32{
33public:
34 Q_DECLARE_PUBLIC(QQuickAbstractButton)
35
37 {
38 return button->d_func();
39 }
40
41 QPointF centerPressPoint() const;
42 void setPressPoint(const QPointF &point);
43 void setMovePoint(const QPointF &point);
44
45 bool handlePress(const QPointF &point, ulong timestamp) override;
46 bool handleMove(const QPointF &point, ulong timestamp) override;
47 bool handleRelease(const QPointF &point, ulong timestamp) override;
48 void handleUngrab() override;
49
50 virtual bool acceptKeyClick(Qt::Key key) const;
51
52 bool isPressAndHoldConnected();
53 bool isDoubleClickConnected();
54 void startPressAndHold();
55 void stopPressAndHold();
56
57 void startRepeatDelay();
58 void startPressRepeat();
59 void stopPressRepeat();
60
61#if QT_CONFIG(shortcut)
62 void grabShortcut();
63 void ungrabShortcut();
64#endif
65
66 QQuickAbstractButton *findCheckedButton() const;
67 QList<QQuickAbstractButton *> findExclusiveButtons() const;
68
69 void actionTextChange();
70 void setText(const QString &text, bool isExplicit);
71 void init();
72
73 void updateEffectiveIcon();
74
75 void click();
76 void trigger(bool doubleClick = false);
77 void toggle(bool value);
78
79 void cancelIndicator();
80 void executeIndicator(bool complete = false);
81
82 void itemImplicitWidthChanged(QQuickItem *item) override;
83 void itemImplicitHeightChanged(QQuickItem *item) override;
84 void itemDestroyed(QQuickItem *item) override;
85
86 // copied from qabstractbutton.cpp
87 static const int AUTO_REPEAT_DELAY = 300;
88 static const int AUTO_REPEAT_INTERVAL = 100;
89
90 bool explicitText = false;
91 bool down = false;
92 bool explicitDown = false;
93 bool pressed = false;
94 bool keepPressed = false;
95 bool checked = false;
96 bool checkable = false;
97 bool autoExclusive = false;
98 bool autoRepeat = false;
99 bool wasHeld = false;
100 bool wasDoubleClick = false;
101 int holdTimer = 0;
102 int delayTimer = 0;
103 int repeatTimer = 0;
104 int repeatDelay = AUTO_REPEAT_DELAY;
105 int repeatInterval = AUTO_REPEAT_INTERVAL;
106#if QT_CONFIG(shortcut)
107 int shortcutId = 0;
109#endif
110 qreal lastTouchReleaseTimestamp = 0;
116 Qt::MouseButtons pressButtons = Qt::NoButton;
118 QQuickDeferredPointer<QQuickItem> indicator;
120 QPointer<QQuickAction> action;
121};
122
124
125#endif // QQUICKABSTRACTBUTTON_P_P_H
The QKeySequence class encapsulates a key sequence as used by shortcuts.
\inmodule QtCore\reentrant
Definition qpoint.h:217
QQuickDeferredPointer< QQuickItem > indicator
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString text
QPushButton * button
[2]
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
@ NoButton
Definition qnamespace.h:57
#define AUTO_REPEAT_DELAY
#define AUTO_REPEAT_INTERVAL
static QDBusError::ErrorType get(const char *name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint64 key
GLboolean GLuint group
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
unsigned long ulong
Definition qtypes.h:35
double qreal
Definition qtypes.h:187
QGraphicsItem * item
insertRed setText("insert red text")