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