Fixed form text size, independant from os
Is it possible to fix sizes of text/other content in qt gui app to fixed size, independant from os setting that can change overall size like 125% 150% etc?
Do you mean going against the OS High DPI settings ?
You can find more information about Qt's High DPI support here.
Yes , to stabilize the app against different os dpi settings.
MainWin m_win; m_win.setAttribute(Qt::AA_Use96Dpi);Does not work
QApplication app(argc,argv); app.setAttribute(Qt::AA_Use96Dpi);
Also wont notice differene.
Problem is that the text gets zoomed too big in labels and ui is designed by fixed cordinates for 100% dpi setting , not 125 or 150.
How to overcome this problem?
It's an application attribute not a widget attribute. You have to set it before creating your QApplication instance using QCoreApplication::setAttribute.
Both QApplication and QWidget has the setAttribute and the options avalible.
The setting has to be modified by the
QCoreApplication::setAttribute.and cant modify it seperately for each window or QApplication instance?
To work against high dpi settings in fixed cordinate designed app by making it small would be better than invisible text, but if possible to implement adjustable zoom for fixed cordinate app, that would allow make overall bigger/smaller would be even better solution.
They both have and both have a different set of attributes. The signature of both function is different. One takes
Qt::ApplicationAttributeand the other
What is your use of fixed coordinates ?
The High-DPI scaling should allow your application to show and interact nicely whatever the DPI is.
@SGaist The ui is designed without layouts, with fixed cordinataes and most ui elements quite closely packed.
Then you have to handle the High DPI stuff yourself also.