Commit 539bc84f authored by Aleks Kissinger's avatar Aleks Kissinger

store qt version in geometry keys to avoid strange behaviours w multiple Qts on one system

parent bd208d8b
......@@ -46,8 +46,8 @@ MainWindow::MainWindow(QWidget *parent) :
_menu->setParent(this);
setMenuBar(_menu);
QVariant geom = settings.value("geometry-main");
QVariant state = settings.value("windowState-main");
QVariant geom = settings.value(QString("geometry-main-qt") + qVersion());
QVariant state = settings.value(QString("windowState-main-qt") + qVersion());
if (geom.isValid()) {
restoreGeometry(geom.toByteArray());
......@@ -108,11 +108,10 @@ QSplitter *MainWindow::splitter() const {
void MainWindow::closeEvent(QCloseEvent *event)
{
//qDebug() << "got close event";
// store qt version in window geometry keys to avoid strange behaviour w/ multiple Qt's on one system
QSettings settings("tikzit", "tikzit");
settings.setValue("geometry-main", saveGeometry());
settings.setValue("windowState-main", saveState(2));
settings.setValue(QString("geometry-main-qt") + qVersion(), saveGeometry());
settings.setValue(QString("windowState-main-qt") + qVersion(), saveState(2));
if (!_tikzDocument->isClean()) {
QString nm = _tikzDocument->shortName();
......
......@@ -44,7 +44,7 @@ PreviewWindow::PreviewWindow(QWidget *parent) :
QSettings settings("tikzit", "tikzit");
ui->setupUi(this);
QVariant geom = settings.value("geometry-preview");
QVariant geom = settings.value(QString("geometry-preview-qt") + qVersion());
if (geom.isValid()) {
restoreGeometry(geom.toByteArray());
......@@ -150,7 +150,7 @@ void PreviewWindow::setStatus(PreviewWindow::Status status)
void PreviewWindow::closeEvent(QCloseEvent *e) {
QSettings settings("tikzit", "tikzit");
settings.setValue("geometry-preview", saveGeometry());
settings.setValue(QString("geometry-preview-qt") + qVersion(), saveGeometry());
QDialog::closeEvent(e);
}
......
......@@ -35,15 +35,6 @@ StylePalette::StylePalette(QWidget *parent) :
{
ui->setupUi(this);
// QSettings settings("tikzit", "tikzit");
// QVariant geom = settings.value("style-palette-geometry");
// if (geom != QVariant()) {
// restoreGeometry(geom.toByteArray());
// }
// _nodeModel = new QStandardItemModel(this);
// _edgeModel = new QStandardItemModel(this);
ui->styleListView->setModel(tikzit->styles()->nodeStyles());
ui->styleListView->setViewMode(QListView::IconMode);
ui->styleListView->setMovement(QListView::Static);
......@@ -180,12 +171,6 @@ void StylePalette::on_currentCategory_currentTextChanged(const QString &cat)
// if (tikzit->activeWindow() != 0) tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes();
//}
void StylePalette::closeEvent(QCloseEvent *event)
{
QSettings settings("tikzit", "tikzit");
settings.setValue("style-palette-geometry", saveGeometry());
QDockWidget::closeEvent(event);
}
void StylePalette::resizeEvent(QResizeEvent *event)
{
......
......@@ -56,7 +56,6 @@ private:
Ui::StylePalette *ui;
protected:
void closeEvent(QCloseEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment