Example #1
0
void QgsCompositionWidget::on_mPaperUnitsComboBox_currentIndexChanged( const QString& text )
{
    Q_UNUSED( text );

    double width = size( mPaperWidthDoubleSpinBox );
    double height = size( mPaperHeightDoubleSpinBox );

    if ( mPaperUnitsComboBox->currentIndex() == 0 )
    {
        // mm, value was inch
        width *= 25.4;
        height *= 25.4;
    }
    else
    {
        // inch, values was mm,
        width /= 25.4;
        height /= 25.4;
    }

    setSize( mPaperWidthDoubleSpinBox, width );
    setSize( mPaperHeightDoubleSpinBox, height );

    if ( mPaperSizeComboBox->currentText() == tr( "Custom" ) )
    {
        adjustOrientation();
        applyWidthHeight();
    }
    else
    {
        adjustOrientation();
        applyCurrentPaperSettings();
    }
}
void QgsCompositionWidget::on_mPaperOrientationComboBox_currentIndexChanged( const QString& text )
{
  if ( mPaperSizeComboBox->currentText() == tr( "Custom" ) )
  {
    adjustOrientation();
    applyWidthHeight();
  }
  else
  {
    adjustOrientation();
    applyCurrentPaperSettings();
  }
}
Example #3
0
void QgsCompositionWidget::applyCurrentPaperSettings()
{
    if ( mComposition )
    {
        //find entry in mPaper map to set width and height
        QMap<QString, QgsCompositionPaper>::iterator it = mPaperMap.find( mPaperSizeComboBox->currentText() );
        if ( it == mPaperMap.end() )
        {
            return;
        }

        mPaperWidthDoubleSpinBox->setEnabled( true );
        mPaperHeightDoubleSpinBox->setEnabled( true );
        setSize( mPaperWidthDoubleSpinBox, it->mWidth );
        setSize( mPaperHeightDoubleSpinBox, it->mHeight );
        mPaperWidthDoubleSpinBox->setEnabled( false );
        mPaperHeightDoubleSpinBox->setEnabled( false );

        adjustOrientation();
        applyWidthHeight();
    }
}
Example #4
0
void QgsCompositionWidget::on_mPaperHeightDoubleSpinBox_editingFinished()
{
    applyWidthHeight();
}