<?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 SwipeView is covering entire window]]></title><description><![CDATA[<p dir="auto">I am having some problems if i use swipe view and i have written following code:</p>
<pre><code>import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Controls 2.2

Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Swipe View")

    MainForm {
        anchors.fill:parent

        Rectangle{
            id:rightRect
            anchors.right:parent.right
            width: parent.width*0.50
            height:parent.height
            color:"yellow"
        }

        Rectangle{
            id:leftRect
            width:parent.width*0.50
            height:parent.height
            color:"lightgreen"
            border.color:"red"
            anchors.right:rightRect.left
            SwipeView{
                id:swipeView
                anchors.fill : leftRect
                //Layout.fillWidth: true
                currentIndex: 0
                interactive: false
                Page{
                    id:page1

                    Rectangle{
                        width:parent.width
                        height:parent.height
                        color:"lightgreen"
                        Button{
                            text:"move to 2"
                            onClicked: swipeView.currentIndex = 1
                        }
                    }
                }

                Page{
                    id:page2
                    Rectangle{
                        width:parent.width
                        height:parent.height
                        color:"lightblue"
                        Button{
                            text:"move to 1"
                            onClicked: swipeView.currentIndex = 0
                        }
                    }
                }
            }
        }
    }
}
</code></pre>
<p dir="auto">Below are the screen shots:</p>
<ol>
<li>Initially i have set current index to <strong>"0"</strong> but index "1" blue area is visible and it's covering the right area(Yellow rectangle):</li>
</ol>
<p dir="auto"><a href="https://i.stack.imgur.com/8lvZp.png" target="_blank" rel="noopener noreferrer nofollow ugc"><img src="https://i.stack.imgur.com/8lvZp.png" alt="enter image description here" class=" img-fluid img-markdown" /></a></p>
<ol start="2">
<li>if I click on <strong>move to 2 button</strong> then the yellow rect is visible as expected.</li>
</ol>
<p dir="auto"><a href="https://i.stack.imgur.com/d3HBV.png" target="_blank" rel="noopener noreferrer nofollow ugc"><img src="https://i.stack.imgur.com/d3HBV.png" alt="enter image description here" class=" img-fluid img-markdown" /></a></p>
<p dir="auto">Now, Even if I click on <strong>move to 1 button</strong> I need same behavior ie., yellow rect should be visible all the time.How to achieve this ??</p>
]]></description><link>https://forum.qt.io/topic/81722/qml-swipeview-is-covering-entire-window</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 19:01:04 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/81722.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 Jul 2017 07:22:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QML SwipeView is covering entire window on Wed, 26 Jul 2017 13:40:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yashpal">@<bdi>Yashpal</bdi></a> .. I Found the answer i should use clip ie.,</p>
<pre><code>Rectangle{
            id:leftRect
            width:parent.width*0.50
            height:parent.height
            color:"lightgreen"
            border.color:"red"
            anchors.right:rightRect.left
            clip:true    //added this
            SwipeView{
</code></pre>
]]></description><link>https://forum.qt.io/post/406964</link><guid isPermaLink="true">https://forum.qt.io/post/406964</guid><dc:creator><![CDATA[pra7]]></dc:creator><pubDate>Wed, 26 Jul 2017 13:40:03 GMT</pubDate></item><item><title><![CDATA[Reply to QML SwipeView is covering entire window on Thu, 27 Jul 2017 03:14:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pra7">@<bdi>pra7</bdi></a> said in <a href="/post/406964">QML SwipeView is covering entire window</a>:</p>
<blockquote>
<p dir="auto">w</p>
</blockquote>
<p dir="auto">That's cool. This solution you came up with is perfect.</p>
]]></description><link>https://forum.qt.io/post/407030</link><guid isPermaLink="true">https://forum.qt.io/post/407030</guid><dc:creator><![CDATA[Yashpal]]></dc:creator><pubDate>Thu, 27 Jul 2017 03:14:36 GMT</pubDate></item><item><title><![CDATA[Reply to QML SwipeView is covering entire window on Wed, 26 Jul 2017 13:40:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yashpal">@<bdi>Yashpal</bdi></a> .. I Found the answer i should use clip ie.,</p>
<pre><code>Rectangle{
            id:leftRect
            width:parent.width*0.50
            height:parent.height
            color:"lightgreen"
            border.color:"red"
            anchors.right:rightRect.left
            clip:true    //added this
            SwipeView{
</code></pre>
]]></description><link>https://forum.qt.io/post/406964</link><guid isPermaLink="true">https://forum.qt.io/post/406964</guid><dc:creator><![CDATA[pra7]]></dc:creator><pubDate>Wed, 26 Jul 2017 13:40:03 GMT</pubDate></item><item><title><![CDATA[Reply to QML SwipeView is covering entire window on Wed, 26 Jul 2017 13:21:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pra7">@<bdi>pra7</bdi></a> That's how SwipeView works. It loads all the pages inside Swipe still, you can control this with Loader making only currentItem to be visible. You can check out an example of it in <a href="https://doc.qt.io/qt-5/qml-qtquick-controls2-swipeview.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qml-qtquick-controls2-swipeview.html</a></p>
]]></description><link>https://forum.qt.io/post/406961</link><guid isPermaLink="true">https://forum.qt.io/post/406961</guid><dc:creator><![CDATA[Yashpal]]></dc:creator><pubDate>Wed, 26 Jul 2017 13:21:04 GMT</pubDate></item></channel></rss>