[kwin] Register QAbstractItemModel as a qml type in TabBox
It's needed if we don't import any Plasma components.
This commit is contained in:
parent
17d28f2639
commit
1d7ee61741
2 changed files with 2 additions and 0 deletions
|
@ -43,6 +43,7 @@ LayoutPreview::LayoutPreview(const QString &path, QObject *parent)
|
|||
QQmlComponent *component = new QQmlComponent(engine, this);
|
||||
qmlRegisterType<WindowThumbnailItem>("org.kde.kwin", 2, 0, "ThumbnailItem");
|
||||
qmlRegisterType<SwitcherItem>("org.kde.kwin", 2, 0, "Switcher");
|
||||
qmlRegisterType<QAbstractItemModel>();
|
||||
component->loadUrl(QUrl::fromLocalFile(path));
|
||||
QObject *item = component->create();
|
||||
auto findSwitcher = [item]() -> SwitcherItem* {
|
||||
|
|
|
@ -293,6 +293,7 @@ void TabBoxHandlerPrivate::show()
|
|||
qmlRegisterType<SwitcherItem>("org.kde.kwin", 2, 0, "Switcher");
|
||||
qmlRegisterType<DesktopThumbnailItem>("org.kde.kwin", 2, 0, "DesktopThumbnailItem");
|
||||
qmlRegisterType<WindowThumbnailItem>("org.kde.kwin", 2, 0, "ThumbnailItem");
|
||||
qmlRegisterType<QAbstractItemModel>();
|
||||
}
|
||||
if (m_qmlComponent.isNull()) {
|
||||
m_qmlComponent.reset(new QQmlComponent(m_qmlEngine.data()));
|
||||
|
|
Loading…
Reference in a new issue