![]() |
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>.
|
#include <qquickitem_p.h>
Public Types | |
enum | Priority { BeforeItem , AfterItem } |
Signals | |
void | leftChanged () |
void | rightChanged () |
void | upChanged () |
void | downChanged () |
void | tabChanged () |
void | backtabChanged () |
void | priorityChanged () |
![]() | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Public Member Functions | |
QQuickKeyNavigationAttached (QObject *=nullptr) | |
\qmltype KeyNavigation \instantiates QQuickKeyNavigationAttached \inqmlmodule QtQuick | |
QQuickItem * | left () const |
void | setLeft (QQuickItem *) |
QQuickItem * | right () const |
void | setRight (QQuickItem *) |
QQuickItem * | up () const |
void | setUp (QQuickItem *) |
QQuickItem * | down () const |
void | setDown (QQuickItem *) |
QQuickItem * | tab () const |
void | setTab (QQuickItem *) |
QQuickItem * | backtab () const |
void | setBacktab (QQuickItem *) |
Priority | priority () const |
\qmlattachedproperty enumeration QtQuick::KeyNavigation::priority | |
void | setPriority (Priority) |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
bool | moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL) |
Changes the thread affinity for this object and its children and returns true on success. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
void | killTimer (Qt::TimerId id) |
template<typename T > | |
T | findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T > | |
T | findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
![]() | |
QQuickItemKeyFilter (QQuickItem *=nullptr) | |
virtual | ~QQuickItemKeyFilter () |
virtual void | shortcutOverrideEvent (QKeyEvent *event) |
virtual void | componentComplete () |
Static Public Member Functions | |
static QQuickKeyNavigationAttached * | qmlAttachedProperties (QObject *) |
![]() | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
Properties | |
QQuickItem * | left |
QQuickItem * | right |
QQuickItem * | up |
QQuickItem * | down |
QQuickItem * | tab |
QQuickItem * | backtab |
Priority | priority |
![]() | |
QString | objectName |
the name of this object | |
Private Member Functions | |
void | keyPressed (QKeyEvent *event, bool post) override |
void | keyReleased (QKeyEvent *event, bool post) override |
Additional Inherited Members | |
![]() | |
void | deleteLater () |
\threadsafe | |
![]() | |
bool | m_processPost |
![]() | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 772 of file qquickitem_p.h.
Enumerator | |
---|---|
BeforeItem | |
AfterItem |
Definition at line 806 of file qquickitem_p.h.
\qmltype KeyNavigation \instantiates QQuickKeyNavigationAttached \inqmlmodule QtQuick
Supports key navigation by arrow keys.
Key-based user interfaces commonly allow the use of arrow keys to navigate between focusable items. The KeyNavigation attached property enables this behavior by providing a convenient way to specify the item that should gain focus when an arrow or tab key is pressed.
The following example provides key navigation for a 2x2 grid of items:
The top-left item initially receives focus by setting \l {Item::}{focus} to true
. When an arrow key is pressed, the focus will move to the appropriate item, as defined by the value that has been set for the KeyNavigation \l left, \l right, \l up or \l down properties.
Note that if a KeyNavigation attached property receives the key press and release events for a requested arrow or tab key, the event is accepted and does not propagate any further.
By default, KeyNavigation receives key events after the item to which it is attached. If the item accepts the key event, the KeyNavigation attached property will not receive an event for that key. Setting the \l priority property to KeyNavigation.BeforeItem
allows the event to be used for key navigation before the item, rather than after.
If the item to which the focus is switching is not enabled or visible, an attempt will be made to skip this item and focus on the next. This is possible if there are a chain of items with the same KeyNavigation handler. If multiple items in a row are not enabled or visible, they will also be skipped.
KeyNavigation will implicitly set the other direction to return focus to this item. So if you set \l left to another item, \l right will be set on that item's KeyNavigation to set focus back to this item. However, if that item's KeyNavigation has had right explicitly set then no change will occur. This means that the example above could achieve the same behavior without specifying KeyNavigation.right or KeyNavigation.down for any of the items.
\qmlattachedproperty Item QtQuick::KeyNavigation::left
This property holds the item to assign focus to when the left cursor key is pressed.
\qmlattachedproperty Item QtQuick::KeyNavigation::right
This property holds the item to assign focus to when the right cursor key is pressed.
\qmlattachedproperty Item QtQuick::KeyNavigation::up
This property holds the item to assign focus to when the up cursor key is pressed.
\qmlattachedproperty Item QtQuick::KeyNavigation::down
This property holds the item to assign focus to when the down cursor key is pressed.
\qmlattachedproperty Item QtQuick::KeyNavigation::tab
This property holds the item to assign focus to when the Tab key is pressed.
\qmlattachedproperty Item QtQuick::KeyNavigation::backtab
This property holds the item to assign focus to when the Shift+Tab key combination (Backtab) is pressed.
Definition at line 426 of file qquickitem.cpp.
References QQuickItemKeyFilter::m_processPost.
Referenced by qmlAttachedProperties().
QQuickItem * QQuickKeyNavigationAttached::backtab | ( | ) | const |
Definition at line 549 of file qquickitem.cpp.
References d.
|
signal |
QQuickItem * QQuickKeyNavigationAttached::down | ( | ) | const |
Definition at line 505 of file qquickitem.cpp.
References d.
|
signal |
|
overrideprivatevirtual |
Reimplemented from QQuickItemKeyFilter.
Definition at line 598 of file qquickitem.cpp.
References Qt::BacktabFocusReason, d, QQuickItemPrivate::get(), Qt::Key_Backtab, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right, Qt::Key_Tab, Qt::Key_Up, QQuickItemKeyFilter::keyPressed(), QQuickItemKeyFilter::m_processPost, QObject::parent(), post(), and Qt::TabFocusReason.
|
overrideprivatevirtual |
Reimplemented from QQuickItemKeyFilter.
Definition at line 661 of file qquickitem.cpp.
References d, QQuickItemPrivate::get(), Qt::Key_Backtab, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right, Qt::Key_Tab, Qt::Key_Up, QQuickItemKeyFilter::keyReleased(), QQuickItemKeyFilter::m_processPost, QObject::parent(), and post().
QQuickItem * QQuickKeyNavigationAttached::left | ( | ) | const |
Definition at line 439 of file qquickitem.cpp.
References d.
|
signal |
QQuickKeyNavigationAttached::Priority QQuickKeyNavigationAttached::priority | ( | ) | const |
\qmlattachedproperty enumeration QtQuick::KeyNavigation::priority
This property determines whether the keys are processed before or after the attached item's own key handling.
\value KeyNavigation.BeforeItem process the key events before normal item key processing. If the event is used for key navigation, it will be accepted and will not be passed on to the item. \value KeyNavigation.AfterItem (default) process the key events after normal item key handling. If the item accepts the key event it will not be handled by the KeyNavigation attached property handler.
Definition at line 584 of file qquickitem.cpp.
References AfterItem, BeforeItem, and QQuickItemKeyFilter::m_processPost.
|
signal |
|
static |
Definition at line 434 of file qquickitem.cpp.
References QQuickKeyNavigationAttached().
Referenced by QQuickFileDialogImpl::componentComplete(), and QQuickFolderDialogImpl::componentComplete().
QQuickItem * QQuickKeyNavigationAttached::right | ( | ) | const |
Definition at line 461 of file qquickitem.cpp.
References d.
|
signal |
void QQuickKeyNavigationAttached::setBacktab | ( | QQuickItem * | i | ) |
Definition at line 555 of file qquickitem.cpp.
References backtabChanged(), d, emit, i, other(), QObject::parent(), and qobject_cast< QQuickItem * >().
void QQuickKeyNavigationAttached::setDown | ( | QQuickItem * | i | ) |
Definition at line 511 of file qquickitem.cpp.
References d, downChanged(), emit, i, other(), QObject::parent(), and qobject_cast< QQuickItem * >().
void QQuickKeyNavigationAttached::setLeft | ( | QQuickItem * | i | ) |
Definition at line 445 of file qquickitem.cpp.
References d, emit, i, leftChanged(), other(), QObject::parent(), and qobject_cast< QQuickItem * >().
Definition at line 589 of file qquickitem.cpp.
References AfterItem, emit, QQuickItemKeyFilter::m_processPost, and priorityChanged().
void QQuickKeyNavigationAttached::setRight | ( | QQuickItem * | i | ) |
Definition at line 467 of file qquickitem.cpp.
References d, emit, i, other(), QObject::parent(), qobject_cast< QQuickItem * >(), and rightChanged().
void QQuickKeyNavigationAttached::setTab | ( | QQuickItem * | i | ) |
Definition at line 533 of file qquickitem.cpp.
References d, emit, i, other(), QObject::parent(), qobject_cast< QQuickItem * >(), and tabChanged().
void QQuickKeyNavigationAttached::setUp | ( | QQuickItem * | i | ) |
Definition at line 489 of file qquickitem.cpp.
References d, emit, i, other(), QObject::parent(), qobject_cast< QQuickItem * >(), and upChanged().
QQuickItem * QQuickKeyNavigationAttached::tab | ( | ) | const |
Definition at line 527 of file qquickitem.cpp.
References d.
|
signal |
QQuickItem * QQuickKeyNavigationAttached::up | ( | ) | const |
Definition at line 483 of file qquickitem.cpp.
References d.
|
signal |
|
readwrite |
Definition at line 782 of file qquickitem_p.h.
|
readwrite |
Definition at line 780 of file qquickitem_p.h.
|
readwrite |
Definition at line 777 of file qquickitem_p.h.
|
readwrite |
Definition at line 783 of file qquickitem_p.h.
|
readwrite |
Definition at line 778 of file qquickitem_p.h.
|
readwrite |
Definition at line 781 of file qquickitem_p.h.
|
readwrite |
Definition at line 779 of file qquickitem_p.h.