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. Porting QListView to QTreeWidget
Qt 6.11 is out! See what's new in the release blog

Porting QListView to QTreeWidget

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

    Hello together,

    I'm trying to remove all my QT3 code and port it to some "real" QT4 classes (not the Q3 compatibility classes). Everything works fine except one problem I can't solve:

    I was changing the number of columns in a QListView dynamically using "removeColumn(int column)" but I didn't find any corresponding function within the QTreeWidget class.

    Does anyone know how to change the number of columns (in my case only removing some columns) in a QTreeWidget?

    Thanks a lot for your help !

    1 Reply Last reply
    0
    • I Offline
      I Offline
      ixSci
      wrote on last edited by
      #2

      Maybe you're searching for QTreeWidget::setColumnCount()?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        If you want to show a subset of a given set of columns (and switch between these) you could use setColumnHidden() to hide the unused columns.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Thanks a lot - the second solution was the one I was looking for.

          Thank you for your fast 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