From 0bb2cbe28fd39fdb8470ac96febae2dd688cc5b8 Mon Sep 17 00:00:00 2001 From: Fushan Wen Date: Sat, 15 Jan 2022 21:27:10 +0800 Subject: [PATCH] shell/panelview: Register enums for QML So MoreSettingsMenu.qml does not have to use numbers to represent VisibilityMode and OpacityMode anymore. --- shell/panelview.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/panelview.cpp b/shell/panelview.cpp index 0662f3948..fbb0f25c2 100644 --- a/shell/panelview.cpp +++ b/shell/panelview.cpp @@ -94,6 +94,9 @@ PanelView::PanelView(ShellCorona *corona, QScreen *targetScreen, QWindow *parent m_strutsTimer.setSingleShot(true); connect(&m_strutsTimer, &QTimer::timeout, this, &PanelView::updateStruts); + // Register enums + qmlRegisterUncreatableMetaObject(PanelView::staticMetaObject, "org.kde.plasma.shell.panel", 0, 1, "Global", QStringLiteral("Error: only enums")); + qmlRegisterAnonymousType("", 1); rootContext()->setContextProperty(QStringLiteral("panel"), this); setSource(m_corona->kPackage().fileUrl("views", QStringLiteral("Panel.qml")));