开发者

Editable QTreeView with expandable cells

I tried to write an editable table based on QTreeView with wordwraped content in cells which in turn sho开发者_如何学编程uld expand in height (that whole text was visible) like usual cells in tables like in MSWord, but have met insuperable obstacles:

first - i can't set fixed cell size.

second - i can't make text display in cells wordwraped. For this i used void QTreeWidget::setItemWidget ( QTreeWidgetItem * item, int column, QWidget * widget ), but it works only for readonly solutions. And i haven't come up with any other idea.

Can such behavior of QTreeView be realized? And how to solve those problems of mine?

Thanks in advance

Serge


You should inherit QTreeView instead of QTreeWidget. And I fear that you may have to specialize from QAbstractItemView, QAbstractItemDelegate and QAbstractItemModel.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜