SchemaDrawer::SchemaDrawer(): QMainWindow( 0 ) { ActionIconProvider actionIconProvider; // SchemaDrawer QMenu* schemaDrawerMenu = menuBar()->addMenu( "SchemaDrawer" ); schemaDrawerMenu->addAction( actionIconProvider.getIconForAction("help"), "Help Me!", this, SLOT(helpMe()) ); schemaDrawerMenu->addSeparator(); schemaDrawerMenu->addAction( actionIconProvider.getIconForAction("exit"), "Exit", this, SLOT(close()) ); // Schema QMenu* schemaMenu = menuBar()->addMenu( "Schema" ); schemaMenu->addAction( actionIconProvider.getIconForAction("add"), "Schema", this, SLOT(newSchema()) ); schemaMenu->addAction( actionIconProvider.getIconForAction("save"), "Save", this, SLOT(saveSchema()) ); schemaMenu->addAction( actionIconProvider.getIconForAction("open"), "Open", this, SLOT(openSchema()) ); // preparing the workspace _workspace = new QWorkspace(); setCentralWidget( _workspace ); // cosmetics Styling styling( *this ); styling.loadOnScreenPosition(); setWindowTitle( "Schema Drawer" ); }
FileEditorContent::FileEditorContent( QString filePath ): QWidget() { // init the file editor component _textFileEditor = new TextFileEditor( filePath ); _textFileEditor->setReadOnly( true ); connect( _textFileEditor->document(), SIGNAL(modificationChanged(bool)), this, SLOT(fileWasChanged(bool)) ); // init the line numbers components LineNumbers* linenumbers = new LineNumbers( _textFileEditor ); linenumbers->setFocusProxy( _textFileEditor ); // init the tool widgets area _toolWidgets = new QVBoxLayout(); _toolWidgets->setSpacing( 0 ); _toolWidgets->setContentsMargins( 0, 0, 0, 0 ); // assemble all the components QHBoxLayout* hBoxLayout = new QHBoxLayout(); hBoxLayout->setSpacing( 0 ); hBoxLayout->setContentsMargins( 0, 0, 0, 0 ); hBoxLayout->addWidget( linenumbers ); hBoxLayout->addWidget( _textFileEditor ); QVBoxLayout* vBoxLayout = new QVBoxLayout( this ); vBoxLayout->setSpacing( 0 ); vBoxLayout->setContentsMargins( 0, 0, 0, 0 ); vBoxLayout->addLayout( hBoxLayout ); vBoxLayout->addLayout( _toolWidgets ); Styling styling( *this ); styling.loadOnScreenPosition(); }
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- // ---- inherited stuff // ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- void SchemaDrawer::closeEvent( QCloseEvent* event ) { _workspace->closeAllWindows(); Styling styling( *this ); styling.saveOnScreenPosition(); event->accept(); }
void deuteron_t20_calc() { styling(); c = new TCanvas("c","Deuteron T_20 Calcs",000,10,500,540); plot_figure("deuteron_t20_calc",gPad); }