void MainWindow::createMenu() { QMenu *fileMenu = menuBar()->addMenu(tr("File")); fileMenu->addAction(tr("New project"), this, SLOT(newProject()), QKeySequence::New); fileMenu->addAction(tr("Open project"), this, SLOT(openProject()), QKeySequence::Open); fileMenu->addAction(tr("Save project"), this, SLOT(saveProject()), QKeySequence::Save); fileMenu->addAction(tr("Save as.."), this, SLOT(saveAsProject()), QKeySequence::SaveAs); fileMenu->addSeparator(); fileMenu->addAction(tr("Export image"), this, SLOT(exportImage()), QKeySequence(Qt::CTRL + Qt::Key_E)); QMenu *editMenu = menuBar()->addMenu(tr("Edit")); QMenu *gridEditMenu = editMenu->addMenu(tr("Grid")); gridEditMenu->addAction(tr("Clear fields"), this, SLOT(clearFields())); gridEditMenu->addAction(tr("Clear borders"), this, SLOT(clearBorders())); }
void scigraphics::plot::replot() { if ( getDrawer() == NULL ) throw std::runtime_error( "Drawer is not initialized" ); prepareForPainting(); clearPlotArea(); drawGraphicsUnderGrid(); drawGrid(); drawGraphicsOverGrid(); drawSelections(); clearBorders(); drawAxis(); drawAxisTicks(); drawAxisLabels(); drawAxisTitles(); drawFloatRectangles(); drawZoomRectangle(); flush(); }