aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/mdichild.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/mdichild.cpp')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/mdichild.cpp77
1 files changed, 77 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/mdichild.cpp b/SQLiteStudio3/guiSQLiteStudio/mdichild.cpp
new file mode 100644
index 0000000..da45b42
--- /dev/null
+++ b/SQLiteStudio3/guiSQLiteStudio/mdichild.cpp
@@ -0,0 +1,77 @@
+#include "mdichild.h"
+#include "mdiwindow.h"
+#include "iconmanager.h"
+#include "mainwindow.h"
+#include <QDebug>
+
+MdiChild::MdiChild(QWidget* parent) :
+ QWidget(parent)
+{
+}
+
+MdiChild::~MdiChild()
+{
+}
+
+QVariant MdiChild::getSessionValue()
+{
+ QVariant value = saveSession();
+ QHash<QString, QVariant> hash = value.toHash();
+ hash["class"] = QString(metaObject()->className());
+ return hash;
+}
+
+bool MdiChild::applySessionValue(const QVariant& sessionValue)
+{
+ bool result = restoreSession(sessionValue);
+ return result;
+}
+
+MdiWindow* MdiChild::getMdiWindow() const
+{
+ return mdiWindow;
+}
+
+void MdiChild::setMdiWindow(MdiWindow* value)
+{
+ mdiWindow = value;
+ if (mdiWindow)
+ {
+ mdiWindow->setWindowTitle(getTitleForMdiWindow());
+ mdiWindow->setWindowIcon(*getIconNameForMdiWindow());
+ }
+}
+
+bool MdiChild::isInvalid() const
+{
+ return invalid;
+}
+
+bool MdiChild::restoreSessionNextTime()
+{
+ return true;
+}
+
+void MdiChild::updateWindowTitle()
+{
+ if (mdiWindow)
+ {
+ QString newTitle = getTitleForMdiWindow();
+ if (mdiWindow->windowTitle() != newTitle)
+ mdiWindow->rename(newTitle);
+ }
+}
+
+bool MdiChild::handleInitialFocus()
+{
+ return false;
+}
+
+Db* MdiChild::getAssociatedDb() const
+{
+ return nullptr;
+}
+
+void MdiChild::dbClosedFinalCleanup()
+{
+}