summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-02-02 09:05:01 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-02-02 13:37:45 +0000
commit05fd8652a7e43df2fc763222892f3c33bed7183f (patch)
tree192aaef450d7bb058fb95e10556d36b4172984f8
parent7bb45dc5318c4c84d94ff35400616eee8e7f741d (diff)
downloadqttools-05fd8652a7e43df2fc763222892f3c33bed7183f.tar.gz
Fix emission of QDesignerFormWindowInterface::changed()
The tools depend on QDesignerFormWindowInterface::changed() to update their views. Connect the signal to QUndoStack::indexChanged() instead of QUndoStack::cleanChanged() as was before in removed class QDesignerUndoStack. In addition, emit changed when the QUndoStack emits cleanChanged(false). Task-number: QTBUG-58584 Change-Id: Idb7dc630952bb9d79695cb914676f1d9657cc17b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
-rw-r--r--src/designer/src/components/formeditor/formwindow.cpp10
-rw-r--r--src/designer/src/components/formeditor/formwindow.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp
index 77e96c307..5a91a6d1a 100644
--- a/src/designer/src/components/formeditor/formwindow.cpp
+++ b/src/designer/src/components/formeditor/formwindow.cpp
@@ -421,9 +421,11 @@ void FormWindow::init()
m_mainContainer = 0;
m_currentWidget = 0;
- connect(&m_undoStack, &QUndoStack::cleanChanged,
+ connect(&m_undoStack, &QUndoStack::indexChanged,
this, &QDesignerFormWindowInterface::changed);
connect(&m_undoStack, &QUndoStack::cleanChanged,
+ this, &FormWindow::slotCleanChanged);
+ connect(this, &QDesignerFormWindowInterface::changed,
this, &FormWindow::checkSelection);
core()->metaDataBase()->add(this);
@@ -2228,6 +2230,12 @@ void FormWindow::slotSelectWidget(QAction *a)
selectSingleWidget(w);
}
+void FormWindow::slotCleanChanged(bool clean)
+{
+ if (!clean)
+ emit changed();
+}
+
static inline QString objectNameOf(const QWidget *w)
{
if (const QLayoutWidget *lw = qobject_cast<const QLayoutWidget *>(w)) {
diff --git a/src/designer/src/components/formeditor/formwindow.h b/src/designer/src/components/formeditor/formwindow.h
index c577fe1ab..d2502f4a7 100644
--- a/src/designer/src/components/formeditor/formwindow.h
+++ b/src/designer/src/components/formeditor/formwindow.h
@@ -230,6 +230,7 @@ private slots:
void checkSelection();
void checkSelectionNow();
void slotSelectWidget(QAction *);
+ void slotCleanChanged(bool);
private:
enum MouseState {