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 *
|
auto VPSheetSceneData::ScenePiece(const VPPiecePtr &piece) const -> VPGraphicsPiece *
|
||||||
{
|
{
|
||||||
VPGraphicsPiece *_graphicsPiece = nullptr;
|
auto _graphicsPiece =
|
||||||
for(auto *graphicPiece : m_graphicsPieces)
|
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)
|
return *_graphicsPiece;
|
||||||
{
|
|
||||||
_graphicsPiece = graphicPiece;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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.")),
|
qCCritical(vMainNoGUIWindow, "%s\n\n%s\n\n%s", qUtf8Printable(tr("File error.")),
|
||||||
qUtf8Printable(e.ErrorMessage()), qUtf8Printable(e.DetailedInformation()));
|
qUtf8Printable(e.ErrorMessage()), qUtf8Printable(e.DetailedInformation()));
|
||||||
|
if (not m.isNull())
|
||||||
|
{
|
||||||
m->clear();
|
m->clear();
|
||||||
|
}
|
||||||
|
|
||||||
if (not VApplication::IsGUIMode())
|
if (not VApplication::IsGUIMode())
|
||||||
{
|
{
|
||||||
qApp->exit(V_EX_NOINPUT);
|
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 ") + QString::number(2008 + 2 * ((_MSC_VER / 100) - 15));
|
||||||
}
|
}
|
||||||
|
return QLatin1String("MSVC <unknown version>");
|
||||||
#else
|
#else
|
||||||
return QStringLiteral("<unknown compiler>");
|
return QStringLiteral("<unknown compiler>");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -223,7 +223,8 @@ bool VPE::VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) c
|
||||||
{
|
{
|
||||||
if (QFile::exists(tmpUrl.toLocalFile()))
|
if (QFile::exists(tmpUrl.toLocalFile()))
|
||||||
{
|
{
|
||||||
tmpFileInfo = QFileInfo(tmpUrl.toLocalFile()); break;
|
tmpFileInfo = QFileInfo(tmpUrl.toLocalFile());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ signals:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void ActivateControls(const QUuid &id);
|
void ActivateControls(const QUuid &id);
|
||||||
void DeactivateControls(QGraphicsItem* pItem);
|
void DeactivateControls(QGraphicsItem* item);
|
||||||
void UpdateControls();
|
void UpdateControls();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -452,7 +452,7 @@ void VBackgroundImageItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *even
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VBackgroundImageItem::keyPressEvent(QKeyEvent *event)
|
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)
|
if (event->key() == Qt::Key_Left)
|
||||||
{
|
{
|
||||||
TranslateImageOn(-move, 0);
|
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;
|
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;
|
m_attachedTabs.at(index)->m_text=text;
|
||||||
setMaximumWidth(TabSizeHint(false).width());
|
setMaximumWidth(TabSizeHint(false).width());
|
||||||
|
|
|
@ -69,13 +69,13 @@ public:
|
||||||
void SetCurrentIndex(int index);
|
void SetCurrentIndex(int index);
|
||||||
int CurrentIndex() const;
|
int CurrentIndex() const;
|
||||||
|
|
||||||
void SetTabToolTip(int index, QString toolTip);
|
void SetTabToolTip(int index, const QString &toolTip);
|
||||||
QString TabToolTip(int index) const;
|
QString TabToolTip(int index) const;
|
||||||
|
|
||||||
QIcon TabIcon(int index) const;
|
QIcon TabIcon(int index) const;
|
||||||
|
|
||||||
QString TabText(int index) const;
|
QString TabText(int index) const;
|
||||||
void SetTabText(int index, QString text);
|
void SetTabText(int index, const QString &text);
|
||||||
|
|
||||||
int Count() const;
|
int Count() const;
|
||||||
QRect TabRect(int index) const;
|
QRect TabRect(int index) const;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user