void QgsLayoutItemPicture::setRotationMap( const QString &mapUuid ) { if ( !mLayout ) { return; } if ( mRotationMap ) { disconnect( mRotationMap, &QgsLayoutItemMap::mapRotationChanged, this, &QgsLayoutItemPicture::updateMapRotation ); disconnect( mRotationMap, &QgsLayoutItemMap::extentChanged, this, &QgsLayoutItemPicture::updateMapRotation ); } if ( mapUuid.isEmpty() ) //disable rotation from map { mRotationMap = nullptr; } else { QgsLayoutItemMap *map = qobject_cast< QgsLayoutItemMap * >( mLayout->itemByUuid( mapUuid ) ); if ( !map ) { return; } mPictureRotation = map->mapRotation(); connect( map, &QgsLayoutItemMap::mapRotationChanged, this, &QgsLayoutItemPicture::updateMapRotation ); connect( map, &QgsLayoutItemMap::extentChanged, this, &QgsLayoutItemPicture::updateMapRotation ); mRotationMap = map; updateMapRotation(); emit pictureRotationChanged( mPictureRotation ); } }
void QgsComposerPicture::setRotationMap( int composerMapId ) { if ( !mComposition ) { return; } if ( composerMapId == -1 ) //disable rotation from map { disconnect( mRotationMap, SIGNAL( mapRotationChanged( double ) ), this, SLOT( updateMapRotation() ) ); disconnect( mRotationMap, SIGNAL( extentChanged() ), this, SLOT( updateMapRotation() ) ); mRotationMap = nullptr; }
void QgsLayoutItemPicture::setNorthOffset( double offset ) { mNorthOffset = offset; updateMapRotation(); }
void QgsLayoutItemPicture::setNorthMode( QgsLayoutItemPicture::NorthMode mode ) { mNorthMode = mode; updateMapRotation(); }