default style of 6.2 looks defect :(
-
Hi,
as I'm new to qt, I'm unsure about what is my mistake and what could be qt issue ...
So I toggle between 5.15 and 6.2When I first compiled my app with 6.2 - I was shocked about the result:
Just to make it clear: same source! Only different toolkit.
Is there a chance to get the same look as 5.15 using 6.2?
In codeeditor widget I set font and fontsize - so both should be the same. -
Hi
Seems to be font scaling.
Did you set the font size as point size or pixel size?
In any case to check if this is due to auto scaling, try disable it in with
Qt::AA_DisableHighDpiScaling
https://doc.qt.io/qt-5/highdpi.htmland see if they then look the same.
-
Hi,
thanks for your attention!
... and thank you for importing the pictures :)@mrjj said in default style of 6.2 looks defect :(:
Seems to be font scaling.
Yes, but the strange thing: in my understanding should dpi settings/font scaling be handled by operating system, not by application.
Font-settings of elements where I don't change font settings is disgusting. I didn't want to overwrite a whole stylesheet, but it looks like I have to ...So compiling an application with another toolkit version should imho not differ that much.
The page you linked says, that high dpi support has been introduces in release 5.6 - so there should be no difference between 5.15 and 6.2@mrjj said in default style of 6.2 looks defect :(:
try disable it in with
Qt::AA_DisableHighDpiScalingI tried to change environment variable (it was already set to 0 by qtcreator), but it made no difference.
-
Hi
Font scaling is mostly handled by the OS but Qt allows the app to tweak how it's applied.Normally you would add
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
Before the app in main.cpp but as far as I know the env also works.I have to try with Qt6. I have not noticed any change. At least not on win 10
-
Hi
I tried a default GUI app with some labels and other widgets on.
I saw zero difference between 5.12 and 6.1So I wonder if you set fonts via stylesheets ?
-
I did not think there was "high-DPI" font scaling offered under Linux, or Qt on Linux (where this application appears to be running).
This may be that the default font applied in whatever QStyle is being used has changed, and that the changed font does not exist in the runtime system. That will result in it being mapped to something else that might be sub-optimal.
-
Hi,
@mrjj said in default style of 6.2 looks defect :(:
So I wonder if you set fonts via stylesheets ?
No I don't
@ChrisW67 said in default style of 6.2 looks defect :(:
I did not think there was "high-DPI" font scaling offered under Linux, or Qt on Linux (where this application appears to be running).
This may be that the default font applied in whatever QStyle is being used has changed, and that the changed font does not exist in the runtime system. That will result in it being mapped to something else that might be sub-optimal.
That sounds reasonable! QStyle does I lot, I didn't get rid of yet.
But that is no reason for the different size of the controls, where I manually set a font. That font is of cause in place ...
So the only reason, that makes sense for me, is different dpi understanding/behaviour.@mrjj said in default style of 6.2 looks defect :(:
Normally you would add
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
Before the app in main.cpp but as far as I know the env also works.I'll try that.
-
@mrjj said in default style of 6.2 looks defect :(:
Normally you would add
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
Before the app in main.cpp but as far as I know the env also works.I couldn't try that before - so did the test right now - and it looks, that Qt6.2 does not have any attribute like "AA_DisableHighDpiScaling".
I got compiler errors, so I guess, environment variable can't work either.I searched a bit for similar attributes and found "Qt::HighDpiScaleFactorRoundingPolicy::Ceil" - but using this attribute does not change anything.