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.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{
93 q->setActiveFocusOnTab(true);
94#ifdef Q_OS_MACOS
95 q->setFocusPolicy(Qt::TabFocus);
96#else
97 q->setFocusPolicy(Qt::StrongFocus);
98#endif
99 q->setAcceptedMouseButtons(Qt::LeftButton);
100#if QT_CONFIG(quicktemplates2_multitouch)
101 q->setAcceptTouchEvents(true);
102#endif
103#if QT_CONFIG(cursor)
104 q->setCursor(Qt::ArrowCursor);
105#endif
107}
108
113
115{
116 pressPoint = point;
117 setMovePoint(point);
118}
119
121{
123 bool xChange = !qFuzzyCompare(point.x(), movePoint.x());
124 bool yChange = !qFuzzyCompare(point.y(), movePoint.y());
125 movePoint = point;
126 if (xChange)
127 emit q->pressXChanged();
128 if (yChange)
129 emit q->pressYChanged();
130}
131
133{
135 QQuickControlPrivate::handlePress(point, timestamp);
136 setPressPoint(point);
137 q->setPressed(true);
138
139 emit q->pressed();
140
141 if (autoRepeat)
143 else if (touchId != -1 || Qt::LeftButton == (pressButtons & Qt::LeftButton))
145 else
147 return true;
148}
149
151{
153 QQuickControlPrivate::handleMove(point, timestamp);
154 setMovePoint(point);
155 q->setPressed(keepPressed || q->contains(point));
156
157 if (!pressed && autoRepeat)
159 else if (holdTimer > 0 && (!pressed || QLineF(pressPoint, point).length() > QGuiApplication::styleHints()->startDragDistance()))
161 return true;
162}
163
165{
167 // Store this here since the base class' handleRelease clears it.
168 const int pressTouchId = touchId;
169
170 QQuickControlPrivate::handleRelease(point, timestamp);
171 bool wasPressed = pressed;
172 setPressPoint(point);
173 q->setPressed(false);
175
176 const bool touchDoubleClick = pressTouchId != -1 && lastTouchReleaseTimestamp != 0
177 && timestamp - lastTouchReleaseTimestamp < qApp->styleHints()->mouseDoubleClickInterval()
179
180 if (!wasHeld && (keepPressed || q->contains(point)))
181 q->nextCheckState();
182
183 if (wasPressed) {
184 emit q->released();
185 if (!wasHeld && !wasDoubleClick)
186 trigger(touchDoubleClick);
187 } else {
188 emit q->canceled();
189 }
190
191 if (autoRepeat)
193 else
195
196 if (!touchDoubleClick) {
197 // This is not a double click yet, but it is potentially the
198 // first release before a double click.
199 if (pressTouchId != -1) {
200 // The corresponding press for this release was a touch press.
201 // Keep track of the timestamp of the release so that we can
202 // emit doubleClicked() if another one comes afterwards.
203 lastTouchReleaseTimestamp = timestamp;
204 }
205 } else {
206 // We just did a double click, so clear the release timestamp
207 // to prepare for any possible future double clicks.
209 }
210
211 wasDoubleClick = false;
212 return true;
213}
214
216{
220 if (!pressed)
221 return;
222
223 q->setPressed(false);
226 wasDoubleClick = false;
228 emit q->canceled();
229}
230
232{
233 const auto buttonPressKeys = QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::ButtonPressKeys).value<QList<Qt::Key>>();
234 return buttonPressKeys.contains(key);
235}
236
238{
240 static const QMetaMethod method = [&]() {
243 }();
244 return q->isSignalConnected(method);
245}
246
248{
250 static const QMetaMethod method = [&]() {
253 }();
254 return q->isSignalConnected(method);
255}
256
258{
260 wasHeld = false;
263 holdTimer = q->startTimer(QGuiApplication::styleHints()->mousePressAndHoldInterval());
264}
265
267{
269 if (holdTimer > 0) {
270 q->killTimer(holdTimer);
271 holdTimer = 0;
272 }
273}
274
281
288
290{
292 if (delayTimer > 0) {
293 q->killTimer(delayTimer);
294 delayTimer = 0;
295 }
296 if (repeatTimer > 0) {
297 q->killTimer(repeatTimer);
298 repeatTimer = 0;
299 }
300}
301
302#if QT_CONFIG(shortcut)
303void QQuickAbstractButtonPrivate::grabShortcut()
304{
306 if (shortcut.isEmpty())
307 return;
308
310
311 if (!q->isEnabled())
312 QGuiApplicationPrivate::instance()->shortcutMap.setShortcutEnabled(false, shortcutId, q);
313}
314
315void QQuickAbstractButtonPrivate::ungrabShortcut()
316{
318 if (!shortcutId)
319 return;
320
321 QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(shortcutId, q);
322 shortcutId = 0;
323}
324#endif
325
334
335void QQuickAbstractButtonPrivate::setText(const QString &newText, bool isExplicit)
336{
338 const QString oldText = q->text();
339 explicitText = isExplicit;
340 text = newText;
341 if (oldText == q->text())
342 return;
343
345}
346
348{
350 // We store effectiveIcon because we need to be able to tell if the icon has actually changed.
351 // If we only stored our icon and the action's icon, and resolved in the getter, we'd have
352 // no way of knowing what the old value was here. As an added benefit, we only resolve when
353 // something has changed, as opposed to doing it unconditionally in the icon() getter.
354 const QQuickIcon newEffectiveIcon = action ? icon.resolve(action->icon()) : icon;
355 if (newEffectiveIcon == effectiveIcon)
356 return;
357
358 effectiveIcon = newEffectiveIcon;
359 emit q->iconChanged();
360}
361
363{
365 if (effectiveEnable)
366 emit q->clicked();
367}
368
370{
372 const bool wasEnabled = effectiveEnable;
373 if (action && action->isEnabled())
374 QQuickActionPrivate::get(action)->trigger(q, false);
375 if (wasEnabled && (!action || !action->isEnabled())) {
376 if (!doubleClick)
377 emit q->clicked();
378 else
379 emit q->doubleClicked();
380 }
381}
382
384{
386 const bool wasChecked = checked;
387 q->setChecked(value);
388 if (wasChecked != checked)
389 emit q->toggled();
390}
391
397
399{
402 return;
403
404 if (!indicator || complete)
406 if (complete)
408}
409
417
425
427{
430 if (item == indicator) {
431 indicator = nullptr;
432 emit q->implicitIndicatorWidthChanged();
433 emit q->implicitIndicatorHeightChanged();
434 }
435}
436
438{
439 Q_Q(const QQuickAbstractButton);
440 if (group)
441 return group->checkedButton();
442
443 const QList<QQuickAbstractButton *> buttons = findExclusiveButtons();
444 // TODO: A singular QRadioButton can be unchecked, which seems logical,
445 // because there's nothing to be exclusive with. However, a RadioButton
446 // from QtQuick.Controls 1.x can never be unchecked, which is the behavior
447 // that QQuickRadioButton adopted. Uncommenting the following count check
448 // gives the QRadioButton behavior. Notice that tst_radiobutton.qml needs
449 // to be updated.
450 if (!autoExclusive /*|| buttons.count() == 1*/)
451 return nullptr;
452
453 for (QQuickAbstractButton *button : buttons) {
454 if (button->isChecked() && button != q)
455 return button;
456 }
457 return checked ? const_cast<QQuickAbstractButton *>(q) : nullptr;
458}
459
460QList<QQuickAbstractButton *> QQuickAbstractButtonPrivate::findExclusiveButtons() const
461{
462 QList<QQuickAbstractButton *> buttons;
463 if (group) {
464 QQmlListProperty<QQuickAbstractButton> groupButtons = group->buttons();
465 int count = groupButtons.count(&groupButtons);
466 for (int i = 0; i < count; ++i) {
467 QQuickAbstractButton *button = qobject_cast<QQuickAbstractButton *>(groupButtons.at(&groupButtons, i));
468 if (button)
469 buttons += button;
470 }
471 } else if (parentItem) {
472 const auto childItems = parentItem->childItems();
473 for (QQuickItem *child : childItems) {
474 QQuickAbstractButton *button = qobject_cast<QQuickAbstractButton *>(child);
476 buttons += button;
477 }
478 }
479 return buttons;
480}
481
488
495
497{
499 d->removeImplicitSizeListener(d->indicator);
500 if (d->group) {
501 auto *attached = qobject_cast<QQuickButtonGroupAttached *>(
502 qmlAttachedPropertiesObject<QQuickButtonGroup>(this, false));
503 if (attached)
504 attached->setGroup(nullptr);
505 else
506 d->group->removeButton(this);
507 }
508#if QT_CONFIG(shortcut)
509 d->ungrabShortcut();
510#endif
511}
512
524{
525 Q_D(const QQuickAbstractButton);
526 return d->explicitText || !d->action ? d->text : d->action->text();
527}
528
530{
532 d->setText(text, true);
533}
534
536{
538 d->setText(QString(), false);
539}
540
552{
553 Q_D(const QQuickAbstractButton);
554 return d->down;
555}
556
558{
560 d->explicitDown = true;
561
562 if (d->down == down)
563 return;
564
565 d->down = down;
567}
568
570{
572 if (!d->explicitDown)
573 return;
574
575 setDown(d->pressed);
576 d->explicitDown = false;
577}
578
589{
590 Q_D(const QQuickAbstractButton);
591 return d->pressed;
592}
593
595{
597 if (d->pressed == isPressed)
598 return;
599
600 d->pressed = isPressed;
604
605 if (!d->explicitDown) {
606 setDown(d->pressed);
607 d->explicitDown = false;
608 }
609}
610
623{
624 Q_D(const QQuickAbstractButton);
625 return d->checked;
626}
627
629{
631 if (d->checked == checked)
632 return;
633
634 d->checked = checked;
635 if (d->action)
636 d->action->setChecked(checked);
637 setAccessibleProperty("checked", checked);
640}
641
656{
657 Q_D(const QQuickAbstractButton);
658 return d->checkable;
659}
660
662{
664 if (d->checkable == checkable)
665 return;
666
667 d->checkable = checkable;
668 if (d->action)
669 d->action->setCheckable(checkable);
670 setAccessibleProperty("checkable", checkable);
673}
674
690{
691 Q_D(const QQuickAbstractButton);
692 return d->autoExclusive;
693}
694
696{
698 if (d->autoExclusive == exclusive)
699 return;
700
701 d->autoExclusive = exclusive;
703}
704
720{
721 Q_D(const QQuickAbstractButton);
722 return d->autoRepeat;
723}
724
726{
728 if (d->autoRepeat == repeat)
729 return;
730
731 d->stopPressRepeat();
732 d->autoRepeat = repeat;
734}
735
742{
744 if (!d->indicator)
745 d->executeIndicator();
746 return d->indicator;
747}
748
750{
752 if (d->indicator == indicator)
753 return;
754
756
757 if (!d->indicator.isExecuting())
758 d->cancelIndicator();
759
760 const qreal oldImplicitIndicatorWidth = implicitIndicatorWidth();
761 const qreal oldImplicitIndicatorHeight = implicitIndicatorHeight();
762
763 d->removeImplicitSizeListener(d->indicator);
765 d->indicator = indicator;
766
767 if (indicator) {
768 if (!indicator->parentItem())
771 d->addImplicitSizeListener(indicator);
772 }
773
774 if (!qFuzzyCompare(oldImplicitIndicatorWidth, implicitIndicatorWidth()))
775 emit implicitIndicatorWidthChanged();
776 if (!qFuzzyCompare(oldImplicitIndicatorHeight, implicitIndicatorHeight()))
777 emit implicitIndicatorHeightChanged();
778 if (!d->indicator.isExecuting())
780}
781
798{
799 Q_D(const QQuickAbstractButton);
800 return d->effectiveIcon;
801}
802
804{
806 d->icon = icon;
807 d->icon.ensureRelativeSourceResolved(this);
808 d->updateEffectiveIcon();
809}
810
829{
830 Q_D(const QQuickAbstractButton);
831 return d->display;
832}
833
835{
837 if (display == d->display)
838 return;
839
840 d->display = display;
841 emit displayChanged();
842}
843
853{
854 Q_D(const QQuickAbstractButton);
855 return d->action;
856}
857
859{
861 if (d->action == action)
862 return;
863
864 const QString oldText = text();
865
866 if (QQuickAction *oldAction = d->action.data()) {
867 QQuickActionPrivate::get(oldAction)->unregisterItem(this);
870
875 }
876
877 if (action) {
878 QQuickActionPrivate::get(action)->registerItem(this);
881
886
890 }
891
892 d->action = action;
893
894 if (oldText != text())
896
897 d->updateEffectiveIcon();
898
899 emit actionChanged();
900}
901
912{
913 Q_D(const QQuickAbstractButton);
914 return d->repeatDelay;
915}
916
918{
920 if (d->repeatDelay == delay)
921 return;
922
923 d->repeatDelay = delay;
924 emit autoRepeatDelayChanged();
925}
926
937{
938 Q_D(const QQuickAbstractButton);
939 return d->repeatInterval;
940}
941
943{
945 if (d->repeatInterval == interval)
946 return;
947
948 d->repeatInterval = interval;
949 emit autoRepeatIntervalChanged();
950}
951
952#if QT_CONFIG(shortcut)
953QKeySequence QQuickAbstractButton::shortcut() const
954{
955 Q_D(const QQuickAbstractButton);
956 return d->shortcut;
957}
958
959void QQuickAbstractButton::setShortcut(const QKeySequence &shortcut)
960{
962 if (d->shortcut == shortcut)
963 return;
964
965 d->ungrabShortcut();
966 d->shortcut = shortcut;
967 if (isVisible())
968 d->grabShortcut();
969}
970#endif
971
984{
985 Q_D(const QQuickAbstractButton);
986 return d->movePoint.x();
987}
988
1001{
1002 Q_D(const QQuickAbstractButton);
1003 return d->movePoint.y();
1004}
1005
1021{
1022 Q_D(const QQuickAbstractButton);
1023 if (!d->indicator)
1024 return 0;
1025 return d->indicator->implicitWidth();
1026}
1027
1043{
1044 Q_D(const QQuickAbstractButton);
1045 if (!d->indicator)
1046 return 0;
1047 return d->indicator->implicitHeight();
1048}
1049
1056{
1058 setChecked(!d->checked);
1059}
1060
1062{
1064 d->executeIndicator(true);
1066}
1067
1069{
1070#if QT_CONFIG(shortcut)
1072 if (event->type() == QEvent::Shortcut) {
1073 QShortcutEvent *se = static_cast<QShortcutEvent *>(event);
1074 if (se->shortcutId() == d->shortcutId) {
1075 d->trigger();
1076 return true;
1077 }
1078 }
1079#endif
1081}
1082
1084{
1087 if (d->touchId == -1) // don't ungrab on multi-touch if another control gets focused
1088 d->handleUngrab();
1089}
1090
1092{
1095 if (d->acceptKeyClick(static_cast<Qt::Key>(event->key()))) {
1096 d->setPressPoint(d->centerPressPoint());
1097 setPressed(true);
1098
1099 if (d->autoRepeat)
1100 d->startRepeatDelay();
1101
1102 emit pressed();
1103 event->accept();
1104 }
1105}
1106
1108{
1111 if (d->pressed && d->acceptKeyClick(static_cast<Qt::Key>(event->key()))) {
1112 setPressed(false);
1113
1115 emit released();
1116 d->trigger();
1117
1118 if (d->autoRepeat)
1119 d->stopPressRepeat();
1120 event->accept();
1121 }
1122}
1123
1125{
1126 if (!(event->buttons() & Qt::LeftButton)) {
1127 event->ignore();
1128 return;
1129 }
1130
1132 d->pressButtons = event->buttons();
1134}
1135
1137{
1138 Q_UNUSED(event);
1140 if (d->isDoubleClickConnected()) {
1141 // don't call QQuickItem::mouseDoubleClickEvent(): it would ignore()
1143 d->wasDoubleClick = true;
1144 }
1145}
1146
1148{
1151 if (event->timerId() == d->holdTimer) {
1152 d->stopPressAndHold();
1153 d->wasHeld = true;
1155 } else if (event->timerId() == d->delayTimer) {
1156 d->startPressRepeat();
1157 } else if (event->timerId() == d->repeatTimer) {
1158 emit released();
1159 d->trigger();
1160 emit pressed();
1161 }
1162}
1163
1165{
1167#if QT_CONFIG(shortcut)
1169 if (change == ItemVisibleHasChanged) {
1170 if (value.boolValue)
1171 d->grabShortcut();
1172 else
1173 d->ungrabShortcut();
1174 }
1175#endif
1176}
1177
1179{
1181 switch (change) {
1183 if (d->checked) {
1184 QQuickAbstractButton *button = d->findCheckedButton();
1185 if (button && button != this)
1186 button->setChecked(false);
1187 }
1188 break;
1189 case ButtonTextChange: {
1190 const QString txt = text();
1192#if QT_CONFIG(shortcut)
1194#endif
1195 emit textChanged();
1196 break;
1197 }
1198 default:
1199 break;
1200 }
1201}
1202
1204{
1206 if (!d->checkable)
1207 return;
1208
1209 if (d->checked) {
1210 if (d->findCheckedButton() == this)
1211 return;
1212 if (d->action) {
1213 // For non-exclusive groups checkedAction is null
1214 if (const auto group = QQuickActionPrivate::get(d->action)->group)
1215 if (group->checkedAction() == d->action)
1216 return;
1217 }
1218 }
1219
1220 d->toggle(!d->checked);
1221}
1222
1223#if QT_CONFIG(accessibility)
1224void QQuickAbstractButton::accessibilityActiveChanged(bool active)
1225{
1226 QQuickControl::accessibilityActiveChanged(active);
1227
1229 if (active) {
1231 setAccessibleProperty("pressed", d->pressed);
1232 setAccessibleProperty("checked", d->checked);
1233 setAccessibleProperty("checkable", d->checkable);
1234 }
1235}
1236
1237QAccessible::Role QQuickAbstractButton::accessibleRole() const
1238{
1239 Q_D(const QQuickAbstractButton);
1240 if (d->checkable) {
1241 return QAccessible::CheckBox;
1242 }
1243 return QAccessible::Button;
1244}
1245
1246void QQuickAbstractButton::accessiblePressAction()
1247{
1249 d->trigger();
1250}
1251#endif
1252
1254
1255#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:470
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:424
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 ...
static constexpr Policy Preferred
static constexpr Policy Fixed
\inmodule QtCore\compares equality \compareswith equality QLine \endcompareswith
Definition qline.h:192
qsizetype count() const noexcept
Definition qlist.h:398
\inmodule QtCore
Definition qmetaobject.h:19
static QMetaMethod fromSignal(PointerToMemberFunction signal)
\inmodule QtGui
Definition qevent.h:196
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:299
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:328
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
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:1389
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
Definition qobject.cpp:1470
\inmodule QtCore\reentrant
Definition qpoint.h:217
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:343
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:348
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
void setText(const QString &text, bool isExplicit)
void init()
Abstract base type providing functionality common to buttons.
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)
static QQuickActionPrivate * get(QQuickAction *action)
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 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
void setSizePolicy(const QLayoutPolicy::Policy &horizontalPolicy, const QLayoutPolicy::Policy &verticalPolicy)
QQuickItem * parentItem
QList< QQuickItem * > childItems
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
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)
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:144
@ ItemVisibleHasChanged
Definition qquickitem.h:148
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:129
\inmodule QtCore
Definition qcoreevent.h:366
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:58
@ NoButton
Definition qnamespace.h:57
@ TabFocus
Definition qnamespace.h:108
@ StrongFocus
Definition qnamespace.h:110
@ 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:333
int qRound(qfloat16 d) noexcept
Definition qfloat16.h:327
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:35
double qreal
Definition qtypes.h:187
myObject disconnect()
[26]
Text files * txt
QGraphicsItem * item
QLayoutItem * child
[0]
button setShortcut(tr("Alt+F7"))
static bool matcher(QObject *object, Qt::ShortcutContext context)
\inmodule QtQuick
Definition qquickitem.h:159