Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Proportion Issue for Qt High-dpi Scaling
Forum Updated to NodeBB v4.3 + New Features

Proportion Issue for Qt High-dpi Scaling

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 538 Views 1 Watching
  • 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 Offline
    V Offline
    Vic Lin
    wrote on last edited by
    #1

    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
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved