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

QML Flat style doesn't work on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 5.14.0
    • Quick: Controls 1
    • None
    • Qt 5.14.0 (arm64-v8a kit)
      macOS Catalina
      android-ndk-r20b
      Android Build SDK: android-26
    • Android

    Description

      I'm trying to set Flat style for my QtQuick.Controls v1 components. Here how I do that in main.cpp:

      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      
      int main(int argc, char *argv[])
      {
          qputenv("QT_QUICK_CONTROLS_1_STYLE", "Flat");
          qputenv("QT_LABS_CONTROLS_STYLE", "Flat");
      
          QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
          QGuiApplication app(argc, argv);
      
          QQmlApplicationEngine engine;
          const QUrl url(QStringLiteral("qrc:/main.qml"));
          QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                           &app, [url](QObject *obj, const QUrl &objUrl) {
              if (!obj && url == objUrl)
                  QCoreApplication::exit(-1);
          }, Qt::QueuedConnection);
          engine.load(url);
      
          return app.exec();
      }
      

      It does work on Desktop (macOS) as expected, but it doesn't work on Android. "Base" and "Desktop" styles also work as expected on both Desktop and Android platforms. I put an example project below alongside with the full debug output of it. I can't see any unusual error messages in the debug output though

      I xample.flattes: Late-enabling -Xcheck:jni
      I libthemeutils: Theme: libthemeutil.so load success
      I Perf    : Connecting to perf service.
      W System  : ClassLoader referenced unknown path:
      I QtCore  : Start
      I Qt      : qt started
      I Adreno  : QUALCOMM build                   : 2c6a1c7, I1490fecf6e
      I Adreno  : Build Date                       : 02/04/19
      I Adreno  : OpenGL ES Shader Compiler Version: EV031.25.03.02
      I Adreno  : Local Branch                     :
      I Adreno  : Remote Branch                    :
      I Adreno  : Remote Branch                    :
      I Adreno  : Reconstruct Branch               :
      I Adreno  : Build Config                     : S L 6.0.7 AArch64
      D vndksupport: Loading /vendor/lib64/hw/gralloc.msm8998.so from current namespace instead of sphal namespace.
      I Adreno  : PFP: 0x005ff112, ME: 0x005ff066
      I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
      I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
      I OpenGLRenderer: Initialized EGL, version 1.4
      D OpenGLRenderer: Swap behavior 2
      D vndksupport: Loading /vendor/lib64/hw/android.hardware.graphics.mapper@2.0-impl.so from current namespace instead of sphal namespace.
      D vndksupport: Loading /vendor/lib64/hw/gralloc.msm8998.so from current namespace instead of sphal namespace
      

      This bug might be relevant to QTBUG-46886

      Attachments

        1. desktop-style.jpg
          desktop-style.jpg
          40 kB
        2. flat-style-not-applied.jpg
          flat-style-not-applied.jpg
          24 kB
        3. flattest.zip
          3 kB
        4. on-desktop.png
          on-desktop.png
          63 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            kozmon Ömer Göktaş
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes