<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>My struggle with HiDPI monitors has come to an at least
workaround solution thanks to your responses, so many thanks!<br>
I'll try to summarize:</p>
<ol>
<li>PyQt(5) applications will behave well with this command:<br>
<pre class="lang-py s-code-block hljs python"><font size="+1"><code>QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, <span class="hljs-literal">True</span>)</code></font></pre>
</li>
<li><code></code>Whether this next command will also be needed
depends on your explicit (perhaps implicit) use of pixmaps with
HiDPIs available<br>
I had no benefit from it<br>
<pre class="lang-py s-code-block hljs python"><font size="+1"><code>QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, <span class="hljs-literal">True</span>)</code></font></pre>
</li>
<li>Unfortunately, matplotlib is separate from this and needs its
own adaptation of settings. This can be done by setting the
'dpi=' parameter in <b>every</b> call to figure:<br>
<tt><font size="+1">matplotlib.pyplot.figure(num=None,
figsize=None, dpi=MySetting, .... )<br>
</font><br>
</tt>But MySetting is a bit tricky: it basically must reverse
the scaling. The default dpi is: MySetting = 100. So, when your
scaling is 200%, then set MySetting=50. Is your scaling 300%,
then set MySetting=33.<br>
<br>
I don't know if there is a single command which could set dpi
for the session?<br>
<br>
</li>
<li>Thankfully the "devicePixelRatio" of QScreen basically has
Scaling/100, i.e. the values 1, 2, 3 for the above examples.
Therefore you can set:<br>
<font size="+1"><tt>MySetting = 100 /
int(QScreen.devicePixelRatio(app.primaryScreen()))<br>
<br>
</tt></font></li>
<li>In the rare case that you do not have several 4k and 8k
monitors to test with :-( you can use Xephyr as suggested by VA.<br>
Though when I tried the examples refernenced by himĀ
<a class="moz-txt-link-freetext" href="https://indigo.re/posts/2020-05-18-hidpi-testing.html">https://indigo.re/posts/2020-05-18-hidpi-testing.html</a> each one
crashed on my system! But in my need I came back and just tried
the small script and it worked! Script:
<a class="moz-txt-link-freetext" href="https://gitlab.com/hydrargyrum/attic/blob/master/xephyr-run-cmd/xephyr-run-cmd">https://gitlab.com/hydrargyrum/attic/blob/master/xephyr-run-cmd/xephyr-run-cmd</a><br>
<br>
</li>
<li>I can now start my program and run it in proper scale with
this command:<br>
<font size="+1"><tt>./xephyr-run-cmd -dpi 200 -screen 4000x2000
-- ./geigerlog</tt><tt><br>
</tt></font><br>
</li>
<li>And lastly a screenshot on a real 8k monitor on Win10:<br>
Full WidthxHeight is 2732x1443 (open it);<br>
and the user says he can even move it back and forth between an
8K and a FullHD monitor without distortion except for a wobble
in the transition !!?<br>
<br>
<img src="cid:part1.200CBE7A.EFE6F5FC@urkam.de" alt=""
moz-do-not-send="false" width="700" height="370"></li>
</ol>
<p>Thanks again, <br>
</p>
<p>ullix<br>
</p>
<p><br>
</p>
</body>
</html>