From 2d4220bba92ab28acaf612ed0df229747e6540c2 Mon Sep 17 00:00:00 2001 From: olivierdalang Date: Tue, 12 Feb 2013 12:30:54 +0100 Subject: [PATCH] Update of composer item's GUI --- python/core/composer/qgscomposeritem.sip | 5 + python/core/composer/qgscomposershape.sip | 8 - src/app/CMakeLists.txt | 2 - src/app/composer/qgscomposerarrowwidget.cpp | 2 +- src/app/composer/qgscomposerhtmlwidget.cpp | 2 +- src/app/composer/qgscomposeritemwidget.cpp | 195 ++- src/app/composer/qgscomposeritemwidget.h | 27 +- src/app/composer/qgscomposerlabelwidget.cpp | 8 +- src/app/composer/qgscomposerlegendwidget.cpp | 2 +- src/app/composer/qgscomposermapwidget.cpp | 66 +- src/app/composer/qgscomposermapwidget.h | 4 +- src/app/composer/qgscomposerpicturewidget.cpp | 45 +- src/app/composer/qgscomposerpicturewidget.h | 2 - .../composer/qgscomposerscalebarwidget.cpp | 2 +- src/app/composer/qgscomposershapewidget.cpp | 92 +- src/app/composer/qgscomposershapewidget.h | 4 - src/app/composer/qgscomposertablewidget.cpp | 17 +- src/app/composer/qgscomposertablewidget.h | 2 +- src/app/composer/qgscompositionwidget.cpp | 62 +- src/app/composer/qgscompositionwidget.h | 6 +- src/app/composer/qgsitempositiondialog.cpp | 247 ---- src/app/composer/qgsitempositiondialog.h | 63 - src/core/composer/qgscomposeritem.cpp | 13 +- src/core/composer/qgscomposeritem.h | 10 + src/core/composer/qgscomposershape.cpp | 213 +-- src/core/composer/qgscomposershape.h | 27 +- src/core/composer/qgscomposition.cpp | 4 +- src/ui/qgscomposerarrowwidgetbase.ui | 201 ++- src/ui/qgscomposerhtmlwidgetbase.ui | 111 +- src/ui/qgscomposeritemwidgetbase.ui | 393 +++++- src/ui/qgscomposerlabelwidgetbase.ui | 452 +++--- src/ui/qgscomposerlegendwidgetbase.ui | 1049 ++++++++------ src/ui/qgscomposermapwidgetbase.ui | 1240 ++++++++--------- src/ui/qgscomposerpicturewidgetbase.ui | 278 ++-- src/ui/qgscomposerscalebarwidgetbase.ui | 641 +++++---- src/ui/qgscomposershapewidgetbase.ui | 124 +- src/ui/qgscomposertablewidgetbase.ui | 345 ++--- src/ui/qgscompositionwidgetbase.ui | 377 +++-- src/ui/qgsitempositiondialogbase.ui | 173 --- 39 files changed, 3234 insertions(+), 3280 deletions(-) delete mode 100644 src/app/composer/qgsitempositiondialog.cpp delete mode 100644 src/app/composer/qgsitempositiondialog.h delete mode 100644 src/ui/qgsitempositiondialogbase.ui diff --git a/python/core/composer/qgscomposeritem.sip b/python/core/composer/qgscomposeritem.sip index cdbed87baf6..b53e95b471c 100644 --- a/python/core/composer/qgscomposeritem.sip +++ b/python/core/composer/qgscomposeritem.sip @@ -189,6 +189,11 @@ class QgsComposerItem: QObject, QGraphicsRectItem @note: this method was added in version 1.6*/ void setItemPosition( double x, double y, double width, double height, ItemPositionMode itemPoint = UpperLeft ); + /**Returns item's last used position mode. + @note: This property has no effect on actual's item position, which is always the top-left corner. + @note: this method was added in version 2.0*/ + ItemPositionMode lastUsedPositionMode(); + /**Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size unit*/ virtual void setSceneRect( const QRectF& rectangle ); diff --git a/python/core/composer/qgscomposershape.sip b/python/core/composer/qgscomposershape.sip index 9c555ce0ae6..c532fa50f41 100644 --- a/python/core/composer/qgscomposershape.sip +++ b/python/core/composer/qgscomposershape.sip @@ -36,16 +36,8 @@ class QgsComposerShape: QgsComposerItem bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); //setters and getters - void setLineWidth( double width ); - double lineWidth() const; - void setOutlineColor( const QColor& color ); - QColor outlineColor() const; - void setFillColor( const QColor& color ); - QColor fillColor() const; QgsComposerShape::Shape shapeType() const; void setShapeType( QgsComposerShape::Shape s ); - bool transparentFill() const; - void setTransparentFill( bool transparent ); /**Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size unit. Also, the shape is scaled*/ diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index f992ce80d7f..db417ef1292 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -133,7 +133,6 @@ SET(QGIS_APP_SRCS composer/qgscomposerlegendwidget.cpp composer/qgscompositionwidget.cpp composer/qgsatlascompositionwidget.cpp - composer/qgsitempositiondialog.cpp legend/qgslegendgroup.cpp legend/qgslegend.cpp @@ -281,7 +280,6 @@ SET (QGIS_APP_MOC_HDRS composer/qgscomposershapewidget.h composer/qgscompositionwidget.h composer/qgsatlascompositionwidget.h - composer/qgsitempositiondialog.h legend/qgslegend.h legend/qgsapplegendinterface.h diff --git a/src/app/composer/qgscomposerarrowwidget.cpp b/src/app/composer/qgscomposerarrowwidget.cpp index f96cad747e2..aca4c33c52a 100644 --- a/src/app/composer/qgscomposerarrowwidget.cpp +++ b/src/app/composer/qgscomposerarrowwidget.cpp @@ -36,7 +36,7 @@ QgsComposerArrowWidget::QgsComposerArrowWidget( QgsComposerArrow* arrow ): QWidg //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, mArrow ); - toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); + mainLayout->addWidget( itemPropertiesWidget ); setGuiElementValues(); diff --git a/src/app/composer/qgscomposerhtmlwidget.cpp b/src/app/composer/qgscomposerhtmlwidget.cpp index 78e2511f437..bc829bbe58e 100644 --- a/src/app/composer/qgscomposerhtmlwidget.cpp +++ b/src/app/composer/qgscomposerhtmlwidget.cpp @@ -42,7 +42,7 @@ QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml* html, QgsComposer { //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, mFrame ); - mToolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); + mainLayout->addWidget( itemPropertiesWidget ); } } diff --git a/src/app/composer/qgscomposeritemwidget.cpp b/src/app/composer/qgscomposeritemwidget.cpp index c6f6c1bbf31..322d61d081f 100644 --- a/src/app/composer/qgscomposeritemwidget.cpp +++ b/src/app/composer/qgscomposeritemwidget.cpp @@ -18,14 +18,35 @@ #include "qgscomposeritemwidget.h" #include "qgscomposeritem.h" #include "qgscomposermap.h" -#include "qgsitempositiondialog.h" #include "qgspoint.h" #include QgsComposerItemWidget::QgsComposerItemWidget( QWidget* parent, QgsComposerItem* item ): QWidget( parent ), mItem( item ) { + setupUi( this ); + + //make button exclusive + QButtonGroup* buttonGroup = new QButtonGroup( this ); + buttonGroup->addButton( mUpperLeftCheckBox ); + buttonGroup->addButton( mUpperMiddleCheckBox ); + buttonGroup->addButton( mUpperRightCheckBox ); + buttonGroup->addButton( mMiddleLeftCheckBox ); + buttonGroup->addButton( mMiddleCheckBox ); + buttonGroup->addButton( mMiddleRightCheckBox ); + buttonGroup->addButton( mLowerLeftCheckBox ); + buttonGroup->addButton( mLowerMiddleCheckBox ); + buttonGroup->addButton( mLowerRightCheckBox ); + buttonGroup->setExclusive( true ); + + mXLineEdit->setValidator( new QDoubleValidator( 0 ) ); + mYLineEdit->setValidator( new QDoubleValidator( 0 ) ); + mWidthLineEdit->setValidator( new QDoubleValidator( 0 ) ); + mHeightLineEdit->setValidator( new QDoubleValidator( 0 ) ); + setValuesForGuiElements(); + connect( mItem, SIGNAL( sizeChanged() ), this, SLOT( setValuesForGuiPositionElements() ) ); + } QgsComposerItemWidget::QgsComposerItemWidget(): QWidget( 0 ), mItem( 0 ) @@ -126,6 +147,70 @@ void QgsComposerItemWidget::changeItemOpacity( int value ) mItem->endCommand(); } +void QgsComposerItemWidget::changeItemPosition() +{ + mItem->beginCommand( tr( "Item position changed" ) ); + + bool convXSuccess, convYSuccess; + double x = mXLineEdit->text().toDouble( &convXSuccess ); + double y = mYLineEdit->text().toDouble( &convYSuccess ); + + bool convSuccessWidth, convSuccessHeight; + double width = mWidthLineEdit->text().toDouble( &convSuccessWidth ); + double height = mHeightLineEdit->text().toDouble( &convSuccessHeight ); + + if ( !convXSuccess || !convYSuccess || !convSuccessWidth || !convSuccessHeight ) + { + return; + } + + mItem->setItemPosition( x, y, width, height, positionMode() ); + + mItem->update(); + mItem->endCommand(); +} + +QgsComposerItem::ItemPositionMode QgsComposerItemWidget::positionMode() const +{ + if ( mUpperLeftCheckBox->checkState() == Qt::Checked ) + { + return QgsComposerItem::UpperLeft; + } + else if ( mUpperMiddleCheckBox->checkState() == Qt::Checked ) + { + return QgsComposerItem::UpperMiddle; + } + else if ( mUpperRightCheckBox->checkState() == Qt::Checked ) + { + return QgsComposerItem::UpperRight; + } + else if ( mMiddleLeftCheckBox->checkState() == Qt::Checked ) + { + return QgsComposerItem::MiddleLeft; + } + else if ( mMiddleCheckBox->checkState() == Qt::Checked ) + { + return QgsComposerItem::Middle; + } + else if ( mMiddleRightCheckBox->checkState() == Qt::Checked ) + { + return QgsComposerItem::MiddleRight; + } + else if ( mLowerLeftCheckBox->checkState() == Qt::Checked ) + { + return QgsComposerItem::LowerLeft; + } + else if ( mLowerMiddleCheckBox->checkState() == Qt::Checked ) + { + return QgsComposerItem::LowerMiddle; + } + else if ( mLowerRightCheckBox->checkState() == Qt::Checked ) + { + return QgsComposerItem::LowerRight; + } + return QgsComposerItem::UpperLeft; +} + void QgsComposerItemWidget::on_mOutlineWidthSpinBox_valueChanged( double d ) { if ( !mItem ) @@ -166,6 +251,93 @@ void QgsComposerItemWidget::on_mBackgroundGroupBox_toggled( bool state ) mItem->endCommand(); } + +void QgsComposerItemWidget::setValuesForGuiPositionElements() +{ + if ( !mItem ) + { + return; + } + + mXLineEdit->blockSignals( true ); + mYLineEdit->blockSignals( true ); + mWidthLineEdit->blockSignals( true ); + mHeightLineEdit->blockSignals( true ); + + + if( mItem->lastUsedPositionMode() == QgsComposerItem::UpperLeft ) + { + mUpperLeftCheckBox->setChecked( true ); + mXLineEdit->setText( QString::number( mItem->transform().dx() ) ); + mYLineEdit->setText( QString::number( mItem->transform().dy() ) ); + } + + if( mItem->lastUsedPositionMode() == QgsComposerItem::UpperMiddle ) + { + mUpperMiddleCheckBox->setChecked( true ); + mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() / 2.0 ) ); + mYLineEdit->setText( QString::number( mItem->transform().dy() ) ); + } + + if( mItem->lastUsedPositionMode() == QgsComposerItem::UpperRight ) + { + mUpperRightCheckBox->setChecked( true ); + mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() ) ); + mYLineEdit->setText( QString::number( mItem->transform().dy() ) ); + } + + if( mItem->lastUsedPositionMode() == QgsComposerItem::MiddleLeft ) + { + mMiddleLeftCheckBox->setChecked( true ); + mXLineEdit->setText( QString::number( mItem->transform().dx() ) ); + mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() / 2.0 ) ); + } + + if( mItem->lastUsedPositionMode() == QgsComposerItem::Middle ) + { + mMiddleCheckBox->setChecked( true ); + mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() / 2.0 ) ); + mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() / 2.0 ) ); + } + + if( mItem->lastUsedPositionMode() == QgsComposerItem::MiddleRight ) + { + mMiddleRightCheckBox->setChecked( true ); + mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() ) ); + mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() / 2.0 ) ); + } + + if( mItem->lastUsedPositionMode() == QgsComposerItem::LowerLeft ) + { + mLowerLeftCheckBox->setChecked( true ); + mXLineEdit->setText( QString::number( mItem->transform().dx() ) ); + mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() ) ); + } + + if( mItem->lastUsedPositionMode() == QgsComposerItem::LowerMiddle ) + { + mLowerMiddleCheckBox->setChecked( true ); + mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() / 2.0 ) ); + mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() ) ); + } + + if( mItem->lastUsedPositionMode() == QgsComposerItem::LowerRight ) + { + mLowerRightCheckBox->setChecked( true ); + mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() ) ); + mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() ) ); + } + + mWidthLineEdit->setText( QString::number( mItem->rect().width() ) ); + mHeightLineEdit->setText( QString::number( mItem->rect().height() ) ); + + + mXLineEdit->blockSignals( false ); + mYLineEdit->blockSignals( false ); + mWidthLineEdit->blockSignals( false ); + mHeightLineEdit->blockSignals( false ); +} + void QgsComposerItemWidget::setValuesForGuiElements() { if ( !mItem ) @@ -173,6 +345,8 @@ void QgsComposerItemWidget::setValuesForGuiElements() return; } + setValuesForGuiPositionElements(); + mOpacitySlider->blockSignals( true ); mOutlineWidthSpinBox->blockSignals( true ); mFrameGroupBox->blockSignals( true ); @@ -195,25 +369,6 @@ void QgsComposerItemWidget::setValuesForGuiElements() mOpacitySpinBox->blockSignals( false ); } -void QgsComposerItemWidget::on_mPositionButton_clicked() -{ - if ( !mItem ) - { - return; - } - - mItem->beginCommand( tr( "Item position changed" ) ); - QgsItemPositionDialog d( mItem, 0 ); - if ( d.exec() == QDialog::Accepted ) - { - mItem->endCommand(); - } - else - { - mItem->cancelCommand(); - } -} - void QgsComposerItemWidget::on_mItemIdLineEdit_textChanged( const QString &text ) { if ( mItem ) diff --git a/src/app/composer/qgscomposeritemwidget.h b/src/app/composer/qgscomposeritemwidget.h index ec30634b864..162b03495b2 100644 --- a/src/app/composer/qgscomposeritemwidget.h +++ b/src/app/composer/qgscomposeritemwidget.h @@ -19,6 +19,7 @@ #define QGSCOMPOSERITEMWIDGET_H #include "ui_qgscomposeritemwidgetbase.h" +#include "qgscomposeritem.h" class QgsComposerItem; @@ -31,6 +32,10 @@ class QgsComposerItemWidget: public QWidget, private Ui::QgsComposerItemWidgetBa QgsComposerItemWidget( QWidget* parent, QgsComposerItem* item ); ~QgsComposerItemWidget(); + /**A combination of upper/middle/lower and left/middle/right*/ + QgsComposerItem::ItemPositionMode positionMode() const; + + public slots: void on_mFrameColorButton_clicked(); void on_mBackgroundColorButton_clicked(); @@ -39,13 +44,31 @@ class QgsComposerItemWidget: public QWidget, private Ui::QgsComposerItemWidgetBa void on_mOutlineWidthSpinBox_valueChanged( double d ); void on_mFrameGroupBox_toggled( bool state ); void on_mBackgroundGroupBox_toggled( bool state ); - void on_mPositionButton_clicked(); void on_mItemIdLineEdit_textChanged( const QString& text ); + //adjust coordinates in line edits + void on_mXLineEdit_editingFinished(){ changeItemPosition(); } + void on_mYLineEdit_editingFinished(){ changeItemPosition(); } + void on_mWidthLineEdit_editingFinished(){ changeItemPosition(); } + void on_mHeightLineEdit_editingFinished(){ changeItemPosition(); } + + void on_mUpperLeftCheckBox_stateChanged( int state ){ changeItemPosition(); } + void on_mUpperMiddleCheckBox_stateChanged( int state ){ changeItemPosition(); } + void on_mUpperRightCheckBox_stateChanged( int state ){ changeItemPosition(); } + void on_mMiddleLeftCheckBox_stateChanged( int state ){ changeItemPosition(); } + void on_mMiddleCheckBox_stateChanged( int state ){ changeItemPosition(); } + void on_mMiddleRightCheckBox_stateChanged( int state ){ changeItemPosition(); } + void on_mLowerLeftCheckBox_stateChanged( int state ){ changeItemPosition(); } + void on_mLowerMiddleCheckBox_stateChanged( int state ){ changeItemPosition(); } + void on_mLowerRightCheckBox_stateChanged( int state ){ changeItemPosition(); } + + void setValuesForGuiElements(); + void setValuesForGuiPositionElements(); + private: QgsComposerItemWidget(); - void setValuesForGuiElements(); void changeItemOpacity( int value ); + void changeItemPosition(); QgsComposerItem* mItem; }; diff --git a/src/app/composer/qgscomposerlabelwidget.cpp b/src/app/composer/qgscomposerlabelwidget.cpp index 411d69ee3d8..e945b7bac43 100644 --- a/src/app/composer/qgscomposerlabelwidget.cpp +++ b/src/app/composer/qgscomposerlabelwidget.cpp @@ -30,7 +30,7 @@ QgsComposerLabelWidget::QgsComposerLabelWidget( QgsComposerLabel* label ): QWidg //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, label ); - toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); + mainLayout->addWidget( itemPropertiesWidget ); if ( mComposerLabel ) @@ -48,15 +48,13 @@ void QgsComposerLabelWidget::on_mHtmlCheckBox_stateChanged( int state ) { mFontButton->setEnabled( false ); mFontColorButton->setEnabled( false ); - mHorizontalAlignementGroup->setEnabled( false ); - mVerticalAlignementGroup->setEnabled( false ); + mAlignementGroup->setEnabled( false ); } else { mFontButton->setEnabled( true ); mFontColorButton->setEnabled( true ); - mHorizontalAlignementGroup->setEnabled( true ); - mVerticalAlignementGroup->setEnabled( true ); + mAlignementGroup->setEnabled( true ); } mComposerLabel->beginCommand( tr( "Label text HTML state changed" ), QgsComposerMergeCommand::ComposerLabelSetText ); diff --git a/src/app/composer/qgscomposerlegendwidget.cpp b/src/app/composer/qgscomposerlegendwidget.cpp index 2319dcdf06b..54cfb8f9843 100644 --- a/src/app/composer/qgscomposerlegendwidget.cpp +++ b/src/app/composer/qgscomposerlegendwidget.cpp @@ -49,7 +49,7 @@ QgsComposerLegendWidget::QgsComposerLegendWidget( QgsComposerLegend* legend ): m //add widget for item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, legend ); - toolBox->addItem( itemPropertiesWidget, tr( "General Options" ) ); + mainLayout->addWidget( itemPropertiesWidget ); if ( legend ) { diff --git a/src/app/composer/qgscomposermapwidget.cpp b/src/app/composer/qgscomposermapwidget.cpp index 1b1c84c38d2..81b8b840c6f 100644 --- a/src/app/composer/qgscomposermapwidget.cpp +++ b/src/app/composer/qgscomposermapwidget.cpp @@ -39,10 +39,8 @@ QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap ): QWidg //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerMap ); - toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); + mainLayout->addWidget( itemPropertiesWidget ); - mWidthLineEdit->setValidator( new QDoubleValidator( mWidthLineEdit ) ); - mHeightLineEdit->setValidator( new QDoubleValidator( mHeightLineEdit ) ); mScaleLineEdit->setValidator( new QDoubleValidator( mScaleLineEdit ) ); mXMinLineEdit->setValidator( new QDoubleValidator( mXMinLineEdit ) ); @@ -91,47 +89,6 @@ QgsComposerMapWidget::~QgsComposerMapWidget() { } -void QgsComposerMapWidget::on_mWidthLineEdit_editingFinished() -{ - if ( mComposerMap ) - { - bool conversionSuccess = true; - double newWidth = mWidthLineEdit->text().toDouble( &conversionSuccess ); - if ( !conversionSuccess ) - { - return; - } - QRectF composerMapRect = mComposerMap->rect(); - QTransform composerMapTransform = mComposerMap->transform(); - - QRectF newRect( composerMapTransform.dx(), composerMapTransform.dy(), newWidth, composerMapRect.height() ); - - mComposerMap->beginCommand( tr( "Change item width" ) ); - mComposerMap->setSceneRect( newRect ); - mComposerMap->endCommand(); - } -} - -void QgsComposerMapWidget::on_mHeightLineEdit_editingFinished() -{ - if ( mComposerMap ) - { - bool conversionSuccess = true; - double newHeight = mHeightLineEdit->text().toDouble( &conversionSuccess ); - if ( !conversionSuccess ) - { - return; - } - QRectF composerMapRect = mComposerMap->rect(); - QTransform composerMapTransform = mComposerMap->transform(); - - QRectF newRect( composerMapTransform.dx(), composerMapTransform.dy(), composerMapRect.width(), newHeight ); - mComposerMap->beginCommand( tr( "Change item height" ) ); - mComposerMap->setSceneRect( newRect ); - mComposerMap->endCommand(); - } -} - void QgsComposerMapWidget::on_mPreviewModeComboBox_activated( int i ) { Q_UNUSED( i ); @@ -264,15 +221,11 @@ void QgsComposerMapWidget::on_mYMaxLineEdit_editingFinished() void QgsComposerMapWidget::setGuiElementValues() { - mHeightLineEdit->blockSignals( true ); - mWidthLineEdit->blockSignals( true ); mScaleLineEdit->blockSignals( true ); mPreviewModeComboBox->blockSignals( true ); updateGuiElements(); - mHeightLineEdit->blockSignals( false ); - mWidthLineEdit->blockSignals( false ); mScaleLineEdit->blockSignals( false ); mPreviewModeComboBox->blockSignals( false ); } @@ -285,8 +238,6 @@ void QgsComposerMapWidget::updateGuiElements() //width, height, scale QRectF composerMapRect = mComposerMap->rect(); - mWidthLineEdit->setText( QString::number( composerMapRect.width() ) ); - mHeightLineEdit->setText( QString::number( composerMapRect.height() ) ); mScaleLineEdit->setText( QString::number( mComposerMap->scale(), 'f', 0 ) ); //preview mode @@ -404,11 +355,11 @@ void QgsComposerMapWidget::updateGuiElements() if ( mComposerMap->showGridAnnotation() ) { - mDrawAnnotationCheckBox->setCheckState( Qt::Checked ); + mDrawAnnotationCheckableGroupBox->setChecked( true ); } else { - mDrawAnnotationCheckBox->setCheckState( Qt::Unchecked ); + mDrawAnnotationCheckableGroupBox->setChecked( false ); } mCoordinatePrecisionSpinBox->setValue( mComposerMap->gridAnnotationPrecision() ); @@ -448,8 +399,6 @@ void QgsComposerMapWidget::updateComposerExtentFromGui() void QgsComposerMapWidget::blockAllSignals( bool b ) { - mWidthLineEdit->blockSignals( b ); - mHeightLineEdit->blockSignals( b ); mScaleLineEdit->blockSignals( b ); mXMinLineEdit->blockSignals( b ); mXMaxLineEdit->blockSignals( b ); @@ -466,7 +415,7 @@ void QgsComposerMapWidget::blockAllSignals( bool b ) mSetToMapCanvasExtentButton->blockSignals( b ); mUpdatePreviewButton->blockSignals( b ); mGridLineStyleButton->blockSignals( b ); - mDrawAnnotationCheckBox->blockSignals( b ); + mDrawAnnotationCheckableGroupBox->blockSignals( b ); mAnnotationFontButton->blockSignals( b ); mAnnotationFormatComboBox->blockSignals( b ); mAnnotationPositionLeftComboBox->blockSignals( b ); @@ -812,7 +761,7 @@ void QgsComposerMapWidget::on_mAnnotationPositionBottomComboBox_currentIndexChan handleChangedAnnotationPosition( QgsComposerMap::Bottom, text ); } -void QgsComposerMapWidget::on_mDrawAnnotationCheckBox_stateChanged( int state ) +void QgsComposerMapWidget::on_mDrawAnnotationCheckableGroupBox_toggled( bool state ) { if ( !mComposerMap ) { @@ -820,7 +769,7 @@ void QgsComposerMapWidget::on_mDrawAnnotationCheckBox_stateChanged( int state ) } mComposerMap->beginCommand( tr( "Annotation toggled" ) ); - if ( state == Qt::Checked ) + if ( state ) { mComposerMap->setShowGridAnnotation( true ); } @@ -907,7 +856,8 @@ void QgsComposerMapWidget::showEvent( QShowEvent * event ) void QgsComposerMapWidget::addPageToToolbox( QWidget* widget, const QString& name ) { - toolBox->addItem( widget, name ); + //TODO : wrap the widget in a collapsibleGroupBox to be more consistent with previous implementation + mainLayout->addWidget( widget ); } void QgsComposerMapWidget::insertAnnotationPositionEntries( QComboBox* c ) diff --git a/src/app/composer/qgscomposermapwidget.h b/src/app/composer/qgscomposermapwidget.h index 20dad33703c..07dcc968cec 100644 --- a/src/app/composer/qgscomposermapwidget.h +++ b/src/app/composer/qgscomposermapwidget.h @@ -35,8 +35,6 @@ class QgsComposerMapWidget: public QWidget, private Ui::QgsComposerMapWidgetBase virtual ~QgsComposerMapWidget(); public slots: - void on_mWidthLineEdit_editingFinished(); - void on_mHeightLineEdit_editingFinished(); void on_mPreviewModeComboBox_activated( int i ); void on_mScaleLineEdit_editingFinished(); void on_mRotationSpinBox_valueChanged( double value ); @@ -78,7 +76,7 @@ class QgsComposerMapWidget: public QWidget, private Ui::QgsComposerMapWidgetBase void on_mAnnotationDirectionComboBoxTop_currentIndexChanged( const QString& text ); void on_mAnnotationDirectionComboBoxBottom_currentIndexChanged( const QString& text ); - void on_mDrawAnnotationCheckBox_stateChanged( int state ); + void on_mDrawAnnotationCheckableGroupBox_toggled( bool state ); void on_mCoordinatePrecisionSpinBox_valueChanged( int value ); void on_mFrameStyleComboBox_currentIndexChanged( const QString& text ); diff --git a/src/app/composer/qgscomposerpicturewidget.cpp b/src/app/composer/qgscomposerpicturewidget.cpp index 2bbf87b7c64..89cbbab73d1 100644 --- a/src/app/composer/qgscomposerpicturewidget.cpp +++ b/src/app/composer/qgscomposerpicturewidget.cpp @@ -36,10 +36,8 @@ QgsComposerPictureWidget::QgsComposerPictureWidget( QgsComposerPicture* picture //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, picture ); - toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); + mainLayout->addWidget( itemPropertiesWidget ); - mWidthLineEdit->setValidator( new QDoubleValidator( this ) ); - mHeightLineEdit->setValidator( new QDoubleValidator( this ) ); setGuiElementValues(); mPreviewListWidget->setIconSize( QSize( 30, 30 ) ); @@ -115,41 +113,6 @@ void QgsComposerPictureWidget::on_mPictureLineEdit_editingFinished() } } -void QgsComposerPictureWidget::on_mWidthLineEdit_editingFinished() -{ - if ( mPicture ) - { - QRectF pictureRect = mPicture->rect(); - - bool conversionOk; - double newWidth = mWidthLineEdit->text().toDouble( &conversionOk ); - if ( conversionOk ) - { - mPicture->beginCommand( tr( "Picture width changed" ) ); - QRectF newSceneRect( mPicture->transform().dx(), mPicture->transform().dy(), newWidth, pictureRect.height() ); - mPicture->setSceneRect( newSceneRect ); - mPicture->endCommand(); - } - } -} - -void QgsComposerPictureWidget::on_mHeightLineEdit_editingFinished() -{ - if ( mPicture ) - { - QRectF pictureRect = mPicture->rect(); - - bool conversionOk; - double newHeight = mHeightLineEdit->text().toDouble( &conversionOk ); - if ( conversionOk ) - { - mPicture->beginCommand( tr( "Picture height changed" ) ); - QRectF newSceneRect( mPicture->transform().dx(), mPicture->transform().dy(), pictureRect.width(), newHeight ); - mPicture->setSceneRect( newSceneRect ); - mPicture->endCommand(); - } - } -} void QgsComposerPictureWidget::on_mRotationSpinBox_valueChanged( double d ) { @@ -345,8 +308,6 @@ void QgsComposerPictureWidget::setGuiElementValues() //set initial gui values if ( mPicture ) { - mWidthLineEdit->blockSignals( true ); - mHeightLineEdit->blockSignals( true ); mRotationSpinBox->blockSignals( true ); mPictureLineEdit->blockSignals( true ); mComposerMapComboBox->blockSignals( true ); @@ -354,8 +315,6 @@ void QgsComposerPictureWidget::setGuiElementValues() mPictureLineEdit->setText( mPicture->pictureFile() ); QRectF pictureRect = mPicture->rect(); - mWidthLineEdit->setText( QString::number( pictureRect.width() ) ); - mHeightLineEdit->setText( QString::number( pictureRect.height() ) ); mRotationSpinBox->setValue( mPicture->rotation() ); refreshMapComboBox(); @@ -381,8 +340,6 @@ void QgsComposerPictureWidget::setGuiElementValues() mRotationFromComposerMapCheckBox->blockSignals( false ); - mWidthLineEdit->blockSignals( false ); - mHeightLineEdit->blockSignals( false ); mRotationSpinBox->blockSignals( false ); mPictureLineEdit->blockSignals( false ); mComposerMapComboBox->blockSignals( false ); diff --git a/src/app/composer/qgscomposerpicturewidget.h b/src/app/composer/qgscomposerpicturewidget.h index 3599406df7a..3cf09f00ef8 100644 --- a/src/app/composer/qgscomposerpicturewidget.h +++ b/src/app/composer/qgscomposerpicturewidget.h @@ -40,8 +40,6 @@ class QgsComposerPictureWidget: public QWidget, private Ui::QgsComposerPictureWi void on_mPictureBrowseButton_clicked(); void on_mPictureLineEdit_editingFinished(); void on_mRotationSpinBox_valueChanged( double d ); - void on_mWidthLineEdit_editingFinished(); - void on_mHeightLineEdit_editingFinished(); void on_mPreviewListWidget_currentItemChanged( QListWidgetItem* current, QListWidgetItem* previous ); void on_mAddDirectoryButton_clicked(); void on_mRemoveDirectoryButton_clicked(); diff --git a/src/app/composer/qgscomposerscalebarwidget.cpp b/src/app/composer/qgscomposerscalebarwidget.cpp index 1ba759eadfc..8be216718b5 100644 --- a/src/app/composer/qgscomposerscalebarwidget.cpp +++ b/src/app/composer/qgscomposerscalebarwidget.cpp @@ -29,7 +29,7 @@ QgsComposerScaleBarWidget::QgsComposerScaleBarWidget( QgsComposerScaleBar* scale //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, scaleBar ); - toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); + mainLayout->addWidget( itemPropertiesWidget ); blockMemberSignals( true ); diff --git a/src/app/composer/qgscomposershapewidget.cpp b/src/app/composer/qgscomposershapewidget.cpp index 18d23c52c99..0b799f0c9cf 100644 --- a/src/app/composer/qgscomposershapewidget.cpp +++ b/src/app/composer/qgscomposershapewidget.cpp @@ -26,7 +26,7 @@ QgsComposerShapeWidget::QgsComposerShapeWidget( QgsComposerShape* composerShape //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerShape ); - toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); + mainLayout->addWidget( itemPropertiesWidget ); blockAllSignals( true ); @@ -53,11 +53,7 @@ QgsComposerShapeWidget::~QgsComposerShapeWidget() void QgsComposerShapeWidget::blockAllSignals( bool block ) { mShapeComboBox->blockSignals( block ); - mOutlineColorButton->blockSignals( block ); - mOutlineWidthSpinBox->blockSignals( block ); - mFillColorButton->blockSignals( block ); mRotationSpinBox->blockSignals( block ); - mTransparentCheckBox->blockSignals( block ); } void QgsComposerShapeWidget::setGuiElementValues() @@ -68,7 +64,7 @@ void QgsComposerShapeWidget::setGuiElementValues() } blockAllSignals( true ); - mOutlineWidthSpinBox->setValue( mComposerShape->lineWidth() ); + mRotationSpinBox->setValue( mComposerShape->rotation() ); if ( mComposerShape->shapeType() == QgsComposerShape::Ellipse ) { @@ -83,16 +79,6 @@ void QgsComposerShapeWidget::setGuiElementValues() mShapeComboBox->setCurrentIndex( mShapeComboBox->findText( tr( "Triangle" ) ) ); } - if ( mComposerShape->transparentFill() ) - { - mTransparentCheckBox->setCheckState( Qt::Checked ); - mFillColorButton->setEnabled( false ); - } - else - { - mTransparentCheckBox->setCheckState( Qt::Unchecked ); - mFillColorButton->setEnabled( true ); - } blockAllSignals( false ); } @@ -131,79 +117,5 @@ void QgsComposerShapeWidget::on_mShapeComboBox_currentIndexChanged( const QStrin mComposerShape->endCommand(); } -void QgsComposerShapeWidget::on_mOutlineColorButton_clicked() -{ - if ( !mComposerShape ) - { - return; - } - QColor existingColor = mComposerShape->outlineColor(); -#if QT_VERSION >= 0x040500 - QColor newColor = QColorDialog::getColor( existingColor, 0, tr( "Select outline color" ), QColorDialog::ShowAlphaChannel ); -#else - QColor newColor = QColorDialog::getColor( existingColor ); -#endif - if ( newColor.isValid() ) - { - mComposerShape->beginCommand( tr( "Shape outline color" ) ); - mComposerShape->setOutlineColor( newColor ); - mComposerShape->update(); - mComposerShape->endCommand(); - } -} - -void QgsComposerShapeWidget::on_mOutlineWidthSpinBox_valueChanged( double d ) -{ - if ( !mComposerShape ) - { - return; - } - mComposerShape->beginCommand( tr( "Shape outline width" ), QgsComposerMergeCommand::ShapeOutlineWidth ); - mComposerShape->setLineWidth( d ); - mComposerShape->update(); - mComposerShape->endCommand(); -} - -void QgsComposerShapeWidget::on_mTransparentCheckBox_stateChanged( int state ) -{ - if ( !mComposerShape ) - { - return; - } - - mComposerShape->beginCommand( tr( "Shape transparency toggled" ) ); - if ( state == Qt::Checked ) - { - mComposerShape->setTransparentFill( true ); - mFillColorButton->setEnabled( false ); - } - else - { - mComposerShape->setTransparentFill( false ); - mFillColorButton->setEnabled( true ); - } - mComposerShape->update(); - mComposerShape->endCommand(); -} -void QgsComposerShapeWidget::on_mFillColorButton_clicked() -{ - if ( !mComposerShape ) - { - return; - } - QColor existingColor = mComposerShape->fillColor(); -#if QT_VERSION >= 0x040500 - QColor newColor = QColorDialog::getColor( existingColor, 0, tr( "Select fill color" ), QColorDialog::ShowAlphaChannel ); -#else - QColor newColor = QColorDialog::getColor( existingColor ); -#endif - if ( newColor.isValid() ) - { - mComposerShape->beginCommand( tr( "Shape fill color" ) ); - mComposerShape->setFillColor( newColor ); - mComposerShape->update(); - mComposerShape->endCommand(); - } -} diff --git a/src/app/composer/qgscomposershapewidget.h b/src/app/composer/qgscomposershapewidget.h index a755bcb87c0..735aff3af2e 100644 --- a/src/app/composer/qgscomposershapewidget.h +++ b/src/app/composer/qgscomposershapewidget.h @@ -38,10 +38,6 @@ class QgsComposerShapeWidget: public QWidget, private Ui::QgsComposerShapeWidget private slots: void on_mShapeComboBox_currentIndexChanged( const QString& text ); - void on_mOutlineColorButton_clicked(); - void on_mOutlineWidthSpinBox_valueChanged( double d ); - void on_mTransparentCheckBox_stateChanged( int state ); - void on_mFillColorButton_clicked(); void on_mRotationSpinBox_valueChanged( int val ); /**Sets the GUI elements to the currentValues of mComposerShape*/ diff --git a/src/app/composer/qgscomposertablewidget.cpp b/src/app/composer/qgscomposertablewidget.cpp index c14fbfd8997..b7b73dcbce5 100644 --- a/src/app/composer/qgscomposertablewidget.cpp +++ b/src/app/composer/qgscomposertablewidget.cpp @@ -30,7 +30,7 @@ QgsComposerTableWidget::QgsComposerTableWidget( QgsComposerAttributeTable* table setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, mComposerTable ); - mToolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); + mainLayout->addWidget( itemPropertiesWidget ); blockAllSignals( true ); @@ -288,20 +288,15 @@ void QgsComposerTableWidget::on_mGridColorButton_clicked() mComposerTable->endCommand(); } -void QgsComposerTableWidget::on_mShowGridCheckBox_stateChanged( int state ) +void QgsComposerTableWidget::on_mShowGridGroupCheckBox_toggled( bool state ) { if ( !mComposerTable ) { return; } - bool showGrid = false; - if ( state == Qt::Checked ) - { - showGrid = true; - } mComposerTable->beginCommand( tr( "Table grid toggled" ) ); - mComposerTable->setShowGrid( showGrid ); + mComposerTable->setShowGrid( state ); mComposerTable->update(); mComposerTable->endCommand(); } @@ -343,11 +338,11 @@ void QgsComposerTableWidget::updateGuiElements() mGridColorButton->setColor( mComposerTable->gridColor() ); if ( mComposerTable->showGrid() ) { - mShowGridCheckBox->setCheckState( Qt::Checked ); + mShowGridGroupCheckBox->setChecked( true ); } else { - mShowGridCheckBox->setCheckState( Qt::Unchecked ); + mShowGridGroupCheckBox->setChecked( false ); } if ( mComposerTable->displayOnlyVisibleFeatures() ) @@ -369,7 +364,7 @@ void QgsComposerTableWidget::blockAllSignals( bool b ) mMarginSpinBox->blockSignals( b ); mGridColorButton->blockSignals( b ); mGridStrokeWidthSpinBox->blockSignals( b ); - mShowGridCheckBox->blockSignals( b ); + mShowGridGroupCheckBox->blockSignals( b ); mShowOnlyVisibleFeaturesCheckBox->blockSignals( b ); } diff --git a/src/app/composer/qgscomposertablewidget.h b/src/app/composer/qgscomposertablewidget.h index ac581c24a76..6091020c13f 100644 --- a/src/app/composer/qgscomposertablewidget.h +++ b/src/app/composer/qgscomposertablewidget.h @@ -49,7 +49,7 @@ class QgsComposerTableWidget: public QWidget, private Ui::QgsComposerTableWidget void on_mGridColorButton_clicked(); void on_mHeaderFontPushButton_clicked(); void on_mContentFontPushButton_clicked(); - void on_mShowGridCheckBox_stateChanged( int state ); + void on_mShowGridGroupCheckBox_toggled( bool state ); void on_mShowOnlyVisibleFeaturesCheckBox_stateChanged( int state ); /**Inserts a new maximum number of features into the spin box (without the spinbox emitting a signal)*/ diff --git a/src/app/composer/qgscompositionwidget.cpp b/src/app/composer/qgscompositionwidget.cpp index 11f0adc7280..c57551fdc9b 100644 --- a/src/app/composer/qgscompositionwidget.cpp +++ b/src/app/composer/qgscompositionwidget.cpp @@ -47,27 +47,13 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget* parent, QgsComposition* c ) mResolutionSpinBox->setValue( mComposition->printResolution() ); //print as raster - if ( mComposition->printAsRaster() ) - { - mPrintAsRasterCheckBox->setCheckState( Qt::Checked ); - } - else - { - mPrintAsRasterCheckBox->setCheckState( Qt::Unchecked ); - } + mPrintAsRasterGroupCheckBox->setChecked( mComposition->printAsRaster() ); - mAlignmentSnapCheckBox->setCheckState( mComposition->alignmentSnap() ? Qt::Checked : Qt::Unchecked ); + mAlignmentSnapGroupCheckBox->setChecked( mComposition->alignmentSnap() ); mAlignmentToleranceSpinBox->setValue( mComposition->alignmentSnapTolerance() ); //snap grid - if ( mComposition->snapToGridEnabled() ) - { - mSnapToGridCheckBox->setCheckState( Qt::Checked ); - } - else - { - mSnapToGridCheckBox->setCheckState( Qt::Unchecked ); - } + mSnapToGridGroupCheckBox->setChecked( mComposition->snapToGridEnabled() ); mGridResolutionSpinBox->setValue( mComposition->snapGridResolution() ); mOffsetXSpinBox->setValue( mComposition->snapGridOffsetX() ); mOffsetYSpinBox->setValue( mComposition->snapGridOffsetY() ); @@ -396,15 +382,7 @@ void QgsCompositionWidget::displaySnapingSettings() return; } - if ( mComposition->snapToGridEnabled() ) - { - mSnapToGridCheckBox->setCheckState( Qt::Checked ); - } - else - { - mSnapToGridCheckBox->setCheckState( Qt::Unchecked ); - } - + mSnapToGridGroupCheckBox->setChecked( mComposition->snapToGridEnabled() ); mGridResolutionSpinBox->setValue( mComposition->snapGridResolution() ); mOffsetXSpinBox->setValue( mComposition->snapGridOffsetX() ); mOffsetYSpinBox->setValue( mComposition->snapGridOffsetY() ); @@ -415,35 +393,21 @@ void QgsCompositionWidget::on_mResolutionSpinBox_valueChanged( const int value ) mComposition->setPrintResolution( value ); } -void QgsCompositionWidget::on_mPrintAsRasterCheckBox_stateChanged( int state ) +void QgsCompositionWidget::on_mPrintAsRasterGroupCheckBox_toggled( bool state ) { if ( !mComposition ) { return; } - if ( state == Qt::Checked ) - { - mComposition->setPrintAsRaster( true ); - } - else - { - mComposition->setPrintAsRaster( false ); - } + mComposition->setPrintAsRaster( state ); } -void QgsCompositionWidget::on_mSnapToGridCheckBox_stateChanged( int state ) +void QgsCompositionWidget::on_mSnapToGridGroupCheckBox_toggled( bool state ) { if ( mComposition ) { - if ( state == Qt::Checked ) - { - mComposition->setSnapToGridEnabled( true ); - } - else - { - mComposition->setSnapToGridEnabled( false ); - } + mComposition->setSnapToGridEnabled( state ); } } @@ -527,11 +491,11 @@ void QgsCompositionWidget::on_mSelectionToleranceSpinBox_valueChanged( double d } } -void QgsCompositionWidget::on_mAlignmentSnapCheckBox_stateChanged( int state ) +void QgsCompositionWidget::on_mAlignmentSnapGroupCheckBox_toggled( bool state ) { if ( mComposition ) { - mComposition->setAlignmentSnap( state == Qt::Checked ? true : false ); + mComposition->setAlignmentSnap( state ); } } @@ -552,8 +516,8 @@ void QgsCompositionWidget::blockSignals( bool block ) mNumPagesSpinBox->blockSignals( block ); mPaperOrientationComboBox->blockSignals( block ); mResolutionSpinBox->blockSignals( block ); - mPrintAsRasterCheckBox->blockSignals( block ); - mSnapToGridCheckBox->blockSignals( block ); + mPrintAsRasterGroupCheckBox->blockSignals( block ); + mSnapToGridGroupCheckBox->blockSignals( block ); mGridResolutionSpinBox->blockSignals( block ); mOffsetXSpinBox->blockSignals( block ); mOffsetYSpinBox->blockSignals( block ); @@ -561,6 +525,6 @@ void QgsCompositionWidget::blockSignals( bool block ) mGridColorButton->blockSignals( block ); mGridStyleComboBox->blockSignals( block ); mSelectionToleranceSpinBox->blockSignals( block ); - mAlignmentSnapCheckBox->blockSignals( block ); + mAlignmentSnapGroupCheckBox->blockSignals( block ); mAlignmentToleranceSpinBox->blockSignals( block ); } diff --git a/src/app/composer/qgscompositionwidget.h b/src/app/composer/qgscompositionwidget.h index 75ddb96249a..9d7c72f2604 100644 --- a/src/app/composer/qgscompositionwidget.h +++ b/src/app/composer/qgscompositionwidget.h @@ -47,9 +47,9 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase void on_mPaperHeightDoubleSpinBox_editingFinished(); void on_mNumPagesSpinBox_valueChanged( int value ); void on_mResolutionSpinBox_valueChanged( const int value ); - void on_mPrintAsRasterCheckBox_stateChanged( int state ); + void on_mPrintAsRasterGroupCheckBox_toggled( bool state ); - void on_mSnapToGridCheckBox_stateChanged( int state ); + void on_mSnapToGridGroupCheckBox_toggled( bool state ); void on_mGridResolutionSpinBox_valueChanged( double d ); void on_mOffsetXSpinBox_valueChanged( double d ); void on_mOffsetYSpinBox_valueChanged( double d ); @@ -57,7 +57,7 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase void on_mGridStyleComboBox_currentIndexChanged( const QString& text ); void on_mPenWidthSpinBox_valueChanged( double d ); void on_mSelectionToleranceSpinBox_valueChanged( double d ); - void on_mAlignmentSnapCheckBox_stateChanged( int state ); + void on_mAlignmentSnapGroupCheckBox_toggled( bool state ); void on_mAlignmentToleranceSpinBox_valueChanged( double d ); /**Sets GUI elements to width/height from composition*/ diff --git a/src/app/composer/qgsitempositiondialog.cpp b/src/app/composer/qgsitempositiondialog.cpp deleted file mode 100644 index 357ab17dc6e..00000000000 --- a/src/app/composer/qgsitempositiondialog.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/*************************************************************************** - qgsitempositiondialog.cpp - ------------------------- - begin : October 2008 - copyright : (C) 2008 by Marco Hugentobler - email : marco dot hugentobler at karto dot baug dot ethz dot ch - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "qgsitempositiondialog.h" -#include "qgspoint.h" -#include -#include - -QgsItemPositionDialog::QgsItemPositionDialog( QgsComposerItem* item, QWidget* parent ): QDialog( parent ), mItem( item ) -{ - setupUi( this ); - - //make button exclusive - QButtonGroup* buttonGroup = new QButtonGroup( this ); - buttonGroup->addButton( mUpperLeftCheckBox ); - buttonGroup->addButton( mUpperMiddleCheckBox ); - buttonGroup->addButton( mUpperRightCheckBox ); - buttonGroup->addButton( mMiddleLeftCheckBox ); - buttonGroup->addButton( mMiddleCheckBox ); - buttonGroup->addButton( mMiddleRightCheckBox ); - buttonGroup->addButton( mLowerLeftCheckBox ); - buttonGroup->addButton( mLowerMiddleCheckBox ); - buttonGroup->addButton( mLowerRightCheckBox ); - buttonGroup->setExclusive( true ); - - mXLineEdit->setValidator( new QDoubleValidator( 0 ) ); - mYLineEdit->setValidator( new QDoubleValidator( 0 ) ); - mWidthLineEdit->setValidator( new QDoubleValidator( 0 ) ); - mHeightLineEdit->setValidator( new QDoubleValidator( 0 ) ); - - //set lower left position of item - mUpperLeftCheckBox->setCheckState( Qt::Checked ); - - //set initial width and height - if ( mItem ) - { - mWidthLineEdit->setText( QString::number( mItem->rect().width() ) ); - mHeightLineEdit->setText( QString::number( mItem->rect().height() ) ); - } -} - -QgsItemPositionDialog::QgsItemPositionDialog(): mItem( 0 ) -{ -} - -QgsItemPositionDialog::~QgsItemPositionDialog() -{ - -} - -int QgsItemPositionDialog::position( QgsPoint& point ) const -{ - bool convXSuccess, convYSuccess; - double x = mXLineEdit->text().toDouble( &convXSuccess ); - double y = mYLineEdit->text().toDouble( &convYSuccess ); - - if ( !convXSuccess || !convYSuccess ) - { - return 1; - } - - point.setX( x ); - point.setY( y ); - return 0; -} - -int QgsItemPositionDialog::size( QSizeF& s ) const -{ - bool convSuccessWidth, convSuccessHeight; - double width = mWidthLineEdit->text().toDouble( &convSuccessWidth ); - double height = mHeightLineEdit->text().toDouble( &convSuccessHeight ); - - if ( !convSuccessWidth || !convSuccessHeight ) - { - return 1; - } - - s.setWidth( width ); - s.setHeight( height ); - return 0; -} - -QgsComposerItem::ItemPositionMode QgsItemPositionDialog::positionMode() const -{ - if ( mUpperLeftCheckBox->checkState() == Qt::Checked ) - { - return QgsComposerItem::UpperLeft; - } - else if ( mUpperMiddleCheckBox->checkState() == Qt::Checked ) - { - return QgsComposerItem::UpperMiddle; - } - else if ( mUpperRightCheckBox->checkState() == Qt::Checked ) - { - return QgsComposerItem::UpperRight; - } - else if ( mMiddleLeftCheckBox->checkState() == Qt::Checked ) - { - return QgsComposerItem::MiddleLeft; - } - else if ( mMiddleCheckBox->checkState() == Qt::Checked ) - { - return QgsComposerItem::Middle; - } - else if ( mMiddleRightCheckBox->checkState() == Qt::Checked ) - { - return QgsComposerItem::MiddleRight; - } - else if ( mLowerLeftCheckBox->checkState() == Qt::Checked ) - { - return QgsComposerItem::LowerLeft; - } - else if ( mLowerMiddleCheckBox->checkState() == Qt::Checked ) - { - return QgsComposerItem::LowerMiddle; - } - else if ( mLowerRightCheckBox->checkState() == Qt::Checked ) - { - return QgsComposerItem::LowerRight; - } - return QgsComposerItem::UpperLeft; -} - -void QgsItemPositionDialog::on_mCloseButton_clicked() -{ - accept(); -} - -void QgsItemPositionDialog::on_mSetPositionButton_clicked() -{ - if ( !mItem ) - { - return; - } - - QgsPoint itemPosition; - QSizeF itemSize; - - if ( position( itemPosition ) == 0 ) - { - if ( size( itemSize ) == 0 ) - { - mItem->setItemPosition( itemPosition.x(), itemPosition.y(), itemSize.width(), itemSize.height(), positionMode() ); - } - else - { - mItem->setItemPosition( itemPosition.x(), itemPosition.y(), positionMode() ); - } - mItem->update(); - } -} - -void QgsItemPositionDialog::on_mUpperLeftCheckBox_stateChanged( int state ) -{ - if ( state == Qt::Checked && mItem ) - { - mXLineEdit->setText( QString::number( mItem->transform().dx() ) ); - mYLineEdit->setText( QString::number( mItem->transform().dy() ) ); - } -} - -void QgsItemPositionDialog::on_mUpperMiddleCheckBox_stateChanged( int state ) -{ - - if ( state == Qt::Checked && mItem ) - { - mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() / 2.0 ) ); - mYLineEdit->setText( QString::number( mItem->transform().dy() ) ); - } -} - -void QgsItemPositionDialog::on_mUpperRightCheckBox_stateChanged( int state ) -{ - if ( state == Qt::Checked && mItem ) - { - mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() ) ); - mYLineEdit->setText( QString::number( mItem->transform().dy() ) ); - } -} - -void QgsItemPositionDialog::on_mMiddleLeftCheckBox_stateChanged( int state ) -{ - if ( state == Qt::Checked && mItem ) - { - mXLineEdit->setText( QString::number( mItem->transform().dx() ) ); - mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() / 2.0 ) ); - } -} - -void QgsItemPositionDialog::on_mMiddleCheckBox_stateChanged( int state ) -{ - if ( state == Qt::Checked && mItem ) - { - mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() / 2.0 ) ); - mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() / 2.0 ) ); - } -} - -void QgsItemPositionDialog::on_mMiddleRightCheckBox_stateChanged( int state ) -{ - if ( state == Qt::Checked && mItem ) - { - mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() ) ); - mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() / 2.0 ) ); - } -} - -void QgsItemPositionDialog::on_mLowerLeftCheckBox_stateChanged( int state ) -{ - if ( state == Qt::Checked && mItem ) - { - mXLineEdit->setText( QString::number( mItem->transform().dx() ) ); - mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() ) ); - } -} - -void QgsItemPositionDialog::on_mLowerMiddleCheckBox_stateChanged( int state ) -{ - if ( state == Qt::Checked && mItem ) - { - mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() / 2.0 ) ); - mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() ) ); - } -} - -void QgsItemPositionDialog::on_mLowerRightCheckBox_stateChanged( int state ) -{ - if ( state == Qt::Checked && mItem ) - { - mXLineEdit->setText( QString::number( mItem->transform().dx() + mItem->rect().width() ) ); - mYLineEdit->setText( QString::number( mItem->transform().dy() + mItem->rect().height() ) ); - } -} diff --git a/src/app/composer/qgsitempositiondialog.h b/src/app/composer/qgsitempositiondialog.h deleted file mode 100644 index bf4f36fca22..00000000000 --- a/src/app/composer/qgsitempositiondialog.h +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - qgsitempositiondialog.h - ------------------------- - begin : October 2008 - copyright : (C) 2008 by Marco Hugentobler - email : marco dot hugentobler at karto dot baug dot ethz dot ch - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef QGSITEMPOSITIONDIALOG_H -#define QGSITEMPOSITIONDIALOG_H - -#include "ui_qgsitempositiondialogbase.h" -#include "qgscomposeritem.h" -class QgsPoint; - -/**A dialog to set the position of upper/middle/lower left/middle/lower point of an item*/ -class QgsItemPositionDialog: public QDialog, private Ui::QgsItemPositionDialogBase -{ - Q_OBJECT - public: - QgsItemPositionDialog( QgsComposerItem* item, QWidget* parent = 0 ); - ~QgsItemPositionDialog(); - - /**Get selected x- and y-coordinate as point. Returns 0 in case of success*/ - int position( QgsPoint& point ) const; - /**Get selected size. Returns 0 in case of success*/ - int size( QSizeF& s ) const; - /**A combination of upper/middle/lower and left/middle/right*/ - QgsComposerItem::ItemPositionMode positionMode() const; - - public slots: - - void on_mCloseButton_clicked(); - void on_mSetPositionButton_clicked(); - - //adjust coordinates in line edits - void on_mUpperLeftCheckBox_stateChanged( int state ); - void on_mUpperMiddleCheckBox_stateChanged( int state ); - void on_mUpperRightCheckBox_stateChanged( int state ); - void on_mMiddleLeftCheckBox_stateChanged( int state ); - void on_mMiddleCheckBox_stateChanged( int state ); - void on_mMiddleRightCheckBox_stateChanged( int state ); - void on_mLowerLeftCheckBox_stateChanged( int state ); - void on_mLowerMiddleCheckBox_stateChanged( int state ); - void on_mLowerRightCheckBox_stateChanged( int state ); - - private: - QgsComposerItem* mItem; - - //default constructor forbidden - QgsItemPositionDialog(); -}; - -#endif diff --git a/src/core/composer/qgscomposeritem.cpp b/src/core/composer/qgscomposeritem.cpp index 3cdba60f90d..ebdd1423313 100644 --- a/src/core/composer/qgscomposeritem.cpp +++ b/src/core/composer/qgscomposeritem.cpp @@ -50,6 +50,7 @@ QgsComposerItem::QgsComposerItem( QgsComposition* composition, bool manageZValue , mItemPositionLocked( false ) , mLastValidViewScaleFactor( -1 ) , mRotation( 0 ) + , mLastUsedPositionMode( UpperLeft ) { init( manageZValue ); } @@ -66,6 +67,7 @@ QgsComposerItem::QgsComposerItem( qreal x, qreal y, qreal width, qreal height, Q , mItemPositionLocked( false ) , mLastValidViewScaleFactor( -1 ) , mRotation( 0 ) + , mLastUsedPositionMode( UpperLeft ) { init( manageZValue ); QTransform t; @@ -147,6 +149,7 @@ bool QgsComposerItem::_writeXML( QDomElement& itemElem, QDomDocument& doc ) cons composerItemElem.setAttribute( "y", QString::number( transform().dy() ) ); composerItemElem.setAttribute( "width", QString::number( rect().width() ) ); composerItemElem.setAttribute( "height", QString::number( rect().height() ) ); + composerItemElem.setAttribute( "positionMode", QString::number( (int) mLastUsedPositionMode ) ); composerItemElem.setAttribute( "zValue", QString::number( zValue() ) ); composerItemElem.setAttribute( "outlineWidth", QString::number( pen().widthF() ) ); composerItemElem.setAttribute( "rotation", QString::number( mRotation ) ); @@ -236,12 +239,17 @@ bool QgsComposerItem::_readXML( const QDomElement& itemElem, const QDomDocument& //position double x, y, width, height; - bool xOk, yOk, widthOk, heightOk; + bool xOk, yOk, widthOk, heightOk, positionModeOK; x = itemElem.attribute( "x" ).toDouble( &xOk ); y = itemElem.attribute( "y" ).toDouble( &yOk ); width = itemElem.attribute( "width" ).toDouble( &widthOk ); height = itemElem.attribute( "height" ).toDouble( &heightOk ); + mLastUsedPositionMode = ( ItemPositionMode )itemElem.attribute( "positionMode" ).toInt( &positionModeOK ); + if ( !positionModeOK ) + { + mLastUsedPositionMode = UpperLeft; + } if ( !xOk || !yOk || !widthOk || !heightOk ) { @@ -771,6 +779,9 @@ void QgsComposerItem::setItemPosition( double x, double y, double width, double double upperLeftX = x; double upperLeftY = y; + //store the item position mode + mLastUsedPositionMode = itemPoint; + //adjust x-coordinate if placement is not done to a left point if ( itemPoint == UpperMiddle || itemPoint == Middle || itemPoint == LowerMiddle ) { diff --git a/src/core/composer/qgscomposeritem.h b/src/core/composer/qgscomposeritem.h index 771115bf480..dee185d8386 100644 --- a/src/core/composer/qgscomposeritem.h +++ b/src/core/composer/qgscomposeritem.h @@ -138,6 +138,11 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem @note: this method was added in version 1.6*/ void setItemPosition( double x, double y, double width, double height, ItemPositionMode itemPoint = UpperLeft ); + /**Returns item's last used position mode. + @note: This property has no effect on actual's item position, which is always the top-left corner. + @note: this method was added in version 2.0*/ + ItemPositionMode lastUsedPositionMode(){ return mLastUsedPositionMode; } + /**Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size unit*/ virtual void setSceneRect( const QRectF& rectangle ); @@ -290,6 +295,7 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem /**True if item background needs to be painted*/ bool mBackground; + /**True if item position and size cannot be changed with mouse move @note: this member was added in version 1.2*/ bool mItemPositionLocked; @@ -300,6 +306,10 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem /**Item rotation in degrees, clockwise*/ double mRotation; + /**The item's position mode + @note: this member was added in version 2.0*/ + ItemPositionMode mLastUsedPositionMode; + //event handlers virtual void mouseMoveEvent( QGraphicsSceneMouseEvent * event ); virtual void mousePressEvent( QGraphicsSceneMouseEvent * event ); diff --git a/src/core/composer/qgscomposershape.cpp b/src/core/composer/qgscomposershape.cpp index b5e576d591f..97f1ce973f2 100644 --- a/src/core/composer/qgscomposershape.cpp +++ b/src/core/composer/qgscomposershape.cpp @@ -20,15 +20,13 @@ QgsComposerShape::QgsComposerShape( QgsComposition* composition ): QgsComposerItem( composition ), mShape( Ellipse ) { - initGraphicsSettings(); + setFrameEnabled(true); } QgsComposerShape::QgsComposerShape( qreal x, qreal y, qreal width, qreal height, QgsComposition* composition ): QgsComposerItem( x, y, width, height, composition ), mShape( Ellipse ) { setSceneRect( QRectF( x, y, width, height ) ); - mShapeWidth = width; - mShapeHeight = height; - initGraphicsSettings(); + setFrameEnabled(true); } QgsComposerShape::~QgsComposerShape() @@ -45,64 +43,73 @@ void QgsComposerShape::paint( QPainter* painter, const QStyleOptionGraphicsItem* return; } drawBackground( painter ); - - painter->save(); - painter->setRenderHint( QPainter::Antialiasing ); - painter->setPen( mPen ); - painter->setBrush( mBrush ); - - painter->translate( rect().width() / 2.0, rect().height() / 2.0 ); - painter->rotate( mRotation ); - painter->translate( -mShapeWidth / 2.0, -mShapeHeight / 2.0 ); - - double halfPenWidth = mPen.widthF() / 2.0; - - switch ( mShape ) - { - case Ellipse: - painter->drawEllipse( QRectF( halfPenWidth, halfPenWidth , mShapeWidth - mPen.widthF(), mShapeHeight - mPen.widthF() ) ); - break; - case Rectangle: - painter->drawRect( QRectF( halfPenWidth, halfPenWidth , mShapeWidth - mPen.widthF(), mShapeHeight - mPen.widthF() ) ); - break; - case Triangle: - QPolygonF triangle; - triangle << QPointF( halfPenWidth, mShapeHeight - halfPenWidth ); - triangle << QPointF( mShapeWidth - halfPenWidth, mShapeHeight - halfPenWidth ); - triangle << QPointF( mShapeWidth / 2.0, halfPenWidth ); - painter->drawPolygon( triangle ); - break; - } - - painter->restore(); - drawFrame( painter ); + if ( isSelected() ) { drawSelectionBoxes( painter ); } } + +void QgsComposerShape::drawShape( QPainter* p ) +{ + + p->save(); + p->setRenderHint( QPainter::Antialiasing ); + + p->translate( rect().width() / 2.0, rect().height() / 2.0 ); + p->rotate( mRotation ); + p->translate( -rect().width() / 2.0, -rect().height() / 2.0 ); + + switch ( mShape ) + { + case Ellipse: + p->drawEllipse( QRectF( 0, 0 , rect().width(), rect().height() ) ); + break; + case Rectangle: + p->drawRect( QRectF( 0, 0 , rect().width(), rect().height() ) ); + break; + case Triangle: + QPolygonF triangle; + triangle << QPointF( 0, rect().height() ); + triangle << QPointF( rect().width() , rect().height() ); + triangle << QPointF( rect().width() / 2.0, 0 ); + p->drawPolygon( triangle ); + break; + } + p->restore(); + +} + + +void QgsComposerShape::drawFrame( QPainter* p ) +{ + if ( mFrame && p ) + { + p->setPen( pen() ); + p->setBrush( Qt::NoBrush ); + p->setRenderHint( QPainter::Antialiasing, true ); + drawShape( p ); + } +} + +void QgsComposerShape::drawBackground( QPainter* p ) +{ + if ( mBackground && p ) + { + p->setBrush( brush() );//this causes a problem in atlas generation + p->setPen( Qt::NoPen ); + p->setRenderHint( QPainter::Antialiasing, true ); + drawShape( p ); + } +} + + bool QgsComposerShape::writeXML( QDomElement& elem, QDomDocument & doc ) const { QDomElement composerShapeElem = doc.createElement( "ComposerShape" ); composerShapeElem.setAttribute( "shapeType", mShape ); - composerShapeElem.setAttribute( "outlineWidth", QString::number( mPen.widthF() ) ); - composerShapeElem.setAttribute( "transparentFill", mBrush.style() == Qt::NoBrush ); - composerShapeElem.setAttribute( "shapeWidth", QString::number( mShapeWidth ) ); - composerShapeElem.setAttribute( "shapeHeight", QString::number( mShapeHeight ) ); - QDomElement outlineColorElem = doc.createElement( "OutlineColor" ); - outlineColorElem.setAttribute( "red", mPen.color().red() ); - outlineColorElem.setAttribute( "green", mPen.color().green() ); - outlineColorElem.setAttribute( "blue", mPen.color().blue() ); - outlineColorElem.setAttribute( "alpha", mPen.color().alpha() ); - composerShapeElem.appendChild( outlineColorElem ); - QDomElement fillColorElem = doc.createElement( "FillColor" ); - fillColorElem.setAttribute( "red", mBrush.color().red() ); - fillColorElem.setAttribute( "green", mBrush.color().green() ); - fillColorElem.setAttribute( "blue", mBrush.color().blue() ); - fillColorElem.setAttribute( "alpha", mBrush.color().alpha() ); - composerShapeElem.appendChild( fillColorElem ); elem.appendChild( composerShapeElem ); return _writeXML( composerShapeElem, doc ); } @@ -110,45 +117,6 @@ bool QgsComposerShape::writeXML( QDomElement& elem, QDomDocument & doc ) const bool QgsComposerShape::readXML( const QDomElement& itemElem, const QDomDocument& doc ) { mShape = QgsComposerShape::Shape( itemElem.attribute( "shapeType", "0" ).toInt() ); - mShapeWidth = itemElem.attribute( "shapeWidth", "10" ).toDouble(); - mShapeHeight = itemElem.attribute( "shapeHeight", "10" ).toDouble(); - mPen.setWidthF( itemElem.attribute( "outlineWidth", "0.4" ).toDouble() ); - - //transparent fill - bool transparent = itemElem.attribute( "transparentFill", "1" ).toInt() == 1; - if ( transparent ) - { - mBrush.setStyle( Qt::NoBrush ); - } - else - { - mBrush.setStyle( Qt::SolidPattern ); - } - - //outline color - QDomNodeList outlineColorList = itemElem.elementsByTagName( "OutlineColor" ); - if ( outlineColorList.size() > 0 ) - { - QDomElement outlineColorElem = outlineColorList.at( 0 ).toElement(); - int penRed = outlineColorElem.attribute( "red", "0" ).toInt(); - int penGreen = outlineColorElem.attribute( "green", "0" ).toInt(); - int penBlue = outlineColorElem.attribute( "blue", "0" ).toInt(); - int penAlpha = outlineColorElem.attribute( "alpha", "255" ).toInt(); - mPen.setColor( QColor( penRed, penGreen, penBlue, penAlpha ) ); - } - - //fill color - QDomNodeList fillNodeList = itemElem.elementsByTagName( "FillColor" ); - if ( fillNodeList.size() > 0 ) - { - QDomElement fillColorElem = fillNodeList.at( 0 ).toElement(); - int brushRed = fillColorElem.attribute( "red", "0" ).toInt(); - int brushGreen = fillColorElem.attribute( "green", "0" ).toInt(); - int brushBlue = fillColorElem.attribute( "blue", "0" ).toInt(); - int brushAlpha = fillColorElem.attribute( "alpha", "255" ).toInt(); - mBrush.setColor( QColor( brushRed, brushGreen, brushBlue, brushAlpha ) ); - } - //restore general composer item properties QDomNodeList composerItemList = itemElem.elementsByTagName( "ComposerItem" ); @@ -161,71 +129,12 @@ bool QgsComposerShape::readXML( const QDomElement& itemElem, const QDomDocument& return true; } -void QgsComposerShape::setLineWidth( double width ) -{ - mPen.setWidthF( width ); -} - -double QgsComposerShape::lineWidth() const -{ - return mPen.widthF(); -} - -void QgsComposerShape::setOutlineColor( const QColor& color ) -{ - mPen.setColor( color ); -} - -QColor QgsComposerShape::outlineColor() const -{ - return mPen.color(); -} - -void QgsComposerShape::setFillColor( const QColor& color ) -{ - mBrush.setColor( color ); -} - -QColor QgsComposerShape::fillColor() const -{ - return mBrush.color(); -} - -bool QgsComposerShape::transparentFill() const -{ - return mBrush.style() == Qt::NoBrush; -} - -void QgsComposerShape::setTransparentFill( bool transparent ) -{ - if ( transparent ) - { - mBrush.setStyle( Qt::NoBrush ); - } - else - { - mBrush.setStyle( Qt::SolidPattern ); - } -} - -void QgsComposerShape::initGraphicsSettings() -{ - mPen.setColor( QColor( 0, 0, 0 ) ); - mPen.setWidthF( 1 ); - mPen.setJoinStyle( Qt::RoundJoin ); - mBrush.setColor( QColor( 0, 0, 0 ) ); - mBrush.setStyle( Qt::NoBrush ); - - //set composer item brush and pen to transparent white by default - setPen( QPen( QColor( 255, 255, 255, 0 ) ) ); - setBrush( QBrush( QColor( 255, 255, 255, 0 ) ) ); -} void QgsComposerShape::setRotation( double r ) { //adapt rectangle size - double width = mShapeWidth; - double height = mShapeHeight; + double width = rect().width(); + double height = rect().height(); sizeChangedByRotation( width, height ); //adapt scene rect to have the same center and the new width / height @@ -246,8 +155,6 @@ void QgsComposerShape::setSceneRect( const QRectF& rectangle ) double newShapeWidth = rectangle.width(); double newShapeHeight = rectangle.height(); imageSizeConsideringRotation( newShapeWidth, newShapeHeight ); - mShapeWidth = newShapeWidth; - mShapeHeight = newShapeHeight; } QgsComposerItem::setSceneRect( rectangle ); diff --git a/src/core/composer/qgscomposershape.h b/src/core/composer/qgscomposershape.h index c368480988d..ef4b63ff380 100644 --- a/src/core/composer/qgscomposershape.h +++ b/src/core/composer/qgscomposershape.h @@ -56,16 +56,8 @@ class CORE_EXPORT QgsComposerShape: public QgsComposerItem bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); //setters and getters - void setLineWidth( double width ); - double lineWidth() const; - void setOutlineColor( const QColor& color ); - QColor outlineColor() const; - void setFillColor( const QColor& color ); - QColor fillColor() const; QgsComposerShape::Shape shapeType() const {return mShape;} void setShapeType( QgsComposerShape::Shape s ) {mShape = s;} - bool transparentFill() const; - void setTransparentFill( bool transparent ); /**Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size unit. Also, the shape is scaled*/ @@ -75,18 +67,21 @@ class CORE_EXPORT QgsComposerShape: public QgsComposerItem /**Sets item rotation and resizes item bounds such that the shape always has the same size*/ virtual void setRotation( double r ); + + protected: + /* reimplement drawFrame, since it's not a rect, but a custom shape */ + virtual void drawFrame( QPainter* p ); + /* reimplement drawBackground, since it's not a rect, but a custom shape */ + virtual void drawBackground( QPainter* p ); + + private: /**Ellipse, rectangle or triangle*/ Shape mShape; - /**Shape outline*/ - QPen mPen; - /**Shape fill*/ - QBrush mBrush; - double mShapeWidth; - double mShapeHeight; - /**Apply default graphics settings*/ - void initGraphicsSettings(); + /* draws the custom shape */ + void drawShape( QPainter* p ); + /**Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point*/ QPointF pointOnLineWithDistance( const QPointF& startPoint, const QPointF& directionPoint, double distance ) const; diff --git a/src/core/composer/qgscomposition.cpp b/src/core/composer/qgscomposition.cpp index fa593c80860..8c179cf60ae 100644 --- a/src/core/composer/qgscomposition.cpp +++ b/src/core/composer/qgscomposition.cpp @@ -49,7 +49,7 @@ QgsComposition::QgsComposition( QgsMapRenderer* mapRenderer ) : QGraphicsScene( 0 ), mMapRenderer( mapRenderer ), mPlotStyle( QgsComposition::Preview ), mPageWidth( 297 ), mPageHeight( 210 ), mSpaceBetweenPages( 10 ), mPrintAsRaster( false ), mSelectionTolerance( 0.0 ), - mSnapToGrid( false ), mSnapGridResolution( 0.0 ), mSnapGridOffsetX( 0.0 ), mSnapGridOffsetY( 0.0 ), mAlignmentSnap( true ), mAlignmentSnapTolerance( 2 ), + mSnapToGrid( false ), mSnapGridResolution( 10.0 ), mSnapGridOffsetX( 0.0 ), mSnapGridOffsetY( 0.0 ), mAlignmentSnap( true ), mAlignmentSnapTolerance( 2 ), mActiveItemCommand( 0 ), mActiveMultiFrameCommand( 0 ), mAtlasComposition( this ) { setBackgroundBrush( Qt::gray ); @@ -61,7 +61,7 @@ QgsComposition::QgsComposition( QgsMapRenderer* mapRenderer ) : QgsComposition::QgsComposition(): QGraphicsScene( 0 ), mMapRenderer( 0 ), mPlotStyle( QgsComposition::Preview ), mPageWidth( 297 ), mPageHeight( 210 ), mSpaceBetweenPages( 10 ), mPrintAsRaster( false ), - mSelectionTolerance( 0.0 ), mSnapToGrid( false ), mSnapGridResolution( 0.0 ), mSnapGridOffsetX( 0.0 ), mSnapGridOffsetY( 0.0 ), mAlignmentSnap( true ), + mSelectionTolerance( 0.0 ), mSnapToGrid( false ), mSnapGridResolution( 10.0 ), mSnapGridOffsetX( 0.0 ), mSnapGridOffsetY( 0.0 ), mAlignmentSnap( true ), mAlignmentSnapTolerance( 2 ), mActiveItemCommand( 0 ), mActiveMultiFrameCommand( 0 ), mAtlasComposition( this ) { loadSettings(); diff --git a/src/ui/qgscomposerarrowwidgetbase.ui b/src/ui/qgscomposerarrowwidgetbase.ui index e7ff689d559..1d1a8032a48 100644 --- a/src/ui/qgscomposerarrowwidgetbase.ui +++ b/src/ui/qgscomposerarrowwidgetbase.ui @@ -6,70 +6,145 @@ 0 0 - 232 - 430 + 469 + 689 Form - - - - - 0 + + + 0 + + + + + true - + 0 0 - 214 - 383 + 467 + 687 - - Arrow - - - - 3 - - - - - Arrow color... + + + + + + 0 + 0 + + + Main properties + + + false + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Line width + + + + + + + + + + mm + + + + + + + Arrow head width + + + + + + + + + + mm + + + + + + + Arrow color... + + + + - - - - Line width + + + + + 0 + 0 + - - - - - - Arrow head width - - - - - Arrow markers + + true + - + + QFormLayout::AllNonFixedFieldsGrow + + + + + + + Default + + + + + + + None + + + + + + + SVG + + + + + + Start marker - + @@ -83,14 +158,14 @@ - - + + - SVG markers + End marker - + @@ -104,49 +179,23 @@ - - - - End marker - - - - - - - No marker - - - - - - - Default marker - - - - - - - Qt::Vertical - - - - 20 - 62 - - - - + + + QgsCollapsibleGroupBoxBasic + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
+
diff --git a/src/ui/qgscomposerhtmlwidgetbase.ui b/src/ui/qgscomposerhtmlwidgetbase.ui index 13e138e2952..1b43ccafffd 100644 --- a/src/ui/qgscomposerhtmlwidgetbase.ui +++ b/src/ui/qgscomposerhtmlwidgetbase.ui @@ -6,70 +6,79 @@ 0 0 - 243 - 153 + 409 + 370 Form + + 0 + - - - 0 + + + true - + 0 0 - 221 - 100 + 407 + 368 - - HTML - - - - - - ... + + + + + + 0 + 0 + - - - - - - - - - URL + + Main properties - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Resize mode + + false + + + + + Resize mode + + + + + + + + + + + + + + + ... + + + + + + + + + URL + + + + @@ -78,6 +87,14 @@ + + + QgsCollapsibleGroupBoxBasic + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
+
diff --git a/src/ui/qgscomposeritemwidgetbase.ui b/src/ui/qgscomposeritemwidgetbase.ui index d82b544295f..d8a0843df4c 100644 --- a/src/ui/qgscomposeritemwidgetbase.ui +++ b/src/ui/qgscomposeritemwidgetbase.ui @@ -7,62 +7,276 @@ 0 0 393 - 391 + 729
- Form + Global Options - - - QFormLayout::AllNonFixedFieldsGrow + + + 7 - - - - Position and size... + + 0 + + + + + + 0 + 0 + + + Position and size + + + true + + + + + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + X + + + + + + + + + + Y + + + + + + + + + + Width + + + + + + + + + + Height + + + + + + + + + + + + Reference point + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + - - falsetrue + + + + + 0 + 0 + + - Show frame + Frame true - - + + true + + + Frame color... - - - - Thickness - - - true - - - mOutlineWidthSpinBox - - - - - + + + + + + Thickness + + + true + + + mOutlineWidthSpinBox + + + + + + + - - falsetrue + + + + + 0 + 0 + + - Show background + Background false @@ -73,69 +287,94 @@ true - - + + true + + + Background color... - - - - Opacity - - - true - - - mOpacitySlider - - - - - - - 255 - - - Qt::Horizontal - - - - - - - 255 - - + + + + + + 255 + + + + + + + 255 + + + Qt::Horizontal + + + + + + + Opacity + + + true + + + mOpacitySlider + + + + - - - - - - + + + + + 0 + 0 + + + Item ID + + true + + + + + + Item ID + + + + + + + - - - - + Qt::Vertical + + QSizePolicy::MinimumExpanding + - 143 - 87 + 20 + 40 @@ -144,9 +383,9 @@ - QgsCollapsibleGroupBox + QgsCollapsibleGroupBoxBasic QGroupBox -
qgscollapsiblegroupbox.h
+
qgscollapsiblegroupbox.h
1
diff --git a/src/ui/qgscomposerlabelwidgetbase.ui b/src/ui/qgscomposerlabelwidgetbase.ui index 0d5429864e1..7dec82a57ed 100644 --- a/src/ui/qgscomposerlabelwidgetbase.ui +++ b/src/ui/qgscomposerlabelwidgetbase.ui @@ -7,7 +7,7 @@ 0 0 443 - 550 + 712
@@ -19,225 +19,303 @@ Label Options - - - - - 0 + + + 0 + + + + + true - + 0 0 - 400 - 503 + 441 + 710 - - Label - - - - - - + + + + + + 0 + 1 + - - mm + + Main properties + + false + + + false + + + + + + 10 + + + + + + + + + Render as HTML + + + + + + + Insert an expression + + + + + + + + + + + + 0 + 0 + + + + Font + + + + + + + Font color... + + + + + + - - + + - + 0 0 - - Rotation + + Alignement - + + false + + true - - mRotationSpinBox - - - - - - - ° - - - 360.000000000000000 - - - - - - - Insert an expression - - - - - - - Render as HTML - - - - - - - Margin - - - - - - - Vertical Alignment: - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Top - - - - - - - Middle - - - - - - - Bottom - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Horizontal Alignment: - - - - QLayout::SetMinimumSize + + + QFormLayout::AllNonFixedFieldsGrow - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + - Left + Vertical - - + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Top + + + + + + + Middle + + + + + + + Bottom + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + - Center + Horizontal - - - - Right - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Left + + + + + + + Center + + + + + + + Right + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - - Font color... - - - - - + + - + 0 0 - - Font + + Display - - - - - - 10 + + false + + true + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Margin + + + + + + + + + + mm + + + + + + + + 0 + 0 + + + + Rotation + + + true + + + mRotationSpinBox + + + + + + + ° + + + 360.000000000000000 + + + + @@ -247,10 +325,14 @@ - - mFontButton - mMarginDoubleSpinBox - + + + QgsCollapsibleGroupBoxBasic + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
+
diff --git a/src/ui/qgscomposerlegendwidgetbase.ui b/src/ui/qgscomposerlegendwidgetbase.ui index 99237aed578..2f4c5d8e345 100644 --- a/src/ui/qgscomposerlegendwidgetbase.ui +++ b/src/ui/qgscomposerlegendwidgetbase.ui @@ -6,8 +6,8 @@ 0 0 - 405 - 490 + 407 + 839
@@ -19,11 +19,11 @@ Barscale Options - + 0 - + QFrame::NoFrame @@ -35,447 +35,585 @@ 0 - 0 - 405 - 490 + -101 + 386 + 940 - - - - - 0 + + + + + + 0 + 0 + - - - - 0 - 0 - 362 - 647 - + + Main properties + + + false + + + + + + &Title + + + mTitleLineEdit + + + + + + + + + + Map + + + + + + + + + + Wrap text on + + + + + + + true + + + + + + + + + + Legend items + + + false + + + + + + + + Add group + + + + + + + Update + + + + 24 + 24 + + + + + + + + All + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Auto Update + + + true + + + + + + + + + + 0 + 0 + + + + QAbstractItemView::ContiguousSelection + + + false + + + true + + + false + + + + + + + 3 + + + + + + 0 + 0 + + + + + + + + :/images/themes/default/mActionArrowDown.png:/images/themes/default/mActionArrowDown.png + + + + 24 + 24 + + + + + + + + + + + + :/images/themes/default/mActionArrowUp.png:/images/themes/default/mActionArrowUp.png + + + + 24 + 24 + + + + + + + + + + + + :/images/themes/default/mActionSignPlus.png:/images/themes/default/mActionSignPlus.png + + + + 24 + 24 + + + + + + + + + + + + :/images/themes/default/mActionSignMinus.png:/images/themes/default/mActionSignMinus.png + + + + 24 + 24 + + + + + + + + + + + + :/images/themes/default/symbologyEdit.png:/images/themes/default/symbologyEdit.png + + + + 24 + 24 + + + + + + + + false + + + Show feature count for each class of vector layer. + + + + + + + :/images/themes/default/mActionSum.png:/images/themes/default/mActionSum.png + + + + 24 + 24 + + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + 0 + 0 + + + + Columns + + + true + + + + + + Count + + + + + + + + + + 1 + + + 1000 + + + + + + + Equal column widths + + + + + + + Allow to split layer items into multiple columns. + + + Split layers + + + + + + + Spacing + + + + + + + + + + mm + + + + + + + + + + + 0 + 0 + + + + Symbol + + + true + + + + QFormLayout::AllNonFixedFieldsGrow - - General - - - - - - - 0 - 0 - - - - Title Font... - - - - - - - Group Font... - - - - - - - Layer Font... - - - - - - - Item Font... - - - - - - - Symbol width - - - mm - - - - - - - Symbol height - - - mm - - - - - - - Layer space - - - mm - - - - - - - Symbol space - - - mm - - - - - - - Icon label space - - - mm - - - - - - - Box space - - - mm - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Map - - - - - - - Group Space - - - mm - - - - - - - Wrap text on - - - - - - - true - - - - - - - - - &Title - - - mTitleLineEdit - - - - - - - - - - - - Column count - - - 1 - - - 1000 - - - - - - - Allow to split layer items into multiple columns. - - - Split layers - - - - - - - Equal column widths - - - - - - - Column space - - - mm - - - - - - - Font color... - - - - - - - - - 0 - 0 - 429 - 385 - - - - Legend items - - - - - - - 0 - 0 - - - - Auto Update - - - true - - - - - - - - 0 - 0 - - - - QAbstractItemView::ContiguousSelection - - - false - - - true - - - false - - - - - - - - 0 - 0 - - - - - - - - :/images/themes/default/mActionArrowDown.png:/images/themes/default/mActionArrowDown.png - - - - 24 - 24 - - - - - - - - - - - - :/images/themes/default/mActionArrowUp.png:/images/themes/default/mActionArrowUp.png - - - - 24 - 24 - - - - - - - - - - - - :/images/themes/default/mActionSignPlus.png:/images/themes/default/mActionSignPlus.png - - - - 24 - 24 - - - - - - - - - - - - :/images/themes/default/mActionSignMinus.png:/images/themes/default/mActionSignMinus.png - - - - 24 - 24 - - - - - - - - - - - - :/images/themes/default/symbologyEdit.png:/images/themes/default/symbologyEdit.png - - - - 24 - 24 - - - - - - - - Update - - - - 24 - 24 - - - - - - - - All - - - - - - - Qt::Horizontal - - - - 0 - 0 - - - - - - - - Add group - - - - - - - false - - - Show feature count for each class of vector layer. - - - - - - - :/images/themes/default/mActionSum.png:/images/themes/default/mActionSum.png - - - - 24 - 24 - - - - true - - - - - + + + + Symbol width + + + + + + + + + + mm + + + + + + + Symbol height + + + + + + + + + + mm + + + + + + + + + + + 0 + 0 + + + + Spacing + + + true + + + + + + Group Space + + + + + + + + + + mm + + + + + + + Layer space + + + + + + + + + + mm + + + + + + + Symbol space + + + + + + + + + + mm + + + + + + + Icon label space + + + + + + + + + + mm + + + + + + + Box space + + + + + + + + + + mm + + + + + + + + + + + 0 + 0 + + + + Fonts + + + true + + + + + + + 0 + 0 + + + + Title Font... + + + + + + + Group Font... + + + + + + + Layer Font... + + + + + + + Item Font... + + + + + + + Font color... + + + + @@ -485,27 +623,14 @@
- - scrollArea - mTitleFontButton - mGroupFontButton - mLayerFontButton - mItemFontButton - mSymbolWidthSpinBox - mSymbolHeightSpinBox - mLayerSpaceSpinBox - mSymbolSpaceSpinBox - mIconLabelSpaceSpinBox - mBoxSpaceSpinBox - mItemTreeView - mMoveDownToolButton - mMoveUpToolButton - mRemoveToolButton - mEditPushButton - mUpdatePushButton - mUpdateAllPushButton - mAddGroupButton - + + + QgsCollapsibleGroupBoxBasic + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
+
diff --git a/src/ui/qgscomposermapwidgetbase.ui b/src/ui/qgscomposermapwidgetbase.ui index 1690e27f454..92a548f92c7 100644 --- a/src/ui/qgscomposermapwidgetbase.ui +++ b/src/ui/qgscomposermapwidgetbase.ui @@ -7,7 +7,7 @@ 0 0 450 - 501 + 910
@@ -19,361 +19,251 @@ Map options - + 0 - - - - 0 + + + + true - - 0 - - + 0 - 0 - 440 - 413 + -115 + 427 + 1023 - - Map - - - - - - - + + + - + 0 0 - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - Update preview - - - - - - - Overview style - - - - - - - Change... - - - - - - - Overview frame - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - 0 - - - - - Width - - - true - - - mWidthLineEdit - - - - - - - - - - Height - - - true - - - mHeightLineEdit - - - - - - - - - - - 0 - 0 - - - - Scale - - - true - - - mScaleLineEdit - - - - - - - - - - - - - - Rotation - - - true - - - - - - - degrees - - - 360.000000000000000 - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Lock layers for map item - - - - - - - Draw map canvas items - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 15 - - - - - - - - - - 0 - 0 - 440 - 413 - - - - Extents - - - - 3 - - - - - QFormLayout::AllNonFixedFieldsGrow - - - 3 - - - - - true - - - X min - - - true - - - mXMinLineEdit - - - - - - - - - - X max - - - true - - - mXMaxLineEdit - - - - - - - - - - Y min - - - true - - - mYMinLineEdit - - - - - - - - - - Y max - - - true - - - mYMaxLineEdit - - - - - - - - - - - 0 - 0 - - - - Set to map canvas extent - - - - - - - - - - - 0 - 0 - 423 - 702 - - - - Grid - - - - - Show grid? + Main properties + + + false + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + + + + 0 + 0 + + + + + + + + Update preview + + + + + + + + + + 0 + 0 + + + + Scale + + + true + + + mScaleLineEdit + + + + + + + + + + + + + + Rotation + + + true + + + + + + + degrees + + + 360.000000000000000 + + + + + + + + + Draw map canvas items + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Lock layers for map item + + + + + + + + + + + + + 0 + 0 + + + + Extents + + + true + + + + + + true + + + X min + + + true + + + mXMinLineEdit + + + + + + + + + + X max + + + true + + + mXMaxLineEdit + + + + + + + + + + Y min + + + true + + + mYMinLineEdit + + + + + + + + + + Y max + + + true + + + mYMaxLineEdit + + + + + + + + + + + 0 + 0 + + + + Set to map canvas extent + + + + + + + + + + + 0 + 0 + + + + Show grid true @@ -381,8 +271,14 @@ false - - + + true + + + + QFormLayout::AllNonFixedFieldsGrow + + @@ -398,363 +294,365 @@ - + - - - - - - 5 - - - 9999999.000000000000000 - - - - - - - Interval X - - - true - - - mIntervalXSpinBox - - - - - - - 5 - - - 9999999.000000000000000 - - - - - - - Interval Y - - - true - - - mIntervalYSpinBox - - - - - - - 5 - - - 9999999.000000000000000 - - - - - - - Offset X - - - true - - - mOffsetXSpinBox - - - - - - - Offset Y - - - true - - - mOffsetYSpinBox - - - - - - - 5 - - - 9999999.000000000000000 - - - - - - - Cross width - - - true - - - mCrossWidthSpinBox - - - - - - - 5 - - - - - - - Frame style - - - - - - - - - - Frame width - - - - - - - - - - - - - - Line style - - - true - - - - - - - change... - - - - - - - + + - Draw annotation + Interval + + + true + + + mIntervalXSpinBox - - - - - - Annotation position left side + + + + + + X - - true + + 5 - - mAnnotationPositionLeftComboBox + + 9999999.000000000000000 - - - - - - - Annotation position right side + + + + Y - - true + + 5 - - mAnnotationPositionRightComboBox + + 9999999.000000000000000 - - - - - - - Annotation position top side - - - true - - - mAnnotationPositionTopComboBox - - - - - - - - - - Annotation position bottom side - - - true - - - mAnnotationPositionRightComboBox - - - - - - - - - - QFrame::NoFrame - - - Annotation direction left side - - - true - - - mAnnotationDirectionComboBoxLeft - - - - - - - - - - Annotation direction right side - - - true - - - mAnnotationDirectionComboBoxRight - - - - - - - - - - Annotation direction top side - - - true - - - - - - - - - - Annotation direction bottom side - - - true - - - - - - - - - - Annotation format - - - - - - - - + + - Font... + Offset X + + + true + + + mOffsetXSpinBox + + + + + + + + + X + + + 5 + + + 9999999.000000000000000 + + + + + + + Y + + + 5 + + + 9999999.000000000000000 + + + + + + + + + Cross width + + + true + + + mCrossWidthSpinBox + + + + + + + 5 + + + + + + + Frame style + + + + + + + + + + Frame width + + + + + + + + + + Line style + + + true + + + + + + + change... - - - Distance to map frame + + + Draw coordinates - + true - - mDistanceToMapFrameSpinBox + + true + + + false + + + false + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Format + + + + + + + + + + Left + + + true + + + mAnnotationPositionLeftComboBox + + + + + + + + + + + + + + + + + Right + + + true + + + mAnnotationPositionRightComboBox + + + + + + + + + + + + + + + + + Top + + + true + + + mAnnotationPositionTopComboBox + + + + + + + + + + + + + + + + + Bottom + + + true + + + mAnnotationPositionRightComboBox + + + + + + + + + + + + + + + + + Font... + + + + + + + Font + + + + + + + Distance to map frame + + + true + + + mDistanceToMapFrameSpinBox + + + + + + + + + + Coordinate precision + + + true + + + mCoordinatePrecisionSpinBox + + + + + + + + + + + + + + + + + 0 + 0 + + + + Overview + + + true + + + + + + Overview frame - - + + - - + + - Coordinate precision - - - true - - - mCoordinatePrecisionSpinBox + Overview style - - - - - - - Qt::Vertical + + + + Change... - - - 20 - 40 - - - + @@ -766,10 +664,14 @@ - - mDrawAnnotationCheckBox - mAnnotationFontButton - + + + QgsCollapsibleGroupBoxBasic + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
+
diff --git a/src/ui/qgscomposerpicturewidgetbase.ui b/src/ui/qgscomposerpicturewidgetbase.ui index 9717234f181..f86efeb03d3 100644 --- a/src/ui/qgscomposerpicturewidgetbase.ui +++ b/src/ui/qgscomposerpicturewidgetbase.ui @@ -6,7 +6,7 @@ 0 0 - 327 + 331 614
@@ -19,50 +19,89 @@ Picture Options - + 0 - - - - 0 + + + + true - + 0 0 - 317 - 577 + 329 + 612 - - Picture options - - - - 3 - + - + - + 0 0 - Preloaded images + Main properties - - - 0 - - - 0 - - + + false + + + + + + Path + + + mPictureLineEdit + + + + + + + + + + + + + 0 + 0 + + + + + 150 + 32767 + + + + ... + + + + + + + + + + + + Search directories + + + false + + + false @@ -96,37 +135,22 @@ - - + + + + + - + - Load another - - - mPictureLineEdit + Remove - - - - - - - 0 - 0 - - - - - 150 - 32767 - - + - ... + Add... @@ -136,9 +160,18 @@ - + + + + 0 + 0 + + - Options + Rotation + + + true @@ -147,135 +180,23 @@ 3 - - - - - 0 - 0 - - - - Width - - - true - - - mWidthLineEdit - - - - - - - - 0 - 0 - - - - Height - - - true - - - mHeightLineEdit - - - - - - - - - - - 0 - 0 - - - - Rotation - - - true - - - mRotationSpinBox - - - - + Sync with map - - - - 360.000000000000000 - - - - + - - - - - - - - - - - 0 - 0 - - - - Search directories - - - - - - - 0 - 0 - + + + + ° - - - - - - Qt::Horizontal - - - - 101 - 20 - - - - - - - - Add... - - - - - - - Remove + + 360.000000000000000 @@ -289,11 +210,16 @@ + + + QgsCollapsibleGroupBoxBasic + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
+
mSearchDirectoriesComboBox - mAddDirectoryButton - mRemoveDirectoryButton - mPreviewListWidget mPictureLineEdit mPictureBrowseButton mRotationFromComposerMapCheckBox diff --git a/src/ui/qgscomposerscalebarwidgetbase.ui b/src/ui/qgscomposerscalebarwidgetbase.ui index 818d9a3d31b..a21255d3f57 100644 --- a/src/ui/qgscomposerscalebarwidgetbase.ui +++ b/src/ui/qgscomposerscalebarwidgetbase.ui @@ -7,7 +7,7 @@ 0 0 436 - 499 + 761
@@ -24,294 +24,407 @@ 0 - - - 0 + + + true - - - true - + 0 0 - 415 - 552 + 434 + 759 - - Scale bar - - - - QFormLayout::AllNonFixedFieldsGrow - - - - + + + + + + 0 + 0 + + + + Main properties + + + false + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + + 0 + 0 + + + + Map + + + true + + + mMapComboBox + + + + + + + true + + + + 0 + 0 + + + + + + + + Style + + + mStyleComboBox + + + + + + + + + + + + + + 0 + 0 + + + Units - - - - - - - - - Unit label - - + true - - mUnitLabelLineEdit - + + + + + Label + + + true + + + mUnitLabelLineEdit + + + + + + + + + + Map units per bar unit + + + true + + + mMapUnitsPerBarUnitSpinBox + + + + + + + 9999999999999.000000000000000 + + + + + + + - - - - - - - Map units per bar unit + + + + + 0 + 0 + - - true - - - mMapUnitsPerBarUnitSpinBox - - - - - - - 9999999999999.000000000000000 - - - - - - - Segment size - - - true - - - mSegmentSizeSpinBox - - - - - - - 4 - - - 9999999999999.000000000000000 - - - - - - + Segments - - - - - - - - left - - - - - - - right - - - - - - - - - Style - - - mStyleComboBox - - - - - - - - - - - 0 - 0 - - - - Map - - + true - - mMapComboBox - + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Segments + + + + + + + + + + + + left + + + + + + + + + + right + + + + + + + + + Size + + + true + + + mSegmentSizeSpinBox + + + + + + + units + + + 2 + + + 9999999999999.000000000000000 + + + + + + + Height + + + + + + + mm + + + + + + + - - - + + + + + 0 + 0 + + + + Display + + true + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Box margin + + + + + + + + + + mm + + + + + + + Labels margin + + + + + + + + + + mm + + + + + + + Line width + + + + + + + + 0 + 0 + + + + + + + mm + + + 0.010000000000000 + + + 0.100000000000000 + + + 0.200000000000000 + + + + + + + Alignment + + + + + + + + + + + - + 0 0 + + Fonts and colors + + + true + + + false + + + false + + + + + + 0 + + + + + + 0 + 0 + + + + Font... + + + + + + + Font color... + + + + + + + + + 0 + + + + + Fill color... + + + + + + + Stroke color... + + + + + + - - - - Alignment - - - - - - - - - - mm - - - Height - - - - - - - Label space - - - mm - - - - - - - - 0 - 0 - - - - Line width - - - mm - - - 0.010000000000000 - - - 0.100000000000000 - - - 0.200000000000000 - - - - - - - Box space - - - mm - - - - - - - 0 - - - - - - 0 - 0 - - - - Font... - - - - - - - Font color... - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - 0 - - - - - Fill color... - - - - - - - Stroke color... - - - - - @@ -319,6 +432,14 @@
+ + + QgsCollapsibleGroupBoxBasic + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
+
diff --git a/src/ui/qgscomposershapewidgetbase.ui b/src/ui/qgscomposershapewidgetbase.ui index 02f19827fee..6213f9986b3 100644 --- a/src/ui/qgscomposershapewidgetbase.ui +++ b/src/ui/qgscomposershapewidgetbase.ui @@ -13,85 +13,83 @@ Form - - - - - 0 + + + 0 + + + + + true - + 0 0 - 267 - 377 + 283 + 425 - - Shape - - - - - - - - - Shape outline color... + + + + + + 0 + 0 + + + Main properties + + + false + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + + + + Rotation + + + + + + + ° + + + + + + 359 + + + + - - - - Outline width - - - - - - - Transparent fill - - - - - - - Shape fill Color... - - - - - - - Rotation - - - 359 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - + + + QgsCollapsibleGroupBoxBasic + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
+
diff --git a/src/ui/qgscomposertablewidgetbase.ui b/src/ui/qgscomposertablewidgetbase.ui index ec790908a66..da907fe9c07 100644 --- a/src/ui/qgscomposertablewidgetbase.ui +++ b/src/ui/qgscomposertablewidgetbase.ui @@ -6,207 +6,206 @@ 0 0 - 262 - 490 + 605 + 631
Form - + - 3 + 0 - - - - 0 + + + + true - + 0 0 - 239 - 464 + 603 + 629 - - Table - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Layer - - - mLayerComboBox - - - - - - - - - - Attributes... - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - Composer map - - - mComposerMapComboBox - - - - - - - - - - Maximum rows - - - mMaximumColumnsSpinBox - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - Show grid - - - - - - - Grid stroke width - - - mGridStrokeWidthSpinBox - - - - - - - - - - Grid color - - - mGridColorButton - - - - - + + + - + 0 0 - - + + Main attributes + + false + + + + + + Layer + + + mLayerComboBox + + + + + + + + + + Attributes... + + + + + + + Composer map + + + mComposerMapComboBox + + + + + + + + + + Show only visible features + + + + + + + Maximum rows + + + mMaximumColumnsSpinBox + + + + + + + + + + Margin + + + mMarginSpinBox + + + + + + + - - - - Qt::Vertical + + + + + 0 + 0 + - - QSizePolicy::Fixed + + Show grid - - - 20 - 10 - + + true - - - - - - Header Font... + + true + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Stroke width + + + mGridStrokeWidthSpinBox + + + + + + + + + + Color + + + mGridColorButton + + + + + + + + 0 + 0 + + + + + + + + - - - - Content Font... + + + + + 0 + 0 + - - - - - - Margin + + Fonts - - mMarginSpinBox - - - - - - - - - - Show only visible features + + true + + + + + Header Font... + + + + + + + Content Font... + + + + @@ -221,6 +220,12 @@ QToolButton
qgscolorbutton.h
+ + QgsCollapsibleGroupBoxBasic + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
diff --git a/src/ui/qgscompositionwidgetbase.ui b/src/ui/qgscompositionwidgetbase.ui index 0d3ef5558d9..7e177867a95 100644 --- a/src/ui/qgscompositionwidgetbase.ui +++ b/src/ui/qgscompositionwidgetbase.ui @@ -6,8 +6,8 @@ 0 0 - 352 - 511 + 391 + 787
@@ -19,9 +19,18 @@ Composition - - + + + 0 + + + + + 0 + 0 + + QFrame::NoFrame @@ -36,15 +45,15 @@ 0 0 - 344 - 503 + 391 + 787 - - - + + + - + 0 0 @@ -52,6 +61,9 @@ Paper and quality + + false + QFormLayout::AllNonFixedFieldsGrow @@ -65,7 +77,7 @@ - Size + Presets true @@ -80,6 +92,72 @@ true + + + + + + Width + + + + + + + + 0 + 0 + + + + + + + + + + 99999.000000000000000 + + + + + + + Height + + + + + + + + 0 + 0 + + + + + + + + + + 99999.000000000000000 + + + + + + + Units + + + + + + + true + 0 @@ -88,62 +166,17 @@ - - - - - - - 0 - 0 - - - - Width - - - - - - 99999.000000000000000 - - - - - - - - 0 - 0 - - - - Height - - - - - - 99999.000000000000000 - - - - - - - true - - - - 0 - 0 - - - - - - + + + Number of pages + + + + + + + @@ -162,7 +195,7 @@ - + true @@ -175,20 +208,38 @@ - - - - - 0 - 0 - - + + + + + + + + 0 + 0 + + + + Print as raster + + + true + + + false + + + true + + + + - Print as raster + Resolution - + @@ -200,60 +251,38 @@ dpi - Quality + 3000 - - - - - - - Number of pages - - - - - + + - + 0 0 - Snapping + Snap to grid - - - - - Alignment snap - - - - - - - Tolerance - - - - - - - Snap to grid - - - - + + true + + + false + + + true + + + @@ -262,22 +291,32 @@ - Spacing + - + mm + + + 10.000000000000000 9999.000000000000000 - - + + + + Grid offset + + + + + - X offset + x: 9999.000000000000000 @@ -287,13 +326,23 @@ - Y offset + y: + + + - + + + + Pen width + + + + @@ -302,11 +351,14 @@ - Pen width + + + + mm - + Grid color @@ -319,7 +371,7 @@ - + @@ -332,7 +384,7 @@ - + Grid style @@ -345,20 +397,75 @@ - + - + + + + Selection tolerance + + + + - Selection tolerance (mm) + + + + mm + + + + + + + Spacing - + + + + + 0 + 0 + + + + Snap to alignements + + + true + + + true + + + + + + Tolerance + + + + + + + + + + mm + + + + + + + Qt::Vertical @@ -384,14 +491,16 @@ QToolButton
qgscolorbutton.h
+ + QgsCollapsibleGroupBoxBasic + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
scrollArea - mPrintAsRasterCheckBox - mSnapToGridCheckBox - mGridResolutionSpinBox mOffsetXSpinBox - mPenWidthSpinBox diff --git a/src/ui/qgsitempositiondialogbase.ui b/src/ui/qgsitempositiondialogbase.ui deleted file mode 100644 index f7feb48f7a5..00000000000 --- a/src/ui/qgsitempositiondialogbase.ui +++ /dev/null @@ -1,173 +0,0 @@ - - - QgsItemPositionDialogBase - - - - 0 - 0 - 334 - 192 - - - - Set item position - - - - - - Item reference point - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Coordinates - - - - - - x - - - - - - - - - - y - - - - - - - - - - Width - - - - - - - - - - Height - - - - - - - - - - - - - Qt::Horizontal - - - - 201 - 20 - - - - - - - - - - Set Position - - - - - - - Close - - - - - - - - - -