widget.h 823 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef WIDGET_H
  2. #define WIDGET_H
  3. #include <QWidget>
  4. #include <QGeoPositionInfo>
  5. #include <QGeoPositionInfoSource>
  6. QTM_USE_NAMESPACE
  7. class QDeclarativeView;
  8. namespace Ui {
  9. class Widget;
  10. }
  11. class Widget : public QWidget
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit Widget(QWidget *parent = 0);
  16. ~Widget();
  17. Q_PROPERTY(QString mapProvider READ mapProvider WRITE setMapProvider NOTIFY mapProviderChanged)
  18. QString mapProvider();
  19. void setMapProvider(QString newMapProvider);
  20. private slots:
  21. void mapProviderSelected(int);
  22. void positionUpdated(QGeoPositionInfo);
  23. signals:
  24. void mapProviderChanged(QString);
  25. void posUpdated(double lat, double lon);
  26. private:
  27. Ui::Widget *ui;
  28. QDeclarativeView* m_view;
  29. QGeoPositionInfoSource* m_geoSource;
  30. QString m_mapProvider;
  31. };
  32. #endif // WIDGET_H