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
QQuickActionGroupPrivate Class Reference

Groups actions together. More...

+ Inheritance diagram for QQuickActionGroupPrivate:
+ Collaboration diagram for QQuickActionGroupPrivate:

Public Member Functions

void clear ()
 
void actionTriggered ()
 
void _q_updateCurrent ()
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Static Public Member Functions

static bool changeEnabled (QQuickAction *action, bool enabled)
 
static void actions_append (QQmlListProperty< QQuickAction > *prop, QQuickAction *obj)
 
static qsizetype actions_count (QQmlListProperty< QQuickAction > *prop)
 
static QQuickActionactions_at (QQmlListProperty< QQuickAction > *prop, qsizetype index)
 
static void actions_clear (QQmlListProperty< QQuickAction > *prop)
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (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 enabled = true
 
bool exclusive = true
 
QPointer< QQuickActioncheckedAction
 
QList< QQuickAction * > actions
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
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 receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Detailed Description

Groups actions together.

\qmltype ActionGroup
\inherits QtObject

! \instantiates QQuickActionGroup \inqmlmodule QtQuick.Controls

Since
5.10

ActionGroup is a non-visual group of actions. A mutually \l exclusive action group is used with actions where only one of the options can be selected at a time.

The most straight-forward way to use ActionGroup is to declare actions as children of the group.

ActionGroup {
id: alignmentGroup
Action {
checked: true
checkable: true
text: qsTr("Left")
}
Action {
checkable: true
text: qsTr("Center")
}
checkable: true
text: qsTr("Right")
}
}
QString text
GLenum GLuint id
[7]

Alternatively, the \l group attached property allows declaring the actions elsewhere and assigning them to a specific group.

ActionGroup { id: alignmentGroup }
Action {
checked: true
checkable: true
text: qsTr("Left")
ActionGroup.group: alignmentGroup
}
Action {
checkable: true
text: qsTr("Center")
ActionGroup.group: alignmentGroup
}
Action {
checkable: true
text: qsTr("Right")
ActionGroup.group: alignmentGroup
}
GLboolean GLuint group

More advanced use cases can be handled using the addAction() and removeAction() methods.

See also
Action, ButtonGroup

\qmlsignal QtQuick.Controls::ActionGroup::triggered(Action action)

This signal is emitted when an action in the group has been triggered.

This signal is convenient for implementing a common signal handler for all actions in the same group.

ActionGroup {
onTriggered: console.log("triggered:", action.text)
Action { text: "First" }
Action { text: "Second" }
Action { text: "Third" }
}
See also
Action::triggered()

Definition at line 109 of file qquickactiongroup.cpp.

Member Function Documentation

◆ _q_updateCurrent()

void QQuickActionGroupPrivate::_q_updateCurrent ( )

Definition at line 149 of file qquickactiongroup.cpp.

References actions, checkedAction, QListSpecialMethodsBase< T >::contains(), exclusive, and QQuickAction::isChecked().

Referenced by QQuickActionGroup::addAction(), clear(), and QQuickActionGroup::removeAction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ actions_append()

void QQuickActionGroupPrivate::actions_append ( QQmlListProperty< QQuickAction > * prop,
QQuickAction * obj )
static

Definition at line 166 of file qquickactiongroup.cpp.

References QQuickActionGroup::addAction().

+ Here is the call graph for this function:

◆ actions_at()

QQuickAction * QQuickActionGroupPrivate::actions_at ( QQmlListProperty< QQuickAction > * prop,
qsizetype index )
static

Definition at line 178 of file qquickactiongroup.cpp.

References actions, and QList< T >::value().

+ Here is the call graph for this function:

◆ actions_clear()

void QQuickActionGroupPrivate::actions_clear ( QQmlListProperty< QQuickAction > * prop)
static

Definition at line 184 of file qquickactiongroup.cpp.

References clear(), emit, QMetaObject::invokeMethod(), and Qt::QueuedConnection.

+ Here is the call graph for this function:

◆ actions_count()

qsizetype QQuickActionGroupPrivate::actions_count ( QQmlListProperty< QQuickAction > * prop)
static

Definition at line 172 of file qquickactiongroup.cpp.

References actions, and QList< T >::size().

+ Here is the call graph for this function:

◆ actionTriggered()

void QQuickActionGroupPrivate::actionTriggered ( )

Definition at line 141 of file qquickactiongroup.cpp.

References emit.

Referenced by QQuickActionGroup::addAction(), clear(), and QQuickActionGroup::removeAction().

+ Here is the caller graph for this function:

◆ changeEnabled()

bool QQuickActionGroupPrivate::changeEnabled ( QQuickAction * action,
bool enabled )
static

Definition at line 161 of file qquickactiongroup.cpp.

References QQuickActionPrivate::get(), and QQuickAction::isEnabled().

+ Here is the call graph for this function:

◆ clear()

void QQuickActionGroupPrivate::clear ( )

Definition at line 131 of file qquickactiongroup.cpp.

References _q_updateCurrent(), actions, actionTriggered(), QQuickAction::checkedChanged(), QList< T >::clear(), QObjectPrivate::disconnect(), QQuickActionPrivate::get(), and QQuickAction::triggered().

Referenced by actions_clear().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ actions

QList<QQuickAction*> QQuickActionGroupPrivate::actions

Definition at line 128 of file qquickactiongroup.cpp.

Referenced by _q_updateCurrent(), actions_at(), actions_count(), and clear().

◆ checkedAction

QPointer<QQuickAction> QQuickActionGroupPrivate::checkedAction

Definition at line 127 of file qquickactiongroup.cpp.

Referenced by _q_updateCurrent().

◆ enabled

bool QQuickActionGroupPrivate::enabled = true

Definition at line 125 of file qquickactiongroup.cpp.

◆ exclusive

bool QQuickActionGroupPrivate::exclusive = true

Definition at line 126 of file qquickactiongroup.cpp.

Referenced by _q_updateCurrent().


The documentation for this class was generated from the following file: