PDA

View Full Version : Disable the Vertical and Horzontal header view



sajis997
13th May 2011, 15:44
Hello forum,


I am going through the example of spinbox delegate when the QTableView is used.

There i would like to disable both the vertical and horizontal view. Any hint?


Regards
Sajjad

Lykurg
13th May 2011, 16:22
Any hint?Reading the docs.

QTableView::horizontalHeader() and QWidget::hide().

sajis997
18th May 2011, 16:04
Thanks for the hint.

I am trying to create a 3-by-3 matrix editor using the spin box delegate. The procedure is described as follows:

1. I have a separate Property class which holds the matrix value as linear array - float matVal[9];

2. In the editor widget constructor, i have created the QStandardItemModel object , QTableView object, and populate the the model from the property .I
hope it is the right manner.

3. Whenever the value is changed in the editor , the delegate reflects that changes to the model through the delegate. But It has to be extendend to the Property class as well. Any hint on this ? Do i have to create signal and slot for this purpose?


Looking forward to some suggestion


Regards
Sajjad

ChrisW67
19th May 2011, 01:43
Have a think abut not using QStandardItemModel; write your own model (derive from QAbstractTableModel) that manipulates your value storage directly.