Cppcheck warnings.
This commit is contained in:
parent
28b4874441
commit
882f4ba0bf
|
@ -218,16 +218,16 @@ auto VPSheetSceneData::RotationControls() const -> VPGraphicsPieceControls *
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VPSheetSceneData::ScenePiece(const VPPiecePtr &piece) const -> VPGraphicsPiece *
|
||||
{
|
||||
VPGraphicsPiece *_graphicsPiece = nullptr;
|
||||
for(auto *graphicPiece : m_graphicsPieces)
|
||||
auto _graphicsPiece =
|
||||
std::find_if(m_graphicsPieces.begin(), m_graphicsPieces.end(),
|
||||
[piece](VPGraphicsPiece *graphicPiece) { return graphicPiece->GetPiece() == piece; });
|
||||
|
||||
if (_graphicsPiece != m_graphicsPieces.end())
|
||||
{
|
||||
if(graphicPiece->GetPiece() == piece)
|
||||
{
|
||||
_graphicsPiece = graphicPiece;
|
||||
}
|
||||
return *_graphicsPiece;
|
||||
}
|
||||
|
||||
return _graphicsPiece;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -1373,7 +1373,11 @@ QSharedPointer<VMeasurements> MainWindowsNoGUI::OpenMeasurementFile(const QStrin
|
|||
{
|
||||
qCCritical(vMainNoGUIWindow, "%s\n\n%s\n\n%s", qUtf8Printable(tr("File error.")),
|
||||
qUtf8Printable(e.ErrorMessage()), qUtf8Printable(e.DetailedInformation()));
|
||||
if (not m.isNull())
|
||||
{
|
||||
m->clear();
|
||||
}
|
||||
|
||||
if (not VApplication::IsGUIMode())
|
||||
{
|
||||
qApp->exit(V_EX_NOINPUT);
|
||||
|
|
|
@ -93,6 +93,7 @@ QString compilerString()
|
|||
{
|
||||
return QLatin1String("MSVC ") + QString::number(2008 + 2 * ((_MSC_VER / 100) - 15));
|
||||
}
|
||||
return QLatin1String("MSVC <unknown version>");
|
||||
#else
|
||||
return QStringLiteral("<unknown compiler>");
|
||||
#endif
|
||||
|
|
|
@ -223,7 +223,8 @@ bool VPE::VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) c
|
|||
{
|
||||
if (QFile::exists(tmpUrl.toLocalFile()))
|
||||
{
|
||||
tmpFileInfo = QFileInfo(tmpUrl.toLocalFile()); break;
|
||||
tmpFileInfo = QFileInfo(tmpUrl.toLocalFile());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ signals:
|
|||
|
||||
public slots:
|
||||
void ActivateControls(const QUuid &id);
|
||||
void DeactivateControls(QGraphicsItem* pItem);
|
||||
void DeactivateControls(QGraphicsItem* item);
|
||||
void UpdateControls();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -452,7 +452,7 @@ void VBackgroundImageItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *even
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VBackgroundImageItem::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
const int move = event->modifiers() & Qt::ShiftModifier ? 10 : 1;
|
||||
const int move = (event->modifiers() & Qt::ShiftModifier) ? 10 : 1;
|
||||
if (event->key() == Qt::Key_Left)
|
||||
{
|
||||
TranslateImageOn(-move, 0);
|
||||
|
|
|
@ -604,7 +604,7 @@ int FancyTabBar::CurrentIndex() const
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void FancyTabBar::SetTabToolTip(int index, QString toolTip)
|
||||
void FancyTabBar::SetTabToolTip(int index, const QString &toolTip)
|
||||
{
|
||||
m_attachedTabs[index]->m_toolTip = toolTip;
|
||||
}
|
||||
|
@ -628,7 +628,7 @@ QString FancyTabBar::TabText(int index) const
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void FancyTabBar::SetTabText(int index, QString text)
|
||||
void FancyTabBar::SetTabText(int index, const QString &text)
|
||||
{
|
||||
m_attachedTabs.at(index)->m_text=text;
|
||||
setMaximumWidth(TabSizeHint(false).width());
|
||||
|
|
|
@ -69,13 +69,13 @@ public:
|
|||
void SetCurrentIndex(int index);
|
||||
int CurrentIndex() const;
|
||||
|
||||
void SetTabToolTip(int index, QString toolTip);
|
||||
void SetTabToolTip(int index, const QString &toolTip);
|
||||
QString TabToolTip(int index) const;
|
||||
|
||||
QIcon TabIcon(int index) const;
|
||||
|
||||
QString TabText(int index) const;
|
||||
void SetTabText(int index, QString text);
|
||||
void SetTabText(int index, const QString &text);
|
||||
|
||||
int Count() const;
|
||||
QRect TabRect(int index) const;
|
||||
|
|
Loading…
Reference in New Issue
Block a user