How to maintain the source in Qt5 when DPI increases

0

I'm having problems when I pass my UI to a user who has a different windows visual configuration than mine. If the user's display is at 125 or 150% my UI gets huge fonts in the labels while the other widgets become standard. I wanted to keep the source of the labels fixed.

I've tried:

QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

ja setei DPI I get 96 and nothing.

I tried to use a .config

[Platforms]
WindowsArguments = dpiawareness=0 , 1 ou 2

I've already tried setting a variable in the project settings but none of this worked, is there any way to make these settings work?

The font setting I use is the default Qt5 Designer.

Mymain.cppofthecodelookslikethis:

#include"meu_UI.h"
#include <QtWidgets/QApplication>
#include <QApplication>


int main(int argc, char *argv[])
{
    //QApplication::setAttribute(Qt::AA_Use96Dpi);
    QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    QApplication a(argc, argv);

    meu_UI w;

    w.show();


    return a.exec();
}
    
asked by anonymous 11.05.2018 / 16:13

0 answers