[TD]CI clang warnings

This commit is contained in:
wandererfan
2022-08-23 15:32:13 -04:00
committed by WandererFan
parent c075a298ae
commit aa2b1b8392
246 changed files with 3944 additions and 4241 deletions

View File

@@ -95,7 +95,7 @@ QGIRichAnno::QGIRichAnno() :
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemIsMovable, true);
setFlag(QGraphicsItem::ItemSendsScenePositionChanges, true);
setFlag(QGraphicsItem::ItemSendsGeometryChanges,true);
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
m_text = new QGCustomText();
m_text->setTextInteractionFlags(Qt::NoTextInteraction);
@@ -107,7 +107,7 @@ QGIRichAnno::QGIRichAnno() :
addToGroup(m_rect);
m_rect->setZValue(ZVALUE::DIMENSION - 1);
m_rect->centerAt(0.0, 0.0);
setZValue(ZVALUE::DIMENSION);
}
@@ -157,7 +157,7 @@ void QGIRichAnno::drawBorder()
void QGIRichAnno::draw()
{
// Base::Console().Log("QGIRA::draw() - %s - parent: %X\n",getFeature()->getNameInDocument(), parentItem());
// Base::Console().Log("QGIRA::draw() - %s - parent: %X\n", getFeature()->getNameInDocument(), parentItem());
if (!isVisible())
// Base::Console().Message("QGIRA::draw - not visible\n");
return;
@@ -180,14 +180,14 @@ void QGIRichAnno::draw()
void QGIRichAnno::setTextItem()
{
// Base::Console().Message("QGIRA::setTextItem() - %s\n",getViewName());
// Base::Console().Message("QGIRA::setTextItem() - %s\n", getViewName());
TechDraw::DrawRichAnno* annoFeat = getFeature();
QString inHtml = QString::fromUtf8(annoFeat->AnnoText.getValue());
//don't do this multiplication if exporting to SVG as other apps interpret
//don't do this multiplication if exporting to SVG as other apps interpret
//font sizes differently from QGraphicsTextItem (?)
if (!getExporting()) {
//convert point font sizes to (Rez,mm) font sizes
//convert point font sizes to (Rez, mm) font sizes
QRegExp rxFontSize(QString::fromUtf8("font-size:([0-9]*)pt;"));
double mmPerPoint = 0.353;
double sizeConvert = Rez::getRezFactor() * mmPerPoint;
@@ -197,13 +197,13 @@ void QGIRichAnno::setTextItem()
while ((pos = rxFontSize.indexIn(inHtml, pos)) != -1) {
QString found = rxFontSize.cap(0);
findList << found;
QString qsOldSize = rxFontSize.cap(1);
QString qsOldSize = rxFontSize.cap(1);
QString repl = found;
double newSize = qsOldSize.toDouble();
newSize = newSize * sizeConvert;
QString qsNewSize = QString::number(newSize, 'f', 2);
repl.replace(qsOldSize,qsNewSize);
repl.replace(qsOldSize, qsNewSize);
replList << repl;
pos += rxFontSize.matchedLength();
}
@@ -220,7 +220,7 @@ void QGIRichAnno::setTextItem()
// m_text->update();
if (annoFeat->ShowFrame.getValue()) {
QRectF r = m_text->boundingRect().adjusted(1,1,-1,-1);
QRectF r = m_text->boundingRect().adjusted(1, 1,-1, -1);
m_rect->setPen(rectPen());
m_rect->setBrush(Qt::NoBrush);
m_rect->setRect(r);
@@ -273,15 +273,15 @@ void QGIRichAnno::setLineSpacing(int lineSpacing)
TechDraw::DrawRichAnno* QGIRichAnno::getFeature()
{
TechDraw::DrawRichAnno* result =
TechDraw::DrawRichAnno* result =
static_cast<TechDraw::DrawRichAnno*>(getViewObject());
return result;
}
QRectF QGIRichAnno::boundingRect() const
{
QRectF rect = mapFromItem(m_text,m_text->boundingRect()).boundingRect();
return rect.adjusted(-10.,-10.,10.,10.);
QRectF rect = mapFromItem(m_text, m_text->boundingRect()).boundingRect();
return rect.adjusted(-10., -10., 10., 10.);
}
void QGIRichAnno::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) {
@@ -306,7 +306,7 @@ QPen QGIRichAnno::rectPen() const
double rectWeight = Rez::guiX(vp->LineWidth.getValue());
Qt::PenStyle rectStyle = (Qt::PenStyle) vp->LineStyle.getValue();
App::Color temp = vp->LineColor.getValue();
QColor rectColor = temp.asValue<QColor>();
QColor rectColor = temp.asValue<QColor>();
pen = QPen(rectStyle);
pen.setWidthF(rectWeight);
@@ -326,7 +326,7 @@ double QGIRichAnno::prefPointSize()
//this conversion is only approximate. the factor changes for different fonts.
// double mmToPts = 2.83; //theoretical value
double mmToPts = 2.00; //practical value. seems to be reasonable for common fonts.
double ptsSize = round(fontSize * mmToPts);
return ptsSize;
}