WebMaps.hpp Example File
webmapview/src/WebMaps.hpp
#ifndef WEBMAPS_HPP
#define WEBMAPS_HPP
#include <QObject>
#include <QMap>
#include <QVariant>
class WebMaps : public QObject
{
Q_OBJECT
Q_ENUMS(Provider)
Q_PROPERTY(Provider currentProvider READ currentProvider WRITE setCurrentProvider NOTIFY currentProviderChanged)
Q_PROPERTY(QString pageContent READ pageContent NOTIFY currentProviderChanged)
Q_PROPERTY(QString viewModeTitle READ viewModeTitle NOTIFY viewModeChanged)
Q_PROPERTY(QString viewMode READ viewMode NOTIFY viewModeChanged)
public:
enum Provider {
GoogleMaps,
BingMaps,
OpenLayers
};
WebMaps(QObject *parent = 0);
public slots:
void nextViewMode();
signals:
void currentProviderChanged();
void viewModeChanged();
private:
Provider currentProvider() const;
void setCurrentProvider(Provider provider);
QString pageContent() const;
QString viewModeTitle() const;
QString viewMode() const;
Provider m_currentProvider;
QMap<Provider, QVariantMap> m_providerData;
int m_currentViewModeIndex;
};
#endif