• 7689阅读
  • 3回复

有谁在treeview中某一个item上放过pushbutton? [复制链接]

上一主题 下一主题
离线bl1983126
 

只看楼主 倒序阅读 楼主  发表于: 2010-07-18
— 本帖被 XChinux 从 General Qt Programming 移动到本区(2011-01-02) —
我使用setIndexWidget,在QTreeView的一列放了一个QPushButton,是可以正常显示的,但是一旦QTreeView和QSortFilterProxyModel一起使用,即使用了
过滤功能之后,treeview上的button就显示不出来了,是一个空白,谁遇到这种情况,帮忙看一下,谢谢!
离线cahwxy

只看该作者 1楼 发表于: 2010-07-19
QSortFilterProxyModel 注意事项
一,setIndexWidget 的index 是 filterProxyModel 的index,不是源model 的index
二, invalidfilter 的时候,需要重新show 那个putton
离线tootzoe
只看该作者 2楼 发表于: 2010-07-19
看看这个吧.....
我能把 checkbox 贴上去, 难道 贴个  pushbutton 会难吗....
   如果需要, 把 checkbox 放到 header 栏都没问题.....


源码: 下载
离线bl1983126

只看该作者 3楼 发表于: 2010-07-20
谢谢楼上的两位, 我重写了createEditor,并且调用了openPersistentEditor,是可以显示出来button的,但是还不清楚creatorEditor中创建出来的button怎么和view联系在一起,因为我需要点击这个Button后,要弹出来一个对话框,而这个对话框是在view中的
快速回复
限100 字节
 
上一个 下一个