From 41ea2d8f94043d49fc26aaaa8030a73dcfdc2da9 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 24 Jan 2021 18:13:44 +0100 Subject: Create rust project --- app/mainwindow.cpp | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 app/mainwindow.cpp (limited to 'app/mainwindow.cpp') diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp deleted file mode 100644 index eed98f9..0000000 --- a/app/mainwindow.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "mainwindow.hpp" -#include -#include -#include -#include -#include -#include - -MainWindow::MainWindow(Renderer r, const Config &conf) - : m_drawer(conf), - runstatus("Not running", this), - m_render(this, m_drawer, r, conf, &runstatus), - m_conf(conf) -{ - - setCentralWidget(&m_drawer); - - auto saveAct = new QAction(tr("&Save as"), this); - saveAct->setStatusTip(tr("Save the rendered image")); - connect(saveAct, &QAction::triggered, this, &MainWindow::saveimage); - - auto stopAct = new QAction(tr("&Stop"), this); - stopAct->setStatusTip(tr("Stop and sync threads")); - QObject::connect(stopAct, &QAction::triggered, &m_render, &RenderCoordinator::stop); - - fileMenu = menuBar()->addMenu(tr("&File")); - fileMenu->addAction(saveAct); - - fileMenu = menuBar()->addMenu(tr("&Render")); - fileMenu->addAction(stopAct); - - helpMenu = menuBar()->addMenu(tr("&Help")); - helpMenu->addAction(tr("About Qt"), qApp, &QApplication::aboutQt); - - statusBar()->addWidget(&runstatus); -} - -void MainWindow::saveimage() { - - QGuiApplication::setOverrideCursor(Qt::WaitCursor); - QString fileName = QFileDialog::getSaveFileName(this, - tr("Save image"), "", tr("PNG image (*.png);;All Files (*)")); - if (fileName.isEmpty()) { - return; - } - - if (!m_drawer.m_img.save(fileName)) { - QMessageBox::information(this, tr("Unable to save file"), ""); - } -} -- cgit v1.2.3