<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[android screen width always 360?]]></title><description><![CDATA[<p dir="auto">hi all,</p>
<p dir="auto">i am new to qml on android. i have created a sample app (using qt creator's "Qt Quick Application - Empty") , put the code below in main.cpp, and then run it on android devices,</p>
<pre><code>QScreen* primaryscreen = QGuiApplication::primaryScreen();
QRect rect = primaryscreen-&gt;geometry();
qreal width = qMin(rect.width(), rect.height());
qreal height = qMax(rect.width(), rect.height());
qDebug() &lt;&lt; "w: " &lt;&lt; (width) &lt;&lt; ", h: " &lt;&lt; (height);
</code></pre>
<p dir="auto">oneplus one (android 7.1.2), w: 360, h: 640<br />
redmi 5 (android 7.1.2), w: 360, h: 660<br />
Huawei P10 plus (android 7.1.2), w: 360, h: 660</p>
<p dir="auto">it seems width is always 360 and height is around 600 something, although the native resolution of all 3 devices are very different. i googling around and can't find doc explaining this 360 figure.</p>
<p dir="auto">is it a expected behavior?</p>
<p dir="auto">thx in advance!</p>
<p dir="auto">py</p>
<p dir="auto">PS: qt 5.11.2 open source, running on ubuntu 16.04 LTS</p>
]]></description><link>https://forum.qt.io/topic/95468/android-screen-width-always-360</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 16:07:24 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/95468.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Oct 2018 04:31:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to android screen width always 360? on Sat, 13 Oct 2018 06:57:23 GMT]]></title><description><![CDATA[<p dir="auto">oh, my mistake.</p>
<p dir="auto">i haven't paid attention to the very 1st line of code in the main.cpp, which is:</p>
<pre><code>QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
</code></pre>
<p dir="auto">after changing it to AA_DisableHighDpiScaling, the geometry(), availableGeometry(), etc work as expected.</p>
<p dir="auto">thanks</p>
<p dir="auto">py</p>
]]></description><link>https://forum.qt.io/post/486705</link><guid isPermaLink="true">https://forum.qt.io/post/486705</guid><dc:creator><![CDATA[pyhk]]></dc:creator><pubDate>Sat, 13 Oct 2018 06:57:23 GMT</pubDate></item><item><title><![CDATA[Reply to android screen width always 360? on Sat, 13 Oct 2018 02:07:39 GMT]]></title><description><![CDATA[<p dir="auto">thanks for pointing out availableGeometry()</p>
<p dir="auto">but the result is still the same. it seems QGuiApplication "masks" the underlying, real screen resolution, and QGuiApplication::primaryScreen() is always 360x600 something. at least it is what looks liked on android device.</p>
<p dir="auto">(i have tried a windows 10 tablet, with 3840×2160 display. the availableGeometry() returns 1920x1080. QGuiApplication does have some magic in itself)</p>
<p dir="auto">py</p>
]]></description><link>https://forum.qt.io/post/486693</link><guid isPermaLink="true">https://forum.qt.io/post/486693</guid><dc:creator><![CDATA[pyhk]]></dc:creator><pubDate>Sat, 13 Oct 2018 02:07:39 GMT</pubDate></item><item><title><![CDATA[Reply to android screen width always 360? on Thu, 11 Oct 2018 05:13:45 GMT]]></title><description><![CDATA[<p dir="auto">hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/pyhk">@<bdi>pyhk</bdi></a> said in <a href="/post/486290">android screen width always 360?</a>:</p>
<p dir="auto">try it with <code>availableGeometry </code></p>
]]></description><link>https://forum.qt.io/post/486295</link><guid isPermaLink="true">https://forum.qt.io/post/486295</guid><dc:creator><![CDATA[J.Hilk]]></dc:creator><pubDate>Thu, 11 Oct 2018 05:13:45 GMT</pubDate></item></channel></rss>