summaryrefslogtreecommitdiff
path: root/src/items/database/databasetableproperties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/items/database/databasetableproperties.cpp')
-rw-r--r--src/items/database/databasetableproperties.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/items/database/databasetableproperties.cpp b/src/items/database/databasetableproperties.cpp
index 8bce7b5..1f54fe6 100644
--- a/src/items/database/databasetableproperties.cpp
+++ b/src/items/database/databasetableproperties.cpp
@@ -39,11 +39,13 @@ public:
QPushButton *moveColumnUpButton;
QPushButton *moveColumnDownButton;
QtColorPicker *colorPicker;
+ bool ignoreUpdates;
};
DatabaseTableProperties::DatabaseTableProperties(QWidget *parent)
: DiagramItemProperties(parent), d(new PrivateData)
{
+ d->ignoreUpdates = false;
addPage(tr("&Table"), createTablePage());
addPage(tr("&Columns"), createColumnsPage());
}
@@ -140,6 +142,8 @@ DatabaseTableProperties::switchCurrentItem(DiagramItem *oldItem, DiagramItem *)
void
DatabaseTableProperties::updateProperty(const QString &name, const QVariant &value)
{
+ if (d->ignoreUpdates)
+ return;
if (name == "name") {
d->nameEdit->setText(value.toString());
}
@@ -152,14 +156,18 @@ void
DatabaseTableProperties::setTableName(const QString &name)
{
DatabaseTable *table = currentTable();
+ d->ignoreUpdates = true;
table->document()->undoStack()->push(new SetObjectPropertyCommand(table, "name", name));
+ d->ignoreUpdates = false;
}
void
DatabaseTableProperties::setTableColor(const QColor &color)
{
DatabaseTable *table = currentTable();
+ d->ignoreUpdates = true;
table->document()->undoStack()->push(new SetObjectPropertyCommand(table, "color", color));
+ d->ignoreUpdates = false;
}
void