Dynamically add buttons to a row and change their text
-
I'm new to QT and trying to use QT Design Studio for my first UI.
I created a custom tab button which is placed in a row item. Now I'm struggling with adding additional custom tab buttons dynamically by using another button. Additionally the text of the new button should to be changed to "New Button".Because my tab button is customized, a text item "tabText" is used. I already included
property alias tabText: tab.text
to the tab button code to get access to the text of the tab button. I tried "Connections" to solve this issue but wasn't successful.
Thank you for your help!
-
@JonB
Thank you for your response.
I think the whole QT framework is not as straightforward as it could be. I also can't find any information on how to best use the Qt tools.
That's why I'm not sure whether the complex UI can be designed in Qt Design Studio and the logic of the UI in Qt Creator.Perhaps someone can clear up the ambiguities.
-
C Christian Ehrlicher moved this topic from General and Desktop on
-
@Alvib Hi
I am not experienced in Design Studio so can not help you there, but I did something similar for a buttons menu, in code, with a ListModel and a delegate button and roles for the button text and button type. Then, adding buttons was just one line of code, by appending elements (buttons) to the list model. -
Hello guys,
I found more information regarding the designer-developer-workflow, which is described in the Qt Design Studio documentation. I have used Qt Design Studio to design my graphical user interface and Qt Creator for the logic. This means that all visual elements are ui.qml files and the logic code can be found in .qml files. -