Fixed form text size, independant from os
-
How to:
setAttribute(Qt::AA_Use96Dpi);
to mainwindow?MainWin m_win; m_win.setAttribute(Qt::AA_Use96Dpi);
Does not workQApplication 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.
-
It's an application attribute not a widget attribute. You have to set it before creating your QApplication instance using QCoreApplication::setAttribute.
@SGaist
Both QApplication and QWidget has the setAttribute and the options avalible.
The setting has to be modified by theQCoreApplication::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::ApplicationAttribute
and the otherQt::WidgetAttribute
.What is your use of fixed coordinates ?
The High-DPI scaling should allow your application to show and interact nicely whatever the DPI is.
-
They both have and both have a different set of attributes. The signature of both function is different. One takes
Qt::ApplicationAttribute
and the otherQt::WidgetAttribute
.What is your use of fixed coordinates ?
The High-DPI scaling should allow your application to show and interact nicely whatever the DPI is.
-
Then you have to handle the High DPI stuff yourself also.