Solved Qt Installer 3.1.0: change package category using the scripting api
-
The new Qt Installer based on Installer Framework 3.1.0 added new gui elements not documented in the controller scripting docs.
How can the package catagory be changed using the scripting api? I would like to be able to change the package category from Latest Releases to Archive:
-
This is an excellent question! I searched on the Qt Installer Framework Manual and I found nothing. Afaik, they updated the installer without adding a way to click on "Archive" and "Refresh", using a script.
Can someone answer this question please?
-
Hi,
That's a question you should bring to the interest mailing list. You'll find there QtIF developers/maintainers. This forum is more user oriented.
-
@Katja-Marttila can you share information about this?
-
We have updated the documentation so from 3.1.2 onwards this will be documented too. But here is a code snippet of how to fetch from categories using controller scripts:
Controller.prototype.ComponentSelectionPageCallback = function() { var page = gui.pageWidgetByObjectName("ComponentSelectionPage"); // if GategoryGroupBox is visible, check one of the checkboxes // and the Fetch before selecting components var groupBox = gui.findChild(page, "CategoryGroupBox") if (groupBox) { console.log("gropupbox found") // findChild second argument is the displayname of the checkbox var checkBox = gui.findChild(page, "Archive"); if (checkBox) { console.log("CheckBox found") console.log("Checkbox name: " + checkBox.text) if (checkBox.checked == false) { checkBox.click() var fetchButton = gui.findChild(page, "FetchCategoryButton") if (fetchButton) { console.log("fetchButton found") fetchButton.click(); } else { console.log("fetchButton NOT found") } } } else { console.log("CheckBox NOT found") } } else { console.log("gropupbox NOT found") } // add qt components }
-
@Katja-Marttila Thank you very much! The code snippet seems to be exactly what i was looking for. And I really appreciate the effort to keep the documentation up to date.