How to add default text to combobox(qMRMLNodeComboBox) before opening any customize model.

,

we have customised model. The GUI is written in XML code. Depending on XML tag qSlicerCLIModuleWidgetPrivate class function is called and dynamically combo box is created. We wanted to add some default text to combo box object. qMRMLNodeComboBox class has setBaseName function. We are able to call the function. But unable to add existing labels as default text. We wanted to add default text label as “Create new Model”. Please refer attached image.

DefaultText

qMRMLNodeComboBox has a regular QComboBox, which does not support default text. This feature is only implemented in ctkComboBox.

1 Like

Is it possible to use ctkComboBox in qMRMLNodeComboBox class?

If you use default text of “Create new Model”, won’t that be confusing because it will be separate from the selection in the qMRMLNodeComboBox that is called “Create new Model”?

Can you describe more of your use case? Are you actually just trying to default select the action so that it will create a new model whenever you use your module?