From 663ab8aff1c96dd30e5b27aba0d5c97650ec2a75 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 19 Jun 2017 17:44:18 +0300 Subject: [PATCH] SonarCloud warnings. --HG-- branch : develop --- src/app/valentina/mainwindow.cpp | 4 ++-- src/libs/vwidgets/vgraphicssimpletextitem.cpp | 6 +++--- src/libs/vwidgets/vgraphicssimpletextitem.h | 4 ++-- src/libs/vwidgets/vscenepoint.cpp | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 05994ad4b..7086abab6 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -1185,8 +1185,8 @@ void MainWindow::ZoomFitBestCurrent() QTransform transform = ui->view->transform(); qreal factor = transform.m11(); - factor = qMax(factor, ui->view->MinScale()); - factor = qMin(factor, ui->view->MaxScale()); + factor = qMax(factor, VMainGraphicsView::MinScale()); + factor = qMin(factor, VMainGraphicsView::MaxScale()); transform.setMatrix(factor, transform.m12(), transform.m13(), transform.m21(), factor, transform.m23(), transform.m31(), transform.m32(), transform.m33()); diff --git a/src/libs/vwidgets/vgraphicssimpletextitem.cpp b/src/libs/vwidgets/vgraphicssimpletextitem.cpp index 79723fd71..6d0387983 100644 --- a/src/libs/vwidgets/vgraphicssimpletextitem.cpp +++ b/src/libs/vwidgets/vgraphicssimpletextitem.cpp @@ -53,7 +53,7 @@ * @param parent parent object. */ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem(QGraphicsItem * parent) - :QGraphicsSimpleTextItem(parent), fontSize(0), selectionType(SelectionType::ByMouseRelease) + :QGraphicsSimpleTextItem(parent), m_fontSize(0), selectionType(SelectionType::ByMouseRelease) { this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setFlag(QGraphicsItem::ItemIsSelectable, true); @@ -62,7 +62,7 @@ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem(QGraphicsItem * parent) this->setAcceptHoverEvents(true); QFont font = this->font(); font.setPointSize(font.pointSize()+20); - fontSize = font.pointSize(); + m_fontSize = font.pointSize(); this->setFont(font); } @@ -73,7 +73,7 @@ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem(QGraphicsItem * parent) * @param parent parent object. */ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem( const QString & text, QGraphicsItem * parent ) - :QGraphicsSimpleTextItem(text, parent), fontSize(0), selectionType(SelectionType::ByMouseRelease) + :QGraphicsSimpleTextItem(text, parent), m_fontSize(0), selectionType(SelectionType::ByMouseRelease) { this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setFlag(QGraphicsItem::ItemIsSelectable, true); diff --git a/src/libs/vwidgets/vgraphicssimpletextitem.h b/src/libs/vwidgets/vgraphicssimpletextitem.h index 526edbd58..aa48fc277 100644 --- a/src/libs/vwidgets/vgraphicssimpletextitem.h +++ b/src/libs/vwidgets/vgraphicssimpletextitem.h @@ -85,7 +85,7 @@ protected: virtual void keyReleaseEvent ( QKeyEvent * event ) Q_DECL_OVERRIDE; private: /** @brief fontSize label font size. */ - qint32 fontSize; + qint32 m_fontSize; SelectionType selectionType; }; @@ -96,7 +96,7 @@ private: */ inline qint32 VGraphicsSimpleTextItem::BaseFontSize() const { - return fontSize; + return m_fontSize; } #endif // VGRAPHICSSIMPLETEXTITEM_H diff --git a/src/libs/vwidgets/vscenepoint.cpp b/src/libs/vwidgets/vscenepoint.cpp index d2bf59fd4..9bd183834 100644 --- a/src/libs/vwidgets/vscenepoint.cpp +++ b/src/libs/vwidgets/vscenepoint.cpp @@ -140,7 +140,8 @@ void VScenePoint::RefreshLine() if (not rect().intersects(nRec)) { const QRectF nameRec = m_namePoint->sceneBoundingRect(); - QPointF p1, p2; + QPointF p1; + QPointF p2; VGObject::LineIntersectCircle(QPointF(), ScaledRadius(SceneScale(scene())), QLineF(QPointF(), nameRec.center() - scenePos()), p1, p2); const QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center()));