diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2023-02-13 15:17:33 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2023-02-20 14:45:35 +0000 |
commit | 0b9eb65d975b499179db32457f1e76009914efe1 (patch) | |
tree | c9d75a362b6a5aae704b259d13be8031b3c86137 /share/qtcreator/qmldesigner/itemLibraryQmlSources | |
parent | b70139fd84eacf173d5489692496b587795f85e6 (diff) | |
download | qt-creator-0b9eb65d975b499179db32457f1e76009914efe1.tar.gz |
QmlDesigner: Allow texture/light probe creation for hdr and ktx files
Also refactored Asset class a bit to optimize cases where multiple type
checks are done against same asset by resolving type at constructor
instead of on demand. Pretty much all cases where Asset instance
is needed also require resolving the type, so this makes sense.
Refactored the remaining cases to not create Asset instance
unnecessarily.
Fixes: QDS-9128
Change-Id: If9d518c9dcfcc70962e5d4e9881889c6ac243c97
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Diffstat (limited to 'share/qtcreator/qmldesigner/itemLibraryQmlSources')
-rw-r--r-- | share/qtcreator/qmldesigner/itemLibraryQmlSources/AssetsContextMenu.qml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/AssetsContextMenu.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/AssetsContextMenu.qml index 2eda6f0773..03051c747d 100644 --- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/AssetsContextMenu.qml +++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/AssetsContextMenu.qml @@ -120,7 +120,7 @@ StudioControls.Menu { id: addTexturesItem text: qsTr("Add Texture") enabled: rootView.hasMaterialLibrary - visible: root.__fileIndex && assetsModel.allFilePathsAreImages(root.__selectedAssetPathsList) + visible: root.__fileIndex && assetsModel.allFilePathsAreTextures(root.__selectedAssetPathsList) height: addTexturesItem.visible ? addTexturesItem.implicitHeight : 0 onTriggered: rootView.addTextures(root.__selectedAssetPathsList) } @@ -130,7 +130,7 @@ StudioControls.Menu { text: qsTr("Add Light Probe") enabled: rootView.hasMaterialLibrary visible: root.__fileIndex && root.__selectedAssetPathsList.length === 1 - && assetsModel.allFilePathsAreImages(root.__selectedAssetPathsList) + && assetsModel.allFilePathsAreTextures(root.__selectedAssetPathsList) height: addLightProbes.visible ? addLightProbes.implicitHeight : 0 onTriggered: rootView.addLightProbe(root.__selectedAssetPathsList[0]) } |