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. QTreeView Filter
Forum Updated to NodeBB v4.3 + New Features

QTreeView Filter

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

    Hello all,

    Is it possible to filter a child node only, without showing its parents?
    Example (strings used):

    Parent("okay")
    -Child("cool")
    Parent("cool")
    -Child("cool")

    In my case, I want to match the strings "cool" for example, It would only show that first Child("cool"), and the second parent("cool"), and its Child("cool"), but not the parent of the first node because it doesn't match the string?

    Thanks in advance.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      loladiro
      wrote on last edited by
      #2

      If the first parent isn't displayed how would you (conceptually) want to display the child?

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

        it is not possible. A tree always starts with the parent index unknown (root aof a tree) and the iterates all childs. From thoes their children etc.
        If you filter out a parent, it's children will never be met, as the parent is out.

        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
        • D Offline
          D Offline
          dangelog
          wrote on last edited by
          #4

          Of course, it's possible to implement a custom proxy model that applies your filter. I just don't think that something like that is already available in Qt.

          Software Engineer
          KDAB (UK) Ltd., a KDAB Group company

          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