QLabel scaling issue
-
Hi,
I've a quick basic question.
I've designed an app with display screen size 100% (In Windows 7 OS). But now I realize when maginify the screen to 125%, all the labels in my app is also scaled and clipped/cutoff from the screen.Is there any QLabel property will prevent this happening? Or is there any other easy work around to this issue?
Thanks in advance
-
@SruDom
have you tried adding the following line at the beginning of your main (before creating the QApplication instance):QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
-
I just tried but has no effect
-
Hi
did you also try
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, false);
or the AA_DisableHighDpiScalingAnyway, did you read this ?
https://doc.qt.io/qt-5/highdpi.htmlIm not sure to what extend Win 7 works as its EOL.
you can try fiddling with QT_SCALE_FACTOR
or try running app with
<application> -platform windows:dpiawareness=0 -
-
'@JonB Thank you. I tried specify those commands on the run command line argument area on the Qt creator. But I get the following error:
...build-POML060_v1-Desktop_Qt_5_12_0_MSVC2015_64bit-Release\release\POML060_v1.exe <application> -platform windows:dpiawareness=0... The system cannot find the file specified.
Not sure what I'm doing wrong here..
-
Hi
<application> should not be included in the cmd line in CreatorIt simply means Your app. The app.
Sorry I though it sort of a universally way to show it :) -
@mrjj Thanks :)
I tried running app with
-platform windows: dpiawareness = 0
and tried setting the follwoing in themain.cpp
QApplication :: setAttribute ( Qt::AA_DisableHighDpiScaling);
None of them seemed working.If I change enlarge the screen from 100% to 125% , some labels and widgets parts are being cutoff. I also tried running the app on Win10 but the issue is same.