Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
QDS 4.2
-
None
Description
*The project is attached (Automotive.zip)
Singletons from imported Modules are not available in the Binding Editor.
In my code, there's an Automotive module, which contains MainModel.qml.
MainModel.qml is a singleton.
//MainModel.qml pragma Singleton import QtQuick 2.15 QtObject { id: mainmodel enum ClusterMode { ModeNormal, ModeSport, ModeEco } property int clusterMode: MainModel.ModeNormal property bool introSequenceStarted: false property bool introSequenceCompleted: false ...
In the same directory as MainModel.qml, there is qmldir. (Ignore the Japanese comments as they are not related to this ticket)
Pasting to the "code" here breaks the format, hense the screenshot.
I also have automotive_module.qmlproject in the same foler.
In the root .qmlproject(Automotive.qmlproject), the directory where these files exist are specified.
ModuleFiles {
files: [
"imports/Automotive/automotive_module.qmlproject",
]
}
importPaths: [ "imports","imports/Automotive"]
In fact, "import Automotive" line in the BaseGauge.ui.qml(the concerned file) isn't causing any error, so we can conclude that there's no issue in the Module import.
Now, what I want to do is this:
duration: MainModel.gaugesValueChangeDuration;
As you can see, I want to bind a property exposed from the singleton, MainModel.
However, when I try to do this on the Binding Editor, it doesn't show "MainModel," so I need to write it in the code manually.
Binding Editor should show all the things available for binding.