From d9fbdb4bfc3110768550774d21a27e21fb0bf570 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Fri, 23 Aug 2019 15:12:26 +0200 Subject: [PATCH] Fix collation combo box for newly added fields in Edit Table dialog This fixes a regression which was introduced by the changes in Commit 0768ccd1dbb608a75812512ad47891ff44bc2e8a. 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. --- src/EditTableDialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/EditTableDialog.cpp b/src/EditTableDialog.cpp index 43551549..22985ae0 100644 --- a/src/EditTableDialog.cpp +++ b/src/EditTableDialog.cpp @@ -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);