Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

QTreeView setFirstColumnSpanned() breaks expand/collapse

$
0
0
In my QTreeView and QTreeModel, only the “leaves” of the tree use all the columns; items with children use only the first column. So, for those items, I call QTreeView::setFirstColumnSpanned(). Graphically, that does what I want. The problem is that mouse clicks on the arrows to the left of those items no longer expand/collapse the items. The mouse clicks are ignored. I can use the keyboard to expand/collapse (left arrow, right arrow, asterisk), but not the mouse. Anybody have any idea why this is happening, and how I might fix it? Another clue: if I call expandToDepth() in the constructor of my QTreeView subclass, mouse clicks work correctly on the items which are initially expanded, but not on lower levels of the tree. I am using Qt 5, and have the same problem on both Windows and Linux.

Viewing all articles
Browse latest Browse all 18427

Trending Articles