diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-10-17 11:04:01 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-10-18 08:58:42 +0000 |
commit | 510029c1d1974d3e0d417e87da30261357fec510 (patch) | |
tree | 9c89094f221c33d46a9a3ff13242a3995459bbed /src/Authoring/Studio/Palettes/Action | |
parent | 4430b2eb13f2b37068b4af65d0ec038d30ff0233 (diff) |
Clean up StudioUtils
Made StudioUtils a class of static functions instead of global
functions. Also cleaned up the code a bit where changes happened
because of this change.
Change-Id: Ic583dd25bf228c7e344be6664b6651958d84906e
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Janne Kangas <janne.kangas@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes/Action')
-rw-r--r-- | src/Authoring/Studio/Palettes/Action/ActionView.cpp | 24 | ||||
-rw-r--r-- | src/Authoring/Studio/Palettes/Action/EventsBrowserView.cpp | 10 | ||||
-rw-r--r-- | src/Authoring/Studio/Palettes/Action/EventsModel.cpp | 4 |
3 files changed, 19 insertions, 19 deletions
diff --git a/src/Authoring/Studio/Palettes/Action/ActionView.cpp b/src/Authoring/Studio/Palettes/Action/ActionView.cpp index 58cb7b75..d7197285 100644 --- a/src/Authoring/Studio/Palettes/Action/ActionView.cpp +++ b/src/Authoring/Studio/Palettes/Action/ActionView.cpp @@ -1015,32 +1015,32 @@ CClientDataModelBridge *ActionView::GetBridge() void ActionView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_parentView"_L1, this); - rootContext()->setContextProperty("_resDir"_L1, resourceImageUrl()); - rootContext()->setContextProperty("_tabOrderHandler"_L1, tabOrderHandler()); - rootContext()->setContextProperty("_mouseHelper"_L1, &m_mouseHelper); + rootContext()->setContextProperty(QStringLiteral("_parentView"), this); + rootContext()->setContextProperty(QStringLiteral("_resDir"), StudioUtils::resourceImageUrl()); + rootContext()->setContextProperty(QStringLiteral("_tabOrderHandler"), tabOrderHandler()); + rootContext()->setContextProperty(QStringLiteral("_mouseHelper"), &m_mouseHelper); QString shiftKey(QStringLiteral("Shift+")); #ifdef Q_OS_MACOS shiftKey = "⇧"; #endif - rootContext()->setContextProperty("_shiftKey"_L1, shiftKey); + rootContext()->setContextProperty(QStringLiteral("_shiftKey"), shiftKey); qmlRegisterUncreatableType<qt3dsdm::HandlerArgumentType>( "Qt3DStudio", 1, 0, "HandlerArgumentType", - "HandlerArgumentType is an enum container"_L1); + QStringLiteral("HandlerArgumentType is an enum container")); qmlRegisterUncreatableType<qt3dsdm::DataModelDataType>( "Qt3DStudio", 1, 0, "DataModelDataType", - "DataModelDataType is an enum container"_L1); + QStringLiteral("DataModelDataType is an enum container")); qmlRegisterUncreatableType<qt3dsdm::AdditionalMetaDataType>( "Qt3DStudio", 1, 0, "AdditionalMetaDataType", - "AdditionalMetaDataType is an enum container"_L1); + QStringLiteral("AdditionalMetaDataType is an enum container")); qmlRegisterUncreatableType<PropertyInfo>( "Qt3DStudio", 1, 0, "PropertyInfo", - "PropertyInfo is anot creatable in QML"_L1); + QStringLiteral("PropertyInfo is not creatable in QML")); qmlRegisterUncreatableType<qt3dsdm::CompleteMetaDataType>( "Qt3DStudio", 1, 0, "CompleteMetaDataType", - "CompleteMetaDataType is an enum container"_L1); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/Action/ActionView.qml"_L1)); + QStringLiteral("CompleteMetaDataType is an enum container")); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/Action/ActionView.qml"))); } QStringList ActionView::slideNames() diff --git a/src/Authoring/Studio/Palettes/Action/EventsBrowserView.cpp b/src/Authoring/Studio/Palettes/Action/EventsBrowserView.cpp index 7dcb682d..891498cc 100644 --- a/src/Authoring/Studio/Palettes/Action/EventsBrowserView.cpp +++ b/src/Authoring/Studio/Palettes/Action/EventsBrowserView.cpp @@ -96,10 +96,10 @@ void EventsBrowserView::focusOutEvent(QFocusEvent *event) void EventsBrowserView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_eventsBrowserView"_L1, this); - rootContext()->setContextProperty("_resDir"_L1, - resourceImageUrl()); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/Action/EventsBrowser.qml"_L1)); + rootContext()->setContextProperty(QStringLiteral("_eventsBrowserView"), this); + rootContext()->setContextProperty(QStringLiteral("_resDir"), + StudioUtils::resourceImageUrl()); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/Action/EventsBrowser.qml"))); } diff --git a/src/Authoring/Studio/Palettes/Action/EventsModel.cpp b/src/Authoring/Studio/Palettes/Action/EventsModel.cpp index 6d8e4b19..981ab95a 100644 --- a/src/Authoring/Studio/Palettes/Action/EventsModel.cpp +++ b/src/Authoring/Studio/Palettes/Action/EventsModel.cpp @@ -152,9 +152,9 @@ QVariant EventsModel::data(const QModelIndex &index, int role) const case DescriptionRole: return isCategory ? category.description: event.description; case IconRole: - return isCategory ? resourceImageUrl() + category.icon : ""; + return isCategory ? StudioUtils::resourceImageUrl() + category.icon : QString(); case HighlightedIconRole: - return isCategory ? resourceImageUrl() + category.highlightIcon : ""; + return isCategory ? StudioUtils::resourceImageUrl() + category.highlightIcon : QString(); case ExpandedRole: return isCategory ? category.expanded : false; case ParentExpandedRole: { |