QTM_BEGIN_NAMESPACE

QGeoTiledMapPixmapObjectInfo::QGeoTiledMapPixmapObjectInfo(QGeoTiledMapData *mapData, QGeoMapObject *mapObject)
    : QGeoTiledMapObjectInfo(mapData, mapObject),
      pixmapItem2(0)
{
    pixmap = static_cast<QGeoMapPixmapObject*>(mapObject);

    connect(pixmap,
            SIGNAL(coordinateChanged(QGeoCoordinate)),
            this,
            SLOT(coordinateChanged(QGeoCoordinate)));
    connect(pixmap,
            SIGNAL(pixmapChanged(QPixmap)),
            this,
            SLOT(pixmapChanged(QPixmap)));
    connect(pixmap,
            SIGNAL(offsetChanged(QPoint)),
            this,
            SLOT(offsetChanged(QPoint)));

    pixmapItem1 = new QGraphicsPixmapItem();
    graphicsItem = pixmapItem1;

    pixmapChanged(this->pixmap->pixmap());
    coordinateChanged(this->pixmap->coordinate());
}
Exemplo n.º 2
0
void QDeclarativePosition::setCoordinate(const QGeoCoordinate &coordinate)
{
    if (m_coordinate == coordinate)
        return;

    m_coordinate = coordinate;

    if (coordinate.type() == QGeoCoordinate::Coordinate3D && !m_altitudeValid) {
        m_altitudeValid = true;
        emit altitudeValidChanged();
    } else if (m_altitudeValid) {
        m_altitudeValid = false;
        emit altitudeValidChanged();
    }
    if (coordinate.isValid()) {
        if (!m_longitudeValid) {
            m_longitudeValid = true;
            emit longitudeValidChanged();
        }
        if (!m_latitudeValid) {
            m_latitudeValid = true;
            emit latitudeValidChanged();
        }
    } else {
        if (m_longitudeValid) {
            m_longitudeValid = false;
            emit longitudeValidChanged();
        }
        if (m_latitudeValid) {
            m_latitudeValid = false;
            emit latitudeValidChanged();
        }
    }
    emit coordinateChanged();
}
Exemplo n.º 3
0
ExampleWidget::ExampleWidget(QWidget *parent)
{
  this->setupUi(this);

  //   LabeledSlider* labeledSlider = new LabeledSlider;
//   labeledSlider->show();
//
//   FloatSlider* floatSlider = new FloatSlider;
//   floatSlider->show();

//   FileSelectionWidget* fileSelectionWidget = new FileSelectionWidget;
//   fileSelectionWidget->show();

  CoordinateEditWidget* coordinateEditWidget = new CoordinateEditWidget;
  coordinateEditWidget->show();
  connect(coordinateEditWidget, SIGNAL(coordinateChanged(QVector<double>)), this, SLOT(slot_coordinateEdit_coordinateChanged(QVector<double>)));

//   QVBoxLayout* VLayout = new QVBoxLayout;
//   VLayout->addWidget(labeledSlider);
//   VLayout->addWidget(floatSlider);
//   VLayout->addWidget(fileSelectionWidget);
//
//   this->setLayout(VLayout);
//   this->show();
}
void QDeclarativeGeoPlace::setCoordinate(QDeclarativeCoordinate* coordinate)
{
    if (m_declarativeCoordinate.coordinate() == coordinate->coordinate())
        return;
    m_declarativeCoordinate.setCoordinate(coordinate->coordinate());
    emit coordinateChanged();
}
void QGeoMapPixmapObject::setCoordinate(const QGeoCoordinate &coordinate)
{
    if (origin() != coordinate) {
        setOrigin(coordinate);
        emit coordinateChanged(coordinate);
    }
}
Exemplo n.º 6
0
void Placemark::setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark )
{
    m_placemark = placemark;
    m_coordinate.setCoordinates( placemark.coordinate() );
    emit coordinateChanged();
    emit nameChanged();
}
/*!
    \qmlproperty coordinate QtPositioning::Location::coordinate

    This property holds the exact geographical coordinate of the location which can be used to retrieve the latitude, longitude and altitude of the location.

    \note this property's changed() signal is currently emitted only if the
    whole object changes, not if only the contents of the object change.
*/
void QDeclarativeGeoLocation::setCoordinate(const QGeoCoordinate coordinate)
{
    if (m_coordinate == coordinate)
        return;

    m_coordinate = coordinate;
    emit coordinateChanged();
}
/*!
    \qmlproperty coordinate MapQuickItem::coordinate

    This property holds the anchor coordinate of the MapQuickItem. The point
    on the sourceItem that is specified by anchorPoint is kept aligned with
    this coordinate when drawn on the map.

    In the image below, there are 3 MapQuickItems that are identical except
    for the value of their anchorPoint properties. The values of anchorPoint
    for each are written on top of the item.

    \image api-mapquickitem-anchor.png
*/
void QDeclarativeGeoMapQuickItem::setCoordinate(const QGeoCoordinate &coordinate)
{
    if (coordinate_ == coordinate)
        return;

    coordinate_ = coordinate;

    updateMapItem();

    emit coordinateChanged();
}
void QDeclarativeReverseGeocodeModel::setCoordinate(QDeclarativeCoordinate *coordinate)
{
    if (coordinate_.coordinate() == coordinate->coordinate())
        return;

    coordinate_.setCoordinate(coordinate->coordinate());

    emit coordinateChanged(&coordinate_);

    if (complete_)
        update();
}
Exemplo n.º 10
0
void Customer::setCoordinate(GeoCoordinate* coordinate)
{
	if (!coordinate) {
	    return;
	}
	if (coordinate != mCoordinate) {
		if (mCoordinate) {
			mCoordinate->deleteLater();
		}
		mCoordinate = coordinate;
		mCoordinate->setParent(this);
		emit coordinateChanged(coordinate);
	}
}
Exemplo n.º 11
0
QgsBullsEyeWidget::QgsBullsEyeWidget( QgsMapCanvas *canvas, QgsLayerTreeView* layerTreeView )
    : QgsBottomBar( canvas ), mLayerTreeView( layerTreeView )
{
  setLayout( new QHBoxLayout );
  layout()->setSpacing( 10 );

  QWidget* base = new QWidget();
  ui.setupUi( base );
  layout()->addWidget( base );

  QPushButton* closeButton = new QPushButton();
  closeButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
  closeButton->setIcon( QIcon( ":/images/themes/default/mIconClose.png" ) );
  closeButton->setToolTip( tr( "Close" ) );
  connect( closeButton, SIGNAL( clicked( bool ) ), this, SIGNAL( close() ) );
  layout()->addWidget( closeButton );
  layout()->setAlignment( closeButton, Qt::AlignTop );

  ui.comboBoxLabels->addItem( tr( "Disabled" ), static_cast<int>( QgsBullsEyeLayer::NO_LABELS ) );
  ui.comboBoxLabels->addItem( tr( "Axes" ), static_cast<int>( QgsBullsEyeLayer::LABEL_AXES ) );
  ui.comboBoxLabels->addItem( tr( "Rings" ), static_cast<int>( QgsBullsEyeLayer::LABEL_RINGS ) );
  ui.comboBoxLabels->addItem( tr( "Axes and rings" ), static_cast<int>( QgsBullsEyeLayer::LABEL_AXES_RINGS ) );

  connect( ui.toolButtonAddLayer, SIGNAL( clicked( bool ) ), this, SLOT( createLayer() ) );
  connect( ui.inputCenter, SIGNAL( coordinateChanged() ), this, SLOT( updateLayer() ) );
  connect( ui.toolButtonPickCenter, SIGNAL( clicked( bool ) ), this, SIGNAL( requestPickCenter() ) );
  connect( ui.spinBoxRings, SIGNAL( valueChanged( int ) ), this, SLOT( updateLayer() ) );

  connect( ui.spinBoxRingInterval, SIGNAL( valueChanged( double ) ), this, SLOT( updateLayer() ) );
  connect( ui.spinBoxAxesInterval, SIGNAL( valueChanged( double ) ), this, SLOT( updateLayer() ) );

  connect( ui.toolButtonColor, SIGNAL( colorChanged( QColor ) ), this, SLOT( updateColor( QColor ) ) );
  connect( ui.spinBoxFontSize, SIGNAL( valueChanged( int ) ), this, SLOT( updateFontSize( int ) ) );
  connect( ui.comboBoxLabels, SIGNAL( currentIndexChanged( int ) ), this, SLOT( updateLabeling( int ) ) );
  connect( ui.spinBoxLineWidth, SIGNAL( valueChanged( int ) ), this, SLOT( updateLineWidth( int ) ) );

  connect( QgsMapLayerRegistry::instance(), SIGNAL( layersAdded( QList<QgsMapLayer*> ) ), this, SLOT( repopulateLayers() ) );
  connect( QgsMapLayerRegistry::instance(), SIGNAL( layersRemoved( QStringList ) ), this, SLOT( repopulateLayers() ) );
  connect( mCanvas, SIGNAL( currentLayerChanged( QgsMapLayer* ) ), this, SLOT( updateSelectedLayer( QgsMapLayer* ) ) );

  repopulateLayers();
  connect( ui.comboBoxLayer, SIGNAL( currentIndexChanged( int ) ), this, SLOT( currentLayerChanged( int ) ) );
}
Exemplo n.º 12
0
MarkerManager::MarkerManager(QGeoSearchManager *searchManager, QObject *parent) :
    QObject(parent),
    d(new MarkerManagerPrivate)
{
    d->searchManager = searchManager;
    d->status = 0;
    d->revGeocodeRunning = false;
    d->myLocHasMoved = false;

    d->myLocation = new Marker(Marker::MyLocationMarker);
    d->myLocation->setName("Me");

    // hook the coordinateChanged() signal for reverse geocoding
    connect(d->myLocation, SIGNAL(coordinateChanged(QGeoCoordinate)),
            this, SLOT(myLocationChanged(QGeoCoordinate)));

    connect(d->searchManager, SIGNAL(finished(QGeoSearchReply*)),
            this, SLOT(replyFinished(QGeoSearchReply*)));
    connect(d->searchManager, SIGNAL(finished(QGeoSearchReply*)),
            this, SLOT(reverseReplyFinished(QGeoSearchReply*)));
}
Exemplo n.º 13
0
void QDeclarativePosition::setPosition(const QGeoPositionInfo &info)
{
    // timestamp
    const QDateTime pTimestamp = m_info.timestamp();
    const QDateTime timestamp = info.timestamp();
    bool emitTimestampChanged = pTimestamp != timestamp;

    // coordinate
    const QGeoCoordinate pCoordinate = m_info.coordinate();
    const QGeoCoordinate coordinate = info.coordinate();
    bool emitCoordinateChanged = pCoordinate != coordinate;
    bool emitLatitudeValidChanged = exclusiveNaN(pCoordinate.latitude(), coordinate.latitude());
    bool emitLongitudeValidChanged = exclusiveNaN(pCoordinate.longitude(), coordinate.longitude());
    bool emitAltitudeValidChanged = exclusiveNaN(pCoordinate.altitude(), coordinate.altitude());

    // direction
    const qreal pDirection = m_info.attribute(QGeoPositionInfo::Direction);
    const qreal direction = info.attribute(QGeoPositionInfo::Direction);
    bool emitDirectionChanged = !equalOrNaN(pDirection, direction);
    bool emitDirectionValidChanged = exclusiveNaN(pDirection, direction);

    // ground speed
    const qreal pSpeed = m_info.attribute(QGeoPositionInfo::GroundSpeed);
    const qreal speed = info.attribute(QGeoPositionInfo::GroundSpeed);
    bool emitSpeedChanged = !equalOrNaN(pSpeed, speed);
    bool emitSpeedValidChanged = exclusiveNaN(pSpeed, speed);

    // vertical speed
    const qreal pVerticalSpeed = m_info.attribute(QGeoPositionInfo::VerticalSpeed);
    const qreal verticalSpeed = info.attribute(QGeoPositionInfo::VerticalSpeed);
    bool emitVerticalSpeedChanged = !equalOrNaN(pVerticalSpeed, verticalSpeed);
    bool emitVerticalSpeedValidChanged = exclusiveNaN(pVerticalSpeed, verticalSpeed);

    // magnetic variation
    const qreal pMagneticVariation = m_info.attribute(QGeoPositionInfo::MagneticVariation);
    const qreal magneticVariation = info.attribute(QGeoPositionInfo::MagneticVariation);
    bool emitMagneticVariationChanged = !equalOrNaN(pMagneticVariation, magneticVariation);
    bool emitMagneticVariationValidChanged = exclusiveNaN(pMagneticVariation, magneticVariation);

    // horizontal accuracy
    const qreal pHorizontalAccuracy = m_info.attribute(QGeoPositionInfo::HorizontalAccuracy);
    const qreal horizontalAccuracy = info.attribute(QGeoPositionInfo::HorizontalAccuracy);
    bool emitHorizontalAccuracyChanged = !equalOrNaN(pHorizontalAccuracy, horizontalAccuracy);
    bool emitHorizontalAccuracyValidChanged = exclusiveNaN(pHorizontalAccuracy, horizontalAccuracy);

    // vertical accuracy
    const qreal pVerticalAccuracy = m_info.attribute(QGeoPositionInfo::VerticalAccuracy);
    const qreal verticalAccuracy = info.attribute(QGeoPositionInfo::VerticalAccuracy);
    bool emitVerticalAccuracyChanged = !equalOrNaN(pVerticalAccuracy, verticalAccuracy);
    bool emitVerticalAccuracyValidChanged = exclusiveNaN(pVerticalAccuracy, verticalAccuracy);

    m_info = info;

    if (emitTimestampChanged)
        emit timestampChanged();
    if (emitCoordinateChanged)
        emit coordinateChanged();
    if (emitLatitudeValidChanged)
        emit latitudeValidChanged();
    if (emitLongitudeValidChanged)
        emit longitudeValidChanged();
    if (emitAltitudeValidChanged)
        emit altitudeValidChanged();
    if (emitDirectionChanged)
        emit directionChanged();
    if (emitDirectionValidChanged)
        emit directionValidChanged();
    if (emitSpeedChanged)
        emit speedChanged();
    if (emitSpeedValidChanged)
        emit speedValidChanged();
    if (emitVerticalSpeedChanged)
        emit verticalSpeedChanged();
    if (emitVerticalSpeedValidChanged)
        emit verticalSpeedValidChanged();
    if (emitHorizontalAccuracyChanged)
        emit horizontalAccuracyChanged();
    if (emitHorizontalAccuracyValidChanged)
        emit horizontalAccuracyValidChanged();
    if (emitVerticalAccuracyChanged)
        emit verticalAccuracyChanged();
    if (emitVerticalAccuracyValidChanged)
        emit verticalAccuracyValidChanged();
    if (emitMagneticVariationChanged)
        emit magneticVariationChanged();
    if (emitMagneticVariationValidChanged)
        emit magneticVariationValidChanged();
}