Editable QTreeView with expandable cells

I tried to write an editable table based on QTreeView with broken contents in cells, which, in turn, should expand in height (all text was visible), like ordinary cells in tables, for example, in MSWord, but encountered insurmountable obstacles:

at first - I cannot set the size of a fixed cell.

second - I cannot display text in wordwraped cells. For this, I used void QTreeWidget :: setItemWidget (QTreeWidgetItem * item, int column, QWidget * widget), but it works only for readonly solutions. And I did not come up with any other idea.

Is it possible to implement such a QTreeView behavior? And how to solve these my problems?

Thanks in advance

Serge

+3
source share
1 answer

You should inherit QTreeView instead of QTreeWidget. And I'm afraid that you might have to specialize in QAbstractItemView, QAbstractItemDelegate, and QAbstractItemModel.

0
source

Source: https://habr.com/ru/post/1741793/


All Articles