Il 15/02/21 12:50, Anisha kaul ha scritto:
|qreal abc = QGuiApplication::primaryScreen()->physicalDotsPerInch(); qDebug() << "null " << abc; qputenv("QT_SCALE_FACTOR", "2"); QGuiApplication app(argc, argv);|

I'm not exactly sure why would you want to do this, but you can destroy and recreate the QGuiApplication object.

The only annoying part is that you'll need to copy the command line arguments. Ignoring that issue for now:


int main(int argc, char **argv) {
  {
     QGuiApplication app(argc, argv);
     // access screen info, calculate scaling, etc.
     // qputenv
  }

  // app destroyed , recreate it

  QGuiApplication app(argc, argv);

  // rest of main

}


My 2 c,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to