Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Add item outside of model to GridView
maxwell31 last edited by maxwell31
I use a GridView to display a model, which creates buttons. However, I need to add another item (a button of a different type, outside of the model, created in qml) to this GridView. Is this possible?
I tried using a Grid as Child of a Flickable, but there I don't know how to make it snap to rows.
Both can't be done. Now any reason you would like add the different button to view ? Can you tell us what you wanted to achieve ? It may help us give you solution with GridView itself.
maxwell31 last edited by
Basically it is for controlling a machine via a touch screen. The machine has several programs. I have a model for these programs which I display through my own
ProgramButtondelegate in a
GridView. As there are many programs, the
GridViewhas several columns and rows and it is possible to flick through the columns. The design team demanded, that we also add some general buttons into the
GridViewwhich can perform other actions not related to the programs. The problem is, that these additional buttons have nothing in common with my
ProgramButton, so incorporating them into the model seems like evil hacking.
This is why a
Gridwould be appropriate. I could simply make a
ProgramButtonsand add the other buttons after the
Repeater. But as I said, there I would have the problem of snapping
When you say 'additional buttons', I'm assuming that all have similar characterstics. For this can try making the conditional delagates.