5,9 → 5,7 |
QItemDelegate(parent) |
{ |
items.append(tr("CHAR(10)")); |
items.append(tr("CHAR(30)")); |
items.append(tr("INT(10)")); |
items.append(tr("DATA")); |
} |
QWidget *DelegateForClassesTable::createEditor(QWidget *parent, |
const QStyleOptionViewItem &/* option */, |
49,9 → 47,6 |
QComboBox *comboBox = static_cast<QComboBox*>(editor); |
int curr_index = items.indexOf(value); |
if (curr_index!= -1) comboBox->setCurrentIndex(curr_index); |
else { |
|
} |
/* |
if (value == "0") comboBox->setCurrentIndex(0); |
if (value == "1") comboBox->setCurrentIndex(1); |
64,7 → 59,7 |
if (value == "8") comboBox->setCurrentIndex(8); |
if (value == "9") comboBox->setCurrentIndex(9); |
*/ |
comboBox->setEditable(false); |
comboBox->setEditable(true); |
|
|
//comboBox->setItemText(0, value); |
97,10 → 92,3 |
editor->setGeometry(option.rect); |
} |
//! [4] |
|
|
void DelegateForClassesTable::setItems(QStringList new_items){ |
|
DelegateForClassesTable::items = new_items; |
|
} |