diff --git a/scwx-qt/source/scwx/qt/model/marker_model.cpp b/scwx-qt/source/scwx/qt/model/marker_model.cpp index c035900a..0fc22ab0 100644 --- a/scwx-qt/source/scwx/qt/model/marker_model.cpp +++ b/scwx-qt/source/scwx/qt/model/marker_model.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -38,7 +39,6 @@ public: MarkerModel::MarkerModel(QObject* parent) : QAbstractTableModel(parent), p(std::make_unique()) { - connect(p->markerManager_.get(), &manager::MarkerManager::MarkersInitialized, this, @@ -127,6 +127,23 @@ QVariant MarkerModel::data(const QModelIndex& index, int role) const } break; break; + case static_cast(Column::Icon): + if (role == Qt::ItemDataRole::DecorationRole) + { + for (auto& icon : types::getMarkerIcons()) + { + if (icon.name == markerInfo->iconName) + { + return util::modulateColors(icon.qIcon, + QSize(30, 30), + QColor(markerInfo->iconColor[0], + markerInfo->iconColor[1], + markerInfo->iconColor[2], + markerInfo->iconColor[3])); + } + } + } + break; default: break; @@ -164,6 +181,9 @@ QVariant MarkerModel::headerData(int section, case static_cast(Column::Longitude): return tr("Longitude"); + case static_cast(Column::Icon): + return tr("Icon"); + default: break; } diff --git a/scwx-qt/source/scwx/qt/model/marker_model.hpp b/scwx-qt/source/scwx/qt/model/marker_model.hpp index 4fc6c95c..91c8854f 100644 --- a/scwx-qt/source/scwx/qt/model/marker_model.hpp +++ b/scwx-qt/source/scwx/qt/model/marker_model.hpp @@ -17,7 +17,8 @@ public: { Latitude = 0, Longitude = 1, - Name = 2, + Icon = 2, + Name = 3, }; explicit MarkerModel(QObject* parent = nullptr);