You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toolbar icons that scale correctly on 4k monitor set to 200% magnification. This seems to be a common issue with Qt-based apps, it is not specific to DB4S.
What did you see instead?
Useful extra information
The info below often helps, please fill it out if you're able to. :)
Issue #1836 mentions setting an environment variable. Can you try setting this: set QT_AUTO_SCREEN_SCALE_FACTOR=1
Slap that in a command-prompt, then run DB4S from the same command-line. Here's a screencast...
The directory you go to to run DB4S will be different though, but the process is the same... https://screencast-o-matic.com/watch/cYiV1y5r6j
Set the variable (copied from above), plop into the DB4S directory, then run the .exe.
Reacted by Justin Clift, Péter Tombor, user9931 and Rob
Perfect! I didn't find that before. It does indeed fix the issue. My main entry point for your app is file associations (double-clicking .db files). Is there anyway to make this a setting? Or maybe I can mod the launch definition for the association. 🤔
Yay! Thanks for reporting back! Glad it worked. We'll try and bake this into a nightly to test, as its the second report of it.
As for double-clicking, we can change the association. Create a batch file, then right-click on a .db file, select 'Properties', then click 'Change', then find the batch file. The batch file would be:
set QT_AUTO_SCREEN_SCALE_FACTOR=1
c:
cd "c:\program files\db4s"
call "DB Browser for SQLite.exe" %1
So you'd need the %1 to pass in the filename. Think you'll need the 'call' bit, otherwise the command-prompt window hangs around until you close DB4S, which can be annoying. Haven't tested this though...
Obviously change the directory after the CD command to wherever you have DB4S installed...
@justinclift - To close this issue, is this something we'd have to add to the DB4S code, or just something the user would have to run pre-running DB4S? (stick it in a batch file, etc).
@gitblit Thanks for the confirmation, that's really helpful. People have mentioned scaling issues with DB4S with HiDPI monitors on Windows before, so having a potential solution is a definite win.
@chrisjlocke Now that it's been confirmed to work, we should probably look at setting that environment variable (or an equivalent Qt setting) at startup time. Not sure if it'll need to be set just for Windows, or if it's safe to set on all platforms, etc.
@MKleusberg Setting the QT_AUTO_SCREEN_SCALE_FACTOR variable (with a value of 1) at start up on Windows is probably safe, yeah?
Setting the variable (with a value of 1) at start up on Windows is probably safe, yeah?
The only 'gotcha' is that as its an environment variable, it'll affect other Qt programs until Windows is restarted or that variable is changed. If its going to be implemented, I'd suggest a command-line switch so that it could be turned off - so set on by default /unless/ a command-switch of --noAutoScreenScaleFactor (as an example) is present...
It might only affect one person out of a million but .... well, just thinking out loud....
The only 'gotcha' is that as its an environment variable, it'll affect other Qt programs until Windows ...
I was meaning more "add it to the DB4S environment for this run of the application", rather than "add it to the system wide environment for everyone". 😄
QT_AUTO_SCREEN_SCALE_FACTOR [boolean] enables automatic scaling, based on the monitor's pixel density. This won't change the size of point-sized fonts, since point is a physical measurement unit. Multiple screens may get different scale factors.
QT_SCALE_FACTOR [numeric] defines a global scale factor for the whole application, including point-sized fonts.
So it would make sense that setting QT_AUTO_SCREEN_SCALE_FACTOR to 1 would fix most of the UI except for the font sizes. Maybe using the new "Font Size" option in the General tab of DB4S's Preferences dialog can be used to adjust that separately. If that works we could try to figure out a way to calculate a good default value for the Font Size option and set that along with QT_AUTO_SCREEN_SCALE_FACTOR.
QT_AUTO_SCREEN_SCALE_FACTOR=1 works perfectly, but why this is no by default? think its necessary for anyone with hidpi display... also, font size are still need to be changed manually
This is PC dependent. I have 2 laptops but only 1 has the tiny font issue.
Will this be a DB4S preference setting or hardcoded?
Adjusting environment variables is not a good solution unless the installer does it.
Setting the env variable globally fixed this issue for me also on windows! Well actually, the UI was fixed but the font was still too small but I went to preferences and changed it from 3 to 8 and now it looks perfect on my high dpi screen!
Activity
chrisjlocke commentedon Jul 1, 2020
Issue #1836 mentions setting an environment variable. Can you try setting this:
set QT_AUTO_SCREEN_SCALE_FACTOR=1Slap that in a command-prompt, then run DB4S from the same command-line. Here's a screencast...
The directory you go to to run DB4S will be different though, but the process is the same...
https://screencast-o-matic.com/watch/cYiV1y5r6j
Set the variable (copied from above), plop into the DB4S directory, then run the .exe.
gitblit commentedon Jul 1, 2020
Perfect! I didn't find that before. It does indeed fix the issue. My main entry point for your app is file associations (double-clicking
.dbfiles). Is there anyway to make this a setting? Or maybe I can mod the launch definition for the association. 🤔chrisjlocke commentedon Jul 1, 2020
Yay! Thanks for reporting back! Glad it worked. We'll try and bake this into a nightly to test, as its the second report of it.
As for double-clicking, we can change the association. Create a batch file, then right-click on a .db file, select 'Properties', then click 'Change', then find the batch file. The batch file would be:
So you'd need the %1 to pass in the filename. Think you'll need the 'call' bit, otherwise the command-prompt window hangs around until you close DB4S, which can be annoying. Haven't tested this though...
Obviously change the directory after the CD command to wherever you have DB4S installed...
justinclift commentedon Jul 1, 2020
It could also be set in Windows itself, to apply to everything. It should then apply automatically to all Qt applications
Whether or not that's a helpful thing is the next question... 😄
gitblit commentedon Jul 1, 2020
Great idea @justinclift. I'll give that a go and see if it breaks any of the other QT apps I might have.
chrisjlocke commentedon Aug 24, 2020
@gitblit - I assume all was good?
@justinclift - To close this issue, is this something we'd have to add to the DB4S code, or just something the user would have to run pre-running DB4S? (stick it in a batch file, etc).
gitblit commentedon Aug 24, 2020
@chrisjlocke all good! I am using the global environment variable workaround with success!
justinclift commentedon Aug 24, 2020
@gitblit Thanks for the confirmation, that's really helpful. People have mentioned scaling issues with DB4S with HiDPI monitors on Windows before, so having a potential solution is a definite win.
@chrisjlocke Now that it's been confirmed to work, we should probably look at setting that environment variable (or an equivalent Qt setting) at startup time. Not sure if it'll need to be set just for Windows, or if it's safe to set on all platforms, etc.
@MKleusberg Setting the
QT_AUTO_SCREEN_SCALE_FACTORvariable (with a value of 1) at start up on Windows is probably safe, yeah?chrisjlocke commentedon Aug 24, 2020
The only 'gotcha' is that as its an environment variable, it'll affect other Qt programs until Windows is restarted or that variable is changed. If its going to be implemented, I'd suggest a command-line switch so that it could be turned off - so set on by default /unless/ a command-switch of --noAutoScreenScaleFactor (as an example) is present...
It might only affect one person out of a million but .... well, just thinking out loud....
justinclift commentedon Aug 25, 2020
I was meaning more "add it to the DB4S environment for this run of the application", rather than "add it to the system wide environment for everyone". 😄
justinclift commentedon Sep 10, 2020
@MKleusberg Ping?
scottfurry commentedon Sep 12, 2020
Piling on to conversation.
Ref: https://doc.qt.io/qt-5/highdpi.html
See section "Migrate Existing Applications".
MKleusberg commentedon Sep 13, 2020
Looking at https://doc.qt.io/qt-5/highdpi.html it says:
So it would make sense that setting
QT_AUTO_SCREEN_SCALE_FACTORto 1 would fix most of the UI except for the font sizes. Maybe using the new "Font Size" option in the General tab of DB4S's Preferences dialog can be used to adjust that separately. If that works we could try to figure out a way to calculate a good default value for the Font Size option and set that along withQT_AUTO_SCREEN_SCALE_FACTOR.user9931 commentedon Jul 16, 2022
QT_AUTO_SCREEN_SCALE_FACTOR=1 works perfectly, but why this is no by default? think its necessary for anyone with hidpi display... also, font size are still need to be changed manually
sky5walk commentedon Sep 19, 2022
This is PC dependent. I have 2 laptops but only 1 has the tiny font issue.
Will this be a DB4S preference setting or hardcoded?
Adjusting environment variables is not a good solution unless the installer does it.
rob4226 commentedon Sep 22, 2022
Setting the env variable globally fixed this issue for me also on windows! Well actually, the UI was fixed but the font was still too small but I went to preferences and changed it from 3 to 8 and now it looks perfect on my high dpi screen!