Is it possible to get Qt error messages when using dynamically created items?
I\'ve installed a message handler to capture Qt output at run time:
qIn
You should read and follow documentation.
What you do not check is that component.status must be equal to Component.Ready
before calling to component.createObject
.
If the file somehow failed to load, as it does not parse correctly, component.status
will be equal to Component.Error
, and you should call errorString() to get more information.
var component = Qt.createComponent( "config.qml" );
if( component.status != Component.Ready )
{
if( component.status == Component.Error )
console.debug("Error:"+ component.errorString() );
return; // or maybe throw
}
var dlg = component.createObject( parentId, {} );
Anyway you should always assert component.status == Component.Ready
before calling createObject()
.