use gui.setTextItems in Qt installer framework
-
Hello,
In Qt installer framework...
I have a ui file containing a QTreeWidget
<layout class="QVBoxLayout" name="verticalLayout">
...
<item>
<widget class="QGroupBox" name="groupBox_2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QTreeWidget" name="treeWidget">
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>Serial Number</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</item>
</layout>In javaScript file, I would like to update this QTreeWidget dynamically, so I created this function:
Component.prototype.buildList = function()
{
var widget = gui.pageWidgetByObjectName("DynamicCameraSelection");
if (widget != null)
{
var listWidget = widget.groupBox_2.treeWidget;
listWidget.clear();
var stringlist = [];for (var i = 0; i < detectedCameras.length; i++) { stringlist += detectedCameras[i].name; stringlist += detectedCameras[i].serial; console.log(stringlist); console.log(widget.groupBox_2.treeWidget); } gui.setTextItems(widget.groupBox_2.treeWidget, stringlist); }}
I can see that I am entering the loop, stringlist variable is updated. It is passed through gui.setTextItems.
Target widget.groupBox_2.treeWidget is found, not null.
I have no error message.
And component is not updated in resulting installer.
Could you help me?