1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2014 Martin Graesslin <mgraesslin@kde.org>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#include "qplatformmenu.h"
6
7#include <qpa/qplatformtheme.h>
8#include <private/qguiapplication_p.h>
9
10QT_BEGIN_NAMESPACE
11
12QPlatformMenuItem::QPlatformMenuItem()
13{
14 m_tag = reinterpret_cast<quintptr>(this);
15}
16
17void QPlatformMenuItem::setTag(quintptr tag)
18{
19 m_tag = tag;
20}
21
22quintptr QPlatformMenuItem::tag() const
23{
24 return m_tag;
25}
26
27QPlatformMenu::QPlatformMenu()
28{
29 m_tag = reinterpret_cast<quintptr>(this);
30}
31
32void QPlatformMenu::setTag(quintptr tag)
33{
34 m_tag = tag;
35}
36
37quintptr QPlatformMenu::tag() const
38{
39 return m_tag;
40
41}
42
43QPlatformMenuItem *QPlatformMenu::createMenuItem() const
44{
45 return QGuiApplicationPrivate::platformTheme()->createPlatformMenuItem();
46}
47
48QPlatformMenu *QPlatformMenu::createSubMenu() const
49{
50 return QGuiApplicationPrivate::platformTheme()->createPlatformMenu();
51}
52
53QPlatformMenu *QPlatformMenuBar::createMenu() const
54{
55 return QGuiApplicationPrivate::platformTheme()->createPlatformMenu();
56}
57
58QT_END_NAMESPACE
59
60#include "moc_qplatformmenu.cpp"
61

source code of qtbase/src/gui/kernel/qplatformmenu.cpp