Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.12.3
-
None
-
Windows 10
Description
The attribute Qt::AA_EnableHighDpiScaling was introduced to solve scaling issues of the user interface for HiDPI displays. Under Windows, this flag has no effect at all. Even worse, fonts are scaled correctly - but the layout and the widgets are not scaled at all.
See the attached sample application QtHiDpiTest.zip.
This application enabled the high DPI scaling for windows and creates a simple main window with three buttons. The layout creates a 16 point margin around and 8 point spacing between the buttons.
If you run this example application under Windows 10 and set the scaling 100%, 150%, 200% and 300%, you will get a result as shown in the following screenshots:
100%:
150%:
200%:
300%:
You can see a number of issues with the scaling:
- Only the font and windows frame is scaled.
- The layout parameters margin=16 and spacing=16 are not scaled.
- The button frames and widget elements are not scaled. The button frame is still one pixel, even at 300%.
This lack of proper scaling leads to strange and not very friendly user interface layouts. Especially if there are icons and other fixed elements involved. E.g. if a label with an icon is set to the fixed size of 16x16, it will be that size, even at a scaling level of 300%.
The Qt::AA_EnableHighDpiScaling flag seems to have no effect at all.
Steps to Reproduce this Problem:
- Use the latest Windows 10 Operating system.
- Compile the Example Application.
- Start the application at 100%, 150%, 200% or 300%
Expected Behaviour:
- The user interface with all its elements is scaled with the configured scale factor. This includes the following elements:
- QLayout margin and spacing.
- QWidget minimum/maximum width/height
- Box padding margin from stylesheets.
- Line widths of the widgets, like QPushButton, QRadioButton etc.
- Line widths set in stylesheets (box model)
Actual Behaviour:
- Only the font is scaled to the correct size.