Commit 0b938e5f authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Global Menu] Respect toplevel menu action visibility

Kolourpaint has hidden "Tools" menu, which would show up in
global menu otherwise.

Moreover, don't `void*` cast so QML can access the `QAction`

BUG: 443505


(cherry picked from commit 2e056ed6)
parent 1f07c8c1
Pipeline #168950 passed with stage
in 10 minutes and 59 seconds
......@@ -114,7 +114,7 @@ Item {
down: pressed || plasmoid.nativeInterface.currentIndex === index
visible: text !== ""
visible: text !== "" && model.activeActions.visible
onClicked: {
plasmoid.nativeInterface.trigger(this, index)
......
......@@ -242,7 +242,7 @@ QVariant AppMenuModel::data(const QModelIndex &index, int role) const
if (role == MenuRole) {
return QString();
} else if (role == ActionRole) {
return QVariant::fromValue((void *)(m_menu->menuAction()));
return QVariant::fromValue(m_menu->menuAction());
}
}
......@@ -262,7 +262,7 @@ QVariant AppMenuModel::data(const QModelIndex &index, int role) const
if (role == MenuRole) { // TODO this should be Qt::DisplayRole
return actions.at(row)->text();
} else if (role == ActionRole) {
return QVariant::fromValue((void *)actions.at(row));
return QVariant::fromValue(actions.at(row));
}
return QVariant();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment