From 4f9ec24e4154258acf0b43f8b9034b17179a69a6 Mon Sep 17 00:00:00 2001 From: Nelsson Huotari Date: Fri, 4 Oct 2019 12:51:57 +0300 Subject: [PATCH] use enum for brushshape at scenetoolshapebrush --- apps/opencs/view/widget/scenetoolshapebrush.cpp | 10 +++++----- apps/opencs/view/widget/scenetoolshapebrush.hpp | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/opencs/view/widget/scenetoolshapebrush.cpp b/apps/opencs/view/widget/scenetoolshapebrush.cpp index 3e2f4e99db..bc7b04c734 100644 --- a/apps/opencs/view/widget/scenetoolshapebrush.cpp +++ b/apps/opencs/view/widget/scenetoolshapebrush.cpp @@ -58,7 +58,7 @@ CSVWidget::ShapeBrushSizeControls::ShapeBrushSizeControls(const QString &title, CSVWidget::ShapeBrushWindow::ShapeBrushWindow(CSMDoc::Document& document, QWidget *parent) : QFrame(parent, Qt::Popup), - mBrushShape(0), + mBrushShape(BrushShape_Point), mBrushSize(1), mDocument(document) { @@ -151,10 +151,10 @@ void CSVWidget::ShapeBrushWindow::setBrushSize(int brushSize) void CSVWidget::ShapeBrushWindow::setBrushShape() { - if(mButtonPoint->isChecked()) mBrushShape = 0; - if(mButtonSquare->isChecked()) mBrushShape = 1; - if(mButtonCircle->isChecked()) mBrushShape = 2; - if(mButtonCustom->isChecked()) mBrushShape = 3; + if(mButtonPoint->isChecked()) mBrushShape = BrushShape_Point; + if(mButtonSquare->isChecked()) mBrushShape = BrushShape_Square; + if(mButtonCircle->isChecked()) mBrushShape = BrushShape_Circle; + if(mButtonCustom->isChecked()) mBrushShape = BrushShape_Custom; emit passBrushShape(mBrushShape); } diff --git a/apps/opencs/view/widget/scenetoolshapebrush.hpp b/apps/opencs/view/widget/scenetoolshapebrush.hpp index bdb6b1309f..44fd66df10 100644 --- a/apps/opencs/view/widget/scenetoolshapebrush.hpp +++ b/apps/opencs/view/widget/scenetoolshapebrush.hpp @@ -53,6 +53,15 @@ namespace CSVWidget Q_OBJECT public: + + enum BrushShape + { + BrushShape_Point = 0, + BrushShape_Square = 1, + BrushShape_Circle = 2, + BrushShape_Custom = 3 + }; + ShapeBrushWindow(CSMDoc::Document& document, QWidget *parent = 0); void configureButtonInitialSettings(QPushButton *button);