Fix collation combo box for newly added fields in Edit Table dialog

This fixes a regression which was introduced by the changes in Commit
0768ccd1db. The newly added combo box for
setting the collation of a field was not created for fields which were
newly added to the table. This broke the setting of the data type for
these fields.

See issue #1973.
This commit is contained in:
Martin Kleusberg
2019-08-23 15:12:26 +02:00
parent c3c6e42dfb
commit d9fbdb4bfc

View File

@@ -771,6 +771,14 @@ void EditTableDialog::addField()
typeBox->installEventFilter(this);
connect(typeBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTypeAndCollation()));
QComboBox* collationBox = new QComboBox(ui->treeWidget);
collationBox->setProperty("column", tbitem->text(kName));
collationBox->addItems(m_collationList);
collationBox->setCurrentIndex(collationBox->findText(""));
ui->treeWidget->setItemWidget(tbitem, kCollation, collationBox);
collationBox->installEventFilter(this);
connect(collationBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTypeAndCollation()));
tbitem->setCheckState(kNotNull, Qt::Unchecked);
tbitem->setCheckState(kPrimaryKey, Qt::Unchecked);
tbitem->setCheckState(kAutoIncrement, Qt::Unchecked);