Changeset View
Changeset View
Standalone View
Standalone View
src/kirigamiplugin.cpp
Show All 17 Lines | |||||
18 | * Free Software Foundation, Inc., | 18 | * Free Software Foundation, Inc., | ||
19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #include "kirigamiplugin.h" | 22 | #include "kirigamiplugin.h" | ||
23 | #include "enums.h" | 23 | #include "enums.h" | ||
24 | #include "desktopicon.h" | 24 | #include "desktopicon.h" | ||
25 | #include "settings.h" | 25 | #include "settings.h" | ||
26 | #include "formlayoutattached.h" | ||||
26 | 27 | | |||
27 | #include <QQmlEngine> | 28 | #include <QQmlEngine> | ||
28 | #include <QQmlContext> | 29 | #include <QQmlContext> | ||
29 | #include <QQuickItem> | 30 | #include <QQuickItem> | ||
30 | #include <QQuickStyle> | 31 | #include <QQuickStyle> | ||
31 | 32 | | |||
32 | #ifdef KIRIGAMI_BUILD_TYPE_STATIC | 33 | #ifdef KIRIGAMI_BUILD_TYPE_STATIC | ||
33 | #include "libkirigami/platformtheme.h" | 34 | #include "libkirigami/platformtheme.h" | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 83 | [](QQmlEngine*, QJSEngine*) -> QObject* { | |||
83 | Settings *settings = new Settings; | 84 | Settings *settings = new Settings; | ||
84 | settings->setStyle(s_selectedStyle); | 85 | settings->setStyle(s_selectedStyle); | ||
85 | return settings; | 86 | return settings; | ||
86 | } | 87 | } | ||
87 | ); | 88 | ); | ||
88 | 89 | | |||
89 | qmlRegisterUncreatableType<ApplicationHeaderStyle>(uri, 2, 0, "ApplicationHeaderStyle", "Cannot create objects of type ApplicationHeaderStyle"); | 90 | qmlRegisterUncreatableType<ApplicationHeaderStyle>(uri, 2, 0, "ApplicationHeaderStyle", "Cannot create objects of type ApplicationHeaderStyle"); | ||
90 | 91 | | |||
92 | //old legacy retrocompatible Theme | ||||
91 | qmlRegisterSingletonType(componentUrl(QStringLiteral("Theme.qml")), uri, 2, 0, "Theme"); | 93 | qmlRegisterSingletonType(componentUrl(QStringLiteral("Theme.qml")), uri, 2, 0, "Theme"); | ||
92 | //Theme changed from a singleton to an attached property | 94 | | ||
93 | qmlRegisterUncreatableType<Kirigami::PlatformTheme>(uri, 2, 2, "Theme", "Cannot create objects of type Theme, use it as an attached poperty"); | | |||
94 | qmlRegisterSingletonType(componentUrl(QStringLiteral("Units.qml")), uri, 2, 0, "Units"); | 95 | qmlRegisterSingletonType(componentUrl(QStringLiteral("Units.qml")), uri, 2, 0, "Units"); | ||
95 | 96 | | |||
96 | qmlRegisterType(componentUrl(QStringLiteral("Action.qml")), uri, 2, 0, "Action"); | 97 | qmlRegisterType(componentUrl(QStringLiteral("Action.qml")), uri, 2, 0, "Action"); | ||
97 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationHeader.qml")), uri, 2, 0, "AbstractApplicationHeader"); | 98 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationHeader.qml")), uri, 2, 0, "AbstractApplicationHeader"); | ||
98 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationWindow.qml")), uri, 2, 0, "AbstractApplicationWindow"); | 99 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationWindow.qml")), uri, 2, 0, "AbstractApplicationWindow"); | ||
99 | qmlRegisterType(componentUrl(QStringLiteral("AbstractListItem.qml")), uri, 2, 0, "AbstractListItem"); | 100 | qmlRegisterType(componentUrl(QStringLiteral("AbstractListItem.qml")), uri, 2, 0, "AbstractListItem"); | ||
100 | qmlRegisterType(componentUrl(QStringLiteral("ApplicationHeader.qml")), uri, 2, 0, "ApplicationHeader"); | 101 | qmlRegisterType(componentUrl(QStringLiteral("ApplicationHeader.qml")), uri, 2, 0, "ApplicationHeader"); | ||
101 | qmlRegisterType(componentUrl(QStringLiteral("ToolBarApplicationHeader.qml")), uri, 2, 0, "ToolBarApplicationHeader"); | 102 | qmlRegisterType(componentUrl(QStringLiteral("ToolBarApplicationHeader.qml")), uri, 2, 0, "ToolBarApplicationHeader"); | ||
Show All 28 Lines | 122 | #endif | |||
130 | qmlRegisterType(componentUrl(QStringLiteral("SwipeListItem.qml")), uri, 2, 0, "SwipeListItem"); | 131 | qmlRegisterType(componentUrl(QStringLiteral("SwipeListItem.qml")), uri, 2, 0, "SwipeListItem"); | ||
131 | 132 | | |||
132 | //2.1 | 133 | //2.1 | ||
133 | qmlRegisterType(componentUrl(QStringLiteral("AbstractItemViewHeader.qml")), uri, 2, 1, "AbstractItemViewHeader"); | 134 | qmlRegisterType(componentUrl(QStringLiteral("AbstractItemViewHeader.qml")), uri, 2, 1, "AbstractItemViewHeader"); | ||
134 | qmlRegisterType(componentUrl(QStringLiteral("ItemViewHeader.qml")), uri, 2, 1, "ItemViewHeader"); | 135 | qmlRegisterType(componentUrl(QStringLiteral("ItemViewHeader.qml")), uri, 2, 1, "ItemViewHeader"); | ||
135 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationItem.qml")), uri, 2, 1, "AbstractApplicationItem"); | 136 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationItem.qml")), uri, 2, 1, "AbstractApplicationItem"); | ||
136 | qmlRegisterType(componentUrl(QStringLiteral("ApplicationItem.qml")), uri, 2, 1, "ApplicationItem"); | 137 | qmlRegisterType(componentUrl(QStringLiteral("ApplicationItem.qml")), uri, 2, 1, "ApplicationItem"); | ||
137 | 138 | | |||
139 | //2.2 | ||||
140 | //Theme changed from a singleton to an attached property | ||||
141 | qmlRegisterUncreatableType<Kirigami::PlatformTheme>(uri, 2, 2, "Theme", "Cannot create objects of type Theme, use it as an attached poperty"); | ||||
142 | | ||||
143 | //2.3 | ||||
144 | qmlRegisterType(componentUrl(QStringLiteral("FormLayout.qml")), uri, 2, 3, "FormLayout"); | ||||
145 | qmlRegisterUncreatableType<FormLayoutAttached>(uri, 2, 3, "FormData", "Cannot create objects of type FormData, use it as an attached poperty"); | ||||
146 | | ||||
138 | qmlProtectModule(uri, 2); | 147 | qmlProtectModule(uri, 2); | ||
139 | } | 148 | } | ||
140 | 149 | | |||
141 | #include "moc_kirigamiplugin.cpp" | 150 | #include "moc_kirigamiplugin.cpp" | ||
142 | 151 | |