Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquickabstractbutton.cpp
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
8#include "qquickaction_p.h"
9#include "qquickaction_p_p.h"
12
13#include <QtGui/qstylehints.h>
14#include <QtGui/qguiapplication.h>
15#if QT_CONFIG(shortcut)
16# include <QtGui/private/qshortcutmap_p.h>
17#endif
18#include <QtGui/private/qguiapplication_p.h>
19#include <QtGui/qpa/qplatformtheme.h>
20#include <QtQuick/private/qquickevents_p_p.h>
21#include <QtQml/qqmllist.h>
22
24
29
91{
92 return QPointF(qRound(width / 2), qRound(height / 2));
93}
94
96{
97 pressPoint = point;
98 setMovePoint(point);
99}
100
102{
104 bool xChange = !qFuzzyCompare(point.x(), movePoint.x());
105 bool yChange = !qFuzzyCompare(point.y(), movePoint.y());
106 movePoint = point;
107 if (xChange)
108 emit q->pressXChanged();
109 if (yChange)
110 emit q->pressYChanged();
111}
112
114{
116 QQuickControlPrivate::handlePress(point, timestamp);
117 setPressPoint(point);
118 q->setPressed(true);
119
120 emit q->pressed();
121
122 if (autoRepeat)
124 else if (touchId != -1 || Qt::LeftButton == (pressButtons & Qt::LeftButton))
126 else
128 return true;
129}
130
132{
134 QQuickControlPrivate::handleMove(point, timestamp);
135 setMovePoint(point);
136 q->setPressed(keepPressed || q->contains(point));
137
138 if (!pressed && autoRepeat)
140 else if (holdTimer > 0 && (!pressed || QLineF(pressPoint, point).length() > QGuiApplication::styleHints()->startDragDistance()))
142 return true;
143}
144
146{
148 // Store this here since the base class' handleRelease clears it.
149 const int pressTouchId = touchId;
150
151 QQuickControlPrivate::handleRelease(point, timestamp);
152 bool wasPressed = pressed;
153 setPressPoint(point);
154 q->setPressed(false);
156
157 const bool touchDoubleClick = pressTouchId != -1 && lastTouchReleaseTimestamp != 0
158 && timestamp - lastTouchReleaseTimestamp < qApp->styleHints()->mouseDoubleClickInterval()
160
161 if (!wasHeld && (keepPressed || q->contains(point)))
162 q->nextCheckState();
163
164 if (wasPressed) {
165 emit q->released();
166 if (!wasHeld && !wasDoubleClick)
167 trigger(touchDoubleClick);
168 } else {
169 emit q->canceled();
170 }
171
172 if (autoRepeat)
174 else
176
177 if (!touchDoubleClick) {
178 // This is not a double click yet, but it is potentially the
179 // first release before a double click.
180 if (pressTouchId != -1) {
181 // The corresponding press for this release was a touch press.
182 // Keep track of the timestamp of the release so that we can
183 // emit doubleClicked() if another one comes afterwards.
184 lastTouchReleaseTimestamp = timestamp;
185 }
186 } else {
187 // We just did a double click, so clear the release timestamp
188 // to prepare for any possible future double clicks.
190 }
191
192 wasDoubleClick = false;
193 return true;
194}
195
197{
201 if (!pressed)
202 return;
203
204 q->setPressed(false);
207 wasDoubleClick = false;
209 emit q->canceled();
210}
211
213{
215 return buttonPressKeys.contains(key);
216}
217
219{
221 static const QMetaMethod method = [&]() {
224 }();
225 return q->isSignalConnected(method);
226}
227
229{
231 static const QMetaMethod method = [&]() {
234 }();
235 return q->isSignalConnected(method);
236}
237
239{
241 wasHeld = false;
244 holdTimer = q->startTimer(QGuiApplication::styleHints()->mousePressAndHoldInterval());
245}
246
248{
250 if (holdTimer > 0) {
251 q->killTimer(holdTimer);
252 holdTimer = 0;
253 }
254}
255
257{
260 delayTimer = q->startTimer(repeatDelay);
261}
262
264{
267 repeatTimer = q->startTimer(repeatInterval);
268}
269
271{
273 if (delayTimer > 0) {
274 q->killTimer(delayTimer);
275 delayTimer = 0;
276 }
277 if (repeatTimer > 0) {
278 q->killTimer(repeatTimer);
279 repeatTimer = 0;
280 }
281}
282
283#if QT_CONFIG(shortcut)
284void QQuickAbstractButtonPrivate::grabShortcut()
285{
287 if (shortcut.isEmpty())
288 return;
289
291
292 if (!q->isEnabled())
293 QGuiApplicationPrivate::instance()->shortcutMap.setShortcutEnabled(false, shortcutId, q);
294}
295
296void QQuickAbstractButtonPrivate::ungrabShortcut()
297{
299 if (!shortcutId)
300 return;
301
302 QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(shortcutId, q);
303 shortcutId = 0;
304}
305#endif
306
308{
310 if (explicitText)
311 return;
312
314}
315
316void QQuickAbstractButtonPrivate::setText(const QString &newText, bool isExplicit)
317{
319 const QString oldText = q->text();
320 explicitText = isExplicit;
321 text = newText;
322 if (oldText == q->text())
323 return;
324
326}
327
329{
331 // We store effectiveIcon because we need to be able to tell if the icon has actually changed.
332 // If we only stored our icon and the action's icon, and resolved in the getter, we'd have
333 // no way of knowing what the old value was here. As an added benefit, we only resolve when
334 // something has changed, as opposed to doing it unconditionally in the icon() getter.
335 const QQuickIcon newEffectiveIcon = action ? icon.resolve(action->icon()) : icon;
336 if (newEffectiveIcon == effectiveIcon)
337 return;
338
339 effectiveIcon = newEffectiveIcon;
340 emit q->iconChanged();
341}
342
344{
346 if (effectiveEnable)
347 emit q->clicked();
348}
349
351{
353 const bool wasEnabled = effectiveEnable;
354 if (action && action->isEnabled())
356 if (wasEnabled && (!action || !action->isEnabled())) {
357 if (!doubleClick)
358 emit q->clicked();
359 else
360 emit q->doubleClicked();
361 }
362}
363
365{
367 const bool wasChecked = checked;
368 q->setChecked(value);
369 if (wasChecked != checked)
370 emit q->toggled();
371}
372
374{
377}
378
380{
383 return;
384
385 if (!indicator || complete)
387 if (complete)
389}
390
392{
395 if (item == indicator)
396 emit q->implicitIndicatorWidthChanged();
397}
398
400{
403 if (item == indicator)
404 emit q->implicitIndicatorHeightChanged();
405}
406
408{
411 if (item == indicator) {
412 indicator = nullptr;
413 emit q->implicitIndicatorWidthChanged();
414 emit q->implicitIndicatorHeightChanged();
415 }
416}
417
419{
420 Q_Q(const QQuickAbstractButton);
421 if (group)
422 return group->checkedButton();
423
425 // TODO: A singular QRadioButton can be unchecked, which seems logical,
426 // because there's nothing to be exclusive with. However, a RadioButton
427 // from QtQuick.Controls 1.x can never be unchecked, which is the behavior
428 // that QQuickRadioButton adopted. Uncommenting the following count check
429 // gives the QRadioButton behavior. Notice that tst_radiobutton.qml needs
430 // to be updated.
431 if (!autoExclusive /*|| buttons.count() == 1*/)
432 return nullptr;
433
434 for (QQuickAbstractButton *button : buttons) {
435 if (button->isChecked() && button != q)
436 return button;
437 }
438 return checked ? const_cast<QQuickAbstractButton *>(q) : nullptr;
439}
440
442{
444 if (group) {
445 QQmlListProperty<QQuickAbstractButton> groupButtons = group->buttons();
446 int count = groupButtons.count(&groupButtons);
447 for (int i = 0; i < count; ++i) {
448 QQuickAbstractButton *button = qobject_cast<QQuickAbstractButton *>(groupButtons.at(&groupButtons, i));
449 if (button)
450 buttons += button;
451 }
452 } else if (parentItem) {
453 const auto childItems = parentItem->childItems();
454 for (QQuickItem *child : childItems) {
455 QQuickAbstractButton *button = qobject_cast<QQuickAbstractButton *>(child);
457 buttons += button;
458 }
459 }
460 return buttons;
461}
462
465{
467#ifdef Q_OS_MACOS
469#else
471#endif
473#if QT_CONFIG(quicktemplates2_multitouch)
475#endif
476#if QT_CONFIG(cursor)
478#endif
479}
480
482 : QQuickControl(dd, parent)
483{
485#ifdef Q_OS_MACOS
487#else
489#endif
491#if QT_CONFIG(quicktemplates2_multitouch)
493#endif
494#if QT_CONFIG(cursor)
496#endif
497}
498
500{
502 d->removeImplicitSizeListener(d->indicator);
503 if (d->group) {
504 auto *attached = qobject_cast<QQuickButtonGroupAttached *>(
505 qmlAttachedPropertiesObject<QQuickButtonGroup>(this, false));
506 if (attached)
507 attached->setGroup(nullptr);
508 else
509 d->group->removeButton(this);
510 }
511#if QT_CONFIG(shortcut)
512 d->ungrabShortcut();
513#endif
514}
515
527{
528 Q_D(const QQuickAbstractButton);
529 return d->explicitText || !d->action ? d->text : d->action->text();
530}
531
533{
535 d->setText(text, true);
536}
537
539{
541 d->setText(QString(), false);
542}
543
555{
556 Q_D(const QQuickAbstractButton);
557 return d->down;
558}
559
561{
563 d->explicitDown = true;
564
565 if (d->down == down)
566 return;
567
568 d->down = down;
570}
571
573{
575 if (!d->explicitDown)
576 return;
577
578 setDown(d->pressed);
579 d->explicitDown = false;
580}
581
592{
593 Q_D(const QQuickAbstractButton);
594 return d->pressed;
595}
596
598{
600 if (d->pressed == isPressed)
601 return;
602
603 d->pressed = isPressed;
607
608 if (!d->explicitDown) {
609 setDown(d->pressed);
610 d->explicitDown = false;
611 }
612}
613
626{
627 Q_D(const QQuickAbstractButton);
628 return d->checked;
629}
630
632{
634 if (d->checked == checked)
635 return;
636
637 d->checked = checked;
638 if (d->action)
639 d->action->setChecked(checked);
640 setAccessibleProperty("checked", checked);
643}
644
659{
660 Q_D(const QQuickAbstractButton);
661 return d->checkable;
662}
663
665{
667 if (d->checkable == checkable)
668 return;
669
670 d->checkable = checkable;
671 if (d->action)
672 d->action->setCheckable(checkable);
673 setAccessibleProperty("checkable", checkable);
676}
677
693{
694 Q_D(const QQuickAbstractButton);
695 return d->autoExclusive;
696}
697
699{
701 if (d->autoExclusive == exclusive)
702 return;
703
704 d->autoExclusive = exclusive;
706}
707
723{
724 Q_D(const QQuickAbstractButton);
725 return d->autoRepeat;
726}
727
729{
731 if (d->autoRepeat == repeat)
732 return;
733
734 d->stopPressRepeat();
735 d->autoRepeat = repeat;
737}
738
745{
747 if (!d->indicator)
748 d->executeIndicator();
749 return d->indicator;
750}
751
753{
755 if (d->indicator == indicator)
756 return;
757
759
760 if (!d->indicator.isExecuting())
761 d->cancelIndicator();
762
763 const qreal oldImplicitIndicatorWidth = implicitIndicatorWidth();
764 const qreal oldImplicitIndicatorHeight = implicitIndicatorHeight();
765
766 d->removeImplicitSizeListener(d->indicator);
768 d->indicator = indicator;
769
770 if (indicator) {
771 if (!indicator->parentItem())
774 d->addImplicitSizeListener(indicator);
775 }
776
777 if (!qFuzzyCompare(oldImplicitIndicatorWidth, implicitIndicatorWidth()))
778 emit implicitIndicatorWidthChanged();
779 if (!qFuzzyCompare(oldImplicitIndicatorHeight, implicitIndicatorHeight()))
780 emit implicitIndicatorHeightChanged();
781 if (!d->indicator.isExecuting())
783}
784
801{
802 Q_D(const QQuickAbstractButton);
803 return d->effectiveIcon;
804}
805
807{
809 d->icon = icon;
810 d->icon.ensureRelativeSourceResolved(this);
811 d->updateEffectiveIcon();
812}
813
832{
833 Q_D(const QQuickAbstractButton);
834 return d->display;
835}
836
838{
840 if (display == d->display)
841 return;
842
843 d->display = display;
844 emit displayChanged();
845}
846
856{
857 Q_D(const QQuickAbstractButton);
858 return d->action;
859}
860
862{
864 if (d->action == action)
865 return;
866
867 const QString oldText = text();
868
869 if (QQuickAction *oldAction = d->action.data()) {
873
878 }
879
880 if (action) {
884
889
893 }
894
895 d->action = action;
896
897 if (oldText != text())
899
900 d->updateEffectiveIcon();
901
902 emit actionChanged();
903}
904
915{
916 Q_D(const QQuickAbstractButton);
917 return d->repeatDelay;
918}
919
921{
923 if (d->repeatDelay == delay)
924 return;
925
926 d->repeatDelay = delay;
927 emit autoRepeatDelayChanged();
928}
929
940{
941 Q_D(const QQuickAbstractButton);
942 return d->repeatInterval;
943}
944
946{
948 if (d->repeatInterval == interval)
949 return;
950
951 d->repeatInterval = interval;
952 emit autoRepeatIntervalChanged();
953}
954
955#if QT_CONFIG(shortcut)
956QKeySequence QQuickAbstractButton::shortcut() const
957{
958 Q_D(const QQuickAbstractButton);
959 return d->shortcut;
960}
961
962void QQuickAbstractButton::setShortcut(const QKeySequence &shortcut)
963{
965 if (d->shortcut == shortcut)
966 return;
967
968 d->ungrabShortcut();
969 d->shortcut = shortcut;
970 if (isVisible())
971 d->grabShortcut();
972}
973#endif
974
987{
988 Q_D(const QQuickAbstractButton);
989 return d->movePoint.x();
990}
991
1004{
1005 Q_D(const QQuickAbstractButton);
1006 return d->movePoint.y();
1007}
1008
1024{
1025 Q_D(const QQuickAbstractButton);
1026 if (!d->indicator)
1027 return 0;
1028 return d->indicator->implicitWidth();
1029}
1030
1046{
1047 Q_D(const QQuickAbstractButton);
1048 if (!d->indicator)
1049 return 0;
1050 return d->indicator->implicitHeight();
1051}
1052
1059{
1061 setChecked(!d->checked);
1062}
1063
1065{
1067 d->executeIndicator(true);
1069}
1070
1072{
1073#if QT_CONFIG(shortcut)
1075 if (event->type() == QEvent::Shortcut) {
1076 QShortcutEvent *se = static_cast<QShortcutEvent *>(event);
1077 if (se->shortcutId() == d->shortcutId) {
1078 d->trigger();
1079 return true;
1080 }
1081 }
1082#endif
1084}
1085
1087{
1090 if (d->touchId == -1) // don't ungrab on multi-touch if another control gets focused
1091 d->handleUngrab();
1092}
1093
1095{
1098 if (d->acceptKeyClick(static_cast<Qt::Key>(event->key()))) {
1099 d->setPressPoint(d->centerPressPoint());
1100 setPressed(true);
1101
1102 if (d->autoRepeat)
1103 d->startRepeatDelay();
1104
1105 emit pressed();
1106 event->accept();
1107 }
1108}
1109
1111{
1114 if (d->pressed && d->acceptKeyClick(static_cast<Qt::Key>(event->key()))) {
1115 setPressed(false);
1116
1118 emit released();
1119 d->trigger();
1120
1121 if (d->autoRepeat)
1122 d->stopPressRepeat();
1123 event->accept();
1124 }
1125}
1126
1128{
1130 d->pressButtons = event->buttons();
1132}
1133
1135{
1136 Q_UNUSED(event);
1138 if (d->isDoubleClickConnected()) {
1139 // don't call QQuickItem::mouseDoubleClickEvent(): it would ignore()
1141 d->wasDoubleClick = true;
1142 }
1143}
1144
1146{
1149 if (event->timerId() == d->holdTimer) {
1150 d->stopPressAndHold();
1151 d->wasHeld = true;
1153 } else if (event->timerId() == d->delayTimer) {
1154 d->startPressRepeat();
1155 } else if (event->timerId() == d->repeatTimer) {
1156 emit released();
1157 d->trigger();
1158 emit pressed();
1159 }
1160}
1161
1163{
1165#if QT_CONFIG(shortcut)
1167 if (change == ItemVisibleHasChanged) {
1168 if (value.boolValue)
1169 d->grabShortcut();
1170 else
1171 d->ungrabShortcut();
1172 }
1173#endif
1174}
1175
1177{
1179 switch (change) {
1181 if (d->checked) {
1182 QQuickAbstractButton *button = d->findCheckedButton();
1183 if (button && button != this)
1184 button->setChecked(false);
1185 }
1186 break;
1187 case ButtonTextChange: {
1188 const QString txt = text();
1190#if QT_CONFIG(shortcut)
1192#endif
1193 emit textChanged();
1194 break;
1195 }
1196 default:
1197 break;
1198 }
1199}
1200
1202{
1204 if (!d->checkable)
1205 return;
1206
1207 if (d->checked) {
1208 if (d->findCheckedButton() == this)
1209 return;
1210 if (d->action) {
1211 // For non-exclusive groups checkedAction is null
1212 if (const auto group = QQuickActionPrivate::get(d->action)->group)
1213 if (group->checkedAction() == d->action)
1214 return;
1215 }
1216 }
1217
1218 d->toggle(!d->checked);
1219}
1220
1221#if QT_CONFIG(accessibility)
1222void QQuickAbstractButton::accessibilityActiveChanged(bool active)
1223{
1224 QQuickControl::accessibilityActiveChanged(active);
1225
1227 if (active) {
1229 setAccessibleProperty("pressed", d->pressed);
1230 setAccessibleProperty("checked", d->checked);
1231 setAccessibleProperty("checkable", d->checkable);
1232 }
1233}
1234
1235QAccessible::Role QQuickAbstractButton::accessibleRole() const
1236{
1237 Q_D(const QQuickAbstractButton);
1238 if (d->checkable) {
1239 return QAccessible::CheckBox;
1240 }
1241 return QAccessible::Button;
1242}
1243
1244void QQuickAbstractButton::accessiblePressAction()
1245{
1247 d->trigger();
1248}
1249#endif
1250
1252
1253#include "moc_qquickabstractbutton_p.cpp"
bool autoExclusive
whether auto-exclusivity is enabled
bool isChecked() const
\inmodule QtCore
Definition qcoreevent.h:45
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:469
static QGuiApplicationPrivate * instance()
static QPlatformTheme * platformTheme()
static QStyleHints * styleHints()
Returns the application's style hints.
The QKeyEvent class describes a key event.
Definition qevent.h:423
The QKeySequence class encapsulates a key sequence as used by shortcuts.
static QKeySequence mnemonic(const QString &text)
Returns the shortcut key sequence for the mnemonic in text, or an empty key sequence if no mnemonics ...
\inmodule QtCore
Definition qline.h:182
Definition qlist.h:74
\inmodule QtCore
Definition qmetaobject.h:18
static QMetaMethod fromSignal(PointerToMemberFunction signal)
\inmodule QtGui
Definition qevent.h:195
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
Definition qobject_p.h:298
static bool disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
Definition qobject_p.h:327
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition qobject.cpp:1363
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
Definition qobject.cpp:1433
virtual QVariant themeHint(ThemeHint hint) const
\inmodule QtCore\reentrant
Definition qpoint.h:214
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:333
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:338
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
Definition qqmllist.h:24
AtFunction at
Definition qqmllist.h:86
CountFunction count
Definition qqmllist.h:85
void setMovePoint(const QPointF &point)
QList< QQuickAbstractButton * > findExclusiveButtons() const
bool handlePress(const QPointF &point, ulong timestamp) override
virtual bool acceptKeyClick(Qt::Key key) const
static QQuickAbstractButtonPrivate * get(QQuickAbstractButton *button)
void itemDestroyed(QQuickItem *item) override
void setPressPoint(const QPointF &point)
void itemImplicitHeightChanged(QQuickItem *item) override
void itemImplicitWidthChanged(QQuickItem *item) override
QQuickDeferredPointer< QQuickItem > indicator
bool handleRelease(const QPointF &point, ulong timestamp) override
void trigger(bool doubleClick=false)
bool handleMove(const QPointF &point, ulong timestamp) override
void executeIndicator(bool complete=false)
QQuickAbstractButton * findCheckedButton() const
QPointF centerPressPoint() const
Abstract base type providing functionality common to buttons.
void setText(const QString &text, bool isExplicit)
QQuickAbstractButton(QQuickItem *parent=nullptr)
void setAction(QQuickAction *action)
void setAutoRepeat(bool repeat)
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
void setAutoExclusive(bool exclusive)
void setIcon(const QQuickIcon &icon)
void setChecked(bool checked)
void setAutoRepeatInterval(int interval)
void keyPressEvent(QKeyEvent *event) override
This event handler can be reimplemented in a subclass to receive key press events for an item.
bool event(QEvent *event) override
This virtual function receives events to an object and should return true if the event e was recogniz...
void setIndicator(QQuickItem *indicator)
bool isPressed() const
\qmlproperty bool QtQuick.Controls::AbstractButton::pressed \readonly
void toggle()
\qmlmethod void QtQuick.Controls::AbstractButton::toggle()
bool isChecked() const
\qmlproperty bool QtQuick.Controls::AbstractButton::checked
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
bool isCheckable() const
\qmlproperty bool QtQuick.Controls::AbstractButton::checkable
void keyReleaseEvent(QKeyEvent *event) override
This event handler can be reimplemented in a subclass to receive key release events for an item.
void setText(const QString &text)
void focusOutEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive focus-out events for an item.
void setCheckable(bool checkable)
virtual void buttonChange(ButtonChange change)
void setDisplay(Display display)
bool isDown() const
\qmlproperty bool QtQuick.Controls::AbstractButton::down
void mouseDoubleClickEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse double-click events for an ite...
void setPressed(bool pressed)
void trigger(QObject *, bool doToggle)
void registerItem(QQuickItem *item)
static QQuickActionPrivate * get(QQuickAction *action)
QQuickActionGroup * group
void unregisterItem(QQuickItem *item)
bool isCheckable() const
\qmlproperty bool QtQuick.Controls::Action::checkable
void triggered(QObject *source=nullptr)
void checkedChanged(bool checked)
void checkableChanged(bool checkable)
void enabledChanged(bool enabled)
QQuickIcon icon
void textChanged(const QString &text)
void iconChanged(const QQuickIcon &icon)
bool isEnabled() const
\qmlproperty bool QtQuick.Controls::Action::enabled
bool isChecked() const
\qmlproperty bool QtQuick.Controls::Action::checked
void itemImplicitWidthChanged(QQuickItem *item) override
virtual bool handlePress(const QPointF &point, ulong timestamp)
static void hideOldItem(QQuickItem *item)
virtual void handleUngrab()
virtual bool handleRelease(const QPointF &point, ulong timestamp)
static void warnIfCustomizationNotSupported(QObject *control, QQuickItem *item, const QString &propertyName)
void itemDestroyed(QQuickItem *item) override
virtual bool handleMove(const QPointF &point, ulong timestamp)
void itemImplicitHeightChanged(QQuickItem *item) override
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void maybeSetAccessibleName(const QString &name)
void setFocusPolicy(Qt::FocusPolicy policy)
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
bool setAccessibleProperty(const char *propertyName, const QVariant &value)
void focusOutEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive focus-out events for an item.
QQuickIcon resolve(const QQuickIcon &other) const
QQuickItem * parentItem
QList< QQuickItem * > childItems
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
QList< QQuickItem * > childItems() const
Returns the children of this item.
virtual void keyPressEvent(QKeyEvent *event)
This event handler can be reimplemented in a subclass to receive key press events for an item.
void setParentItem(QQuickItem *parent)
void setAcceptTouchEvents(bool accept)
If enabled is true, this sets the item to accept touch events; otherwise, touch events are not accept...
bool isVisible() const
void setEnabled(bool)
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
Sets the mouse buttons accepted by this item to buttons.
QQuickItem * parentItem() const
virtual void keyReleaseEvent(QKeyEvent *event)
This event handler can be reimplemented in a subclass to receive key release events for an item.
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
Definition qquickitem.h:143
@ ItemVisibleHasChanged
Definition qquickitem.h:147
void setActiveFocusOnTab(bool)
The QShortcutEvent class provides an event which is generated when the user presses a key combination...
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qcoreevent.h:359
T value() const &
Definition qvariant.h:511
QString text
QPushButton * button
[2]
auto signal
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
@ LeftButton
Definition qnamespace.h:57
@ NoButton
Definition qnamespace.h:56
@ TabFocus
Definition qnamespace.h:107
@ StrongFocus
Definition qnamespace.h:109
@ ArrowCursor
@ WindowShortcut
#define qApp
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:287
int qRound(qfloat16 d) noexcept
Definition qfloat16.h:281
GLuint64 key
GLint GLsizei GLsizei height
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLsizei width
GLboolean GLuint group
struct _cl_event * event
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
void quickCancelDeferred(QObject *object, const QString &property)
void quickCompleteDeferred(QObject *object, const QString &property, QQuickDeferredPointer< T > &delegate)
void quickBeginDeferred(QObject *object, const QString &property, QQuickDeferredPointer< T > &delegate)
#define QStringLiteral(str)
#define emit
#define Q_UNUSED(x)
static QString indicatorName()
unsigned long ulong
Definition qtypes.h:30
double qreal
Definition qtypes.h:92
myObject disconnect()
[26]
Text files * txt
item setCursor(Qt::IBeamCursor)
[1]
QGraphicsItem * item
QLayoutItem * child
[0]
button setShortcut(tr("Alt+F7"))
bool contains(const AT &t) const noexcept
Definition qlist.h:44
static bool matcher(QObject *object, Qt::ShortcutContext context)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
\inmodule QtQuick
Definition qquickitem.h:158