13#include <QtGui/qstylehints.h>
14#include <QtGui/qguiapplication.h>
15#if QT_CONFIG(shortcut)
16# include <QtGui/private/qshortcutmap_p.h>
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>
93 q->setActiveFocusOnTab(
true);
100#if QT_CONFIG(quicktemplates2_multitouch)
101 q->setAcceptTouchEvents(
true);
127 emit q->pressXChanged();
129 emit q->pressYChanged();
168 const int pressTouchId =
touchId;
173 q->setPressed(
false);
196 if (!touchDoubleClick) {
199 if (pressTouchId != -1) {
223 q->setPressed(
false);
234 return buttonPressKeys.contains(
key);
244 return q->isSignalConnected(
method);
254 return q->isSignalConnected(
method);
302#if QT_CONFIG(shortcut)
303void QQuickAbstractButtonPrivate::grabShortcut()
315void QQuickAbstractButtonPrivate::ungrabShortcut()
341 if (oldText ==
q->text())
359 emit q->iconChanged();
379 emit q->doubleClicked();
386 const bool wasChecked =
checked;
415 emit q->implicitIndicatorWidthChanged();
423 emit q->implicitIndicatorHeightChanged();
432 emit q->implicitIndicatorWidthChanged();
433 emit q->implicitIndicatorHeightChanged();
441 return group->checkedButton();
462 QList<QQuickAbstractButton *> buttons;
464 QQmlListProperty<QQuickAbstractButton> groupButtons =
group->buttons();
465 int count = groupButtons.
count(&groupButtons);
499 d->removeImplicitSizeListener(
d->indicator);
501 auto *attached = qobject_cast<QQuickButtonGroupAttached *>(
502 qmlAttachedPropertiesObject<QQuickButtonGroup>(
this,
false));
504 attached->setGroup(
nullptr);
506 d->group->removeButton(
this);
508#if QT_CONFIG(shortcut)
526 return d->explicitText || !
d->action ?
d->text :
d->action->text();
532 d->setText(
text,
true);
560 d->explicitDown =
true;
572 if (!
d->explicitDown)
576 d->explicitDown =
false;
605 if (!
d->explicitDown) {
607 d->explicitDown =
false;
692 return d->autoExclusive;
698 if (
d->autoExclusive == exclusive)
701 d->autoExclusive = exclusive;
722 return d->autoRepeat;
728 if (
d->autoRepeat == repeat)
731 d->stopPressRepeat();
732 d->autoRepeat = repeat;
745 d->executeIndicator();
757 if (!
d->indicator.isExecuting())
758 d->cancelIndicator();
763 d->removeImplicitSizeListener(
d->indicator);
775 emit implicitIndicatorWidthChanged();
777 emit implicitIndicatorHeightChanged();
778 if (!
d->indicator.isExecuting())
800 return d->effectiveIcon;
807 d->icon.ensureRelativeSourceResolved(
this);
808 d->updateEffectiveIcon();
841 emit displayChanged();
894 if (oldText !=
text())
897 d->updateEffectiveIcon();
899 emit actionChanged();
914 return d->repeatDelay;
920 if (
d->repeatDelay == delay)
923 d->repeatDelay = delay;
924 emit autoRepeatDelayChanged();
939 return d->repeatInterval;
945 if (
d->repeatInterval == interval)
948 d->repeatInterval = interval;
949 emit autoRepeatIntervalChanged();
952#if QT_CONFIG(shortcut)
986 return d->movePoint.x();
1003 return d->movePoint.y();
1025 return d->indicator->implicitWidth();
1047 return d->indicator->implicitHeight();
1064 d->executeIndicator(
true);
1070#if QT_CONFIG(shortcut)
1074 if (se->shortcutId() ==
d->shortcutId) {
1087 if (
d->touchId == -1)
1095 if (
d->acceptKeyClick(
static_cast<Qt::Key>(
event->key()))) {
1096 d->setPressPoint(
d->centerPressPoint());
1100 d->startRepeatDelay();
1111 if (
d->pressed &&
d->acceptKeyClick(
static_cast<Qt::Key>(
event->key()))) {
1119 d->stopPressRepeat();
1132 d->pressButtons =
event->buttons();
1140 if (
d->isDoubleClickConnected()) {
1143 d->wasDoubleClick =
true;
1151 if (
event->timerId() ==
d->holdTimer) {
1152 d->stopPressAndHold();
1155 }
else if (
event->timerId() ==
d->delayTimer) {
1156 d->startPressRepeat();
1157 }
else if (
event->timerId() ==
d->repeatTimer) {
1167#if QT_CONFIG(shortcut)
1170 if (
value.boolValue)
1173 d->ungrabShortcut();
1192#if QT_CONFIG(shortcut)
1210 if (
d->findCheckedButton() ==
this)
1215 if (
group->checkedAction() ==
d->action)
1220 d->toggle(!
d->checked);
1223#if QT_CONFIG(accessibility)
1224void QQuickAbstractButton::accessibilityActiveChanged(
bool active)
1226 QQuickControl::accessibilityActiveChanged(active);
1237QAccessible::Role QQuickAbstractButton::accessibleRole()
const
1241 return QAccessible::CheckBox;
1243 return QAccessible::Button;
1246void QQuickAbstractButton::accessiblePressAction()
1255#include "moc_qquickabstractbutton_p.cpp"
The QFocusEvent class contains event parameters for widget focus events.
static QGuiApplicationPrivate * instance()
static QPlatformTheme * platformTheme()
static QStyleHints * styleHints()
Returns the application's style hints.
The QKeyEvent class describes a key event.
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
qsizetype count() const noexcept
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)
static bool disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
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)
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)
QList< QQuickItem * > childItems
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
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 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.
The QShortcutEvent class provides an event which is generated when the user presses a key combination...
\macro QT_RESTRICTED_CAST_FROM_ASCII
struct wl_display * display
Combined button and popup list for selecting options.
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
int qRound(qfloat16 d) noexcept
GLint GLsizei GLsizei height
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLdouble GLdouble GLdouble GLdouble q
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)
static QString indicatorName()
myObject disconnect()
[26]
static bool matcher(QObject *object, Qt::ShortcutContext context)