![]() |
Qt 6.x
The Qt SDK
|
#include <qquickaction_p_p.h>
Static Public Member Functions | |
static QQuickActionPrivate * | get (QQuickAction *action) |
![]() | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (const QObject *o) |
template<typename Func1 , typename Func2 > | |
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) |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot) |
static QMetaObject::Connection | connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static bool | disconnect (const QObject *sender, int signal_index, void **slot) |
static bool | disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot) |
Public Attributes | ||
bool | explicitEnabled = false | |
bool | enabled = true | |
bool | checked = false | |
bool | checkable = false | |
QString | text | |
QQuickIcon | icon | |
QQuickActionGroup * | group = nullptr | |
![]() | ||
ExtraData * | extraData | |
QAtomicPointer< QThreadData > | threadData | |
QAtomicPointer< ConnectionData > | connections | |
union { | ||
QObject * currentChildBeingDeleted | ||
QAbstractDeclarativeData * declarativeData | ||
}; | ||
QAtomicPointer< QtSharedPointer::ExternalRefCountData > | sharedRefcount | |
![]() | ||
QObject * | q_ptr | |
QObject * | parent | |
QObjectList | children | |
uint | isWidget: 1 | |
uint | blockSig: 1 | |
uint | wasDeleted: 1 | |
uint | isDeletingChildren: 1 | |
uint | sendChildEvents: 1 | |
uint | receiveChildEvents: 1 | |
uint | isWindow: 1 | |
uint | deleteLaterCalled: 1 | |
uint | isQuickItem: 1 | |
uint | willBeWidget: 1 | |
uint | wasWidget: 1 | |
uint | unused: 21 | |
QAtomicInt | postedEvents | |
QDynamicMetaObjectData * | metaObject | |
QBindingStorage | bindingStorage | |
Additional Inherited Members | |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
Definition at line 31 of file qquickaction_p_p.h.
|
inlinestatic |
Definition at line 36 of file qquickaction_p_p.h.
Referenced by QQuickActionGroup::addAction(), QQuickActionGroupPrivate::changeEnabled(), QQuickActionGroupPrivate::clear(), QQuickAbstractButton::nextCheckState(), QQuickActionGroup::removeAction(), QQuickAbstractButton::setAction(), and QQuickAbstractButtonPrivate::trigger().
bool QQuickActionPrivate::handleShortcutEvent | ( | QObject * | object, |
QShortcutEvent * | event | ||
) |
|
overridevirtual |
Reimplemented from QQuickItemChangeListener.
Definition at line 256 of file qquickaction.cpp.
References item, and unregisterItem().
|
overridevirtual |
Reimplemented from QQuickItemChangeListener.
Definition at line 238 of file qquickaction.cpp.
References QGraphicsItem::isVisible(), item, and Q_UNUSED.
void QQuickActionPrivate::registerItem | ( | QQuickItem * | item | ) |
Definition at line 207 of file qquickaction.cpp.
References QGraphicsItem::isVisible(), item, and watchItem().
Referenced by QQuickAbstractButton::setAction().
QT_BEGIN_NAMESPACE void QQuickActionPrivate::setEnabled | ( | bool | enable | ) |
Abstract user interface action.
\qmltype Action \inherits QtObject
! \instantiates QQuickAction \inqmlmodule QtQuick.Controls
Action represents an abstract user interface action that can have shortcuts and can be assigned to menu items and toolbar buttons.
Actions may contain \l text, an \l icon, and a \l shortcut. Actions are normally \l triggered by the user via menu items, toolbar buttons, or keyboard shortcuts. A \l checkable Action toggles its \l checked state when triggered.
Action is commonly used to implement application commands that can be invoked via menu items, toolbar buttons, and keyboard shortcuts. Since the user expects the commands to be performed in the same way, regardless of the user interface used, it is useful to represent the commands as shareable actions.
Action can be also used to separate the logic and the visual presentation. For example, when declaring buttons and menu items in .ui.qml files, actions can be declared elsewhere and assigned from the outside.
When an action is paired with buttons and menu items, the enabled
, checkable
, and checked
states are synced automatically. For example, in a word processor, if the user clicks a "Bold" toolbar button, the "Bold" menu item will automatically be checked. Buttons and menu items get their text
and icon
from the action by default. An action-specific text
or icon
can be overridden for a specific control by specifying text
or icon
directly on the control.
Since Action presents a user interface action, it is intended to be assigned to a \l MenuItem, \l ToolButton, or any other control that inherits \l AbstractButton. For keyboard shortcuts, the simpler \l Shortcut type is more appropriate.
\qmlsignal QtQuick.Controls::Action::toggled(QtObject source)
This signal is emitted when the action is toggled. The source argument identifies the object that toggled the action.
For example, if the action is assigned to a menu item and a toolbar button, the action is toggled when the control is toggled, the shortcut is activated, or when \l toggle() is called directly.
\qmlsignal QtQuick.Controls::Action::triggered(QtObject source)
This signal is emitted when the action is triggered. The source argument identifies the object that triggered the action.
For example, if the action is assigned to a menu item and a toolbar button, the action is triggered when the control is clicked, the shortcut is activated, or when \l trigger() is called directly.
Definition at line 168 of file qquickaction.cpp.
References emit.
Definition at line 510 of file qquickaction.cpp.
References checkable, checked, emit, and QPointer< T >::isNull().
Referenced by QQuickAbstractButtonPrivate::trigger().
void QQuickActionPrivate::unregisterItem | ( | QQuickItem * | item | ) |
Definition at line 222 of file qquickaction.cpp.
References item, Q_UNUSED, and unwatchItem().
Referenced by itemDestroyed(), and QQuickAbstractButton::setAction().
bool QQuickActionPrivate::unwatchItem | ( | QQuickItem * | item | ) |
Definition at line 196 of file qquickaction.cpp.
References QQuickItemPrivate::Destroyed, QQuickItemPrivate::get(), item, QQuickItemPrivate::removeItemChangeListener(), and QQuickItemPrivate::Visibility.
Referenced by unregisterItem().
bool QQuickActionPrivate::watchItem | ( | QQuickItem * | item | ) |
Definition at line 185 of file qquickaction.cpp.
References QQuickItemPrivate::addItemChangeListener(), QQuickItemPrivate::Destroyed, QQuickItemPrivate::get(), item, and QQuickItemPrivate::Visibility.
Referenced by registerItem().
bool QQuickActionPrivate::checkable = false |
Definition at line 88 of file qquickaction_p_p.h.
Referenced by trigger().
bool QQuickActionPrivate::checked = false |
Definition at line 87 of file qquickaction_p_p.h.
Referenced by trigger().
bool QQuickActionPrivate::enabled = true |
Definition at line 86 of file qquickaction_p_p.h.
bool QQuickActionPrivate::explicitEnabled = false |
Definition at line 85 of file qquickaction_p_p.h.
Referenced by QQuickActionGroupPrivate::changeEnabled().
QQuickActionGroup* QQuickActionPrivate::group = nullptr |
Definition at line 97 of file qquickaction_p_p.h.
Referenced by QQuickActionGroup::addAction(), QQuickActionGroupPrivate::clear(), QQuickAbstractButton::nextCheckState(), and QQuickActionGroup::removeAction().
QQuickIcon QQuickActionPrivate::icon |
Definition at line 90 of file qquickaction_p_p.h.
QString QQuickActionPrivate::text |
Definition at line 89 of file qquickaction_p_p.h.