Skip to content

Commit

Permalink
Fixed some Clang Tools analyzer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JairajJangle committed Jul 3, 2020
1 parent 57e1077 commit ec06254
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CustomWidgets/ChainMenuWidget/chainmenuwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ChainMenuWidget::ChainMenuWidget(QWidget *parent) :

ui->verticalLayout_2->setAlignment(Qt::AlignCenter);

for(auto key : chainMenuOpMap.keys())
for(int &key : chainMenuOpMap.keys())
{
ui->comboBox->addItem(chainMenuOpMap.value(key), key);
}
Expand Down
4 changes: 2 additions & 2 deletions CustomWidgets/focusawarelineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ FocusAwareLineEdit::~FocusAwareLineEdit()
void FocusAwareLineEdit::focusInEvent(QFocusEvent *e)
{
QLineEdit::focusInEvent(e);
emit(focussed(true));
emit focussed(true);
}

void FocusAwareLineEdit::focusOutEvent(QFocusEvent *e)
{
QLineEdit::focusOutEvent(e);
emit(focussed(false));
emit focussed(false);
}
2 changes: 1 addition & 1 deletion OpenCVFunction/backgroundsubtract.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private slots:
this, SLOT(resetChangesClicked()));

learningRateEditLayout->lineEdit->setValidator(
new QRegExpValidator(RegExps::regEx0_1Decimal));
new QRegExpValidator(QRegExp(RegExps::regEx0_1Decimal)));

pKNN = cv::createBackgroundSubtractorKNN(1,2000.0,false); //int history=500, double dist2Threshold=400.0, bool detectShadows=true
pMOG = cv::bgsegm::createBackgroundSubtractorMOG();
Expand Down
8 changes: 4 additions & 4 deletions Utils/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
#include <QRegExp>

namespace Info {
const QString appName = "OpenCV Catalogue";
const QString version = "v0.2.1";
static const char* appName = "OpenCV Catalogue";
static const char* version = "v0.2.1";
}

namespace RegExps {
const QRegExp regEx0_1Decimal = QRegExp("^(0(\\.[0-9]{1,4})?|1(\\.0{1,4})?)$");
static const char* regEx0_1Decimal = "^(0(\\.[0-9]{1,4})?|1(\\.0{1,4})?)$";
}

namespace Strings {
const QString noOperationSelected = "No operation Selected";
static const char* noOperationSelected = "No operation Selected";
}

#endif // CONSTANTS_H
10 changes: 5 additions & 5 deletions Window/MainWindow/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,18 @@ void MainWindow::refreshOperationWidgets()
if(vBoxSub->count() > 1)
{
dynamic_cast<ChainMenuWidget*>(vBoxSub->itemAt(vBoxSub->count() - 2)->
widget())->setLineVisibility(true);
widget())->setLineVisibility(true);
dynamic_cast<ChainMenuWidget*>(vBoxSub->itemAt(vBoxSub->count() - 2)->
widget())->setEnabled(false);
widget())->setEnabled(false);
dynamic_cast<ChainMenuWidget*>(vBoxSub->itemAt(vBoxSub->count() - 1)->
widget())->setEnabled(true);
widget())->setEnabled(true);
}
else if(vBoxSub->count() == 1)
{
dynamic_cast<ChainMenuWidget*>(vBoxSub->itemAt(vBoxSub->count() - 1)->
widget())->setEnabled(true);
widget())->setEnabled(true);
dynamic_cast<ChainMenuWidget*>(vBoxSub->itemAt(vBoxSub->count() - 1)->
widget())->setRemoveButtonEnabled(false);
widget())->setRemoveButtonEnabled(false);
}

wgtSub->update();
Expand Down
4 changes: 2 additions & 2 deletions Window/MainWindow/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ private slots:
void GetSourceCaptureImage();
void GetSourceCaptureError(QString);
void toggleFlipSource(bool);
void addOperation(OPCodes opCode = NONE);
void lastOperationChanged(OPCodes opCode);
void addOperation(MainWindow::OPCodes opCode = NO_OPERATION);
void lastOperationChanged(MainWindow::OPCodes opCode);
void showAboutDialog();
void outputLabelLBClicked(int x, int y);
void showHideExplodedView();
Expand Down

0 comments on commit ec06254

Please sign in to comment.