23 #include <QCloseEvent>
24 #include <QMainWindow>
31 ViewerDockWidget::ViewerDockWidget(Qt::DockWidgetArea area,
const shared_ptr<Ws::MergedPreferences>& p,
32 QWidget* parent, std::function<
void()> on_close)
33 :
QDockWidget(parent), m_preferences(p), m_on_close(on_close)
35 setWindowModality(Qt::NonModal);
36 static_cast<QMainWindow*
>(parent)->addDockWidget(area,
this);
38 const auto pos_x = m_preferences->Get<
int>(
"position.x");
39 const auto pos_y = m_preferences->Get<
int>(
"position.y");
40 const auto size_x = m_preferences->Get<
int>(
"size.x");
41 const auto size_y = m_preferences->Get<
int>(
"size.y");
42 setGeometry(pos_x, pos_y, size_x, size_y);
45 ViewerDockWidget::~ViewerDockWidget()
48 m_preferences->Put(
"position.x", g.x());
49 m_preferences->Put(
"position.y", g.y());
50 m_preferences->Put(
"size.x", g.width());
51 m_preferences->Put(
"size.y", g.height());
Interface for ViewerDockWidget.
see the online Qt documentation
see the online Qt documentation
see the online Qt documentation
virtual void closeEvent(QCloseEvent *)
overrides QWidget::closeEvent
Namespace for generic graphical shell for simulators.