Qt 6.x
The Qt SDK
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
25
26class QQuickAction;
28
29class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickAbstractButtonPrivate : public QQuickControlPrivate
30{
31public:
32 Q_DECLARE_PUBLIC(QQuickAbstractButton)
33
35 {
36 return button->d_func();
37 }
38
39 QPointF centerPressPoint() const;
40 void setPressPoint(const QPointF &point);
41 void setMovePoint(const QPointF &point);
42
43 bool handlePress(const QPointF &point, ulong timestamp) override;
44 bool handleMove(const QPointF &point, ulong timestamp) override;
45 bool handleRelease(const QPointF &point, ulong timestamp) override;
46 void handleUngrab() override;
47
48 virtual bool acceptKeyClick(Qt::Key key) const;
49
50 bool isPressAndHoldConnected();
51 bool isDoubleClickConnected();
52 void startPressAndHold();
53 void stopPressAndHold();
54
55 void startRepeatDelay();
56 void startPressRepeat();
57 void stopPressRepeat();
58
59#if QT_CONFIG(shortcut)
60 void grabShortcut();
61 void ungrabShortcut();
62#endif
63
64 QQuickAbstractButton *findCheckedButton() const;
65 QList<QQuickAbstractButton *> findExclusiveButtons() const;
66
67 void actionTextChange();
68 void setText(const QString &text, bool isExplicit);
69
70 void updateEffectiveIcon();
71
72 void click();
73 void trigger(bool doubleClick = false);
74 void toggle(bool value);
75
76 void cancelIndicator();
77 void executeIndicator(bool complete = false);
78
81 void itemDestroyed(QQuickItem *item) override;
82
83 // copied from qabstractbutton.cpp
84 static const int AUTO_REPEAT_DELAY = 300;
85 static const int AUTO_REPEAT_INTERVAL = 100;
86
87 bool explicitText = false;
88 bool down = false;
89 bool explicitDown = false;
90 bool pressed = false;
91 bool keepPressed = false;
92 bool checked = false;
93 bool checkable = false;
94 bool autoExclusive = false;
95 bool autoRepeat = false;
96 bool wasHeld = false;
97 bool wasDoubleClick = false;
98 int holdTimer = 0;
99 int delayTimer = 0;
100 int repeatTimer = 0;
101 int repeatDelay = AUTO_REPEAT_DELAY;
102 int repeatInterval = AUTO_REPEAT_INTERVAL;
103#if QT_CONFIG(shortcut)
104 int shortcutId = 0;
106#endif
107 qreal lastTouchReleaseTimestamp = 0;
113 Qt::MouseButtons pressButtons = Qt::NoButton;
118};
119
121
122#endif // QQUICKABSTRACTBUTTON_P_P_H
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Definition qlist.h:74
\inmodule QtCore\reentrant
Definition qpoint.h:214
\inmodule QtCore
Definition qpointer.h:18
QQuickDeferredPointer< QQuickItem > indicator
void itemImplicitWidthChanged(QQuickItem *item) override
virtual bool handlePress(const QPointF &point, ulong timestamp)
virtual void handleUngrab()
virtual bool handleRelease(const QPointF &point, ulong timestamp)
void itemDestroyed(QQuickItem *item) override
virtual bool handleMove(const QPointF &point, ulong timestamp)
void itemImplicitHeightChanged(QQuickItem *item) override
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
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:56
#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
unsigned long ulong
Definition qtypes.h:30
double qreal
Definition qtypes.h:92
QGraphicsItem * item
insertRed setText("insert red text")