我想在每个嵌套级别的左侧增加一个QTreeView
不的凹痕。我尝试设置QTreeView::setIndentation(0)
。它会按照我的意愿删除压痕,但是也会隐藏树形箭头。
setIndentation(0)
之后:那么如何获得第三个示例中显示的结果?是否有任何标准方法可以执行此操作,否则我将不得不重新实现QTreeView::paintEvent()
,QTreeView::drawBranches()
等?
答案 0 :(得分:2)
为解决此问题,我使用了一名代表来翻译项目的绘制并绘制箭头。
1.0 < nan // false <-|
nan < 1.0 // false, <-| these inequalities can break balanced trees algorithms if you use float as a key and happen to insert a nan
nan = nan // false <-|
nan <> nan // true <-| perhaps also surprising?