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");
|
||||
|
||||
auto geometry = settings.value("geometry").toByteArray();
|
||||
if (!geometry.isEmpty())
|
||||
{
|
||||
restoreGeometry(geometry);
|
||||
}
|
||||
|
||||
if (!geometry.isEmpty()){
|
||||
restoreGeometry(geometry);
|
||||
}
|
||||
auto last_file = settings.value("last_file");
|
||||
if (!last_file.isNull())
|
||||
{
|
||||
m_lastFile = last_file.toString().toStdString();
|
||||
}
|
||||
|
||||
settings.endGroup();
|
||||
}
|
||||
@ -203,6 +209,7 @@ void ProfMainWindow::saveSettings()
|
||||
settings.beginGroup("main");
|
||||
|
||||
settings.setValue("geometry", this->saveGeometry());
|
||||
settings.setValue("last_file", m_lastFile.c_str());
|
||||
|
||||
settings.endGroup();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user