<?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[When Rectangle not get load in Qt Qml based Application ?]]></title><description><![CDATA[<p dir="auto">Hi i have added the below code in qml. i am loading this qml using  mvc based code.</p>
<pre><code>import QtQuick 2.12
import QtQuick.Window 2.12
import QtGraphicalEffects 1.12
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.12
import QtQuick.VirtualKeyboard 2.0
import QtQuick.VirtualKeyboard.Settings 2.0

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    Rectangle{
        width: 200
        height: 400
        color: "red"
    }

    Component.onCompleted: {
        console.log("Print")
    }
}

</code></pre>
<p dir="auto">in the output</p>
<p dir="auto">i get the console output : <em>qml: Print</em></p>
<p dir="auto"><strong>why it open this screen and not show the rectangle ? and why i am not able to load rectangle ?<br />
Why when i click on close at that time it not close this window also ?</strong></p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/9ae8df15-e8b1-4e2b-9ac5-8aa12e0979b1.png" alt="3d3874fe-120f-4505-8848-5326330d3e63-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>How to debug and find root cause of this type of problem?</strong></p>
<p dir="auto">because the code is working fine and not crash but just only when load the qml at that time this problem come</p>
]]></description><link>https://forum.qt.io/topic/154909/when-rectangle-not-get-load-in-qt-qml-based-application</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Jul 2026 10:01:08 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/154909.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Feb 2024 11:07:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to When Rectangle not get load in Qt Qml based Application ? on Tue, 27 Feb 2024 13:48:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt-embedded-developer">@<bdi>Qt-embedded-developer</bdi></a> This issue happen due to</p>
<p dir="auto">calling the below line into class constructor :</p>
<pre><code>pPtr-&gt;installEventFilter(this);
</code></pre>
<p dir="auto">And i have written the below function def:</p>
<p dir="auto">bool Bapplication::eventFilter(QObject *watched, QEvent *event)<br />
{</p>
<p dir="auto">return true;<br />
}</p>
]]></description><link>https://forum.qt.io/post/791545</link><guid isPermaLink="true">https://forum.qt.io/post/791545</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Tue, 27 Feb 2024 13:48:32 GMT</pubDate></item></channel></rss>