IndikaU
15th September 2011, 03:00
Hi,
I'm using a delegate to QComboBox in table view.How can I emit a signal when user select the item in the combo box?
Here's the code fragment I'm using.
QWidget * DelegateComboBox::createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const
{
if ( index.column() == 1 )
{
QComboBox *editor = new QComboBox(parent); //Here the parent is QTableView
editor->addItem("STRING");
editor->addItem("INTEGER");
editor->addItem("DOUBLE");
return editor;6854
}
return QItemDelegate::createEditor(parent, option, index);
}
I'm using a delegate to QComboBox in table view.How can I emit a signal when user select the item in the combo box?
Here's the code fragment I'm using.
QWidget * DelegateComboBox::createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const
{
if ( index.column() == 1 )
{
QComboBox *editor = new QComboBox(parent); //Here the parent is QTableView
editor->addItem("STRING");
editor->addItem("INTEGER");
editor->addItem("DOUBLE");
return editor;6854
}
return QItemDelegate::createEditor(parent, option, index);
}