1 hour ago, Cuq said:But how to transfer a list from the main Python program to the QML Module ?
Ah, right. I misunderstood the question.
If you look at the perobject setting tool, you see that it does the following
self.setExposedProperties("SelectedObjectId", "ContainerID", "SelectedActiveExtruder", "MeshType")
It also defines the function
def getMeshType(self):
In the qml it then does the following:
UM.ActiveTool.properties.getValue("MeshType")
So in your case you could do something like
self.setExposedProperties("ObjectTypes") def getObjectTypes(self): return self._object_types model: UM.ActiveTool.properties.getValue("ObjectTypes")Edited by nallath
Removed trailing whitespaces
Recommended Posts
nallath 1,124
The Per Model Settings plugin already has a combobox, so you could have a look at that.
As for getting a list of files in a directory: https://stackoverflow.com/questions/3207219/how-do-i-list-all-files-of-a-directory
You might need to create a ListModel to display the values that you want in the combobox.
Edited by nallathLink to post
Share on other sites
Cuq 206
Thank you @nallath for you answer. My problem was not really to get the list of files but it's on the QML side.
How to define the "Model" attribute of the Combobox . right now I have the possibility to hard coded the list :
But how to transfer a list from the main Python program to the QML Module ?
Link to post
Share on other sites