summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-10-01 18:13:25 (GMT)
committerAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-10-01 18:13:25 (GMT)
commitcbb065ade17493f563d0e47a2e699e4ab69c2c5d (patch)
treeaeb594d2ae811f788c5fa7c1a500fb522926ae71
parent590ae75bb07da81d1c299ad501ba93fc49826e3e (diff)
Unload QML engine when layout object gets deleted
This allows the QML items to assume that the layout object always exists.
-rw-r--r--src/editor/keyboardlayouteditor.cpp5
-rw-r--r--src/editor/keyboardlayouteditor.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/editor/keyboardlayouteditor.cpp b/src/editor/keyboardlayouteditor.cpp
index 455e392..b51e8f1 100644
--- a/src/editor/keyboardlayouteditor.cpp
+++ b/src/editor/keyboardlayouteditor.cpp
@@ -69,6 +69,11 @@ KeyboardLayoutEditor::KeyboardLayoutEditor(QWidget* parent):
}
+KeyboardLayoutEditor::~KeyboardLayoutEditor()
+{
+ m_view->setSource(QUrl());
+}
+
void KeyboardLayoutEditor::openKeyboardLayout(DataIndexKeyboardLayout* dataIndexKeyboardLayout)
{
DataAccess dataAccess;
diff --git a/src/editor/keyboardlayouteditor.h b/src/editor/keyboardlayouteditor.h
index 436581c..f713da6 100644
--- a/src/editor/keyboardlayouteditor.h
+++ b/src/editor/keyboardlayouteditor.h
@@ -34,6 +34,7 @@ class KeyboardLayoutEditor : public AbstractEditor, private Ui::KeyboardLayoutEd
Q_PROPERTY(int zoomLevel READ zoomLevel WRITE setZoomLevel NOTIFY zoomLevelChanged)
public:
explicit KeyboardLayoutEditor(QWidget* parent = 0);
+ ~KeyboardLayoutEditor();
void openKeyboardLayout(DataIndexKeyboardLayout* dataIndexKeyboardLayout);
void clearUndoStackForKeyboardLayout(DataIndexKeyboardLayout* dataIndexKeyboardLayout);