on par with desktop components
add item and clear menu
This commit is contained in:
parent
4df3869dc6
commit
bb0bb5bb4e
@ -73,6 +73,19 @@ void QMenuProxy::setVisualParent(QDeclarativeItem *parent)
|
|||||||
emit visualParentChanged();
|
emit visualParentChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QMenuProxy::clearMenuItems()
|
||||||
|
{
|
||||||
|
qDeleteAll(m_items);
|
||||||
|
m_items.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMenuProxy::addMenuItem(const QString &text)
|
||||||
|
{
|
||||||
|
QMenuItem *item = new QMenuItem(this);
|
||||||
|
item->setText(text);
|
||||||
|
m_items << item;
|
||||||
|
}
|
||||||
|
|
||||||
void QMenuProxy::showMenu(int x, int y)
|
void QMenuProxy::showMenu(int x, int y)
|
||||||
{
|
{
|
||||||
m_menu->clear();
|
m_menu->clear();
|
||||||
|
@ -52,6 +52,8 @@ public:
|
|||||||
void showMenu(int x, int y);
|
void showMenu(int x, int y);
|
||||||
Q_INVOKABLE void open();
|
Q_INVOKABLE void open();
|
||||||
Q_INVOKABLE void close();
|
Q_INVOKABLE void close();
|
||||||
|
Q_INVOKABLE void clearMenuItems();
|
||||||
|
Q_INVOKABLE void addMenuItem(const QString &text);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void statusChanged();
|
void statusChanged();
|
||||||
|
Loading…
Reference in New Issue
Block a user