mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-27 08:41:02 +08:00
(ProfMainWindow) Saving last opened file path into QSettings
This commit is contained in:
parent
7366defa63
commit
67ed94c774
@ -97,10 +97,16 @@ ProfMainWindow::ProfMainWindow() : QMainWindow(), m_treeWidget(nullptr), m_graph
|
|||||||
settings.beginGroup("main");
|
settings.beginGroup("main");
|
||||||
|
|
||||||
auto geometry = settings.value("geometry").toByteArray();
|
auto geometry = settings.value("geometry").toByteArray();
|
||||||
|
if (!geometry.isEmpty())
|
||||||
|
{
|
||||||
|
restoreGeometry(geometry);
|
||||||
|
}
|
||||||
|
|
||||||
if (!geometry.isEmpty()){
|
auto last_file = settings.value("last_file");
|
||||||
restoreGeometry(geometry);
|
if (!last_file.isNull())
|
||||||
}
|
{
|
||||||
|
m_lastFile = last_file.toString().toStdString();
|
||||||
|
}
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
@ -203,6 +209,7 @@ void ProfMainWindow::saveSettings()
|
|||||||
settings.beginGroup("main");
|
settings.beginGroup("main");
|
||||||
|
|
||||||
settings.setValue("geometry", this->saveGeometry());
|
settings.setValue("geometry", this->saveGeometry());
|
||||||
|
settings.setValue("last_file", m_lastFile.c_str());
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user