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. How can I handle the columns of a QTreeWidgetItem as a single entity?
QtWS25 Last Chance

How can I handle the columns of a QTreeWidgetItem as a single entity?

Scheduled Pinned Locked Moved Solved General and Desktop
qtreewidgetqtreewidgetitemqt5
3 Posts 1 Posters 1.2k 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.
  • J Offline
    J Offline
    Jakob
    wrote on last edited by
    #1

    I have some read-only data that is displayed in a QTreeWidget. Each column shows a parameter for an item. The idea is that it is possible select or deselect an item for subsequent processing.

    Because the different columns reflect just a set of parameters for each item, I'd like the user interaction to be such that when the user selects one item, all the columns are selected. In other words, I'd like the same behaviour one gets when I do setFirstColumnSpanned(true), but without losing the display of the data in the extra columns.

    Additionally, I'd like that the checkbox in the first column toggles, independent of where in the item the user clicks. When I simply enable the checkbox, the user has to click precisely on the checkbox in order to toggle it. Instead I'd like the checkbox to be toggled if the user clicks in any of the columns, as long is it is in the row of the item (essentially like clicking the text next to a checkbox also toggles the checkbox)

    How do I achieve these things?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jakob
      wrote on last edited by
      #2

      I should have mentioned that I already tried different settings for SelectionBehavior, but changing that value didn't seem to have any effect whatsoever.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jakob
        wrote on last edited by
        #3

        After disabling a whole bunch of Windows policies suddenly I get the desired behaviour.... that is surprising. I still don't know the root cause, but I'll postpone looking further until the problem reappears

        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