Implemented window size and position tracking for the forms that are currently implemented and working

This commit is contained in:
Collin Kidder
2015-06-28 18:55:46 -04:00
parent 821e681dcd
commit 6c967d2071
16 changed files with 253 additions and 0 deletions
+28
View File
@@ -12,6 +12,8 @@ FlowViewWindow::FlowViewWindow(const QVector<CANFrame> *frames, QWidget *parent)
{
ui->setupUi(this);
readSettings();
modelFrames = frames;
playbackTimer = new QTimer();
@@ -99,6 +101,32 @@ FlowViewWindow::~FlowViewWindow()
delete playbackTimer;
}
void FlowViewWindow::closeEvent(QCloseEvent *event)
{
writeSettings();
}
void FlowViewWindow::readSettings()
{
QSettings settings;
if (settings.value("Main/SaveRestorePositions", false).toBool())
{
resize(settings.value("FlowView/WindowSize", QSize(1078, 621)).toSize());
move(settings.value("FlowView/WindowPos", QPoint(50, 50)).toPoint());
}
}
void FlowViewWindow::writeSettings()
{
QSettings settings;
if (settings.value("Main/SaveRestorePositions", false).toBool())
{
settings.setValue("FlowView/WindowSize", size());
settings.setValue("FlowView/WindowPos", pos());
}
}
void FlowViewWindow::contextMenuRequestFlow(QPoint pos)
{
QMenu *menu = new QMenu(this);