void QGeoMapController::cameraDataChanged(const QGeoCameraData &cameraData) { if (oldCameraData_.center() != cameraData.center()) emit centerChanged(cameraData.center()); if (oldCameraData_.bearing() != cameraData.bearing()) emit bearingChanged(cameraData.bearing()); if (oldCameraData_.tilt() != cameraData.tilt()) emit tiltChanged(cameraData.tilt()); if (oldCameraData_.roll() != cameraData.roll()) emit rollChanged(cameraData.roll()); if (oldCameraData_.zoomLevel() != cameraData.zoomLevel()) emit zoomChanged(cameraData.zoomLevel()); oldCameraData_ = cameraData; }
QTM_BEGIN_NAMESPACE /*! \class QGraphicsGeoMap \brief The QGraphicsGeoMap class is used to display a map and manager the interactions between the user and the map. \inmodule QtLocation \since 1.1 \ingroup maps-mapping Most of the functionality is provided by QGeoMappingManager, which handles most aspects of the display. The map viewport can be panned, the zoom level can be changed and the center coordinate of the viewport can be set explicitly. The screenPositionToCoordinate() and coordinateToScreenPoisition() functions can be used to convert between positions on the screen and global coordinates. Mouse and keyboard events should be handled by subclassing QGraphicsGeoMap and providing implementations of the event handling functions present in QGraphicsWidget. */ /*! \enum QGraphicsGeoMap::MapType Describes a type of map data. \value NoMap Indicates a lack of map valid data. \value StreetMap The map data is a graphical representation of streets and building boundaries. \value SatelliteMapDay The map data is composed of images collected by satellites during the daytime. \value SatelliteMapNight The map data is composed of images collected by satellites during the nighttime. \value TerrainMap The map data is a graphical representation of terrain features. This may also include some of the information provided by QGraphicsGeoMap::StreetMap. */ /*! \enum QGraphicsGeoMap::ConnectivityMode Describes the method of obtaining the mapping data. \value NoConnectivity There is no map data. \value OfflineMode The map data will come from an offline source. \value OnlineMode The map data will come from an online source. \value HybridMode The map data will come from a combination of offline and online sources. */ /*! Creates a new mapping widget, with the mapping operations managed by \a manager, and the specified \a parent. Note that the \a manager will typically be accessed from an instance of QGeoServiceProvider: \code QGeoServiceProvider serviceProvider("nokia"); QGeoMappingManager *manager = serviceProvider.mappingManager(); QGraphicsGeoMap *widget = new QGraphicsGeoMap(manager); \endcode */ QGraphicsGeoMap::QGraphicsGeoMap(QGeoMappingManager *manager, QGraphicsItem *parent) : QGraphicsWidget(parent), d_ptr(new QGraphicsGeoMapPrivate()) { Q_ASSERT(manager != 0); d_ptr->manager = manager; d_ptr->mapData = d_ptr->manager->createMapData(); d_ptr->mapData->init(); connect(d_ptr->mapData, SIGNAL(updateMapDisplay(QRectF)), this, SLOT(updateMapDisplay(QRectF))); setMapType(QGraphicsGeoMap::StreetMap); d_ptr->mapData->setWindowSize(size()); connect(d_ptr->mapData, SIGNAL(zoomLevelChanged(qreal)), this, SIGNAL(zoomLevelChanged(qreal))); connect(d_ptr->mapData, SIGNAL(bearingChanged(qreal)), this, SIGNAL(bearingChanged(qreal))); connect(d_ptr->mapData, SIGNAL(tiltChanged(qreal)), this, SIGNAL(tiltChanged(qreal))); connect(d_ptr->mapData, SIGNAL(mapTypeChanged(QGraphicsGeoMap::MapType)), this, SIGNAL(mapTypeChanged(QGraphicsGeoMap::MapType))); connect(d_ptr->mapData, SIGNAL(centerChanged(QGeoCoordinate)), this, SIGNAL(centerChanged(QGeoCoordinate))); connect(d_ptr->mapData, SIGNAL(connectivityModeChanged(QGraphicsGeoMap::ConnectivityMode)), this, SIGNAL(connectivityModeChanged(QGraphicsGeoMap::ConnectivityMode))); setFlag(QGraphicsItem::ItemIsFocusable); setFocus(); setMinimumSize(QSizeF(0, 0)); setPreferredSize(QSizeF(500, 500)); }
void PTUInterface::setTilt(double tilt){ if(this->tilt != tilt){ this->tilt = tilt; emit tiltChanged(tilt); } }