Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Make QTableView rows expandable and collapsable

    General and Desktop
    4
    4
    4458
    Loading More Posts
    • 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
      Avihay last edited by

      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 Reply Quote 0
      • D
        dbzhang800 last edited by

        Hi,

        You should use QTreeView instead of QTableView.

        Regards,

        1 Reply Last reply Reply Quote 0
        • G
          giesbert last edited by

          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 Reply Quote 0
          • A
            andre last edited by

            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 Reply Quote 0
            • First post
              Last post