I am trying to make a model flexible by adapting all my gp directly from a specific caliber.
I want to make the choose of the caliber by an app, which ask directly the caliber from an enum editor.
Once I have this parameter I can go ahead and set all the gp directly with python.
This is how I want to handle this
Now I am already stucked by reading the caliber given in the enum editor.
I gave 3 items: 16 / 25 /32
I thought it was easy to set my parameter such like:
But I can't find the right way to do the job.
I am looking in the AdvancedCustomizedParameterizationApp.ame
But because of my poor python level (actually 0), it is not successfull
Thanks for any tip
Solved! Go to Solution.
The enumeration widget is close to a combobox. If you need help, you should look at Qt QComboBox class documentation.
You have then to properties available.
You can try this in your code
ng_parameter = self.my_enum_editor.currentIndex()
You will probably need for your code to update itself when you interact with your GUI.
=> use the connect method
self.my_enum_editor = QComboBox() self.my_enum_editor.addItems(['16', '25', '32']) self.my_enum_editor.currentIndexChanged.connect(se
lf.my_update_function) def my_update_function(self, index) : print index print self.my_enum_editor.currentIndex() # both methods should print the same results
This should help you.