[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:
Martin Gräßlin 2013-12-16 11:48:41 +01:00
parent 17d28f2639
commit 1d7ee61741
2 changed files with 2 additions and 0 deletions

View file

@ -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* {

View file

@ -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()));