Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.4.x-7.5] QT.AA_EnableHighDpiScaling results in wrong DPI on some screens #5155

Open
ichorid opened this issue Feb 22, 2020 · 6 comments
Open

Comments

@ichorid
Copy link
Contributor

ichorid commented Feb 22, 2020

A user on the forum reported detected a QT bug with auto-scaling.

This happens for all the 7.4.x series along with the experimental build or 7.5.

@ichorid ichorid added this to the V7.5: core refactoring milestone Feb 22, 2020
@ichorid ichorid changed the title [7.4.x-7.5] GUI resolution too low (don't fit into the screen) [7.4.x-7.5] QT.AA_EnableHighDpiScaling results in wrong DPI on some screens Feb 22, 2020
@ichorid
Copy link
Contributor Author

ichorid commented Feb 22, 2020

The user tried a custom Tribler build that does not include

QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)

lines. It solved his problem.

Apparently, QT DPI scaling detects DPI wrongly on some Windows machines.

@Rik44444
Copy link

Rik44444 commented May 12, 2020

same problem here, i am not using a custom build, i'm using the most recent stable build from tribler.org 7.4.4. . i'm on Windows 10, HP laptop, display res 1920/1080, scaling at 150%.

temp

@ichorid
Copy link
Contributor Author

ichorid commented May 14, 2020

@Rik44444 , thanks for reporting! We're probably going to include some kind of option to turn the scaling off in the upcoming 7.5 release.

@ichorid
Copy link
Contributor Author

ichorid commented Jun 3, 2020

For 7.5 we're not going to provide the settings option as it will require some pretty invasive changes in how our GUI settings are processed. To solve this properly we should do as the QT manual states:

Always use the qreal versions of the QPainter drawing API.
Size windows and dialogs in relation to the corresponding screen size.
Replace hard-coded sizes in layouts and drawing code with values calculated from font metrics or screen size.

and change the GUI settings loading order so the GUI will first load its settings, and only then will create the window. This will enable us to create a "scaling factor" option in the GUI that will be available for tuning by the user.

For people who are affected by this problem:
you can try adding QT_SCALE_FACTOR=1 environment variable, and/or play with the value to adjust it to DPI.

@ichorid
Copy link
Contributor Author

ichorid commented Apr 20, 2021

@drew2a drew2a modified the milestones: Next-next release, Backlog Sep 15, 2021
@drew2a
Copy link
Collaborator

drew2a commented Dec 12, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Bug crunch
  
Needs triage
Development

No branches or pull requests

4 participants