Is there a way to create a tableview inside a button click event?
Unsolved
QML and Qt Quick
-
When an object is created in the click event, the message expected token ',' is displayed...
Is there a way to refresh the tableview on click or create a table within the event?
Thanks for your help. -
Im not sure what are you trying to achieve but you cant create objects like this with java script... (since button handlers are js functions and are not evaluated as qml code) , consider using a loader and a check-able button
so that when the button is checked you set the loader visible or not visible (though you dont need a loader for that) or change the source component
somthing like this:Item{ Button{id: someButton } Loader{ visible: someButton.checked sourceComponent:TableVIew{...} } }
Also you might want to read this https://doc.qt.io/qt-5/qtqml-javascript-dynamicobjectcreation.html