Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QtCreator - JSON-Based Wizards and question about Combo Boxes



  • Hello,

    A quick question about checkbox in JSON-Based Wizards.
    Is it possible to create dependent checkboxes on one field? For example the second option depends on the first option. I will give a simple example:

    "pages":
        [
            {
                "trDisplayName": "Options",
                "trShortTitle": "The second option depends on the first option",
                "typeId": "Fields",
                "data":
                [
                {
                    "name": "CB_1",
                    "trDisplayName": "Options:",
                    "type": "ComboBox",
                    "data":
                    {
                        "items": [ { "trKey": "<Custom>", "value": "" },
                                   "Option_1", "Option_2"]
                    }
                },
                {
                    "name": "CB_2",
                    "trDisplayName": "Seconds options:",
                    "type": "ComboBox",
                    "data":
                    {
                        "items": [ { "trKey": "Option_1_1", "value": "", "condition": "%{JS: value('CB_1') === 'Option_1'}" },
                                   { "trKey": "Option_1_2", "value": "", "condition": "%{JS: value('CB_1') === 'Option_1'}" },
                                   { "trKey": "Option_2_1", "value": "", "condition": "%{JS: value('CB_1') === 'Option_2'}" }]
                    }
                }
                ]
            }
        ]
    

    Unfortunately, this code doesn't work. When I change the first option, the second does not refresh. It works when I divide combo boxes into different fields.

    Any suggestions?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You should add the versions you are currently working with.



  • Of course!
    QtCreator 4.10.1 based on Qt 5.13.1.

    Second question:
    Is it possible to add scrollbar to page where I have many widgets? Now I have to resize window to fit widgets.


  • Lifetime Qt Champion

    @woocom said in QtCreator - JSON-Based Wizards and question about Combo Boxes:

    Is it possible to add scrollbar to page where I have many widgets?

    Yes, https://doc.qt.io/qt-5/qscrollarea.html


Log in to reply