예제 #1
0
파일: MainWindow.cpp 프로젝트: netromdk/sld
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()));
}
예제 #2
0
파일: plot.cpp 프로젝트: zhgn/scigraphics
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();
}