TD: Fix warnings
This commit is contained in:
committed by
Chris Hennes
parent
a102c8a359
commit
2dcb495a67
@@ -1567,17 +1567,16 @@ DrawComplexSection::findNormalForFace(const TopoDS_Face& face,
|
||||
const std::vector<std::pair<int, Base::Vector3d>>& normalKV,
|
||||
const std::vector<TopoDS_Edge>& segmentEdges)
|
||||
{
|
||||
size_t index = getSegmentIndex(face, segmentEdges);
|
||||
if (index < 0 ||
|
||||
index >= segmentEdges.size()) { //NOLINT
|
||||
int index = getSegmentIndex(face, segmentEdges);
|
||||
if (index < 0) {
|
||||
throw Base::RuntimeError("DCS::findNormalForFace - did not find normal for face!");
|
||||
}
|
||||
for (auto& keyValue : normalKV) {
|
||||
if (static_cast<size_t>(keyValue.first) == index) {
|
||||
if (keyValue.first == index) {
|
||||
return keyValue;
|
||||
}
|
||||
}
|
||||
throw Base::RuntimeError("DCS::findNormalForFace - no keyValue pair for segment!");
|
||||
throw Base::RuntimeError("DCS::findNormalForFace - no keyValue pair for segment!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ void QGIRichAnno::setTextItem()
|
||||
}
|
||||
|
||||
if (m_isEditing) {
|
||||
Q_EMIT positionChanged(scenePos());
|
||||
Q_EMIT positionChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ void QGIRichAnno::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
|
||||
|
||||
QTimer::singleShot(0, this, [this]() {
|
||||
if (this && scene()) {
|
||||
Q_EMIT positionChanged(scenePos());
|
||||
Q_EMIT positionChanged();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -508,7 +508,7 @@ void QGIRichAnno::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
|
||||
// Ensure focus returns to the text item after the resize handle is released
|
||||
refocusAnnotation();
|
||||
|
||||
Q_EMIT positionChanged(scenePos());
|
||||
Q_EMIT positionChanged();
|
||||
|
||||
if (!isUnderMouse()) {
|
||||
QGraphicsSceneHoverEvent leaveEvent(QEvent::GraphicsSceneHoverLeave);
|
||||
@@ -585,7 +585,7 @@ void QGIRichAnno::setEditMode(bool enable)
|
||||
|
||||
refocusAnnotation();
|
||||
|
||||
Q_EMIT positionChanged(scenePos());
|
||||
Q_EMIT positionChanged();
|
||||
}
|
||||
else {
|
||||
m_text->setTextInteractionFlags(Qt::NoTextInteraction);
|
||||
@@ -637,7 +637,7 @@ QVariant QGIRichAnno::itemChange(GraphicsItemChange change, const QVariant& valu
|
||||
{
|
||||
if (change == QGraphicsItem::ItemScenePositionHasChanged
|
||||
&& scene()) {
|
||||
Q_EMIT positionChanged(scenePos());
|
||||
Q_EMIT positionChanged();
|
||||
}
|
||||
return QGIView::itemChange(change, value);
|
||||
}
|
||||
@@ -661,7 +661,7 @@ void QGIRichAnno::updateLayout()
|
||||
update();
|
||||
|
||||
if (scene()) {
|
||||
Q_EMIT positionChanged(scenePos());
|
||||
Q_EMIT positionChanged();
|
||||
}
|
||||
drawBorder();
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
void widthChanged();
|
||||
void textChanged();
|
||||
void selectionChanged();
|
||||
void positionChanged(const QPointF& scenePos);
|
||||
void positionChanged();
|
||||
|
||||
protected:
|
||||
void draw() override;
|
||||
@@ -154,4 +154,4 @@ private Q_SLOTS:
|
||||
void onContentsChanged();
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ void TaskRichAnno::onViewTransformed()
|
||||
// When the view pans, the item's scene position hasn't changed.
|
||||
// We just need to re-run the position calculation with its current scenePos.
|
||||
if (m_qgiAnno) {
|
||||
onViewPositionChanged(m_qgiAnno->scenePos());
|
||||
onViewPositionChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ void TaskRichAnno::onViewSelectionChanged()
|
||||
|
||||
}
|
||||
|
||||
void TaskRichAnno::onViewPositionChanged(const QPointF& scenePos)
|
||||
void TaskRichAnno::onViewPositionChanged()
|
||||
{
|
||||
// Make sure you have a local variable for the QGVPage to make the code cleaner
|
||||
QGVPage* graphicsView = nullptr;
|
||||
|
||||
@@ -99,7 +99,7 @@ protected Q_SLOTS:
|
||||
void refocusAnnotation();
|
||||
|
||||
void onViewSelectionChanged();
|
||||
void onViewPositionChanged(const QPointF& scenePos);
|
||||
void onViewPositionChanged();
|
||||
|
||||
private:
|
||||
void removeViewFilter();
|
||||
@@ -168,4 +168,4 @@ private:
|
||||
Gui::TaskView::TaskBox* taskbox;
|
||||
};
|
||||
|
||||
} //namespace TechDrawGui
|
||||
} //namespace TechDrawGui
|
||||
|
||||
@@ -819,7 +819,7 @@ void MRichTextEdit::addFontSize(QString fontSize)
|
||||
}
|
||||
|
||||
// 2. Check if the new size is already in the list (using fuzzy comparison for doubles)
|
||||
for (double existingSize : qAsConst(sizes)) {
|
||||
for (double existingSize : std::as_const(sizes)) {
|
||||
if (qFuzzyCompare(existingSize, newSize)) {
|
||||
// Already exists, just make sure it's the current text
|
||||
f_fontsize->setCurrentText(QString::number(newSize, 'g', 4));
|
||||
@@ -833,7 +833,7 @@ void MRichTextEdit::addFontSize(QString fontSize)
|
||||
|
||||
// 4. Repopulate the combobox with the sorted, correctly formatted list
|
||||
QStringList newList;
|
||||
for (double size : qAsConst(sizes)) {
|
||||
for (double size : std::as_const(sizes)) {
|
||||
newList << QString::number(size, 'g', 4);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user