37 Q_DECLARE_PUBLIC(QQuickAbstractButton)
39 static QQuickAbstractButtonPrivate *get(QQuickAbstractButton *button)
41 return button->d_func();
44 QPointF centerPressPoint()
const;
45 void setPressPoint(
const QPointF &point);
46 void setMovePoint(
const QPointF &point);
48 bool handlePress(
const QPointF &point, ulong timestamp) override;
49 bool handleMove(
const QPointF &point, ulong timestamp) override;
50 bool handleRelease(
const QPointF &point, ulong timestamp) override;
51 void handleUngrab() override;
53 virtual bool acceptKeyClick(Qt::Key key)
const;
54 virtual void accessiblePressAction();
55 virtual void accessibleToggleAction();
57 bool isPressAndHoldConnected();
58 bool isDoubleClickConnected();
59 void startPressAndHold();
60 void stopPressAndHold();
62 void startRepeatDelay();
63 void startPressRepeat();
64 void stopPressRepeat();
66#if QT_CONFIG(shortcut)
68 void ungrabShortcut();
71 QQuickAbstractButton *findCheckedButton()
const;
72 QList<QQuickAbstractButton *> findExclusiveButtons()
const;
74 void actionTextChange();
75 void setText(
const QString &text, QQml::PropertyUtils::State propertyState);
82 void setMnemonicEnabled(
bool enabled);
84 void updateEffectiveIcon();
87 void trigger(
bool doubleClick =
false);
88 void toggle(
bool value);
90 void cancelIndicator();
91 void executeIndicator(
bool complete =
false);
93 void itemImplicitWidthChanged(QQuickItem *item) override;
94 void itemImplicitHeightChanged(QQuickItem *item) override;
95 void itemDestroyed(QQuickItem *item) override;
98 static const int AUTO_REPEAT_DELAY = 300;
99 static const int AUTO_REPEAT_INTERVAL = 100;
101 bool explicitText =
false;
103 bool explicitDown =
false;
104 bool pressed =
false;
105 bool keepPressed =
false;
106 bool checked =
false;
107 bool checkable =
false;
108 bool autoExclusive =
false;
109 bool autoRepeat =
false;
110 bool wasHeld =
false;
111 bool wasDoubleClick =
false;
112 bool wasEnabledBeforeTrigger =
false;
116 int repeatDelay = AUTO_REPEAT_DELAY;
117 int repeatInterval = AUTO_REPEAT_INTERVAL;
118 int animateTimer = 0;
119#if QT_CONFIG(shortcut)
121 QKeySequence shortcut;
123 qreal lastTouchReleaseTimestamp = 0;
126 QQuickIcon effectiveIcon;
129 Qt::MouseButtons pressButtons = Qt::NoButton;
130 QQuickAbstractButton::Display display = QQuickAbstractButton::TextBesideIcon;
131 QQuickDeferredPointer<QQuickItem> indicator;
132 bool mnemonicEnabled =
true;
133 QQuickButtonGroup *group =
nullptr;
134 QPointer<QQuickAction> action;