From ab82adb88972586a7d241e38bec4d56c9b46a33d Mon Sep 17 00:00:00 2001 From: Jacob Gustafson Date: Sun, 6 Nov 2016 12:24:32 -0500 Subject: [PATCH] refactoring method names and updated readme --- README.md | 10 +++++++++- mainwindow.cpp | 6 +++--- mainwindow.h | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3bede6b..be738d8 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,15 @@ Possibly, rotoscoping applications are not considered commercially viable since * use alpha.png for reducing opacity of parts of background layer * allow blocker layer type (make an animated object that seems to "undo" previous edits, such as to reveal parts of characters under the effect, without permanently erasing any part of the effect) * use layer cache (purpose for unused variable cacheMaxMB) - +* Keyboard controls for fast operation: + Ctrl Scrollwheel: zoom + Shift Alt Scrollwheel: brush hardness + Shift Scrollwheel: brush size +* Add exception handling in appropriate situations: +catch(std::exception& e) { + qCritical() << "Exception thrown:" << e.what(); + } + ## Low-priority Known Issues * drawLineTo (this is used for painting) should draw line instead of last point diff --git a/mainwindow.cpp b/mainwindow.cpp index 948effa..2d81ef2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -72,7 +72,7 @@ void MainWindow::askOpen() //! [4] //! [5] -void MainWindow::askSave() +void MainWindow::save() //! [5] //! [6] { QAction *action = qobject_cast(sender()); @@ -151,14 +151,14 @@ void MainWindow::createActions() saveFrameAct = new QAction(tr("&Save"), this); saveFrameAct->setShortcut(QKeySequence::Save); - connect(saveFrameAct, SIGNAL(triggered()), this, SLOT(askSave())); + connect(saveFrameAct, SIGNAL(triggered()), this, SLOT(save())); foreach (QByteArray format, QImageWriter::supportedImageFormats()) { QString text = tr("%1...").arg(QString(format).toUpper()); QAction *action = new QAction(text, this); action->setData(format); - connect(action, SIGNAL(triggered()), this, SLOT(askSave())); + connect(action, SIGNAL(triggered()), this, SLOT(save())); saveAsActs.append(action); } diff --git a/mainwindow.h b/mainwindow.h index 7a77a1a..0288af3 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -21,7 +21,7 @@ protected: private slots: void askOpen(); - void askSave(); + void save(); void askBrushColor(); void askBrushOpacity(); void askBrushRadius();