ArcGIS Runtime SDK for Qt

Show legend

Loading

Code

#ifndef SHOW_LEGEND_H
#define SHOW_LEGEND_H

namespace Esri
{
    namespace ArcGISRuntime
    {
        class Map;
        class MapQuickView;
        class LegendInfoListModel;
    }
}

class QString;

#include <QQuickItem>

class ShowLegend : public QQuickItem
{
    Q_OBJECT

    Q_PROPERTY(Esri::ArcGISRuntime::LegendInfoListModel* legendInfoListModel READ legendInfoListModel NOTIFY legendInfoListModelChanged)

public:
    explicit ShowLegend(QQuickItem* parent = nullptr);
    ~ShowLegend();

    void componentComplete() Q_DECL_OVERRIDE;

signals:
    void legendInfoListModelChanged();

private:
    Esri::ArcGISRuntime::LegendInfoListModel* legendInfoListModel() const { return m_legendInfoListModel; }
    void addLayers();

private:
    Esri::ArcGISRuntime::Map* m_map = nullptr;
    Esri::ArcGISRuntime::MapQuickView* m_mapView = nullptr;
    Esri::ArcGISRuntime::LegendInfoListModel* m_legendInfoListModel = nullptr;
};

#endif // SHOW_LEGEND_H


In this topic
  1. Code