2
* Copyright 2016 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include <QQmlListProperty>
22
#include <QLoggingCategory>
24
#include <ubuntutoolkitglobal.h>
26
#include "ucaction_p.h"
28
Q_DECLARE_LOGGING_CATEGORY(ucMenu);
31
class QPlatformMenuItem;
39
class UBUNTUTOOLKIT_EXPORT Menu : public UCAction
43
Q_PROPERTY(QQmlListProperty<QObject> data READ data FINAL)
44
Q_CLASSINFO("DefaultProperty", "data")
47
explicit Menu(QObject *parent = 0);
50
QQmlListProperty<QObject> data();
52
Q_INVOKABLE void appendObject(QObject* obj);
53
Q_INVOKABLE void insertObject(int index, QObject* obj);
54
Q_INVOKABLE void removeObject(QObject* obj);
56
QPlatformMenu *platformMenu() const;
59
void show(const QPoint& pt);
64
Q_DECLARE_PRIVATE(Menu)
65
QScopedPointer<MenuPrivate> d_ptr;
67
Q_PRIVATE_SLOT(d_func(), void _q_updateEnabled())
68
Q_PRIVATE_SLOT(d_func(), void _q_updateText())
69
Q_PRIVATE_SLOT(d_func(), void _q_updateIcon())
70
Q_PRIVATE_SLOT(d_func(), void _q_updateVisible())