Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-95476

Imagine style does not support non-PNG image files

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/X11

      Description

      Since Qt 5.1x, QQuickImage supoorts OpenGL Texture Files such as PKM, KTX, ASTC

      https://doc.qt.io/qt-5/qml-qtquick-image.html

      OpenGL Texture Files

      When the default OpenGL scene graph backend is in use, images can also be supplied in compressed texture files. The content must be a simple RGB(A) format 2D texture. Supported compression schemes are only limited by the underlying OpenGL driver and GPU. The following container file formats are supported:

      • PKM (since Qt 5.10)
      • KTX (since Qt 5.11)
      • ASTC (since Qt 5.13)

       

      However ImageSelector (from QtQuick.Controls.Imagine) does not support PKM, KTX, ASTC because of below code

      qtquickcontrols2/src/imports/controls/imagine/qquickimageselector.cpp

      QStringList QQuickImageSelector::fileExtensions() const
      {
          static const QStringList extensions = QStringList() << QStringLiteral("png");
          return extensions;
      }

      and there is no Q_PROPERTY setter to set fileExtensions.

      Moreover we cannot inherit qquickimageselector_p.h to make custom ImageSelector because it's internal and qquickimageselector_p.h is not shipped in Qt installation directory.

       

      In my humble opinion, we have to provide the way to select PKM, KTX, ASTC images via ImageSelector because QQuickImage supports them.

       

      Please see the attached test QML file. (image_test2.qml)

       

        Attachments

        1. astc_n.astc
          46 kB
        2. astc_p.astc
          46 kB
        3. image_test2.qml
          0.7 kB
        4. png_n.png
          png_n.png
          70 kB
        5. png_p.png
          png_p.png
          63 kB

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              javihria Jarko Vihriälä
              Reporter:
              seokhako Seokha Ko
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes