[TD]CI clang warnings
This commit is contained in:
@@ -61,9 +61,6 @@
|
||||
#include "PreferencesGui.h"
|
||||
#include "QGIArrow.h"
|
||||
#include "ViewProviderLeader.h"
|
||||
#include "MDIViewPage.h"
|
||||
#include "DrawGuiUtil.h"
|
||||
#include "QGVPage.h"
|
||||
#include "QGIPrimPath.h"
|
||||
#include "QGEPath.h"
|
||||
|
||||
@@ -90,15 +87,15 @@ QGILeaderLine::QGILeaderLine() :
|
||||
setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||
setFlag(QGraphicsItem::ItemIsMovable, false);
|
||||
setFlag(QGraphicsItem::ItemSendsScenePositionChanges, false);
|
||||
setFlag(QGraphicsItem::ItemSendsGeometryChanges,true);
|
||||
|
||||
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||
|
||||
setCacheMode(QGraphicsItem::NoCache);
|
||||
|
||||
m_line = new QGIPrimPath();
|
||||
addToGroup(m_line);
|
||||
m_line->setFlag(QGraphicsItem::ItemIsSelectable, false);
|
||||
m_line->setAcceptHoverEvents(false);
|
||||
m_line->setPos(0.0,0.0);
|
||||
m_line->setPos(0.0, 0.0);
|
||||
|
||||
m_editPath = new QGEPath(this);
|
||||
addToGroup(m_editPath);
|
||||
@@ -111,7 +108,7 @@ QGILeaderLine::QGILeaderLine() :
|
||||
|
||||
m_arrow1 = new QGIArrow();
|
||||
addToGroup(m_arrow1);
|
||||
m_arrow1->setPos(0.0,0.0);
|
||||
m_arrow1->setPos(0.0, 0.0);
|
||||
m_arrow1->hide();
|
||||
m_arrow2 = new QGIArrow();
|
||||
addToGroup(m_arrow2);
|
||||
@@ -133,7 +130,7 @@ void QGILeaderLine::setLeaderFeature(TechDraw::DrawLeaderLine* feat)
|
||||
|
||||
float x = Rez::guiX(feat->X.getValue());
|
||||
float y = Rez::guiX(-feat->Y.getValue());
|
||||
setPos(x,y);
|
||||
setPos(x, y);
|
||||
|
||||
setNormalColorAll();
|
||||
setPrettyNormal();
|
||||
@@ -160,20 +157,20 @@ QVariant QGILeaderLine::itemChange(GraphicsItemChange change, const QVariant &va
|
||||
//QGILL isn't draggable so skip QGIV::mousePress have event
|
||||
void QGILeaderLine::mousePressEvent(QGraphicsSceneMouseEvent * event)
|
||||
{
|
||||
// Base::Console().Message("QGILL::mousePressEvent() - %s\n",getViewName());
|
||||
// Base::Console().Message("QGILL::mousePressEvent() - %s\n", getViewName());
|
||||
QGraphicsItem::mousePressEvent(event);
|
||||
}
|
||||
|
||||
//QGILL isn't draggable so skip QGIV::mouseRelease
|
||||
void QGILeaderLine::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
||||
{
|
||||
// Base::Console().Message("QGILL::mouseReleaseEvent() - %s\n",getViewName());
|
||||
// Base::Console().Message("QGILL::mouseReleaseEvent() - %s\n", getViewName());
|
||||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
void QGILeaderLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
// Base::Console().Message("QGILL::hoverEnter() - selected; %d\n",isSelected());
|
||||
// Base::Console().Message("QGILL::hoverEnter() - selected; %d\n", isSelected());
|
||||
m_hasHover = true;
|
||||
if (!isSelected()) {
|
||||
setPrettyPre();
|
||||
@@ -183,7 +180,7 @@ void QGILeaderLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
|
||||
void QGILeaderLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
// Base::Console().Message("QGILL::hoverLeave() - selected; %d\n",isSelected());
|
||||
// Base::Console().Message("QGILL::hoverLeave() - selected; %d\n", isSelected());
|
||||
m_hasHover = false;
|
||||
if(!isSelected()) {
|
||||
setPrettyNormal();
|
||||
@@ -193,7 +190,7 @@ void QGILeaderLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
|
||||
void QGILeaderLine::onSourceChange(TechDraw::DrawView* newParent)
|
||||
{
|
||||
// Base::Console().Message("QGILL::onSoureChange(%s)\n",newParent->getNameInDocument());
|
||||
// Base::Console().Message("QGILL::onSoureChange(%s)\n", newParent->getNameInDocument());
|
||||
std::string parentName = newParent->getNameInDocument();
|
||||
QGIView* qgiParent = getQGIVByName(parentName);
|
||||
if (qgiParent) {
|
||||
@@ -201,7 +198,7 @@ void QGILeaderLine::onSourceChange(TechDraw::DrawView* newParent)
|
||||
setParentItem(m_parentItem);
|
||||
draw();
|
||||
} else {
|
||||
Base::Console().Warning("QGILL::onSourceChange - new parent %s has no QGIView\n",parentName.c_str());
|
||||
Base::Console().Warning("QGILL::onSourceChange - new parent %s has no QGIView\n", parentName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,14 +239,14 @@ void QGILeaderLine::closeEdit()
|
||||
{
|
||||
// Base::Console().Message("QGIL::closeEdit()\n");
|
||||
if (m_editPath) {
|
||||
m_editPath->onEndEdit(); //tell QEPath that edit session ended
|
||||
m_editPath->onEndEdit(); //tell QEPath that edit session ended
|
||||
}
|
||||
}
|
||||
|
||||
//signaled from QEPath
|
||||
void QGILeaderLine::onLineEditFinished(QPointF tipDisplace, std::vector<QPointF> points)
|
||||
{
|
||||
// Base::Console().Message("QGILL::onLineEditFinished(%s, %d)\n",
|
||||
// Base::Console().Message("QGILL::onLineEditFinished(%s, %d)\n",
|
||||
// TechDraw::DrawUtil::formatVector(tipDisplace).c_str(),
|
||||
// points.size());
|
||||
m_blockDraw = true;
|
||||
@@ -258,8 +255,8 @@ void QGILeaderLine::onLineEditFinished(QPointF tipDisplace, std::vector<QPointF>
|
||||
return;
|
||||
double baseScale = featLeader->getBaseScale();
|
||||
|
||||
if ( !(TechDraw::DrawUtil::fpCompare(tipDisplace.x(),0.0) &&
|
||||
TechDraw::DrawUtil::fpCompare(tipDisplace.y(),0.0)) ) {
|
||||
if ( !(TechDraw::DrawUtil::fpCompare(tipDisplace.x(), 0.0) &&
|
||||
TechDraw::DrawUtil::fpCompare(tipDisplace.y(), 0.0)) ) {
|
||||
//tip was moved. need to change AttachPoint
|
||||
QPointF oldAttach = getAttachFromFeature();
|
||||
QPointF newAttach = oldAttach + (tipDisplace / baseScale);
|
||||
@@ -271,7 +268,7 @@ void QGILeaderLine::onLineEditFinished(QPointF tipDisplace, std::vector<QPointF>
|
||||
std::vector<Base::Vector3d> waypoints;
|
||||
for (auto& p: points) {
|
||||
QPointF moved = p - tipDisplace;
|
||||
Base::Vector3d v(moved.x(),moved.y(),0.0);
|
||||
Base::Vector3d v(moved.x(), moved.y(), 0.0);
|
||||
waypoints.push_back(v);
|
||||
}
|
||||
waypoints.at(0) = Base::Vector3d(0.0, 0.0, 0.0);
|
||||
@@ -329,7 +326,7 @@ void QGILeaderLine::restoreState()
|
||||
|
||||
void QGILeaderLine::updateView(bool update)
|
||||
{
|
||||
// Base::Console().Message("QGIL::updateView() %s\n",getViewObject()->getNameInDocument());
|
||||
// Base::Console().Message("QGIL::updateView() %s\n", getViewObject()->getNameInDocument());
|
||||
Q_UNUSED(update);
|
||||
auto featLeader( dynamic_cast<TechDraw::DrawLeaderLine*>(getViewObject()) );
|
||||
if (!featLeader) {
|
||||
@@ -375,7 +372,7 @@ void QGILeaderLine::draw()
|
||||
double baseScale = featLeader->getBaseScale();
|
||||
double x = Rez::guiX(featLeader->X.getValue());
|
||||
double y = - Rez::guiX(featLeader->Y.getValue());
|
||||
QPointF aPoint(x,y);
|
||||
QPointF aPoint(x, y);
|
||||
aPoint *= baseScale;
|
||||
setPos(aPoint);
|
||||
|
||||
@@ -383,7 +380,7 @@ void QGILeaderLine::draw()
|
||||
m_line->setStyle(m_lineStyle);
|
||||
m_line->setWidth(getLineWidth());
|
||||
|
||||
m_line->setPos(0,0); //make m_line coords == leader coords
|
||||
m_line->setPos(0, 0); //make m_line coords == leader coords
|
||||
|
||||
std::vector<QPointF> qPoints = getWayPointsFromFeature();
|
||||
if (featLeader->Scalable.getValue()) {
|
||||
@@ -416,9 +413,9 @@ QPainterPath QGILeaderLine::makeLeaderPath(std::vector<QPointF> qPoints)
|
||||
return result;
|
||||
}
|
||||
|
||||
QPointF startAdjVec(0.0,0.0);
|
||||
QPointF startAdjVec(0.0, 0.0);
|
||||
double startAdjLength(0.0);
|
||||
QPointF endAdjVec(0.0,0.0);
|
||||
QPointF endAdjVec(0.0, 0.0);
|
||||
double endAdjLength(0.0);
|
||||
if (qPoints.size() > 1) {
|
||||
//make path adjustment to hide leaderline ends behind arrowheads
|
||||
@@ -464,7 +461,7 @@ QPointF QGILeaderLine::getAttachFromFeature()
|
||||
}
|
||||
double x = Rez::guiX(featLeader->X.getValue());
|
||||
double y = - Rez::guiX(featLeader->Y.getValue());
|
||||
result = QPointF(x,y);
|
||||
result = QPointF(x, y);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -492,7 +489,7 @@ std::vector<QPointF> QGILeaderLine::getWayPointsFromFeature()
|
||||
void QGILeaderLine::setArrows(std::vector<QPointF> pathPoints)
|
||||
{
|
||||
// Base::Console().Message("QGILL::setArrows()\n");
|
||||
Base::Vector3d stdX(1.0,0.0,0.0);
|
||||
Base::Vector3d stdX(1.0, 0.0, 0.0);
|
||||
TechDraw::DrawLeaderLine* featLeader = getFeature();
|
||||
|
||||
QPointF lastOffset = (pathPoints.back() - pathPoints.front());
|
||||
@@ -509,16 +506,16 @@ void QGILeaderLine::setArrows(std::vector<QPointF> pathPoints)
|
||||
QPointF s = (*it);
|
||||
QPointF e = (*(it + 1));
|
||||
QPointF qsVec = s - e;
|
||||
Base::Vector3d sVec(qsVec.x(),qsVec.y(),0.0);
|
||||
Base::Vector3d sVec(qsVec.x(), qsVec.y(), 0.0);
|
||||
m_arrow1->setDirection(sVec);
|
||||
m_arrow1->setPos(0.0,0.0);
|
||||
m_arrow1->setPos(0.0, 0.0);
|
||||
}
|
||||
m_arrow1->draw();
|
||||
m_arrow1->show();
|
||||
} else {
|
||||
m_arrow1->hide();
|
||||
}
|
||||
|
||||
|
||||
if (featLeader->EndSymbol.getValue() != ArrowType::NONE) {
|
||||
m_arrow2->setStyle(featLeader->EndSymbol.getValue());
|
||||
m_arrow2->setWidth(getLineWidth());
|
||||
@@ -529,7 +526,7 @@ void QGILeaderLine::setArrows(std::vector<QPointF> pathPoints)
|
||||
QPointF s = (*itr);
|
||||
QPointF e = (*(itr + 1));
|
||||
QPointF qeVec = s - e;
|
||||
Base::Vector3d eVec(qeVec.x(),qeVec.y(),0.0);
|
||||
Base::Vector3d eVec(qeVec.x(), qeVec.y(), 0.0);
|
||||
m_arrow2->setDirection(eVec);
|
||||
m_arrow2->setPos(lastOffset);
|
||||
}
|
||||
@@ -567,7 +564,7 @@ double QGILeaderLine::getLineWidth()
|
||||
|
||||
TechDraw::DrawLeaderLine* QGILeaderLine::getFeature()
|
||||
{
|
||||
TechDraw::DrawLeaderLine* result =
|
||||
TechDraw::DrawLeaderLine* result =
|
||||
static_cast<TechDraw::DrawLeaderLine*>(getViewObject());
|
||||
return result;
|
||||
}
|
||||
@@ -577,23 +574,16 @@ double QGILeaderLine::getEdgeFuzz() const
|
||||
return PreferencesGui::edgeFuzz();
|
||||
}
|
||||
|
||||
QColor QGILeaderLine::getNormalColor()
|
||||
QColor QGILeaderLine::prefNormalColor()
|
||||
{
|
||||
// Base::Console().Message("QGILL::getNormalColor()\n");
|
||||
m_colNormal = PreferencesGui::leaderQColor();
|
||||
setNormalColor(PreferencesGui::leaderQColor());
|
||||
|
||||
auto lead( dynamic_cast<TechDraw::DrawLeaderLine*>(getViewObject()) );
|
||||
if (!lead)
|
||||
// Base::Console().Message("QGILL::getNormalColor - no feature\n");
|
||||
return m_colNormal;
|
||||
|
||||
auto vp = static_cast<ViewProviderLeader*>(getViewProvider(getViewObject()));
|
||||
if (!vp)
|
||||
// Base::Console().Message("QGILL::getNormalColor - no viewProvider\n");
|
||||
return m_colNormal;
|
||||
|
||||
m_colNormal = vp->Color.getValue().asValue<QColor>();
|
||||
return m_colNormal;
|
||||
auto vp = dynamic_cast<ViewProviderLeader*>(getViewProvider(getViewObject()));
|
||||
if (vp) {
|
||||
setNormalColor(vp->Color.getValue().asValue<QColor>());
|
||||
}
|
||||
return getNormalColor();
|
||||
}
|
||||
|
||||
QRectF QGILeaderLine::boundingRect() const
|
||||
|
||||
Reference in New Issue
Block a user