0

Is there any way to have a QTreeWidget with horizontal scroll bar but to have some specific columns (for example the first and the second) be const as the user scrolls horizontally?

As for now there is no need to do something like that, but just in case is this possible? If yes how?

musicamante
  • 41,230
  • 6
  • 33
  • 58
Chris P
  • 2,059
  • 4
  • 34
  • 68
  • What does 'be const' mean? Constant? If so, what should be constant? – mahkitah Apr 30 '23 at 18:12
  • I mean the scroll effect didn't apply to the first columns – Chris P Apr 30 '23 at 18:13
  • Like they are pinned to be constant – Chris P Apr 30 '23 at 18:14
  • One possible solution may be two QTreeWidgets, but they are problems in filtering and vertically scrolling – Chris P Apr 30 '23 at 18:37
  • Looks like there's no easy built in way: https://stackoverflow.com/questions/2616289/how-to-implement-frozen-rows-in-a-qtableview, https://stackoverflow.com/questions/41968792/fixed-freezed-row-in-tableview – mahkitah Apr 30 '23 at 18:38
  • You could look for the "frozen column" tables implementations, but that doesn't consider the level indentation. It wouldn't be conceptually too different, you only need to connect the signals for collapsed and expanded items, and be careful about the size hint changes of the delegate in case you want to auto resize the first column. – musicamante May 01 '23 at 00:21

0 Answers0