diff options
Diffstat (limited to 'src/Authoring/Studio/Palettes')
16 files changed, 84 insertions, 80 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: { diff --git a/src/Authoring/Studio/Palettes/BasicObjects/BasicObjectsModel.cpp b/src/Authoring/Studio/Palettes/BasicObjects/BasicObjectsModel.cpp index 867a441b..8694fda7 100644 --- a/src/Authoring/Studio/Palettes/BasicObjects/BasicObjectsModel.cpp +++ b/src/Authoring/Studio/Palettes/BasicObjects/BasicObjectsModel.cpp @@ -78,7 +78,7 @@ QVariant BasicObjectsModel::data(const QModelIndex &index, int role) const switch (role) { case NameRole: return m_ObjectItems.at(row).name(); - case IconRole: return resourceImageUrl() + + case IconRole: return StudioUtils::resourceImageUrl() + m_ObjectItems.at(row).icon(); case ObjectTypeRole: return m_ObjectItems.at(row).objectType(); case PrimitiveTypeRole: return m_ObjectItems.at(row).primitiveType(); diff --git a/src/Authoring/Studio/Palettes/BasicObjects/BasicObjectsView.cpp b/src/Authoring/Studio/Palettes/BasicObjects/BasicObjectsView.cpp index e3b35963..e23423fe 100644 --- a/src/Authoring/Studio/Palettes/BasicObjects/BasicObjectsView.cpp +++ b/src/Authoring/Studio/Palettes/BasicObjects/BasicObjectsView.cpp @@ -77,10 +77,10 @@ void BasicObjectsView::mousePressEvent(QMouseEvent *event) void BasicObjectsView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_basicObjectsModel"_L1, m_ObjectsModel); - rootContext()->setContextProperty("_basicObjectsView"_L1, this); - rootContext()->setContextProperty("_resDir"_L1, resourceImageUrl()); + rootContext()->setContextProperty(QStringLiteral("_basicObjectsModel"), m_ObjectsModel); + rootContext()->setContextProperty(QStringLiteral("_basicObjectsView"), this); + rootContext()->setContextProperty(QStringLiteral("_resDir"), StudioUtils::resourceImageUrl()); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/BasicObjects/BasicObjectsView.qml"_L1)); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/BasicObjects/BasicObjectsView.qml"))); } diff --git a/src/Authoring/Studio/Palettes/Inspector/ChooserModelBase.cpp b/src/Authoring/Studio/Palettes/Inspector/ChooserModelBase.cpp index 1457a3c1..3f5583ea 100644 --- a/src/Authoring/Studio/Palettes/Inspector/ChooserModelBase.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/ChooserModelBase.cpp @@ -83,10 +83,12 @@ QVariant ChooserModelBase::data(const QModelIndex &index, int role) const switch (role) { case Qt::DecorationRole: - if (!item.iconSource.isEmpty()) - return resourceImageUrl() + item.iconSource; - else - return resourceImageUrl() + CStudioObjectTypes::GetNormalIconName(item.iconType); + if (!item.iconSource.isEmpty()) { + return StudioUtils::resourceImageUrl() + item.iconSource; + } else { + return StudioUtils::resourceImageUrl() + + CStudioObjectTypes::GetNormalIconName(item.iconType); + } case IsExpandableRole: return false; @@ -112,7 +114,7 @@ QVariant ChooserModelBase::data(const QModelIndex &index, int role) const switch (role) { case Qt::DecorationRole: { QString path = item.index.data(QFileSystemModel::FilePathRole).toString(); - return resourceImageUrl() + getIconName(path); + return StudioUtils::resourceImageUrl() + getIconName(path); } case IsExpandableRole: { diff --git a/src/Authoring/Studio/Palettes/Inspector/FileChooserView.cpp b/src/Authoring/Studio/Palettes/Inspector/FileChooserView.cpp index a2d285bf..ab211068 100644 --- a/src/Authoring/Studio/Palettes/Inspector/FileChooserView.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/FileChooserView.cpp @@ -55,12 +55,12 @@ FileChooserView::FileChooserView(QWidget *parent) void FileChooserView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_resDir"_L1, - resourceImageUrl()); - rootContext()->setContextProperty("_fileChooserView"_L1, this); - rootContext()->setContextProperty("_fileChooserModel"_L1, m_model); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/Inspector/FileChooser.qml"_L1)); + rootContext()->setContextProperty(QStringLiteral("_resDir"), + StudioUtils::resourceImageUrl()); + rootContext()->setContextProperty(QStringLiteral("_fileChooserView"), this); + rootContext()->setContextProperty(QStringLiteral("_fileChooserModel"), m_model); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/Inspector/FileChooser.qml"))); } QSize FileChooserView::sizeHint() const diff --git a/src/Authoring/Studio/Palettes/Inspector/ImageChooserView.cpp b/src/Authoring/Studio/Palettes/Inspector/ImageChooserView.cpp index 2863ae5f..b05a77ba 100644 --- a/src/Authoring/Studio/Palettes/Inspector/ImageChooserView.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/ImageChooserView.cpp @@ -56,12 +56,12 @@ ImageChooserView::ImageChooserView(QWidget *parent) void ImageChooserView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_resDir"_L1, - resourceImageUrl()); - rootContext()->setContextProperty("_imageChooserView"_L1, this); - rootContext()->setContextProperty("_imageChooserModel"_L1, m_model); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/Inspector/ImageChooser.qml"_L1)); + rootContext()->setContextProperty(QStringLiteral("_resDir"), + StudioUtils::resourceImageUrl()); + rootContext()->setContextProperty(QStringLiteral("_imageChooserView"), this); + rootContext()->setContextProperty(QStringLiteral("_imageChooserModel"), m_model); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/Inspector/ImageChooser.qml"))); } QSize ImageChooserView::sizeHint() const diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp index bf077a4e..abde42ea 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp @@ -217,19 +217,20 @@ void InspectorControlView::mousePressEvent(QMouseEvent *event) void InspectorControlView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_parentView"_L1, this); - rootContext()->setContextProperty("_inspectorModel"_L1, m_inspectorControlModel); - rootContext()->setContextProperty("_resDir"_L1, resourceImageUrl()); - rootContext()->setContextProperty("_tabOrderHandler"_L1, tabOrderHandler()); - rootContext()->setContextProperty("_mouseHelper"_L1, &m_mouseHelper); - - qmlRegisterUncreatableType<qt3dsdm::DataModelDataType>("Qt3DStudio", 1, 0, "DataModelDataType", - "DataModelDataType is an enum container"); + rootContext()->setContextProperty(QStringLiteral("_parentView"), this); + rootContext()->setContextProperty(QStringLiteral("_inspectorModel"), m_inspectorControlModel); + rootContext()->setContextProperty(QStringLiteral("_resDir"), StudioUtils::resourceImageUrl()); + rootContext()->setContextProperty(QStringLiteral("_tabOrderHandler"), tabOrderHandler()); + rootContext()->setContextProperty(QStringLiteral("_mouseHelper"), &m_mouseHelper); + + qmlRegisterUncreatableType<qt3dsdm::DataModelDataType>( + "Qt3DStudio", 1, 0, "DataModelDataType", + QStringLiteral("DataModelDataType is an enum container")); qmlRegisterUncreatableType<qt3dsdm::AdditionalMetaDataType>( "Qt3DStudio", 1, 0, "AdditionalMetaDataType", - "AdditionalMetaDataType is an enum container"); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/Inspector/InspectorControlView.qml"_L1)); + QStringLiteral("AdditionalMetaDataType is an enum container")); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/Inspector/InspectorControlView.qml"))); } QAbstractItemModel *InspectorControlView::inspectorControlModel() const diff --git a/src/Authoring/Studio/Palettes/Inspector/MeshChooserView.cpp b/src/Authoring/Studio/Palettes/Inspector/MeshChooserView.cpp index 28613eeb..b32cd3fa 100644 --- a/src/Authoring/Studio/Palettes/Inspector/MeshChooserView.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/MeshChooserView.cpp @@ -55,13 +55,13 @@ MeshChooserView::MeshChooserView(QWidget *parent) void MeshChooserView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_resDir"_L1, - resourceImageUrl()); - rootContext()->setContextProperty("_meshChooserView"_L1, this); - rootContext()->setContextProperty("_meshChooserModel"_L1, m_model); + rootContext()->setContextProperty(QStringLiteral("_resDir"), + StudioUtils::resourceImageUrl()); + rootContext()->setContextProperty(QStringLiteral("_meshChooserView"), this); + rootContext()->setContextProperty(QStringLiteral("_meshChooserModel"), m_model); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/Inspector/MeshChooser.qml"_L1)); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/Inspector/MeshChooser.qml"))); } QSize MeshChooserView::sizeHint() const diff --git a/src/Authoring/Studio/Palettes/Inspector/ObjectBrowserView.cpp b/src/Authoring/Studio/Palettes/Inspector/ObjectBrowserView.cpp index e6faa1db..18273ff4 100644 --- a/src/Authoring/Studio/Palettes/Inspector/ObjectBrowserView.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/ObjectBrowserView.cpp @@ -143,10 +143,11 @@ void ObjectBrowserView::focusOutEvent(QFocusEvent *event) void ObjectBrowserView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_objectBrowserView"_L1, this); - rootContext()->setContextProperty("_resDir"_L1, resourceImageUrl()); - qmlRegisterUncreatableType<ObjectBrowserView>("Qt3DStudio", 1, 0, "ObjectBrowserView" - , tr("Creation of ObjectBrowserView not allowed from QML")); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/Inspector/ObjectBrowser.qml"_L1)); + rootContext()->setContextProperty(QStringLiteral("_objectBrowserView"), this); + rootContext()->setContextProperty(QStringLiteral("_resDir"), StudioUtils::resourceImageUrl()); + qmlRegisterUncreatableType<ObjectBrowserView>( + "Qt3DStudio", 1, 0, "ObjectBrowserView", + QStringLiteral("Creation of ObjectBrowserView not allowed from QML")); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/Inspector/ObjectBrowser.qml"))); } diff --git a/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp b/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp index 51e65e56..46cc501a 100644 --- a/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp @@ -141,7 +141,7 @@ QVariant ObjectListModel::data(const QModelIndex &index, } case IconRole: { auto info = m_objRefHelper->GetInfo(handle); - return resourceImageUrl() + CStudioObjectTypes::GetNormalIconName(info.m_Type); + return StudioUtils::resourceImageUrl() + CStudioObjectTypes::GetNormalIconName(info.m_Type); } case TextColorRole: { auto bridge = m_core->GetDoc()->GetStudioSystem()->GetClientDataModelBridge(); diff --git a/src/Authoring/Studio/Palettes/Inspector/TextureChooserView.cpp b/src/Authoring/Studio/Palettes/Inspector/TextureChooserView.cpp index dda078f2..4ef7242c 100644 --- a/src/Authoring/Studio/Palettes/Inspector/TextureChooserView.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/TextureChooserView.cpp @@ -56,11 +56,11 @@ TextureChooserView::TextureChooserView(QWidget *parent) void TextureChooserView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_resDir"_L1, resourceImageUrl()); - rootContext()->setContextProperty("_textureChooserView"_L1, this); - rootContext()->setContextProperty("_textureChooserModel"_L1, m_model); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/Inspector/TextureChooser.qml"_L1)); + rootContext()->setContextProperty(QStringLiteral("_resDir"), StudioUtils::resourceImageUrl()); + rootContext()->setContextProperty(QStringLiteral("_textureChooserView"), this); + rootContext()->setContextProperty(QStringLiteral("_textureChooserModel"), m_model); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/Inspector/TextureChooser.qml"))); } QSize TextureChooserView::sizeHint() const diff --git a/src/Authoring/Studio/Palettes/Project/ProjectFileSystemModel.cpp b/src/Authoring/Studio/Palettes/Project/ProjectFileSystemModel.cpp index a27f3af9..cb7a7a42 100644 --- a/src/Authoring/Studio/Palettes/Project/ProjectFileSystemModel.cpp +++ b/src/Authoring/Studio/Palettes/Project/ProjectFileSystemModel.cpp @@ -85,7 +85,7 @@ QVariant ProjectFileSystemModel::data(const QModelIndex &index, int role) const switch (role) { case Qt::DecorationRole: { QString path = item.index.data(QFileSystemModel::FilePathRole).toString(); - return resourceImageUrl() + getIconName(path); + return StudioUtils::resourceImageUrl() + getIconName(path); } case IsExpandableRole: { diff --git a/src/Authoring/Studio/Palettes/Project/ProjectView.cpp b/src/Authoring/Studio/Palettes/Project/ProjectView.cpp index 3337798b..66f73a6d 100644 --- a/src/Authoring/Studio/Palettes/Project/ProjectView.cpp +++ b/src/Authoring/Studio/Palettes/Project/ProjectView.cpp @@ -103,11 +103,11 @@ QSize ProjectView::sizeHint() const void ProjectView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_resDir"_L1, resourceImageUrl()); - rootContext()->setContextProperty("_parentView"_L1, this); + rootContext()->setContextProperty(QStringLiteral("_resDir"), StudioUtils::resourceImageUrl()); + rootContext()->setContextProperty(QStringLiteral("_parentView"), this); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/Project/ProjectView.qml"_L1)); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/Project/ProjectView.qml"))); } void ProjectView::effectAction(int row) diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp index 19695809..7346ed63 100644 --- a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp +++ b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp @@ -391,11 +391,11 @@ void SlideView::updateDataInputStatus() void SlideView::initialize() { CStudioPreferences::setQmlContextProperties(rootContext()); - rootContext()->setContextProperty("_parentView"_L1, this); - rootContext()->setContextProperty("_resDir"_L1, resourceImageUrl()); + rootContext()->setContextProperty(QStringLiteral("_parentView"), this); + rootContext()->setContextProperty(QStringLiteral("_resDir"), StudioUtils::resourceImageUrl()); - engine()->addImportPath(qmlImportPath()); - setSource(QUrl("qrc:/Palettes/Slide/SlideView.qml"_L1)); + engine()->addImportPath(StudioUtils::qmlImportPath()); + setSource(QUrl(QStringLiteral("qrc:/Palettes/Slide/SlideView.qml"))); const QVector<EDataType> acceptedTypes = { EDataType::DataTypeString }; m_dataInputSelector = new DataInputSelectView(acceptedTypes, this); |