Skip to content

Commit

Permalink
Fixed QMap < Operator issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JairajJangle committed May 14, 2022
1 parent 65c486e commit 6d17e61
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CustomWidgets/labelledcombobox.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ class LabelledComboBox : public QHBoxLayout
}

explicit LabelledComboBox(QString title,
QMap<QVariant, QString> nameValueMap,
QMap<int, QString> nameValueMap,
int comboBoxFixedWidth = 0,
int labelFixedWidth = 0,
QWidget *parent = nullptr)
:QHBoxLayout(parent)
{
QMapIterator<QVariant, QString> i(nameValueMap);
QMapIterator<int, QString> i(nameValueMap);
while (i.hasNext())
{
i.next();
Expand Down
2 changes: 1 addition & 1 deletion OpenCVFunction/backgroundsubtract.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void resetAnchorClicked(){
}

private:
QList<cv::Ptr< cv::BackgroundSubtractor>> bkgSubTechList;
QList<cv::Ptr<cv::BackgroundSubtractor>> bkgSubTechList;

// More at: https://docs.opencv.org/3.4/d7/df6/classcv_1_1BackgroundSubtractor.html
QList<QString> bkgSubTechs = { "KNN", "MOG", "MOG2", "GMG", "GSOC", "CNT", "LSBP" };
Expand Down
4 changes: 2 additions & 2 deletions OpenCVFunction/bitwiseops.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class BitWise: public BaseConfigWidget
const QString baseInfoLink = "https://docs.opencv.org/2.4/modules/core/doc/operations_on_arrays.html#bitwise-";
public:
enum BitWiseLogic{AND, OR, XOR, NOT};
QMap <QVariant, QString> logicNameMap = {
QMap<int, QString> logicNameMap = {
{AND, "AND"},
{OR, "OR"},
{XOR, "XOR"},
Expand Down Expand Up @@ -87,7 +87,7 @@ class BitWise: public BaseConfigWidget
private slots:
void logicTypeChanged(QVariant value){
selectedLogic = static_cast<BitWiseLogic>(value.toInt());
moreInfoLink = baseInfoLink + logicNameMap.value(value).toLower();
moreInfoLink = baseInfoLink + logicNameMap.value(value.toInt()).toLower();
qDebug() << "Selected Bitwise operator: " << selectedLogic;
}
private:
Expand Down
14 changes: 10 additions & 4 deletions Utils/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ void logger(QtMsgType type, const QMessageLogContext &context, const QString &ms

if(fp != NULL)
{
fprintf(fp, tagFile.c_str(),
dateTime.constData(), localMsg.constData(), context.file, context.line, context.function);
fprintf(fp,
tagFile.c_str(),
dateTime.constData(),
localMsg.constData(),
context.file, context.line, context.function);
fflush(fp);
}
else if(fp == NULL)
Expand All @@ -77,8 +80,11 @@ void logger(QtMsgType type, const QMessageLogContext &context, const QString &ms
}

#ifdef QT_DEBUG
fprintf(stderr, tagStd.c_str(),
dateTime.constData(), localMsg.constData(), context.file, context.line, context.function);
fprintf(stderr,
tagStd.c_str(),
dateTime.constData(),
localMsg.constData(),
context.file, context.line, context.function);
#endif

if(type == QtFatalMsg)
Expand Down

0 comments on commit 6d17e61

Please sign in to comment.