10#include <QtGui/private/qguiapplication_p.h>
11#include <QtGui/qpa/qplatformtheme.h>
13#include <QtQml/qqmlcontext.h>
14#include <QtQml/qqmlcomponent.h>
15#include <QtQml/qqmlengine.h>
67 menuBarItem->setMenu(
menu);
102 else if (
menu && activate)
103 menu->setCurrentIndex(0);
121 item->setHighlighted(
true);
189 totalWidth +=
item->implicitWidth();
202 maxHeight =
qMax(maxHeight,
item->implicitHeight());
338 const int count =
d->contentModel->count();
434 switch (
event->type()) {
440 if (
auto *
item = qobject_cast<QQuickMenuBarItem *>(
d->itemAt(
i))) {
441 d->activateItem(
item);
463 d->altPressed =
false;
464 qApp->removeEventFilter(
this);
472 if (altKeyNavigation) {
476 d->altPressed =
true;
477 qApp->installEventFilter(
this);
489 switch (
event->key()) {
491 d->toggleCurrentMenu(
false,
false);
495 d->toggleCurrentMenu(
true,
true);
501 d->activateNextItem();
503 d->activatePreviousItem();
506 if (
d->currentItem) {
507 d->activateItem(
nullptr);
512#if QT_CONFIG(shortcut)
516 if (
auto *
item = qobject_cast<QQuickMenuBarItem *>(
d->itemAt(
i))) {
517 if (
item->shortcut() == mnemonic) {
518 d->activateItem(
item);
519 d->toggleCurrentMenu(
true,
true);
533 switch (
event->key()) {
552 if (!
d->popupMode &&
d->currentItem)
553 d->activateItem(
nullptr);
558 return qobject_cast<QQuickMenuBarItem *>(
item);
567 if (
d->windowContentItem)
568 d->windowContentItem->removeEventFilter(
this);
570 d->windowContentItem =
value.window->contentItem();
571 if (
d->windowContentItem)
572 d->windowContentItem->installEventFilter(
this);
591 d->updateImplicitContentSize();
612 d->updateImplicitContentSize();
621#if QT_CONFIG(accessibility)
622QAccessible::Role QQuickMenuBar::accessibleRole()
const
624 return QAccessible::MenuBar;
630#include "moc_qquickmenubar_p.cpp"
bool isEnabled() const
Returns true if the item is enabled; otherwise, false is returned.
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
static QPlatformTheme * platformTheme()
The QKeyEvent class describes a key event.
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
int key() const
Returns the code of the key that was pressed or released.
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)
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events if this object has been installed as an event filter for the watched object.
void deleteLater()
\threadsafe
The QPalette class contains color groups for each widget state.
The QQmlComponent class encapsulates a QML component definition.
virtual QObject * beginCreate(QQmlContext *)
Create an object instance from this component, within the specified context.
virtual void completeCreate()
This method provides advanced control over component instance creation.
QQmlContext * creationContext() const
Returns the QQmlContext the component was created in.
The QQmlContext class defines a context within a QML engine.
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
int count() const override
\qmlproperty int QtQml.Models::ObjectModel::count
int indexOf(QObject *object, QObject *objectContext) const override
static void contentData_append(QQmlListProperty< QObject > *prop, QObject *obj)
static QObject * contentData_at(QQmlListProperty< QObject > *prop, qsizetype index)
static qsizetype contentData_count(QQmlListProperty< QObject > *prop)
QQuickItem * itemAt(int index) const
static void contentData_clear(QQmlListProperty< QObject > *prop)
QQmlObjectModel * contentModel
virtual void itemMoved(int index, QQuickItem *item)
Q_INVOKABLE void addItem(QQuickItem *item)
\qmlmethod void QtQuick.Controls::Container::addItem(Item item)
virtual void itemAdded(int index, QQuickItem *item)
Q_INVOKABLE void removeItem(QQuickItem *item)
virtual void itemRemoved(int index, QQuickItem *item)
Q_INVOKABLE QQuickItem * itemAt(int index) const
\qmlmethod Item QtQuick.Controls::Container::itemAt(int index)
void itemChange(ItemChange change, const ItemChangeData &data) override
Called when change occurs for this item.
Q_INVOKABLE void insertItem(int index, QQuickItem *item)
\qmlmethod void QtQuick.Controls::Container::insertItem(int index, Item item)
QQuickDeferredPointer< QQuickItem > contentItem
void updateImplicitContentWidth()
void updateImplicitContentHeight()
void setFocusReason(Qt::FocusReason reason)
void setFocusPolicy(Qt::FocusPolicy policy)
bool isHovered() const
\qmlproperty bool QtQuick.Controls::Control::hovered \readonly
bool isMirrored() const
\qmlproperty bool QtQuick.Controls::Control::mirrored \readonly
virtual void itemImplicitWidthChanged(QQuickItem *)
virtual void itemImplicitHeightChanged(QQuickItem *)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
Q_INVOKABLE void forceActiveFocus()
\qmlmethod point QtQuick::Item::mapToItem(Item item, real x, real y) \qmlmethod point QtQuick::Item::...
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.
virtual void hoverLeaveEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
static QPalette palette(Scope scope)
static QFont font(Scope scope)
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qMax(const T &a, const T &b)
GLenum GLenum GLsizei count
GLdouble GLdouble GLdouble GLdouble q
QQmlContext * qmlContext(const QObject *obj)
void QQml_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent