[kwin] Register QAbstractItemModel as a qml type in TabBox

It's needed if we don't import any Plasma components.
master
Martin Gräßlin 11 years ago
parent 17d28f2639
commit 1d7ee61741

@ -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…
Cancel
Save