Commit 07dbff0f authored by Volker Krause's avatar Volker Krause
Browse files

Don't use AppMenuModel in AppMenuApplet

That's in a plugin we don't link against here, we only see its header.
This happens to work with Qt5, but Qt6 wants fully defined types for
properties. Use a QAbstractItemModel pointer instead, we only access that
API anyway, and for QML the difference doesn't matter.
parent 14dac2a9
Pipeline #146413 passed with stage
in 11 minutes and 33 seconds
......@@ -67,12 +67,12 @@ void AppMenuApplet::init()
AppMenuModel *AppMenuApplet::model() const
QAbstractItemModel *AppMenuApplet::model() const
return m_model;
void AppMenuApplet::setModel(AppMenuModel *model)
void AppMenuApplet::setModel(QAbstractItemModel *model)
if (m_model != model) {
m_model = model;
......@@ -290,3 +290,4 @@ bool AppMenuApplet::eventFilter(QObject *watched, QEvent *event)
K_PLUGIN_CLASS_WITH_JSON(AppMenuApplet, "../package/metadata.json")
#include "appmenuapplet.moc"
#include "moc_appmenuapplet.cpp"
......@@ -7,17 +7,18 @@
#pragma once
#include <Plasma/Applet>
#include <QAbstractItemModel>
#include <QPointer>
class QQuickItem;
class QMenu;
class AppMenuModel;
class AppMenuApplet : public Plasma::Applet
Q_PROPERTY(AppMenuModel *model READ model WRITE setModel NOTIFY modelChanged)
Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelChanged)
Q_PROPERTY(int view READ view WRITE setView NOTIFY viewChanged)
......@@ -41,8 +42,8 @@ public:
QQuickItem *buttonGrid() const;
void setButtonGrid(QQuickItem *buttonGrid);
AppMenuModel *model() const;
void setModel(AppMenuModel *model);
QAbstractItemModel *model() const;
void setModel(QAbstractItemModel *model);
int view() const;
void setView(int type);
......@@ -69,6 +70,6 @@ private:
int m_viewType = FullView;
QPointer<QMenu> m_currentMenu;
QPointer<QQuickItem> m_buttonGrid;
QPointer<AppMenuModel> m_model;
QPointer<QAbstractItemModel> m_model;
static int s_refs;
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