Unsolved Creating a form with the correct font for the host operating system.
-
@jsulm , I'm now creating a new UI, dropped a Push Button from the palette onto the mainwindow.ui, the button is very small and the font almost unreadable, yet this is using all the defaults, nothing has been modified.
How to I get a button thats equal to the buttons as used by the dialogs in Qt Creator which look like they are the same size as every other button in the User Interface?
-
@SPlatten
Hi
Are you on a hires screen?
Does app look the same when you run it ? -
@mrjj , My screen is insane, its a 49" curved Samsung monitor, resolution is 5120x1140. No it doesn't look the same, without modifications, the button is smaller and not large enough for the font that was chosen by default. I have now resized the button and font, but I didn't think I would have to do this?
-
@SPlatten
Ok so it is a hi def display.Read the link. there are some values you can try to tweak.
How about Creator it self ? Does it look ok ?
-
@mrjj , Qt Creator isn't a problem, I would have thought that regardless of the hardware being used that Qt Creator would use the same default OS settings?
-
@SPlatten
well im asking if it scales as it should ? buttons and menus etc are ok size ?
(not in the UI i mean, but the creator app itself)
Qt 5.9 is pretty old but i think hi res support came in 5.6
but been tweaked in later versions.well normally one would put all buttons etc in layouts and when app run it should look "normal"
however, you should check ifint main(int argc, char *argv[]) { QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // <-- enable it QGuiApplication app(argc, argv);
makes any difference.
-
@mrjj Thank you, but I'm not sure how this helps, because as I see it there are two problems here:
- Qt Creator doesn't select the correct font by default when designing the WYSIWYG interface.
- At runtime the font is different from that used when designing the interface.
-
@SPlatten
Yep but its how it is with hi res display and fonts.
I highly recommend you read the link to gain an overview.You might need to tweak the settings for it to look normal on that screen.
Must be nice with 5k desktop :)
-
@mrjj Thank you
-
@SPlatten
Oh i forgot to ask.
In windows 10. there is a text scale setting.
Often 150% or 200% for such screen.What is your settings at ?
-
@mrjj I haven't changed it, just checked it's on 150% (Recommended).
-
@SPlatten
ok. pretty normal value.If you change it, does it affect how the buttons in the ui are ? I mean text size ?