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

DPI setting ignored in 5.11

    XMLWordPrintable

Details

    • 89f9a3db15940ea87d6ad89f93bfa5aa1d7564fb

    Description

      The following window (and its contents, should it have any) is the correct size with 5.10 and v5.11.0, but with the latest 5.11 the device pixel ratio (2) is ignored and it is half the size it should be:

      main.cpp
      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      
          QGuiApplication app(argc, argv);
      
          QQmlApplicationEngine engine;
          engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
          if (engine.rootObjects().isEmpty())
              return -1;
      
          return app.exec();
      }
      
      main.qml
      import QtQuick 2.8
      import QtQuick.Window 2.2
      
      Window {
          width: 1200
          height: 800
          visible: true
      }
      

      This happens when running the application from Creator or on the command line.

      Attachments

        Issue Links

          Activity

            People

              frederik Frederik Gladhorn
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: