PDA

View Full Version : inserting combo box in table ..



wagmare
29th May 2009, 06:57
hi friends,
is there a way to insert a QComboBox in QTable column ... please help .

Lykurg
29th May 2009, 07:07
hi friends,
is there a way to insert a QComboBox in QTable column ... please help .

(QTable == QTableWidget) ? use QTableWidget::setCellWidget() : specify(Qt3?);

EDIT: in Qt3 there is also Q3Table::cellWidget()...

Zuzzu
1st June 2009, 00:49
hi friends,
is there a way to insert a QComboBox in QTable column ... please help .

Hi,

what is the use of QComboBox inside the QTable column? Is it for editing the content of model? If yes, a good approach is to implement a custom Delegate for editing the column. This delegate will create the QComboBox as editor for each column cell, will fill the QComboBox with the relevant items and manages the set of current value inside the QComboBox, retrieve the user selection and set it as current value inside the table.

Bye.

Alessandro

wagmare
2nd June 2009, 07:42
custom Delegate ..
yes this one is the better one ... thank you