<?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[[solved] two forms in one project]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I have two main windows for the user to be shown.<br />
The first should be the initial one which is displayed at the beginning.<br />
Then there is a button which makes that the other window (form) should be shown instead.</p>
<p dir="auto">Therefore I want to make two QML-files and the only thing they have in common is the resolution (the page's width and height).</p>
<p dir="auto">How to show the other form (window) = qml file then on the onClick event ???</p>
<p dir="auto">Thank you</p>
]]></description><link>https://forum.qt.io/topic/15673/solved-two-forms-in-one-project</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 16:30:47 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/15673.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Apr 2012 11:19:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [solved] two forms in one project on Fri, 06 Apr 2012 16:10:55 GMT]]></title><description><![CDATA[<p dir="auto">Yeah, this works.<br />
Now, I also have an Item which is always visible because it is directly in <em>mainwindow</em>, a sibling of window1 and window2.</p>
]]></description><link>https://forum.qt.io/post/134889</link><guid isPermaLink="true">https://forum.qt.io/post/134889</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 06 Apr 2012 16:10:55 GMT</pubDate></item><item><title><![CDATA[Reply to [solved] two forms in one project on Fri, 06 Apr 2012 14:59:33 GMT]]></title><description><![CDATA[<p dir="auto">The following code does what you want:<br />
@<br />
Rectangle{<br />
id: mainWindow<br />
anchors.fill:parent</p>
<pre><code>property bool isWindow1Visible: true;

Rectangle{
    id: window1
    anchors.fill:parent
    visible: isWindow1Visible
}

Rectangle{
    id: window2
    anchors.fill:parent
    visible: !isWindow1Visible
}

MouseArea{
    anchors.fill:parent
    onClicked: {
        isWindow1Visible = !isWindow1Visible
    }
}
</code></pre>
<p dir="auto">}<br />
@</p>
<p dir="auto">No actual z-ordering, simply hide and reveal what you want.</p>
<p dir="auto">Also if you are targeting Symbian or Maemo the recommend solution at your problem would be the "Page and PageStack Navigation":<a href="http://doc.qt.nokia.com/qt-components-symbian/qt-components-pages-and-navigation-overview.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.nokia.com/qt-components-symbian/qt-components-pages-and-navigation-overview.html</a></p>
]]></description><link>https://forum.qt.io/post/134880</link><guid isPermaLink="true">https://forum.qt.io/post/134880</guid><dc:creator><![CDATA[favoritas37]]></dc:creator><pubDate>Fri, 06 Apr 2012 14:59:33 GMT</pubDate></item><item><title><![CDATA[Reply to [solved] two forms in one project on Fri, 06 Apr 2012 14:33:18 GMT]]></title><description><![CDATA[<p dir="auto">So you mean one qml file and one window is just z ordered over the other one ?</p>
]]></description><link>https://forum.qt.io/post/134877</link><guid isPermaLink="true">https://forum.qt.io/post/134877</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 06 Apr 2012 14:33:18 GMT</pubDate></item><item><title><![CDATA[Reply to [solved] two forms in one project on Fri, 06 Apr 2012 14:31:25 GMT]]></title><description><![CDATA[<p dir="auto">The easiest way would be to create those 2 views, add them in a qml file will you will load and then play with the visibility of the windows.</p>
]]></description><link>https://forum.qt.io/post/134876</link><guid isPermaLink="true">https://forum.qt.io/post/134876</guid><dc:creator><![CDATA[favoritas37]]></dc:creator><pubDate>Fri, 06 Apr 2012 14:31:25 GMT</pubDate></item></channel></rss>