diff options
| author | 2014-12-06 17:33:25 -0500 | |
|---|---|---|
| committer | 2014-12-06 17:33:25 -0500 | |
| commit | 7167ce41b61d2ba2cdb526777a4233eb84a3b66a (patch) | |
| tree | a35c14143716e1f2c98f808c81f89426045a946f /SQLiteStudio3/guiSQLiteStudio/mdichild.cpp | |
Imported Upstream version 2.99.6upstream/2.99.6
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/mdichild.cpp')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/mdichild.cpp | 77 |
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() +{ +} |
