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

Material style for Label for QtQuick controls 2 breaks font size (UWP).

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P3: Somewhat important
    • None
    • 5.13.2
    • Quick: Controls 2
    • None
    • WinRT

    Description

      How to reproduce:

      make the simplest QtQuick project with QML:

      import QtQuick 2.13
      import QtQuick.Controls 2.13
      
      ApplicationWindow {
          title: "My Application"
          width: 640
          height: 480
          visible: true
      
          Label {
              text: "TEXT"
              anchors.centerIn: parent
          }
      }
      

      make the simplest cpp file:

      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      #include <QQuickStyle>
      
      int main(int argc, char *argv[])
      {
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      
        QGuiApplication app(argc, argv);
        QQuickStyle::setStyle("Material");
      
        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();
      }
      

      and add quickcontrols2 to pro file

      QT += quick quickcontrols2
      

      Build the project for UWP in Qt 5.13.2.

      The first test
      Change the font size for the system to 100%.
      Run the app.
      Change the font size for the system to 150%.

      The size of the text (Label) does not change. <<-- This is the problem.

      The second test
      Remove teh line from cpp

      QQuickStyle::setStyle("Material");
      

      Build the project

      Change the font size for the system to 100%.
      Run the app.
      Change the font size for the system to 150%.

      The size of the text (Label) is bigger and this is correct. <<-- All OK.

      Attachments

        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
            sploid Ivan Krivenkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes