Hello,

I would like to modify the extraSelectors of QQmlFileSelector at runtime
and have QML load the new QML file from the appropriate selector folder.
I have gotten this to work by calling setExtraSelectors() from a C++
object I have exposed to QML and then forcing a re-evaluation of the
Loader's source property:

Loader {
     id: myLoader
     source: Qt.resolvedUrl("MyItem.qml")
}

Connections {
     target: myCppObject
     onSelectorChanged: myLoader.source = Qt.resolvedUrl("MyItem.qml")
}

Now, for my use case I really need the ability to achieve the same
behavior without using Loader or Component. I essentially want something
like this:

MyItem { }

Connections {
     target: myCppObject
     onSelectorChanged: // when selector changes, the MyItem instance
     above is automatically resolved to the MyItem definition in the
     appropriate selector folder.

How can this be accomplished?

Thanks!
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to