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 item if QTreeView or QStandartItem unvisible
Qt 6.11 is out! See what's new in the release blog

Make item if QTreeView or QStandartItem unvisible

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.3k 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.
  • R Offline
    R Offline
    Ruzik
    wrote on last edited by
    #1

    Hello!
    How can i make item of QTreeView or QStandartItem unvisible?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      QTreeView has the "hide slot":http://developer.qt.nokia.com/doc/qt-4.8/qwidget.html#hide "see the list of all members":http://developer.qt.nokia.com/doc/qt-4.8/qtreeview-members.html
      QStandardItem does "not have hide slot":http://developer.qt.nokia.com/doc/qt-4.8/qstandarditem-members.html

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Ruzik
        wrote on last edited by
        #3

        No no, you dont understud:
        I need to do some item of QTreeView unvisible, you offer do QTreeView unvisible

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

          [quote author="Ruzik" date="1329709495"]No no, you dont understud:
          I need to do some item of QTreeView unvisible, you offer do QTreeView unvisible[/quote]
          Then, your formulation of your question was off, because you clearly asked for both:

          [quote author="Ruzik" date="1329677314"]How can i make item of QTreeView or QStandartItem unvisible?
          [/quote]

          Anyway, as koahnig already said: items in an item view don't have a visible property or something like that. You therefore have two options:

          Remove the item in question from your model

          Use a SortFilterProxyModel between your model and your view, and filter out the item in question.

          Which approach is best, depends on your exact case.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Ruzik
            wrote on last edited by
            #5

            I already try to use QSortFilterProxyModel and сonfronted with the question(http://developer.qt.nokia.com/forums/viewthread/14401/#74631)
            No matter what thank you for your help!

            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