Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Make QTableView rows expandable and collapsable

Make QTableView rows expandable and collapsable

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 4.9k 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.
  • A Offline
    A Offline
    Avihay
    wrote on last edited by
    #1

    Hi, I'm using QTableView to display alerts in a monitoring application. I would to add the following feature to the table:

    For each row there'll be a field, that once it's clicked it'll collapse all the alerts with the same subject (same value in a certain field) and instead display a single row. For that single row there'll be a field that once it's clikced, all the collapsed rows will be expanded again.

    I need this feature to enable the users to control the number of rows they see and control....

    How can it be done?

    Thanks.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on last edited by
      #2

      Hi,

      You should use QTreeView instead of QTableView.

      Regards,

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        If it should look like a tree, use QTreeWidget.
        Otherwise use a Filter Proxy model and implement some stuff for that (e.g. a checkable item which means

        checked = filtered

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Note that you can adapt how a tree looks, so even if it functions like one, it doesn't need to look like one.

          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