Esempio n. 1
0
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 );
  }
}
Esempio n. 2
0
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;
  }
Esempio n. 3
0
void QgsLayoutItemPicture::setNorthOffset( double offset )
{
  mNorthOffset = offset;
  updateMapRotation();
}
Esempio n. 4
0
void QgsLayoutItemPicture::setNorthMode( QgsLayoutItemPicture::NorthMode mode )
{
  mNorthMode = mode;
  updateMapRotation();
}