From a209e840b8e68db64c9bf952b2505b7d256d306d Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Tue, 27 May 2014 20:13:18 +0200 Subject: [PATCH] EditTableDialog: Also update the SQL when type is automatically changed Also update the internal table representation and thus the SQL string at the bottom of the window when the type of a column is changed automatically, e.g. when the AI checkbox is clicked. Closes #24. --- src/EditTableDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EditTableDialog.cpp b/src/EditTableDialog.cpp index 27bd16c4..267a4882 100644 --- a/src/EditTableDialog.cpp +++ b/src/EditTableDialog.cpp @@ -313,10 +313,10 @@ void EditTableDialog::addField() tbitem->setText(kName, "Field" + QString::number(ui->treeWidget->topLevelItemCount())); QComboBox* typeBox = new QComboBox(ui->treeWidget); typeBox->setProperty("column", tbitem->text(kName)); - connect(typeBox, SIGNAL(activated(int)), this, SLOT(updateTypes())); typeBox->setEditable(false); typeBox->addItems(sqlb::Field::Datatypes); ui->treeWidget->setItemWidget(tbitem, kType, typeBox); + connect(typeBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTypes())); tbitem->setCheckState(kNotNull, Qt::Unchecked); tbitem->setCheckState(kPrimaryKey, Qt::Unchecked);