subwindow.cpp
Go to the documentation of this file.
00001 #include "subwindow.h"
00002 #include <QDebug>
00003 #include <QSettings>
00004 
00005 SubWindow::SubWindow(QString name, PlotMatrix *first_tab, PlotDataMap &mapped_data, QMainWindow *parent_window) :
00006   QMainWindow(parent_window)
00007 {
00008     tabbed_widget_ = new TabbedPlotWidget( name, parent_window, first_tab, mapped_data, this );
00009     this->setCentralWidget( tabbed_widget_ );
00010 
00011     Qt::WindowFlags flags = this->windowFlags();
00012     this->setWindowFlags( flags | Qt::SubWindow );
00013     this->setWindowTitle( tabbed_widget_->name() );
00014 
00015     QSettings settings( "IcarusTechnology", "PlotJuggler");
00016     restoreGeometry(settings.value( QString("SubWindow.%1.geometry").arg(name) ).toByteArray());
00017 
00018     this->setAttribute( Qt::WA_DeleteOnClose );
00019 }
00020 
00021 SubWindow::~SubWindow()
00022 {
00023     QSettings settings( "IcarusTechnology", "PlotJuggler");
00024     settings.setValue(QString("SubWindow.%1.geometry").arg( tabbedWidget()->name() ), saveGeometry());
00025     tabbed_widget_->close();
00026 }
00027 
00028 void SubWindow::closeEvent(QCloseEvent *event)
00029 {
00030     QMainWindow::closeEvent(event);
00031 }


plotjuggler
Author(s): Davide Faconti
autogenerated on Fri Sep 1 2017 02:41:57