23 #include <QCloseEvent>
30 ViewerWindow::ViewerWindow(
const shared_ptr<Ws::MergedPreferences>& p,
QWidget* parent, std::function<
void()> on_close)
31 :
QMainWindow(parent, Qt::Dialog), m_preferences(p), m_on_close(on_close)
33 setWindowModality(Qt::NonModal);
35 auto pos_x = m_preferences->Get<
int>(
"position.x");
36 auto pos_y = m_preferences->Get<
int>(
"position.y");
37 auto size_x = m_preferences->Get<
int>(
"size.x");
38 auto size_y = m_preferences->Get<
int>(
"size.y");
39 setGeometry(pos_x, pos_y, size_x, size_y);
42 ViewerWindow::~ViewerWindow()
45 m_preferences->Put(
"position.x", g.x());
46 m_preferences->Put(
"position.y", g.y());
47 m_preferences->Put(
"size.x", g.width());
48 m_preferences->Put(
"size.y", g.height());
Interface for ViewerWindow.
see the online Qt documentation
see the online Qt documentation
virtual void closeEvent(QCloseEvent *)
overrides QWidget::closeEvent
Namespace for generic graphical shell for simulators.