Skip to content

Commit

Permalink
EditTableDialog: Also update the SQL when type is automatically changed
Browse files Browse the repository at this point in the history
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 sqlitebrowser#24.
  • Loading branch information
MKleusberg committed May 27, 2014
1 parent 2fcb131 commit a209e84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/EditTableDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a209e84

Please sign in to comment.