Unsolved Add item outside of model to GridView
-
Hi,
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.
-
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
ProgramButton
delegate in aGridView
. As there are many programs, theGridView
has 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 theGridView
which can perform other actions not related to the programs. The problem is, that these additional buttons have nothing in common with myProgramButton
, so incorporating them into the model seems like evil hacking.This is why a
Grid
would be appropriate. I could simply make aRepeater
for myProgramButtons
and add the other buttons after theRepeater
. 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.