QmlDesigner: Add support for .ktx

Task-number: QDS-5849
Change-Id: Ibe0bb3f2480a25a2d80793526d6581e89c22529f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Thomas Hartmann
2021-12-22 15:26:18 +01:00
parent d88b32722e
commit 1d2636dd08
4 changed files with 4 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ Row {
property variant backendValue property variant backendValue
property color textColor: colorLogic.highlight ? colorLogic.textColor property color textColor: colorLogic.highlight ? colorLogic.textColor
: StudioTheme.Values.themeTextColor : StudioTheme.Values.themeTextColor
property string filter: "*.png *.gif *.jpg *.bmp *.jpeg *.svg *.pbm *.pgm *.ppm *.xbm *.xpm *.hdr *.webp" property string filter: "*.png *.gif *.jpg *.bmp *.jpeg *.svg *.pbm *.pgm *.ppm *.xbm *.xpm *.hdr *.ktx *.webp"
// This property takes an array of strings which define default items that should be added // This property takes an array of strings which define default items that should be added
// to the ComboBox model in addition to the items from the FileResourcesModel. This is used // to the ComboBox model in addition to the items from the FileResourcesModel. This is used

View File

@@ -1553,6 +1553,7 @@ void DesignerActionManager::createDefaultAddResourceHandler()
auto transformer = [](const QByteArray& format) -> QString { return QString("*.") + format; }; auto transformer = [](const QByteArray& format) -> QString { return QString("*.") + format; };
auto imageFormats = Utils::transform(QImageReader::supportedImageFormats(), transformer); auto imageFormats = Utils::transform(QImageReader::supportedImageFormats(), transformer);
imageFormats.push_back("*.hdr"); imageFormats.push_back("*.hdr");
imageFormats.push_back("*.ktx");
// The filters will be displayed in reverse order to these lists in file dialog, // The filters will be displayed in reverse order to these lists in file dialog,
// so declare most common types last // so declare most common types last

View File

@@ -180,7 +180,7 @@ const QStringList &ItemLibraryAssetsModel::supportedVideoSuffixes()
const QStringList &ItemLibraryAssetsModel::supportedTexture3DSuffixes() const QStringList &ItemLibraryAssetsModel::supportedTexture3DSuffixes()
{ {
// These are file types only supported by 3D textures // These are file types only supported by 3D textures
static QStringList retList {"*.hdr"}; static QStringList retList {"*.hdr", "*.ktx"};
return retList; return retList;
} }

View File

@@ -300,6 +300,7 @@ ImageFileFilterItem::ImageFileFilterItem(QObject *parent)
// supported image formats according to // supported image formats according to
QList<QByteArray> extensions = QImageReader::supportedImageFormats(); QList<QByteArray> extensions = QImageReader::supportedImageFormats();
extensions.append("hdr"); extensions.append("hdr");
extensions.append("ktx");
for (const QByteArray &extension : qAsConst(extensions)) for (const QByteArray &extension : qAsConst(extensions))
filter.append(QString::fromLatin1("*.%1;").arg(QString::fromLatin1(extension))); filter.append(QString::fromLatin1("*.%1;").arg(QString::fromLatin1(extension)));
setFilter(filter); setFilter(filter);