<?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[Popup Qt Quick event handler issue]]></title><description><![CDATA[<p dir="auto">Hi guys, i use 2 popup like below code in qml. i want that when popup2 open, btn1 is not hovered and change it background to green. How can i do that? Thanks in advance for any help</p>
<pre><code>Popup {
	id: popup1
	width: 200
	height: 300
	modal: true
	focus: true
	contentItem: Rectangle {
		id: popup1Container
		Button {
			id: btn1
			background: Rectangle {
				color: btn1.hovered ? "red" : green
			}
			onClicked: popup2.open()
		}
	}
}

Popup {
	id: popup2
	width: 200
	height: 300
	modal: true
	focus: true
	contentItem: Rectangle {
		id: popup1Container
		Button {
			id: btn2
		}
	}
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/164248/popup-qt-quick-event-handler-issue</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 21:42:26 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164248.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 12 Feb 2026 04:34:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Popup Qt Quick event handler issue on Wed, 25 Feb 2026 01:53:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/grecko">@<bdi>GrecKo</bdi></a> if the code like below:</p>
<pre><code>Rectangle {
	id: rect
	
	width: 100
	height: 100
	color: mouseArea.containsMouse ? "red" : "green"
	
	MouseArea {
		id: mouseArea
		anchors.fill: rect
		hoverEnabled: true
		onClicked: popup1.open()
	}
}

Popup {
	id: popup1
	width: 200
	height: 300
	modal: true
	focus: true
	anchors.centerIn: parent
	closePolicy: Popup.CloseOnEscape
	contentItem : Rectangle {
	}
}
</code></pre>
<p dir="auto">The color of id  "rect"  auto change to "red" when popup1 opened. (the popup auto "catch" hovered behavior  on mousearea)</p>
<p dir="auto">But if i have 2 popup like the first post,  when popup2 opened (by click on btn1 on popup1) , btn1 will keep hovered behavior (not "catch" by popup2)</p>
]]></description><link>https://forum.qt.io/post/836561</link><guid isPermaLink="true">https://forum.qt.io/post/836561</guid><dc:creator><![CDATA[Tai Hoang]]></dc:creator><pubDate>Wed, 25 Feb 2026 01:53:18 GMT</pubDate></item><item><title><![CDATA[Reply to Popup Qt Quick event handler issue on Tue, 24 Feb 2026 10:22:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tai-hoang">@<bdi>Tai-Hoang</bdi></a> said in <a href="/post/836180">Popup Qt Quick event handler issue</a>:</p>
<blockquote>
<p dir="auto">i want that when popup2 open, btn1 is not hovered and change it background to green.</p>
</blockquote>
<p dir="auto">What have you tried and what is blocking you?<br />
You currently have a binding to determine the background color of <code>btn1</code>. Have you tried changing that binding to account for your additional condition?</p>
]]></description><link>https://forum.qt.io/post/836544</link><guid isPermaLink="true">https://forum.qt.io/post/836544</guid><dc:creator><![CDATA[GrecKo]]></dc:creator><pubDate>Tue, 24 Feb 2026 10:22:30 GMT</pubDate></item><item><title><![CDATA[Reply to Popup Qt Quick event handler issue on Tue, 24 Feb 2026 01:53:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mzimmers">@<bdi>mzimmers</bdi></a> i am using Qt 6.7.2 on ubuntu 22.04 (run on vmware). My app  is not select any Style.</p>
]]></description><link>https://forum.qt.io/post/836524</link><guid isPermaLink="true">https://forum.qt.io/post/836524</guid><dc:creator><![CDATA[Tai Hoang]]></dc:creator><pubDate>Tue, 24 Feb 2026 01:53:24 GMT</pubDate></item><item><title><![CDATA[Reply to Popup Qt Quick event handler issue on Mon, 23 Feb 2026 13:58:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tai-hoang">@<bdi>Tai-Hoang</bdi></a> what version of Qt are you using, and what platform? Also, does your app select a Style?</p>
]]></description><link>https://forum.qt.io/post/836509</link><guid isPermaLink="true">https://forum.qt.io/post/836509</guid><dc:creator><![CDATA[mzimmers]]></dc:creator><pubDate>Mon, 23 Feb 2026 13:58:08 GMT</pubDate></item><item><title><![CDATA[Reply to Popup Qt Quick event handler issue on Mon, 23 Feb 2026 02:34:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mzimmers">@<bdi>mzimmers</bdi></a> thank you for your support!</p>
<p dir="auto">You are right, I want to disable hover behavior on btn1( on popup1) when popup2 visible.<br />
( I need to change background of btn1 to green when popup2 opened)</p>
<p dir="auto">But it seen that the code you show don't help me. I have implemented like your code but btn1 also "red" when popup2 opened</p>
]]></description><link>https://forum.qt.io/post/836494</link><guid isPermaLink="true">https://forum.qt.io/post/836494</guid><dc:creator><![CDATA[Tai Hoang]]></dc:creator><pubDate>Mon, 23 Feb 2026 02:34:29 GMT</pubDate></item><item><title><![CDATA[Reply to Popup Qt Quick event handler issue on Mon, 16 Feb 2026 19:31:15 GMT]]></title><description><![CDATA[<p dir="auto">I'm not sure what behavior you expect, but I think you want to disable hovered behavior on the first popup button while the second popup is up. If that's true, here's your code rewritten into a full QML page (I also added a Loader example to give you an idea of an alternative implementation). If I understand your requirement, this works for me.</p>
<pre><code>import QtQuick
import QtQuick.Controls
Window {
    width: 640
    height: 480
    visible: true

    Component.onCompleted: {
        loader.item.open()
    }

    Loader {
        id: loader
        sourceComponent: popupComponent
    }
    Popup {
        id: popup1
        width: 100
        height: 100
        x: 100
        y: 100
        padding: 0
        modal: true
        focus: true
        contentItem: Rectangle {
            id: popup1Container
            Button {
                id: btn1
                anchors.fill: parent
                background: Rectangle {
                    color: btn1.hovered ? "red" : "green"
                }
                onClicked: popup2.open()
            }
        }
    }

    Popup {
        id: popup2
        width: 100
        height: 100
        padding: 0
        closePolicy: Popup.NoAutoClose
        x: popup1.x + popup1.width
        y: popup1.y + popup1.height
        modal: true
        focus: true
        contentItem: Rectangle {
            id: popup2Container
            height: 100
            width: 100
            Button {
                id: btn2
                anchors.fill: parent
                background: Rectangle {
                    color: "yellow"
                }
                onClicked: popup2.close()
                Text {
                    text: "Close"
                    anchors.centerIn: parent
                }
            }
        }
    }
    Component {
        id: popupComponent
        Popup {
            width: 100
            height: 100
            modal: true
            focus: true
            background: Rectangle {
                id: popupContainer
                color: "blue"
                TapHandler {
                    onTapped: popup1.open()
                }
            }
        }
    }
}

</code></pre>
]]></description><link>https://forum.qt.io/post/836332</link><guid isPermaLink="true">https://forum.qt.io/post/836332</guid><dc:creator><![CDATA[mzimmers]]></dc:creator><pubDate>Mon, 16 Feb 2026 19:31:15 GMT</pubDate></item></channel></rss>