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. How to add a component onto the whole row of a multi-column TableView?
Forum Updated to NodeBB v4.3 + New Features

How to add a component onto the whole row of a multi-column TableView?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
tableviewrowmulti-columnanchoring
5 Posts 2 Posters 1.1k Views 1 Watching
  • 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.
  • jeanmilostJ Offline
    jeanmilostJ Offline
    jeanmilost
    wrote on last edited by jeanmilost
    #1

    For a Qt Quick controls 2 project, I needed to create a custom TableView, containing several columns, as shown on the below screenshot:
    tableview.png

    This tree works well, however I need to add an optional progress bar, which may be visible on each item, as shown on the below image:
    tableview with progress.png

    I initially though to add this progress bar in the item delegate, however this seems not to be possible, because the delegate is called for each cell independently, and not once for the whole row. And now I have no idea about how to add a such component.

    Have anybody an idea about how to add a such progress bar to my rows?

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by fcarney
      #3

      Another possibility is a popup or item the appears above the delegate and tracks its position. When progress is finished then this item goes away. This would not require resizing delegates to make room. It could just sit above the delegate tracking its position inside the table.

      Edit: The trick is detecting the column and only making changes from column == 0

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      0
      • fcarneyF Offline
        fcarneyF Offline
        fcarney
        wrote on last edited by
        #2

        You can detect from the delegate which row the delegate is in. Also, you can provide a progress value to all delegates.

        1 Detect column 0, if progress is not 100% then display bar below normal delegate info. Make progress bar width of table. Keep rest of delegate to delegate width.
        2 For all rows resize height of delegates to allow room when progress is not 100%.

        I am not 100% sure this will work. You can also play around with the older tableview from controls 1. It has a row delegate in addition to a regular delegate.

        C++ is a perfectly valid school of magic.

        1 Reply Last reply
        0
        • fcarneyF Offline
          fcarneyF Offline
          fcarney
          wrote on last edited by fcarney
          #3

          Another possibility is a popup or item the appears above the delegate and tracks its position. When progress is finished then this item goes away. This would not require resizing delegates to make room. It could just sit above the delegate tracking its position inside the table.

          Edit: The trick is detecting the column and only making changes from column == 0

          C++ is a perfectly valid school of magic.

          1 Reply Last reply
          0
          • jeanmilostJ Offline
            jeanmilostJ Offline
            jeanmilost
            wrote on last edited by
            #4

            @fcarney thank you very much, I'll try that as soon as possible

            fcarneyF 1 Reply Last reply
            0
            • jeanmilostJ jeanmilost

              @fcarney thank you very much, I'll try that as soon as possible

              fcarneyF Offline
              fcarneyF Offline
              fcarney
              wrote on last edited by
              #5

              @jeanmilost Because of z ordering issues between delegates you will most likely need a popup.

              C++ is a perfectly valid school of magic.

              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