Application crashes after fast load using ```Qt.createComponent```
-
Hi, I recently started using Qt.createComponent to dynamically load the pages in my application. example:
function onLogInSuccessful(username, fullName) { var component = Qt.createComponent("Dashboard.qml"); if (component.status === Component.Ready) { var signInWindow = component.createObject(null, { "usernameRef": username, "fullName": fullName }); // Pass the variable here signInWindow.visible = true; root.close(); } else { console.log("Error loading Dashboard.qml: " + component.errorString()); } }
After some time of testing my program I found out that the program crashes without any given error (the window of the app hides but the app is running) and I have to forcefully close it. If that wasn't clear enough I would be happy to provide more info
-
D dheerendra moved this topic from General and Desktop on
-
Does it crash or hide ?
Does this happen after login ?
How about commenting root.close() ?May be workable example will help.
-
If you are on WIndows and build with MIngw32 there is a nice a simple tool that use on test host,drmingw is save me in many time.
https://github.com/jrfonseca/drmingwPS
build the release with CONFIG+=force_debug_info -
@dheerendra said in Application crashes after fast load using ```Qt.createComponent```:
Does it crash or hide ?
Does this happen after login ?The window hides. The app is still working but the window hides.
It happens no matter if it is a login or any other window opening withvar component = Qt.createComponent("Dashboard.qml"); if (component.status === Component.Ready) { var signInWindow = component.createObject(null, { "usernameRef": username, "fullName": fullName }); // Pass the variable here signInWindow.visible = true; root.close(); } else { console.log("Error loading Dashboard.qml: " + component.errorString()); }
not using
root.close
isn't doing me any good. the other window opens but the previous window is still open