PDA

View Full Version : Functionality of QTableView



doberkofler
8th November 2009, 21:27
I'm currently evaluating the functionality of the QTableView widget and somehow miss the following functionality:
1) Multiple fixed columns (often used when showing a structured primary key for each row)
2) Fixed (last) row (often used when showing totals, counts, etc. in the last row)
3) Rearranging columns using drag and drop
4) Automatically size row/column width for individual or multiple columns
5) Column and row headers with mutiline text

I was wondering if I just missed this functionality when looking at the documentation or if this is really not supported. If not, I would be interested in understanding how the above mentioned functionality might e best implemented and if there are 3rd party widgets out there that might offer this functionality.

Thank you!

wysota
9th November 2009, 10:24
I'm currently evaluating the functionality of the QTableView widget and somehow miss the following functionality:
1) Multiple fixed columns (often used when showing a structured primary key for each row)
If you mean multiple line headers, this has been implemented. Look at qt-apps.

If you mean frozen rows or frozen columns, you have to implement it yourself by placing another table between the header of the main table and its contents. QAbstractScrollArea::setViewportMargins() will help you do that.


2) Fixed (last) row (often used when showing totals, counts, etc. in the last row)
Same as above.

3) Rearranging columns using drag and drop
QHeaderView::setMovable()


4) Automatically size row/column width for individual or multiple columns
QHeaderView::setResizeMode()

5) Column and row headers with mutiline text
You need to reimplement QHeaderView::paintSection() (and possibly QHeaderView::sectionSizeFromContents()) for that.

doberkofler
22nd March 2010, 07:15
wysota: Thank you for the your feedback and sorry for my late reply!

It seems as if sorting by multiple columns is also not supported by QTableView and I'm now looking for existing implementations of what I need.
Would you now of any documentation, examples, code snippets, free or commercial implementation providing a QTableView like functionality enhanced by:
1) Frozen (first) columns (often used when showing a structured primary key for each row)
2) Frozen (last) row (often used when showing totals, counts, etc. in the last row)
3) Column and row headers with mutiline text
4) Ability to sort by mutiple columns

wysota
22nd March 2010, 09:56
You can try QICSTable provided by ICS. I don't know if it has all the features you want but it's worth to take a look.