39 Q_DECLARE_PUBLIC(QQuickAbstractButton)
41 static QQuickAbstractButtonPrivate *get(QQuickAbstractButton *button)
43 return button->d_func();
46 QPointF centerPressPoint()
const;
47 void setPressPoint(
const QPointF &point);
48 void setMovePoint(
const QPointF &point);
50 bool handlePress(
const QPointF &point, ulong timestamp) override;
51 bool handleMove(
const QPointF &point, ulong timestamp) override;
52 bool handleRelease(
const QPointF &point, ulong timestamp) override;
53 void handleUngrab() override;
55 virtual bool acceptKeyClick(Qt::Key key)
const;
56 virtual void accessiblePressAction();
57 virtual void accessibleToggleAction();
59 bool isPressAndHoldConnected();
60 bool isDoubleClickConnected();
61 void startPressAndHold();
62 void stopPressAndHold();
64 void startRepeatDelay();
65 void startPressRepeat();
66 void stopPressRepeat();
68#if QT_CONFIG(shortcut)
70 void ungrabShortcut();
73 QQuickAbstractButton *findCheckedButton()
const;
74 QList<QQuickAbstractButton *> findExclusiveButtons()
const;
76 void actionTextChange();
77 void setText(
const QString &text, QQml::PropertyUtils::State propertyState);
78 bool needsTextFormatWarning()
const;
85 void setMnemonicEnabled(
bool enabled);
87 void updateEffectiveIcon();
90 void trigger(
bool doubleClick =
false);
91 void toggle(
bool value);
93 void cancelIndicator();
94 void executeIndicator(
bool complete =
false);
96 void itemImplicitWidthChanged(QQuickItem *item) override;
97 void itemImplicitHeightChanged(QQuickItem *item) override;
98 void itemDestroyed(QQuickItem *item) override;
101 static const int AUTO_REPEAT_DELAY = 300;
102 static const int AUTO_REPEAT_INTERVAL = 100;
104 bool explicitText =
false;
106 bool explicitDown =
false;
107 bool pressed =
false;
108 bool keepPressed =
false;
109 bool checked =
false;
110 bool checkable =
false;
111 bool autoExclusive =
false;
112 bool autoRepeat =
false;
113 bool wasHeld =
false;
114 bool wasDoubleClick =
false;
115 bool wasEnabledBeforeTrigger =
false;
119 int repeatDelay = AUTO_REPEAT_DELAY;
120 int repeatInterval = AUTO_REPEAT_INTERVAL;
121 int animateTimer = 0;
122#if QT_CONFIG(shortcut)
124 QKeySequence shortcut;
126 qreal lastTouchReleaseTimestamp = 0;
129 QQuickIcon effectiveIcon;
132 Qt::MouseButtons pressButtons = Qt::NoButton;
133 QQuickAbstractButton::Display display = QQuickAbstractButton::TextBesideIcon;
134 QQuickDeferredPointer<QQuickItem> indicator;
135 bool mnemonicEnabled =
true;
136 QQuickButtonGroup *group =
nullptr;
137 QPointer<QQuickAction> action;
138 std::optional<QQuickText::TextFormat> textFormat;
139 bool textFormatWarningDisplayed =
false;