From e5f73277b25410d1ff9299381702cc3a77561aba Mon Sep 17 00:00:00 2001 From: Tats Date: Sat, 5 Mar 2016 18:15:57 -0500 Subject: [PATCH 1/2] Removed unused items to prevent compilation warnings. --- MainWindow.cpp | 1 + Polygon.cpp | 3 --- ShapeGraphicsItem.cpp | 2 ++ main.cpp | 3 --- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/MainWindow.cpp b/MainWindow.cpp index 863a3bd..21a2f99 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -428,6 +428,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) void MainWindow::keyPressEvent(QKeyEvent *event) { #ifdef Q_OS_OSX // On Mac OS X + Q_UNUSED(event); // Do nothing #endif diff --git a/Polygon.cpp b/Polygon.cpp index 5198e67..6b4882e 100644 --- a/Polygon.cpp +++ b/Polygon.cpp @@ -34,9 +34,6 @@ void Polygon::_constrainVertex(const QPolygonF& polygon, int i, QPointF& v) if (polygon.size() <= 3) return; - // Save previous position of vertex. - QPointF prevV = polygon.at(i); - // Look at the two adjunct segments to vertex i and see if they // intersect with any non-adjacent segments. diff --git a/ShapeGraphicsItem.cpp b/ShapeGraphicsItem.cpp index 605b6d2..678ffd0 100644 --- a/ShapeGraphicsItem.cpp +++ b/ShapeGraphicsItem.cpp @@ -111,6 +111,8 @@ void ShapeGraphicsItem::paint(QPainter *painter, void ColorGraphicsItem::_prePaint(QPainter *painter, const QStyleOptionGraphicsItem *option) { + Q_UNUSED(option); + Color* color = static_cast(getMapping()->getPaint().data()); Q_ASSERT(color); diff --git a/main.cpp b/main.cpp index 4f6cbde..237d042 100644 --- a/main.cpp +++ b/main.cpp @@ -142,9 +142,6 @@ int main(int argc, char *argv[]) splash.showMessage(" " + QObject::tr("Initiating program..."), Qt::AlignLeft | Qt::AlignTop, MM::WHITE); - bool FORCE_FRENCH_LANG = false; - // set_language_to_french(app); - // Let splash for at least one second. I::sleep(1); From 2429728e497a5f0ac638ccc71fe6e6d9528f3f39 Mon Sep 17 00:00:00 2001 From: Tats Date: Sat, 5 Mar 2016 18:16:49 -0500 Subject: [PATCH 2/2] Removed drawControls*() methods in Utils.h which are not used anymore. --- Util.cpp | 77 -------------------------------------------------------- Util.h | 6 ----- 2 files changed, 83 deletions(-) diff --git a/Util.cpp b/Util.cpp index 85d204a..283f3c2 100644 --- a/Util.cpp +++ b/Util.cpp @@ -169,83 +169,6 @@ void drawControlsVertex(QPainter* painter, const QPointF& vertex, bool selected, painter->drawLine( vertex + QPointF(offset, -offset), vertex + QPointF(-offset, offset) ); } -void drawControlsVertices(QPainter* painter, const QList* selectedVertices, const MShape& shape) -{ - if (!selectedVertices) - for (int i=0; icontains(i), shape.isLocked()); -} - -void drawControlsEllipse(QPainter* painter, const QList* selectedVertices, const Ellipse& ellipse) -{ - // Init colors and stroke. - painter->setPen(MM::SHAPE_STROKE); - painter->setBrush(Qt::NoBrush); - - // Draw ellipse contour. - qreal rotation = ellipse.getRotation(); - - painter->save(); // save painter state - - painter->resetTransform(); - const QPointF& center = ellipse.getCenter(); - painter->translate(center); - painter->rotate(rotation); - painter->drawEllipse(QPointF(0,0), ellipse.getHorizontalRadius(), ellipse.getVerticalRadius()); - - painter->restore(); // restore saved painter state - - // Draw control points. - drawControlsVertices(painter, selectedVertices, ellipse); -} - -void drawControlsQuad(QPainter* painter, const QList* selectedVertices, const Quad& quad) -{ - // Init colors and stroke. - painter->setPen(MM::SHAPE_STROKE); - - // Draw quad. - painter->drawPolygon(quad.toPolygon()); - - // Draw control points. - drawControlsVertices(painter, selectedVertices, quad); -} - -void drawControlsMesh(QPainter* painter, const QList* selectedVertices, const Mesh& mesh) -{ - // Init colors and stroke. - painter->setPen(MM::SHAPE_INNER_STROKE); - - // Draw inner quads. - QVector quads = mesh.getQuads(); - for (QVector::const_iterator it = quads.begin(); it != quads.end(); ++it) - { - painter->drawPolygon((*it)->toPolygon()); - } - - // Draw outer quad. - painter->setPen(MM::SHAPE_STROKE); - painter->drawPolygon(mesh.toPolygon()); - - // Draw control points. - drawControlsVertices(painter, selectedVertices, mesh); -} - -void drawControlsPolygon(QPainter* painter, const QList* selectedVertices, const Polygon& polygon) -{ - // Init colors and stroke. - painter->setPen(MM::SHAPE_STROKE); - - // Draw inner quads. - painter->drawPolygon(polygon.toPolygon()); - - // Draw control points. - //drawControlsVertices(painter, selectedVertices, polygon); -} - bool fileExists(const QString& filename) { return QFile::exists(filename); diff --git a/Util.h b/Util.h index da6b8a2..1d87e58 100644 --- a/Util.h +++ b/Util.h @@ -60,12 +60,6 @@ Ellipse* createEllipseForColor(int frameWidth, int frameHeight); void drawControlsVertex(QPainter* painter, const QPointF& vertex, bool selected, bool locked, qreal radius = MM::VERTEX_SELECT_RADIUS, qreal strokeWidth = MM::VERTEX_SELECT_STROKE_WIDTH); -void drawControlsVertices(QPainter* painter, const QList* selectedVertices, const MShape& shape); -void drawControlsEllipse(QPainter* painter, const QList* selectedVertices, const Ellipse& ellipse); -void drawControlsQuad(QPainter* painter, const QList* selectedVertices, const Quad& quad); -void drawControlsMesh(QPainter* painter, const QList* selectedVertices, const Mesh& mesh); -void drawControlsPolygon(QPainter* painter, const QList* selectedVertices, const Polygon& polygon); - /** * Checks if a file exists or not. */