Skip to content
  • 0 Votes
    13 Posts
    8k Views
    A

    @Curtwagner1984 @JonB @J-Hilk @JKSH
    I used Python PyQt5-5.15 for my application
    I have guimain.exe and panelgui.ui files . Made qt.conf file
    But when I change windows scaling to 125% or 150% the text fonts and other ui widgets get messed up...how to make it work i.e disable windows scaling for application

  • 0 Votes
    13 Posts
    918 Views
    Pavel_47P

    Yes ! Works. Thanks

    int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
  • 0 Votes
    4 Posts
    1k Views
    R

    @johngod Thank you so much, you're right Screen.pixelDensity would be the complete solution if it was in qml,
    sifting trough the qt source i was able that it was derived from:

    double pixelpermm = QGuiApplication::primaryScreen()->physicalDotsPerInch() / 25.4 //physicalDotsPerInchX() & physicalDotsPerInchY() also exist

    and it seems to be correct on both my iPhone & iPad quite wel (better than all other ways I found so far)

    @Lorenz thanks, but for the time being I want to stick to Qt as it is a paid sdk as soon as you go commercial

  • 1 Votes
    7 Posts
    3k Views
    fra87F

    Ok, did some tests and it seems that setting the windows:dpiawareness to 0 or 1 fixes the problem.

    But... The problem is, the form is much more readable with the scaling at 2, since it is almost the same size on both monitors. The problem is that while the font size increases, the local sizes don't. And so the labels are cropped.

    In my opinion, a much better scaling would be to increase also the linear sizes, so that the whole window has almost the same size on both monitors.

    I don't know if I could explain well my opinion...