<?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[Qml orientation animation]]></title><description><![CDATA[<p dir="auto">hi there,</p>
<p dir="auto">i started working with qml and got a problem.<br />
i like to animate my ui when the sreenorientation changes. but without black screen.<br />
i have googled a lot, but i can't get it working.</p>
<p dir="auto">i tried to do it like the first comment on "this ":<a href="http://www.developer.nokia.com/Community/Wiki/Implementing_orientation_change_animation_with_QML" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.developer.nokia.com/Community/Wiki/Implementing_orientation_change_animation_with_QML</a> site says.<br />
But i cant get it working because the connect is not possible with my qmlapplicationviewer.<br />
How can i connect a signal of my qmlapplicationviewer to a function in my main.qml?</p>
<p dir="auto">Thanks in advance!</p>
<p dir="auto">my main.cpp:</p>
<p dir="auto">@QScopedPointer&lt;QApplication&gt; app(createApplication(argc, argv));<br />
QScopedPointer&lt;QmlApplicationViewer&gt; viewer(QmlApplicationViewer::create());<br />
viewer-&gt;setMainQmlFile(QLatin1String("qml/Tankinatornew/main.qml"));<br />
viewer-&gt;setOrientation(viewer-&gt;ScreenOrientationLockPortrait);<br />
viewer-&gt;showExpanded();@</p>
]]></description><link>https://forum.qt.io/topic/13011/qml-orientation-animation</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 07:02:03 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/13011.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 11 Jan 2012 14:27:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qml orientation animation on Thu, 12 Jan 2012 11:49:29 GMT]]></title><description><![CDATA[<p dir="auto">I don't want to get into your code too much, but I can tell you how I did it. A simple, yet powerful solution, totally OS independent.</p>
<p dir="auto">In my main QML file, I set height and width by reading a property from C++. This property is being updated by a slot that is connected to QWidget::resize() (in this case, that would be QDeclarativeView::resize()).</p>
<p dir="auto">Also, you'll need to set this: viewer-&gt;setResizeMode(QDeclarativeView::SizeRootObjectToView);</p>
]]></description><link>https://forum.qt.io/post/123658</link><guid isPermaLink="true">https://forum.qt.io/post/123658</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Thu, 12 Jan 2012 11:49:29 GMT</pubDate></item><item><title><![CDATA[Reply to Qml orientation animation on Thu, 12 Jan 2012 10:11:00 GMT]]></title><description><![CDATA[<p dir="auto">ok, i was able to connect the signal to a function.<br />
but now i have another problem.<br />
i created a new class inheriting QDeclarativeView. This class should send a signal when its resizeEvent() is called. but that never happens without showing it. But when i show it i can't see my viewer, so there is an empty screen. i also tried to set its stylesheet transparent, but then the screen is white.<br />
How can i show "viewer" and let "my" run the resizeEvent on switching the phone?</p>
<p dir="auto">my code:<br />
@<br />
QScopedPointer&lt;QApplication&gt; app(createApplication(argc, argv));<br />
QScopedPointer&lt;QmlApplicationViewer&gt; viewer(QmlApplicationViewer::create());<br />
viewer-&gt;setMainQmlFile(QLatin1String("qml/Tankinatornew/main.qml"));<br />
viewer-&gt;setOrientation(viewer-&gt;ScreenOrientationLockPortrait);<br />
viewer-&gt;showExpanded();<br />
MyClass my;<br />
<a href="//my.showFullScreen" target="_blank" rel="noopener noreferrer nofollow ugc">//my.showFullScreen</a>();<br />
QObject <em>rootObject = dynamic_cast&lt;QObject</em>&gt;(viewer-&gt;getrootObject());<br />
QObject::connect(&amp;my, SIGNAL(data(QVariant)), rootObject, SLOT(updateori(QVariant)));</p>
<pre><code>return app-&gt;exec&amp;#40;&amp;#41;;@
</code></pre>
]]></description><link>https://forum.qt.io/post/123646</link><guid isPermaLink="true">https://forum.qt.io/post/123646</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 12 Jan 2012 10:11:00 GMT</pubDate></item></channel></rss>