PDA

View Full Version : Editable QTreeView with expandable cells



corrado
19th April 2010, 18:42
Hi everyone,

I tried to write an editable table based on QTreeView with wordwraped content in cells which in turn should expand in height (that whole text was visible without ellipsis) like usual cells in tables like in MSWord, but have met insuperable obstacles:

first - i can't set fixed cell size, i'm overloading sizeHint function in my delegate, but i'm unable to set fixed width for cell

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