<?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[Two QmlApplicationViewers in an application]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">I want to <em>lock</em> screen orientation on Portrait for some qml pages and <em>lock</em> it on Landscape for another qml pages.  I didn't find a way to do it in QML.</p>
<p dir="auto">So here is my solution:</p>
<p dir="auto">I create 2 QmlApplicationViewers in the main.cpp, one is locked on Portrait and the other is locked on Landscape:</p>
<p dir="auto">@QmlApplicationViewer view1;<br />
view1.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);<br />
view1.showFullScreen();</p>
<p dir="auto">QmlApplicationViewer view2;<br />
view2.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);<br />
view2.close();@</p>
<p dir="auto">I also got some signals and slots to swith between those viewers. I thought this method should work. But a problem appears:</p>
<p dir="auto">the application is just take the view2's orientation into account. the two views seem to use the same orientation setting.</p>
<p dir="auto">My question is: how to solve this problem or anyone has other ideas to lock orientation for <em>specific</em> QML pages?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/topic/5240/two-qmlapplicationviewers-in-an-application</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 23:38:22 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/5240.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Apr 2011 13:50:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Two QmlApplicationViewers in an application on Wed, 08 Aug 2012 14:17:59 GMT]]></title><description><![CDATA[<p dir="auto">rishygupta, you have asked this question in a number of threads, a couple of which are very old.  Please open a separate thread for a new question and please don't duplicate your questions.  Thanks.</p>
]]></description><link>https://forum.qt.io/post/101106</link><guid isPermaLink="true">https://forum.qt.io/post/101106</guid><dc:creator><![CDATA[mlong]]></dc:creator><pubDate>Wed, 08 Aug 2012 14:17:59 GMT</pubDate></item><item><title><![CDATA[Reply to Two QmlApplicationViewers in an application on Wed, 08 Aug 2012 10:14:54 GMT]]></title><description><![CDATA[<p dir="auto">is it possible QmlApplicationViewer can be used or manipulated in other class rather than main;</p>
]]></description><link>https://forum.qt.io/post/101105</link><guid isPermaLink="true">https://forum.qt.io/post/101105</guid><dc:creator><![CDATA[rishygupta]]></dc:creator><pubDate>Wed, 08 Aug 2012 10:14:54 GMT</pubDate></item><item><title><![CDATA[Reply to Two QmlApplicationViewers in an application on Thu, 21 Apr 2011 10:08:55 GMT]]></title><description><![CDATA[<p dir="auto">You can rotate video page according to sensors.</p>
]]></description><link>https://forum.qt.io/post/84944</link><guid isPermaLink="true">https://forum.qt.io/post/84944</guid><dc:creator><![CDATA[minimoog77]]></dc:creator><pubDate>Thu, 21 Apr 2011 10:08:55 GMT</pubDate></item><item><title><![CDATA[Reply to Two QmlApplicationViewers in an application on Thu, 21 Apr 2011 08:36:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/minimoog77">@<bdi>minimoog77</bdi></a> ,but i can imagine, if i lock the application on portrait, all pages are locked on portait. Video page is included, i can use sensors to get orientation's changing signals to change qml elements' properties (width, height...etc), but i can't set orientation on Landscape. isn't it ?</p>
]]></description><link>https://forum.qt.io/post/84938</link><guid isPermaLink="true">https://forum.qt.io/post/84938</guid><dc:creator><![CDATA[huluyige]]></dc:creator><pubDate>Thu, 21 Apr 2011 08:36:46 GMT</pubDate></item><item><title><![CDATA[Reply to Two QmlApplicationViewers in an application on Wed, 20 Apr 2011 20:28:41 GMT]]></title><description><![CDATA[<p dir="auto">Yes, that was the idea, if you want full control of orientation.</p>
]]></description><link>https://forum.qt.io/post/84904</link><guid isPermaLink="true">https://forum.qt.io/post/84904</guid><dc:creator><![CDATA[minimoog77]]></dc:creator><pubDate>Wed, 20 Apr 2011 20:28:41 GMT</pubDate></item><item><title><![CDATA[Reply to Two QmlApplicationViewers in an application on Wed, 20 Apr 2011 17:08:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/minimoog77">@<bdi>minimoog77</bdi></a>, i want to do it because, in my appli, there is a video player, i have to set it on Landscape, and for other QML pages, i want to locked it on portrait.</p>
<p dir="auto">you mean for the QmlApplicationViewer, l locke the application on portrait, and use accelerometers or orientation sensor to set orientation for video page?</p>
]]></description><link>https://forum.qt.io/post/84895</link><guid isPermaLink="true">https://forum.qt.io/post/84895</guid><dc:creator><![CDATA[huluyige]]></dc:creator><pubDate>Wed, 20 Apr 2011 17:08:31 GMT</pubDate></item><item><title><![CDATA[Reply to Two QmlApplicationViewers in an application on Wed, 20 Apr 2011 17:02:20 GMT]]></title><description><![CDATA[<p dir="auto">You will <em>lock</em> the orientation. Then you will use accelerometers to detect if it's orientation was changed, and you will manually orient the qml elements.</p>
<p dir="auto">But, why do you want locking the orientation both ways?</p>
]]></description><link>https://forum.qt.io/post/84893</link><guid isPermaLink="true">https://forum.qt.io/post/84893</guid><dc:creator><![CDATA[minimoog77]]></dc:creator><pubDate>Wed, 20 Apr 2011 17:02:20 GMT</pubDate></item><item><title><![CDATA[Reply to Two QmlApplicationViewers in an application on Wed, 20 Apr 2011 16:42:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/minimoog77">@<bdi>minimoog77</bdi></a>, thanks for your suggestion, But i didn't find a way to <em>lock</em> screen orientation using accelerometers, could you please explain it more?</p>
]]></description><link>https://forum.qt.io/post/84891</link><guid isPermaLink="true">https://forum.qt.io/post/84891</guid><dc:creator><![CDATA[huluyige]]></dc:creator><pubDate>Wed, 20 Apr 2011 16:42:32 GMT</pubDate></item><item><title><![CDATA[Reply to Two QmlApplicationViewers in an application on Wed, 20 Apr 2011 16:32:49 GMT]]></title><description><![CDATA[<p dir="auto">Why don't just read the accelerometers by yourself?</p>
]]></description><link>https://forum.qt.io/post/84889</link><guid isPermaLink="true">https://forum.qt.io/post/84889</guid><dc:creator><![CDATA[minimoog77]]></dc:creator><pubDate>Wed, 20 Apr 2011 16:32:49 GMT</pubDate></item><item><title><![CDATA[Reply to Two QmlApplicationViewers in an application on Wed, 20 Apr 2011 14:48:48 GMT]]></title><description><![CDATA[<p dir="auto">is it possible to set screen orientation on the fly?</p>
]]></description><link>https://forum.qt.io/post/84877</link><guid isPermaLink="true">https://forum.qt.io/post/84877</guid><dc:creator><![CDATA[huluyige]]></dc:creator><pubDate>Wed, 20 Apr 2011 14:48:48 GMT</pubDate></item></channel></rss>