Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Proportion Issue for Qt High-dpi Scaling

    General and Desktop
    1
    1
    399
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      Vic Lin last edited by

      Hi there:

      I have an issue about the proportion of Qt high-dpi scaling. I am using Qt 5.7.0 for Windows 64-bit (VS 2015) under a 64-bit Windows 10.

      Please refer to attached pictures - Screenshot 1 and Screenshot 2 - with details there. What can I do to solve the proportion issue? Please help.
      Screenshot 1
      Screenshot 2

      1. I just called QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); in main.cpp

      2. main.cpp is as the following:
        #include "mainwindow.h"
        #include <QApplication>

      int main(int argc, char *argv[])
      {
      QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);

      QApplication a(argc, argv);
      MainWindow w;
      w.show();
      
      return a.exec();
      

      }

      1. mainwindow.cpp is as the following:
        #include "mainwindow.h"
        #include "ui_mainwindow.h"

      MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
      {
      ui->setupUi(this);
      }

      MainWindow::~MainWindow()
      {
      delete ui;
      }

      1 Reply Last reply Reply Quote 0
      • First post
        Last post