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
qwidgetplatformmenu_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QWIDGETPLATFORMMENU_P_H
5#define QWIDGETPLATFORMMENU_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/qpa/qplatformmenu.h>
19#include <QtCore/private/qglobal_p.h>
20
22
23class QMenu;
25
27{
29
30public:
31 explicit QWidgetPlatformMenu(QObject *parent = nullptr);
33
34 QMenu *menu() const;
35
38 void syncMenuItem(QPlatformMenuItem *item) override;
39 void syncSeparatorsCollapsible(bool enable) override;
40
41 void setText(const QString &text) override;
42 void setIcon(const QIcon &icon) override;
43 void setEnabled(bool enabled) override;
44 bool isEnabled() const override;
45 void setVisible(bool visible) override;
46 void setMinimumWidth(int width) override;
47 void setFont(const QFont &font) override;
48 void setMenuType(MenuType type) override;
49
50 void showPopup(const QWindow *window, const QRect &targetRect, const QPlatformMenuItem *item) override;
51 void dismiss() override;
52
53 QPlatformMenuItem *menuItemAt(int position) const override;
55
56 QPlatformMenuItem *createMenuItem() const override;
57 QPlatformMenu *createSubMenu() const override;
58
59private:
60 QScopedPointer<QMenu> m_menu;
61 QList<QWidgetPlatformMenuItem *> m_items;
62};
63
65
67
68#endif // QWIDGETPLATFORMMENU_P_H
\reentrant
Definition qfont.h:22
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
Definition qmenu.h:26
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
virtual quintptr tag() const
\inmodule QtCore\reentrant
Definition qrect.h:30
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void showPopup(const QWindow *window, const QRect &targetRect, const QPlatformMenuItem *item) override
QPlatformMenuItem * menuItemAt(int position) const override
QPlatformMenu * createSubMenu() const override
QPlatformMenuItem * menuItemForTag(quintptr tag) const override
void setEnabled(bool enabled) override
void setText(const QString &text) override
void setVisible(bool visible) override
bool isEnabled() const override
void insertMenuItem(QPlatformMenuItem *item, QPlatformMenuItem *before) override
void syncSeparatorsCollapsible(bool enable) override
QPlatformMenuItem * createMenuItem() const override
void syncMenuItem(QPlatformMenuItem *item) override
void setFont(const QFont &font) override
void setMenuType(MenuType type) override
void setMinimumWidth(int width) override
void setIcon(const QIcon &icon) override
void removeMenuItem(QPlatformMenuItem *item) override
\inmodule QtGui
Definition qwindow.h:63
QString text
Combined button and popup list for selecting options.
#define Q_DECLARE_METATYPE(TYPE)
Definition qmetatype.h:1525
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei width
GLenum type
GLboolean enable
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_OBJECT
size_t quintptr
Definition qtypes.h:167
QT_BEGIN_NAMESPACE typedef QPlatformMenu QWidgetPlatformMenu
QGraphicsItem * item
aWidget window() -> setWindowTitle("New Window Title")
[2]