Unsolved Proportion Issue for Qt High-dpi Scaling
-
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.
-
I just called QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); in main.cpp
-
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();
}
- 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;
} -