When Rectangle not get load in Qt Qml based Application ?
-
Hi i have added the below code in qml. i am loading this qml using mvc based 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") } }in the output
i get the console output : qml: Print
why it open this screen and not show the rectangle ? and why i am not able to load rectangle ?
Why when i click on close at that time it not close this window also ?
How to debug and find root cause of this type of problem?
because the code is working fine and not crash but just only when load the qml at that time this problem come
-
Hi i have added the below code in qml. i am loading this qml using mvc based 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") } }in the output
i get the console output : qml: Print
why it open this screen and not show the rectangle ? and why i am not able to load rectangle ?
Why when i click on close at that time it not close this window also ?
How to debug and find root cause of this type of problem?
because the code is working fine and not crash but just only when load the qml at that time this problem come
@Qt-embedded-developer This issue happen due to
calling the below line into class constructor :
pPtr->installEventFilter(this);And i have written the below function def:
bool Bapplication::eventFilter(QObject *watched, QEvent *event)
{return true;
} -
Q Qt embedded developer has marked this topic as solved on