void MainWindow::createActions() { // Map menu: createWorldActions(); m_actNewGen = new QAction(tr("&New generator"), this); m_actNewGen->setShortcut(tr("Ctrl+N")); m_actNewGen->setStatusTip(tr("Open a generator INI file and display the generated biomes")); connect(m_actNewGen, SIGNAL(triggered()), this, SLOT(newGenerator())); m_actOpenGen = new QAction(tr("&Open generator..."), this); m_actOpenGen->setShortcut(tr("Ctrl+G")); m_actOpenGen->setStatusTip(tr("Open a generator INI file and display the generated biomes")); connect(m_actOpenGen, SIGNAL(triggered()), this, SLOT(openGenerator())); m_actOpenWorld = new QAction(tr("&Open world..."), this); m_actOpenWorld->setShortcut(tr("Ctrl+O")); m_actOpenWorld->setStatusTip(tr("Open an existing world and display its biomes")); connect(m_actOpenWorld, SIGNAL(triggered()), this, SLOT(openWorld())); m_actReload = new QAction(tr("&Reload"), this); m_actReload->setShortcut(tr("F5")); m_actReload->setStatusTip(tr("Clear the view cache and force a reload of all the data")); connect(m_actReload, SIGNAL(triggered()), m_BiomeView, SLOT(reload())); m_actExit = new QAction(tr("E&xit"), this); m_actExit->setShortcut(tr("Alt+X")); m_actExit->setStatusTip(tr("Exit %1").arg(QApplication::instance()->applicationName())); connect(m_actExit, SIGNAL(triggered()), this, SLOT(close())); // View menu: m_actViewCenter = new QAction(tr("&Reset to center"), this); m_actViewCenter->setStatusTip(tr("Scrolls the view back to the map center")); connect(m_actViewCenter, SIGNAL(triggered()), this, SLOT(centerView())); QActionGroup * zoomGroup = new QActionGroup(this); for (int i = 0; i < ARRAYCOUNT(m_ViewZooms); i++) { m_actViewZoom[i] = new QAction(tr("&Zoom %1%").arg(std::floor(m_ViewZooms[i] * 100)), this); m_actViewZoom[i]->setCheckable(true); m_actViewZoom[i]->setData(QVariant(i)); zoomGroup->addAction(m_actViewZoom[i]); connect(m_actViewZoom[i], SIGNAL(triggered()), this, SLOT(setViewZoom())); } m_actViewZoom[m_CurrentZoomLevel]->setChecked(true); }
void PlaneViewer::zoomOut() { setViewZoom(ImageUtils::getQuantizedZoomFactor(m_aff.a11, false)); }
void PlaneViewer::zoomIn() { setViewZoom(ImageUtils::getQuantizedZoomFactor(m_aff.a11, true)); }