PDA

View Full Version : few table issues



anli
5th August 2006, 15:22
I use subclassed QAbstractTableModel for QTableView. The issues are:

1. It's may be funny, I have not found a way to change (all) rows heights.

2. One of the columns is editable. Editing itself works fine:
- I double-click a cell,
- input new text,
- hit Enter.

New information is saved in my container which is used for data() (moreover,
changings are successfully saved to persistent storage - XML-file in my case),
dataChanged(index, index) is emited. But, in spite of emitting the signal, the
view doesn't update just edited cell.

3. How to force a cell editor to use current cell data as starting point for edit?

anli
6th August 2006, 15:59
I have resolved the 3d issue via setting own item delegate (based on QLineEdit).

To dig in the 2d problem (cell contents doesn't update) I have overloaded dataChanged() QTableView's slot to be sure an appropriate signal is received.

It's received, but cell contents isn't updated.

??

anli
6th August 2006, 22:56
Aha,

I have found the 2d issue reason, it was my incorrect use of Qt-containers. So, only one question is unanswered now:

How to set table row heights (all at once)?

jacek
6th August 2006, 23:05
How to set table row heights (all at once)?
You can try to reimplement QHeaderView::sectionSizeFromContents().

anli
6th August 2006, 23:07
You can try to reimplement QHeaderView::sectionSizeFromContents().
Thanks, I'll try and report :-)