Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
i'm trying to crate a small dialog to configure my project, and i need to use some ComboBox, but i can add values to them...
I need to do this in the Script Editor, the code should be inside the Vpb file.
I tried with this code, but i got an error using the addItem
xml = """<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>vrFimConfigurationPlugin</class>
<widget class="QWidget" name="vrFimConfigurationPluginGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Configurazione</string>
</property>
<layout class="QVBoxLayout" name="FimCfgDialogLay">
<item>
<widget class="QLabel" name="Title">
<property name="text">
<string>My Combo Title</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="_MyCombo">
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
"""
MyDialog = vrWidget(xml)
MyDialog.setToolWindow(True)
myCombo = findQObject(MyDialog.getQObject(), "_MyCombo")
myCombo.addItem("My Value")
Where i am wrong? Or i have to change approach?
Best
Chris
Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn
![]()
Solved! Go to Solution.