From 3d9e44a76406cb87786e3a635a8cb2aa22ee1837 Mon Sep 17 00:00:00 2001 From: Pierre Willenbrock Date: Fri, 4 Feb 2022 12:09:57 +0100 Subject: [PATCH 1/2] Add missing headers --- src/SharedPtr.hpp | 1 + src/solvers/agent_routing/AgentType.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/SharedPtr.hpp b/src/SharedPtr.hpp index 5121ef3..ff41ca8 100644 --- a/src/SharedPtr.hpp +++ b/src/SharedPtr.hpp @@ -15,6 +15,7 @@ #include #include #endif +#include namespace templ { diff --git a/src/solvers/agent_routing/AgentType.cpp b/src/solvers/agent_routing/AgentType.cpp index f5bdf92..f4b9f23 100644 --- a/src/solvers/agent_routing/AgentType.cpp +++ b/src/solvers/agent_routing/AgentType.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "AgentType.hpp" From 9113d6da70fb7523fb78bdd09e135b7bc6db2f65 Mon Sep 17 00:00:00 2001 From: Pierre Willenbrock Date: Fri, 4 Feb 2022 12:09:45 +0100 Subject: [PATCH 2/2] Use casts to resolve ambiguities --- src/gui/models/AgentStyleModel.cpp | 2 +- src/gui/widgets/PenStyle.cpp | 8 ++++---- src/solvers/csp/branchers/TimelineBrancher.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/models/AgentStyleModel.cpp b/src/gui/models/AgentStyleModel.cpp index 73488cb..3b23be2 100644 --- a/src/gui/models/AgentStyleModel.cpp +++ b/src/gui/models/AgentStyleModel.cpp @@ -39,7 +39,7 @@ AgentStyleModel::AgentStyleModel(const moreorg::ModelPool& modelPool) { QModelIndex idx = createIndex(row, 1); - QVariant value = Qt::black; + QVariant value = (QColor)Qt::black; setData(idx, value, Qt::BackgroundColorRole); } diff --git a/src/gui/widgets/PenStyle.cpp b/src/gui/widgets/PenStyle.cpp index 5299443..4d8d73f 100644 --- a/src/gui/widgets/PenStyle.cpp +++ b/src/gui/widgets/PenStyle.cpp @@ -16,9 +16,9 @@ PenStyle::PenStyle(QWidget* parent) QVariant variant = mSettings.value("editor/edge/pen"); // style - mpUi->styleComboBox->addItem(/*icon, */"Solid Line", Qt::SolidLine); - mpUi->styleComboBox->addItem(/*icon, */"Dash Line", Qt::DashLine); - mpUi->styleComboBox->addItem(/*icon, */"Dot Line", Qt::DotLine); + mpUi->styleComboBox->addItem(/*icon, */"Solid Line", (int)Qt::SolidLine); + mpUi->styleComboBox->addItem(/*icon, */"Dash Line", (int)Qt::DashLine); + mpUi->styleComboBox->addItem(/*icon, */"Dot Line", (int)Qt::DotLine); // pen join style mpUi->joinStyleComboBox->addItem(/*icon, */"Bevel", Qt::BevelJoin); @@ -37,7 +37,7 @@ PenStyle::PenStyle(QWidget* parent) } else { QPen pen = variant.value(); mpUi->colorPushButton->setStyleSheet("background-color: " + pen.brush().color().name()); - mpUi->styleComboBox->setCurrentIndex( mpUi->styleComboBox->findData( pen.style() ) ); + mpUi->styleComboBox->setCurrentIndex( mpUi->styleComboBox->findData( (int)pen.style() ) ); mpUi->joinStyleComboBox->setCurrentIndex( mpUi->joinStyleComboBox->findData( pen.joinStyle() ) ); mpUi->capStyleComboBox->setCurrentIndex( mpUi->capStyleComboBox->findData( pen.capStyle() ) ); mpUi->widthSpinBox->setValue(pen.width()); diff --git a/src/solvers/csp/branchers/TimelineBrancher.cpp b/src/solvers/csp/branchers/TimelineBrancher.cpp index 5c9b877..2373904 100644 --- a/src/solvers/csp/branchers/TimelineBrancher.cpp +++ b/src/solvers/csp/branchers/TimelineBrancher.cpp @@ -397,7 +397,7 @@ bool TimelineBrancher::status(const Gecode::Space& home) const while(!mNextRoles.empty()) { // Pick role randomly from the remaining set of roles - size_t nextRoleIdx = mRandom(mNextRoles.size() - 1); + size_t nextRoleIdx = mRandom((unsigned long long)(mNextRoles.size() - 1)); size_t role = mNextRoles[nextRoleIdx]; LOG_DEBUG_S << "Brancher: " << id() << " trying role " << role;