Qt Quick Controls 2 Material size too big on desktop
-
Although Qt Quick Controls 2 designs well, and Material style fascinating, however when we use in desktop, we can bear because the control is too big. I wonder is there any way to adjust the size of control JUST IN A LINE OF CODE, or to configure it?
-
You can tweak the automatic scaling http://doc.qt.io/qt-5.10/qtquickcontrols2-highdpi.html
Or see QT_SCALE_FACTOR usage described in http://doc.qt.io/qt-5/highdpi.html I think this is exactly what you want :-)
Additional reading: http://doc.qt.io/qt-5/scalability.html
-
you can upvote https://bugreports.qt.io/browse/QTBUG-65061?filter=-2
cause this high dpi mode works not well on desktop -
This is screenshot for Lubuntu.
- Use
QCoreApplication::setAttribute( Qt::AA_EnableHighDpiScaling );
beforeQGuiApplication app( argc, argv );
-> Useless - Commented out
QCoreApplication::setAttribute( Qt::AA_EnableHighDpiScaling );
-> Useless - Set
QT_AUTO_SCREEN_SCALE_FACTOR=1
into "Environment Variable" panel in Qt Creator -> Useless
I need further help.
- Use
-
This is what Qt Quick Controls 2 demo "gallery" looks like:
I know Qt Quick Controls 2 is targeting mobile devices, but in fact Material theme looks good even in desktop. We need some utility to configure the look'n' feel for Material style.
BTW: I don't like to make a copy and change the controls one by one. -
@jiancaiyang said in Qt Quick Controls 2 Material size too big on desktop:
I need further help
Quoting myself: "Or see QT_SCALE_FACTOR usage described in http://doc.qt.io/qt-5/highdpi.html I think this is exactly what you want :-)"
We need some utility to configure the look'n' feel for Material style. BTW: I don't like to make a copy and change the controls one by one.
While it is not an utility, there is the conf file described in docs
-
The Material Design guidelines specify a dense variant for desktop, but it was not (yet?) implemented for Qt Quick Controls 2. This was simply mainly due to lack of resources, but there have been also some performance concerns. Anyway, feel free to vote and/or comment QTBUG-51109 if you think it should be prioritized higher.