Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Add item outside of model to GridView

Add item outside of model to GridView

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 640 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maxwell31
    wrote on last edited by maxwell31
    #1

    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.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      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.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maxwell31
        wrote on last edited by
        #3

        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 a GridView. As there are many programs, the GridView 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 the GridView which 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 Grid would be appropriate. I could simply make a Repeater for my ProgramButtons and add the other buttons after the Repeater. But as I said, there I would have the problem of snapping

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by dheerendra
          #4

          When you say 'additional buttons', I'm assuming that all have similar characterstics. For this can try making the conditional delagates.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved