How to resolve HiDPI problem with Qt apps
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
1
down vote
favorite
I recently began using the command xrandr --dpi 166
for my new laptop running Ubuntu 16.04.3 64-bit after noticing that otherwise the system automatically uses 96 dpi.
However, such a high dpi setting results in extremely big menus and toolbars only in Qt apps I have, such as Master PDF Editor, digiKam and Krita (the latter two are in AppImage format). Other apps running in Java or WINE environment don't pose such problems.
I'm hoping to find a way of manually entering a specific dpi setting for Qt apps or some other way of resolving this problem.
If there is no way of globally specifying a dpi setting for Qt apps, maybe a simple wrapper script entering xrandr --dpi 96
before and restoring the initial dpi setting after such an app could do as well...
qt hdpi
add a comment |Â
up vote
1
down vote
favorite
I recently began using the command xrandr --dpi 166
for my new laptop running Ubuntu 16.04.3 64-bit after noticing that otherwise the system automatically uses 96 dpi.
However, such a high dpi setting results in extremely big menus and toolbars only in Qt apps I have, such as Master PDF Editor, digiKam and Krita (the latter two are in AppImage format). Other apps running in Java or WINE environment don't pose such problems.
I'm hoping to find a way of manually entering a specific dpi setting for Qt apps or some other way of resolving this problem.
If there is no way of globally specifying a dpi setting for Qt apps, maybe a simple wrapper script entering xrandr --dpi 96
before and restoring the initial dpi setting after such an app could do as well...
qt hdpi
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I recently began using the command xrandr --dpi 166
for my new laptop running Ubuntu 16.04.3 64-bit after noticing that otherwise the system automatically uses 96 dpi.
However, such a high dpi setting results in extremely big menus and toolbars only in Qt apps I have, such as Master PDF Editor, digiKam and Krita (the latter two are in AppImage format). Other apps running in Java or WINE environment don't pose such problems.
I'm hoping to find a way of manually entering a specific dpi setting for Qt apps or some other way of resolving this problem.
If there is no way of globally specifying a dpi setting for Qt apps, maybe a simple wrapper script entering xrandr --dpi 96
before and restoring the initial dpi setting after such an app could do as well...
qt hdpi
I recently began using the command xrandr --dpi 166
for my new laptop running Ubuntu 16.04.3 64-bit after noticing that otherwise the system automatically uses 96 dpi.
However, such a high dpi setting results in extremely big menus and toolbars only in Qt apps I have, such as Master PDF Editor, digiKam and Krita (the latter two are in AppImage format). Other apps running in Java or WINE environment don't pose such problems.
I'm hoping to find a way of manually entering a specific dpi setting for Qt apps or some other way of resolving this problem.
If there is no way of globally specifying a dpi setting for Qt apps, maybe a simple wrapper script entering xrandr --dpi 96
before and restoring the initial dpi setting after such an app could do as well...
qt hdpi
qt hdpi
edited Feb 10 at 10:08
asked Feb 10 at 9:25
Sadi
8,56543748
8,56543748
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
A less than perfect temporary solution that I've found is the following simple wrapper bash script that can be used in the relevant .desktop file instead of the executable of the app in question, e.g. masterpdfeditor4
:
#!/bin/bash
HiDPI="$(xdpyinfo | grep dots | awk -F'x' 'print $2' | awk -F' ' 'print $1')"
if [[ ! $HiDPI = 96 ]]
then
xrandr --dpi 96
masterpdfeditor4 "$@"
xrandr --dpi $HiDPI
else
masterpdfeditor4 "$@"
fi
This will restore the original dpi setting only if one such app is opened and closed, or in case more than one such app is launched, only if the first app is closed last.
Secondly, somehow some GUI elements other than menus and toolbars cannot be fixed in this way, e.g. cursor size in Krita workspace...
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
A less than perfect temporary solution that I've found is the following simple wrapper bash script that can be used in the relevant .desktop file instead of the executable of the app in question, e.g. masterpdfeditor4
:
#!/bin/bash
HiDPI="$(xdpyinfo | grep dots | awk -F'x' 'print $2' | awk -F' ' 'print $1')"
if [[ ! $HiDPI = 96 ]]
then
xrandr --dpi 96
masterpdfeditor4 "$@"
xrandr --dpi $HiDPI
else
masterpdfeditor4 "$@"
fi
This will restore the original dpi setting only if one such app is opened and closed, or in case more than one such app is launched, only if the first app is closed last.
Secondly, somehow some GUI elements other than menus and toolbars cannot be fixed in this way, e.g. cursor size in Krita workspace...
add a comment |Â
up vote
0
down vote
A less than perfect temporary solution that I've found is the following simple wrapper bash script that can be used in the relevant .desktop file instead of the executable of the app in question, e.g. masterpdfeditor4
:
#!/bin/bash
HiDPI="$(xdpyinfo | grep dots | awk -F'x' 'print $2' | awk -F' ' 'print $1')"
if [[ ! $HiDPI = 96 ]]
then
xrandr --dpi 96
masterpdfeditor4 "$@"
xrandr --dpi $HiDPI
else
masterpdfeditor4 "$@"
fi
This will restore the original dpi setting only if one such app is opened and closed, or in case more than one such app is launched, only if the first app is closed last.
Secondly, somehow some GUI elements other than menus and toolbars cannot be fixed in this way, e.g. cursor size in Krita workspace...
add a comment |Â
up vote
0
down vote
up vote
0
down vote
A less than perfect temporary solution that I've found is the following simple wrapper bash script that can be used in the relevant .desktop file instead of the executable of the app in question, e.g. masterpdfeditor4
:
#!/bin/bash
HiDPI="$(xdpyinfo | grep dots | awk -F'x' 'print $2' | awk -F' ' 'print $1')"
if [[ ! $HiDPI = 96 ]]
then
xrandr --dpi 96
masterpdfeditor4 "$@"
xrandr --dpi $HiDPI
else
masterpdfeditor4 "$@"
fi
This will restore the original dpi setting only if one such app is opened and closed, or in case more than one such app is launched, only if the first app is closed last.
Secondly, somehow some GUI elements other than menus and toolbars cannot be fixed in this way, e.g. cursor size in Krita workspace...
A less than perfect temporary solution that I've found is the following simple wrapper bash script that can be used in the relevant .desktop file instead of the executable of the app in question, e.g. masterpdfeditor4
:
#!/bin/bash
HiDPI="$(xdpyinfo | grep dots | awk -F'x' 'print $2' | awk -F' ' 'print $1')"
if [[ ! $HiDPI = 96 ]]
then
xrandr --dpi 96
masterpdfeditor4 "$@"
xrandr --dpi $HiDPI
else
masterpdfeditor4 "$@"
fi
This will restore the original dpi setting only if one such app is opened and closed, or in case more than one such app is launched, only if the first app is closed last.
Secondly, somehow some GUI elements other than menus and toolbars cannot be fixed in this way, e.g. cursor size in Krita workspace...
answered Feb 10 at 13:37
Sadi
8,56543748
8,56543748
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1004799%2fhow-to-resolve-hidpi-problem-with-qt-apps%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password