Skip to content

Commit 9cd59c9

Browse files
committedJul 3, 2012
[FEATURE]: possibility to change grid annotation position and direction indidually for left/right/top/bottom
1 parent fab2fe1 commit 9cd59c9

File tree

5 files changed

+632
-301
lines changed

5 files changed

+632
-301
lines changed
 

‎src/app/composer/qgscomposermapwidget.cpp

Lines changed: 145 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include "qgscomposermapwidget.h"
1919
#include "qgscomposeritemwidget.h"
20-
#include "qgscomposermap.h"
2120
#include "qgsmaprenderer.h"
2221
#include <QColorDialog>
2322
#include <QFontDialog>
@@ -47,13 +46,16 @@ QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap ): QWidg
4746
mGridTypeComboBox->insertItem( 0, tr( "Solid" ) );
4847
mGridTypeComboBox->insertItem( 1, tr( "Cross" ) );
4948

50-
mAnnotationPositionComboBox->insertItem( 0, tr( "Inside frame" ) );
51-
mAnnotationPositionComboBox->insertItem( 1, tr( "Outside frame" ) );
49+
insertAnnotationPositionEntries( mAnnotationPositionLeftComboBox );
50+
insertAnnotationPositionEntries( mAnnotationPositionRightComboBox );
51+
insertAnnotationPositionEntries( mAnnotationPositionTopComboBox );
52+
insertAnnotationPositionEntries( mAnnotationPositionBottomComboBox );
53+
54+
insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxLeft );
55+
insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxRight );
56+
insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxTop );
57+
insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxBottom );
5258

53-
mAnnotationDirectionComboBox->insertItem( 0, tr( "Horizontal" ) );
54-
mAnnotationDirectionComboBox->insertItem( 1, tr( "Vertical" ) );
55-
mAnnotationDirectionComboBox->insertItem( 2, tr( "Horizontal and Vertical" ) );
56-
mAnnotationDirectionComboBox->insertItem( 2, tr( "Boundary direction" ) );
5759
if ( composerMap )
5860
{
5961
connect( composerMap, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
@@ -344,15 +346,17 @@ void QgsComposerMapWidget::updateGuiElements()
344346

345347
mCrossWidthSpinBox->setValue( mComposerMap->crossLength() );
346348

347-
QgsComposerMap::GridAnnotationPosition annotationPos = mComposerMap->gridAnnotationPosition();
348-
if ( annotationPos == QgsComposerMap::InsideMapFrame )
349-
{
350-
mAnnotationPositionComboBox->setCurrentIndex( mAnnotationPositionComboBox->findText( tr( "Inside frame" ) ) );
351-
}
352-
else
353-
{
354-
mAnnotationPositionComboBox->setCurrentIndex( mAnnotationPositionComboBox->findText( tr( "Outside frame" ) ) );
355-
}
349+
//grid annotation position
350+
initAnnotationPositionBox( mAnnotationPositionLeftComboBox, mComposerMap->gridAnnotationPosition( QgsComposerMap::Left ) );
351+
initAnnotationPositionBox( mAnnotationPositionRightComboBox, mComposerMap->gridAnnotationPosition( QgsComposerMap::Right ) );
352+
initAnnotationPositionBox( mAnnotationPositionTopComboBox, mComposerMap->gridAnnotationPosition( QgsComposerMap::Top ) );
353+
initAnnotationPositionBox( mAnnotationPositionBottomComboBox, mComposerMap->gridAnnotationPosition( QgsComposerMap::Bottom ) );
354+
355+
//grid annotation direction
356+
initAnnotationDirectionBox( mAnnotationDirectionComboBoxLeft, mComposerMap->gridAnnotationDirection( QgsComposerMap::Left ) );
357+
initAnnotationDirectionBox( mAnnotationDirectionComboBoxRight, mComposerMap->gridAnnotationDirection( QgsComposerMap::Right ) );
358+
initAnnotationDirectionBox( mAnnotationDirectionComboBoxTop, mComposerMap->gridAnnotationDirection( QgsComposerMap::Top ) );
359+
initAnnotationDirectionBox( mAnnotationDirectionComboBoxBottom, mComposerMap->gridAnnotationDirection( QgsComposerMap::Bottom ) );
356360

357361
mDistanceToMapFrameSpinBox->setValue( mComposerMap->annotationFrameDistance() );
358362

@@ -365,24 +369,6 @@ void QgsComposerMapWidget::updateGuiElements()
365369
mDrawAnnotationCheckBox->setCheckState( Qt::Unchecked );
366370
}
367371

368-
QgsComposerMap::GridAnnotationDirection dir = mComposerMap->gridAnnotationDirection();
369-
if ( dir == QgsComposerMap::Horizontal )
370-
{
371-
mAnnotationDirectionComboBox->setCurrentIndex( mAnnotationDirectionComboBox->findText( tr( "Horizontal" ) ) );
372-
}
373-
else if ( dir == QgsComposerMap::Vertical )
374-
{
375-
mAnnotationDirectionComboBox->setCurrentIndex( mAnnotationDirectionComboBox->findText( tr( "Vertical" ) ) );
376-
}
377-
else if ( dir == QgsComposerMap::HorizontalAndVertical )
378-
{
379-
mAnnotationDirectionComboBox->setCurrentIndex( mAnnotationDirectionComboBox->findText( tr( "Horizontal and Vertical" ) ) );
380-
}
381-
else //BoundaryDirection
382-
{
383-
mAnnotationDirectionComboBox->setCurrentIndex( mAnnotationDirectionComboBox->findText( tr( "Boundary direction" ) ) );
384-
}
385-
386372
mCoordinatePrecisionSpinBox->setValue( mComposerMap->gridAnnotationPrecision() );
387373

388374
QPen gridPen = mComposerMap->gridPen();
@@ -445,9 +431,15 @@ void QgsComposerMapWidget::blockAllSignals( bool b )
445431
mLineColorButton->blockSignals( b );
446432
mDrawAnnotationCheckBox->blockSignals( b );
447433
mAnnotationFontButton->blockSignals( b );
448-
mAnnotationPositionComboBox->blockSignals( b );
434+
mAnnotationPositionLeftComboBox->blockSignals( b );
435+
mAnnotationPositionRightComboBox->blockSignals( b );
436+
mAnnotationPositionTopComboBox->blockSignals( b );
437+
mAnnotationPositionBottomComboBox->blockSignals( b );
449438
mDistanceToMapFrameSpinBox->blockSignals( b );
450-
mAnnotationDirectionComboBox->blockSignals( b );
439+
mAnnotationDirectionComboBoxLeft->blockSignals( b );
440+
mAnnotationDirectionComboBoxRight->blockSignals( b );
441+
mAnnotationDirectionComboBoxTop->blockSignals( b );
442+
mAnnotationDirectionComboBoxBottom->blockSignals( b );
451443
mCoordinatePrecisionSpinBox->blockSignals( b );
452444
mDrawCanvasItemsCheckBox->blockSignals( b );
453445
}
@@ -683,49 +675,120 @@ void QgsComposerMapWidget::on_mDistanceToMapFrameSpinBox_valueChanged( double d
683675
mComposerMap->endCommand();
684676
}
685677

686-
void QgsComposerMapWidget::on_mAnnotationPositionComboBox_currentIndexChanged( const QString& text )
678+
void QgsComposerMapWidget::on_mAnnotationPositionLeftComboBox_currentIndexChanged( const QString& text )
679+
{
680+
handleChangedAnnotationPosition( QgsComposerMap::Left, text );
681+
}
682+
683+
void QgsComposerMapWidget::on_mAnnotationPositionRightComboBox_currentIndexChanged( const QString& text )
684+
{
685+
handleChangedAnnotationPosition( QgsComposerMap::Right, text );
686+
}
687+
688+
void QgsComposerMapWidget::on_mAnnotationPositionTopComboBox_currentIndexChanged( const QString& text )
689+
{
690+
handleChangedAnnotationPosition( QgsComposerMap::Top, text );
691+
}
692+
693+
void QgsComposerMapWidget::on_mAnnotationPositionBottomComboBox_currentIndexChanged( const QString& text )
694+
{
695+
handleChangedAnnotationPosition( QgsComposerMap::Bottom, text );
696+
}
697+
698+
void QgsComposerMapWidget::on_mDrawAnnotationCheckBox_stateChanged( int state )
687699
{
688700
if ( !mComposerMap )
689701
{
690702
return;
691703
}
692704

693-
mComposerMap->beginCommand( tr( "Annotation position changed" ) );
694-
if ( text == tr( "Inside frame" ) )
705+
mComposerMap->beginCommand( tr( "Annotation toggled" ) );
706+
if ( state == Qt::Checked )
695707
{
696-
mComposerMap->setGridAnnotationPosition( QgsComposerMap::InsideMapFrame );
708+
mComposerMap->setShowGridAnnotation( true );
697709
}
698710
else
699711
{
700-
mComposerMap->setGridAnnotationPosition( QgsComposerMap::OutsideMapFrame );
712+
mComposerMap->setShowGridAnnotation( false );
701713
}
702714
mComposerMap->updateBoundingRect();
703715
mComposerMap->update();
704716
mComposerMap->endCommand();
705717
}
706718

707-
void QgsComposerMapWidget::on_mDrawAnnotationCheckBox_stateChanged( int state )
719+
void QgsComposerMapWidget::on_mAnnotationDirectionComboBoxLeft_currentIndexChanged( const QString& text )
720+
{
721+
handleChangedAnnotationDirection( QgsComposerMap::Left, text );
722+
}
723+
724+
void QgsComposerMapWidget::on_mAnnotationDirectionComboBoxRight_currentIndexChanged( const QString& text )
725+
{
726+
handleChangedAnnotationDirection( QgsComposerMap::Right, text );
727+
}
728+
729+
void QgsComposerMapWidget::on_mAnnotationDirectionComboBoxTop_currentIndexChanged( const QString& text )
730+
{
731+
handleChangedAnnotationDirection( QgsComposerMap::Top, text );
732+
}
733+
734+
void QgsComposerMapWidget::on_mAnnotationDirectionComboBoxBottom_currentIndexChanged( const QString& text )
735+
{
736+
handleChangedAnnotationDirection( QgsComposerMap::Bottom, text );
737+
}
738+
739+
void QgsComposerMapWidget::on_mCoordinatePrecisionSpinBox_valueChanged( int value )
740+
{
741+
if ( !mComposerMap )
742+
{
743+
return;
744+
}
745+
mComposerMap->beginCommand( tr( "Changed annotation precision" ) );
746+
mComposerMap->setGridAnnotationPrecision( value );
747+
mComposerMap->updateBoundingRect();
748+
mComposerMap->update();
749+
mComposerMap->endCommand();
750+
}
751+
752+
void QgsComposerMapWidget::insertAnnotationPositionEntries( QComboBox* c )
753+
{
754+
c->insertItem( 0, tr( "Inside frame" ) );
755+
c->insertItem( 1, tr( "Outside frame" ) );
756+
c->insertItem( 2, tr( "Disabled" ) );
757+
}
758+
759+
void QgsComposerMapWidget::insertAnnotationDirectionEntries( QComboBox* c )
760+
{
761+
c->insertItem( 0, tr( "Horizontal" ) );
762+
c->insertItem( 1, tr( "Vertical" ) );
763+
}
764+
765+
void QgsComposerMapWidget::handleChangedAnnotationPosition( QgsComposerMap::Border border, const QString& text )
708766
{
709767
if ( !mComposerMap )
710768
{
711769
return;
712770
}
713771

714-
mComposerMap->beginCommand( tr( "Annotation toggled" ) );
715-
if ( state == Qt::Checked )
772+
mComposerMap->beginCommand( tr( "Annotation position changed" ) );
773+
if ( text == tr( "Inside frame" ) )
716774
{
717-
mComposerMap->setShowGridAnnotation( true );
775+
mComposerMap->setGridAnnotationPosition( QgsComposerMap::InsideMapFrame, border );
718776
}
719-
else
777+
else if ( text == tr( "Disabled" ) )
720778
{
721-
mComposerMap->setShowGridAnnotation( false );
779+
mComposerMap->setGridAnnotationPosition( QgsComposerMap::Disabled, border );
780+
}
781+
else //Outside frame
782+
{
783+
mComposerMap->setGridAnnotationPosition( QgsComposerMap::OutsideMapFrame, border );
722784
}
785+
723786
mComposerMap->updateBoundingRect();
724787
mComposerMap->update();
725788
mComposerMap->endCommand();
726789
}
727790

728-
void QgsComposerMapWidget::on_mAnnotationDirectionComboBox_currentIndexChanged( const QString& text )
791+
void QgsComposerMapWidget::handleChangedAnnotationDirection( QgsComposerMap::Border border, const QString& text )
729792
{
730793
if ( !mComposerMap )
731794
{
@@ -735,34 +798,51 @@ void QgsComposerMapWidget::on_mAnnotationDirectionComboBox_currentIndexChanged(
735798
mComposerMap->beginCommand( tr( "Changed annotation direction" ) );
736799
if ( text == tr( "Horizontal" ) )
737800
{
738-
mComposerMap->setGridAnnotationDirection( QgsComposerMap::Horizontal );
801+
mComposerMap->setGridAnnotationDirection( QgsComposerMap::Horizontal, border );
802+
}
803+
else //Vertical
804+
{
805+
mComposerMap->setGridAnnotationDirection( QgsComposerMap::Vertical, border );
739806
}
740-
else if ( text == tr( "Vertical" ) )
807+
mComposerMap->updateBoundingRect();
808+
mComposerMap->update();
809+
mComposerMap->endCommand();
810+
}
811+
812+
void QgsComposerMapWidget::initAnnotationPositionBox( QComboBox* c, QgsComposerMap::GridAnnotationPosition pos )
813+
{
814+
if ( !c )
741815
{
742-
mComposerMap->setGridAnnotationDirection( QgsComposerMap::Vertical );
816+
return;
743817
}
744-
else if ( text == tr( "Horizontal and Vertical" ) )
818+
819+
if ( pos == QgsComposerMap::InsideMapFrame )
745820
{
746-
mComposerMap->setGridAnnotationDirection( QgsComposerMap::HorizontalAndVertical );
821+
c->setCurrentIndex( c->findText( tr( "Inside frame" ) ) );
747822
}
748-
else //BoundaryDirection
823+
else if ( pos == QgsComposerMap::OutsideMapFrame )
749824
{
750-
mComposerMap->setGridAnnotationDirection( QgsComposerMap::BoundaryDirection );
825+
c->setCurrentIndex( c->findText( tr( "Outside frame" ) ) );
826+
}
827+
else //disabled
828+
{
829+
c->setCurrentIndex( c->findText( tr( "Disabled" ) ) );
751830
}
752-
mComposerMap->updateBoundingRect();
753-
mComposerMap->update();
754-
mComposerMap->endCommand();
755831
}
756832

757-
void QgsComposerMapWidget::on_mCoordinatePrecisionSpinBox_valueChanged( int value )
833+
void QgsComposerMapWidget::initAnnotationDirectionBox( QComboBox* c, QgsComposerMap::GridAnnotationDirection dir )
758834
{
759-
if ( !mComposerMap )
835+
if ( !c )
760836
{
761837
return;
762838
}
763-
mComposerMap->beginCommand( tr( "Changed annotation precision" ) );
764-
mComposerMap->setGridAnnotationPrecision( value );
765-
mComposerMap->updateBoundingRect();
766-
mComposerMap->update();
767-
mComposerMap->endCommand();
839+
840+
if ( dir == QgsComposerMap::Vertical )
841+
{
842+
c->setCurrentIndex( c->findText( tr( "Vertical" ) ) );
843+
}
844+
else //horizontal
845+
{
846+
c->setCurrentIndex( c->findText( tr( "Horizontal" ) ) );
847+
}
768848
}

‎src/app/composer/qgscomposermapwidget.h

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
#define QGSCOMPOSERMAPWIDGET_H
2020

2121
#include "ui_qgscomposermapwidgetbase.h"
22-
23-
class QgsComposerMap;
22+
#include "qgscomposermap.h"
2423

2524
/** \ingroup MapComposer
2625
* Input widget for the configuration of QgsComposerMap
@@ -61,9 +60,20 @@ class QgsComposerMapWidget: public QWidget, private Ui::QgsComposerMapWidgetBase
6160
void on_mCrossWidthSpinBox_valueChanged( double d );
6261
void on_mAnnotationFontButton_clicked();
6362
void on_mDistanceToMapFrameSpinBox_valueChanged( double d );
64-
void on_mAnnotationPositionComboBox_currentIndexChanged( const QString& text );
63+
64+
//annotation position
65+
void on_mAnnotationPositionLeftComboBox_currentIndexChanged( const QString& text );
66+
void on_mAnnotationPositionRightComboBox_currentIndexChanged( const QString& text );
67+
void on_mAnnotationPositionTopComboBox_currentIndexChanged( const QString& text );
68+
void on_mAnnotationPositionBottomComboBox_currentIndexChanged( const QString& text );
69+
70+
//annotation direction
71+
void on_mAnnotationDirectionComboBoxLeft_currentIndexChanged( const QString& text );
72+
void on_mAnnotationDirectionComboBoxRight_currentIndexChanged( const QString& text );
73+
void on_mAnnotationDirectionComboBoxTop_currentIndexChanged( const QString& text );
74+
void on_mAnnotationDirectionComboBoxBottom_currentIndexChanged( const QString& text );
75+
6576
void on_mDrawAnnotationCheckBox_stateChanged( int state );
66-
void on_mAnnotationDirectionComboBox_currentIndexChanged( const QString& text );
6777
void on_mCoordinatePrecisionSpinBox_valueChanged( int value );
6878

6979
private slots:
@@ -82,6 +92,15 @@ class QgsComposerMapWidget: public QWidget, private Ui::QgsComposerMapWidgetBase
8292

8393
/**Blocks / unblocks the signals of all GUI elements*/
8494
void blockAllSignals( bool b );
95+
96+
void handleChangedAnnotationPosition( QgsComposerMap::Border border, const QString& text );
97+
void handleChangedAnnotationDirection( QgsComposerMap::Border border, const QString& text );
98+
99+
void insertAnnotationPositionEntries( QComboBox* c );
100+
void insertAnnotationDirectionEntries( QComboBox* c );
101+
102+
void initAnnotationPositionBox( QComboBox* c, QgsComposerMap::GridAnnotationPosition pos );
103+
void initAnnotationDirectionBox( QComboBox* c, QgsComposerMap::GridAnnotationDirection dir );
85104
};
86105

87106
#endif

‎src/core/composer/qgscomposermap.cpp

Lines changed: 143 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
***************************************************************************/
1717

1818
#include "qgscomposermap.h"
19-
2019
#include "qgscoordinatetransform.h"
2120
#include "qgslogger.h"
2221
#include "qgsmaprenderer.h"
23-
#include "qgsmaplayer.h"
2422
#include "qgsmaplayerregistry.h"
2523
#include "qgsmaptopixel.h"
2624
#include "qgsproject.h"
@@ -42,7 +40,9 @@
4240
QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int width, int height )
4341
: QgsComposerItem( x, y, width, height, composition ), mKeepLayerSet( false ), mGridEnabled( false ), mGridStyle( Solid ),
4442
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ),
45-
mGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ), mGridAnnotationDirection( Horizontal ),
43+
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ), mTopGridAnnotationPosition( OutsideMapFrame ),
44+
mBottomGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ), mLeftGridAnnotationDirection( Horizontal ), mRightGridAnnotationDirection( Horizontal ),
45+
mTopGridAnnotationDirection( Horizontal ), mBottomGridAnnotationDirection( Horizontal ),
4646
mCrossLength( 3 ), mMapCanvas( 0 ), mDrawCanvasItems( true )
4747
{
4848
mComposition = composition;
@@ -87,7 +87,9 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int w
8787
QgsComposerMap::QgsComposerMap( QgsComposition *composition )
8888
: QgsComposerItem( 0, 0, 10, 10, composition ), mKeepLayerSet( false ), mGridEnabled( false ), mGridStyle( Solid ),
8989
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ),
90-
mGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ), mGridAnnotationDirection( Horizontal ), mCrossLength( 3 ),
90+
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ), mTopGridAnnotationPosition( OutsideMapFrame ),
91+
mBottomGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ), mLeftGridAnnotationDirection( Horizontal ), mRightGridAnnotationDirection( Horizontal ),
92+
mTopGridAnnotationDirection( Horizontal ), mBottomGridAnnotationDirection( Horizontal ), mCrossLength( 3 ),
9193
mMapCanvas( 0 ), mDrawCanvasItems( true )
9294
{
9395
//Offset
@@ -694,9 +696,15 @@ bool QgsComposerMap::writeXML( QDomElement& elem, QDomDocument & doc ) const
694696
//grid annotation
695697
QDomElement annotationElem = doc.createElement( "Annotation" );
696698
annotationElem.setAttribute( "show", mShowGridAnnotation );
697-
annotationElem.setAttribute( "position", mGridAnnotationPosition );
699+
annotationElem.setAttribute( "leftPosition", mLeftGridAnnotationPosition );
700+
annotationElem.setAttribute( "rightPosition", mRightGridAnnotationPosition );
701+
annotationElem.setAttribute( "topPosition", mTopGridAnnotationPosition );
702+
annotationElem.setAttribute( "bottomPosition", mBottomGridAnnotationPosition );
703+
annotationElem.setAttribute( "leftDirection", mLeftGridAnnotationDirection );
704+
annotationElem.setAttribute( "rightDirection", mRightGridAnnotationDirection );
705+
annotationElem.setAttribute( "topDirection", mTopGridAnnotationDirection );
706+
annotationElem.setAttribute( "bottomDirection", mBottomGridAnnotationDirection );
698707
annotationElem.setAttribute( "frameDistance", QString::number( mAnnotationFrameDistance ) );
699-
annotationElem.setAttribute( "direction", mGridAnnotationDirection );
700708
annotationElem.setAttribute( "font", mGridAnnotationFont.toString() );
701709
annotationElem.setAttribute( "precision", mGridAnnotationPrecision );
702710

@@ -811,7 +819,15 @@ bool QgsComposerMap::readXML( const QDomElement& itemElem, const QDomDocument& d
811819
{
812820
QDomElement annotationElem = annotationNodeList.at( 0 ).toElement();
813821
mShowGridAnnotation = ( annotationElem.attribute( "show", "0" ) != "0" );
814-
mGridAnnotationPosition = QgsComposerMap::GridAnnotationPosition( annotationElem.attribute( "position", "0" ).toInt() );
822+
mLeftGridAnnotationPosition = QgsComposerMap::GridAnnotationPosition( annotationElem.attribute( "leftPosition", "0" ).toInt() );
823+
mRightGridAnnotationPosition = QgsComposerMap::GridAnnotationPosition( annotationElem.attribute( "rightPosition", "0" ).toInt() );
824+
mTopGridAnnotationPosition = QgsComposerMap::GridAnnotationPosition( annotationElem.attribute( "topPosition", "0" ).toInt() );
825+
mBottomGridAnnotationPosition = QgsComposerMap::GridAnnotationPosition( annotationElem.attribute( "bottomPosition", "0" ).toInt() );
826+
mLeftGridAnnotationDirection = QgsComposerMap::GridAnnotationDirection( annotationElem.attribute( "leftDirection", "0" ).toInt() );
827+
mRightGridAnnotationDirection = QgsComposerMap::GridAnnotationDirection( annotationElem.attribute( "rightDirection", "0" ).toInt() );
828+
mTopGridAnnotationDirection = QgsComposerMap::GridAnnotationDirection( annotationElem.attribute( "topDirection", "0" ).toInt() );
829+
mBottomGridAnnotationDirection = QgsComposerMap::GridAnnotationDirection( annotationElem.attribute( "bottomDirection", "0" ).toInt() );
830+
815831
mAnnotationFrameDistance = annotationElem.attribute( "frameDistance", "0" ).toDouble();
816832
mGridAnnotationDirection = QgsComposerMap::GridAnnotationDirection( annotationElem.attribute( "direction", "0" ).toInt() );
817833
mGridAnnotationFont.fromString( annotationElem.attribute( "font", "" ) );
@@ -991,9 +1007,9 @@ void QgsComposerMap::drawCoordinateAnnotation( QPainter* p, const QPointF& pos,
9911007
if ( frameBorder == Left )
9921008
{
9931009

994-
if ( mGridAnnotationPosition == InsideMapFrame )
1010+
if ( mLeftGridAnnotationPosition == InsideMapFrame )
9951011
{
996-
if ( mGridAnnotationDirection == Vertical || mGridAnnotationDirection == BoundaryDirection )
1012+
if ( mLeftGridAnnotationDirection == Vertical || mLeftGridAnnotationDirection == BoundaryDirection )
9971013
{
9981014
xpos += textHeight + mAnnotationFrameDistance;
9991015
ypos += textWidth / 2.0;
@@ -1005,9 +1021,9 @@ void QgsComposerMap::drawCoordinateAnnotation( QPainter* p, const QPointF& pos,
10051021
ypos += textHeight / 2.0;
10061022
}
10071023
}
1008-
else //Outside map frame
1024+
else if ( mLeftGridAnnotationPosition == OutsideMapFrame ) //Outside map frame
10091025
{
1010-
if ( mGridAnnotationDirection == Vertical || mGridAnnotationDirection == BoundaryDirection )
1026+
if ( mLeftGridAnnotationDirection == Vertical || mLeftGridAnnotationDirection == BoundaryDirection )
10111027
{
10121028
xpos -= mAnnotationFrameDistance;
10131029
ypos += textWidth / 2.0;
@@ -1019,27 +1035,31 @@ void QgsComposerMap::drawCoordinateAnnotation( QPainter* p, const QPointF& pos,
10191035
ypos += textHeight / 2.0;
10201036
}
10211037
}
1038+
else
1039+
{
1040+
return;
1041+
}
10221042

10231043
}
10241044
else if ( frameBorder == Right )
10251045
{
1026-
if ( mGridAnnotationPosition == InsideMapFrame )
1046+
if ( mRightGridAnnotationPosition == InsideMapFrame )
10271047
{
1028-
if ( mGridAnnotationDirection == Vertical || mGridAnnotationDirection == BoundaryDirection )
1048+
if ( mRightGridAnnotationDirection == Vertical || mRightGridAnnotationDirection == BoundaryDirection )
10291049
{
10301050
xpos -= mAnnotationFrameDistance;
10311051
ypos += textWidth / 2.0;
10321052
rotation = 270;
10331053
}
1034-
else //Horizontal
1054+
else
10351055
{
10361056
xpos -= textWidth + mAnnotationFrameDistance;
10371057
ypos += textHeight / 2.0;
10381058
}
10391059
}
1040-
else //OutsideMapFrame
1060+
else if ( mRightGridAnnotationPosition == OutsideMapFrame )//OutsideMapFrame
10411061
{
1042-
if ( mGridAnnotationDirection == Vertical || mGridAnnotationDirection == BoundaryDirection )
1062+
if ( mRightGridAnnotationDirection == Vertical || mRightGridAnnotationDirection == BoundaryDirection )
10431063
{
10441064
xpos += textHeight + mAnnotationFrameDistance;
10451065
ypos += textWidth / 2.0;
@@ -1051,12 +1071,16 @@ void QgsComposerMap::drawCoordinateAnnotation( QPainter* p, const QPointF& pos,
10511071
ypos += textHeight / 2.0;
10521072
}
10531073
}
1074+
else
1075+
{
1076+
return;
1077+
}
10541078
}
10551079
else if ( frameBorder == Bottom )
10561080
{
1057-
if ( mGridAnnotationPosition == InsideMapFrame )
1081+
if ( mBottomGridAnnotationPosition == InsideMapFrame )
10581082
{
1059-
if ( mGridAnnotationDirection == Horizontal || mGridAnnotationDirection == BoundaryDirection )
1083+
if ( mBottomGridAnnotationDirection == Horizontal || mBottomGridAnnotationDirection == BoundaryDirection )
10601084
{
10611085
ypos -= mAnnotationFrameDistance;
10621086
xpos -= textWidth / 2.0;
@@ -1068,9 +1092,9 @@ void QgsComposerMap::drawCoordinateAnnotation( QPainter* p, const QPointF& pos,
10681092
rotation = 270;
10691093
}
10701094
}
1071-
else //OutsideMapFrame
1095+
else if ( mBottomGridAnnotationPosition == OutsideMapFrame ) //OutsideMapFrame
10721096
{
1073-
if ( mGridAnnotationDirection == Horizontal || mGridAnnotationDirection == BoundaryDirection )
1097+
if ( mBottomGridAnnotationDirection == Horizontal || mBottomGridAnnotationDirection == BoundaryDirection )
10741098
{
10751099
ypos += mAnnotationFrameDistance + textHeight;
10761100
xpos -= textWidth / 2.0;
@@ -1082,12 +1106,16 @@ void QgsComposerMap::drawCoordinateAnnotation( QPainter* p, const QPointF& pos,
10821106
rotation = 270;
10831107
}
10841108
}
1109+
else
1110+
{
1111+
return;
1112+
}
10851113
}
10861114
else //Top
10871115
{
1088-
if ( mGridAnnotationPosition == InsideMapFrame )
1116+
if ( mTopGridAnnotationPosition == InsideMapFrame )
10891117
{
1090-
if ( mGridAnnotationDirection == Horizontal || mGridAnnotationDirection == BoundaryDirection )
1118+
if ( mTopGridAnnotationDirection == Horizontal || mTopGridAnnotationDirection == BoundaryDirection )
10911119
{
10921120
xpos -= textWidth / 2.0;
10931121
ypos += textHeight + mAnnotationFrameDistance;
@@ -1099,9 +1127,9 @@ void QgsComposerMap::drawCoordinateAnnotation( QPainter* p, const QPointF& pos,
10991127
rotation = 270;
11001128
}
11011129
}
1102-
else //OutsideMapFrame
1130+
else if ( mTopGridAnnotationPosition == OutsideMapFrame ) //OutsideMapFrame
11031131
{
1104-
if ( mGridAnnotationDirection == Horizontal || mGridAnnotationDirection == BoundaryDirection )
1132+
if ( mTopGridAnnotationDirection == Horizontal || mTopGridAnnotationDirection == BoundaryDirection )
11051133
{
11061134
xpos -= textWidth / 2.0;
11071135
ypos -= mAnnotationFrameDistance;
@@ -1113,6 +1141,10 @@ void QgsComposerMap::drawCoordinateAnnotation( QPainter* p, const QPointF& pos,
11131141
rotation = 270;
11141142
}
11151143
}
1144+
else
1145+
{
1146+
return;
1147+
}
11161148
}
11171149

11181150
drawAnnotation( p, QPointF( xpos, ypos ), rotation, annotationString );
@@ -1611,3 +1643,90 @@ QPointF QgsComposerMap::composerMapPosForItem( const QGraphicsItem* item ) const
16111643
double mapY = mapRendererExtent.yMaximum() - itemScenePos.y() / graphicsSceneRect.height() * mapRendererExtent.height();
16121644
return mapToItemCoords( QPointF( mapX, mapY ) );
16131645
}
1646+
1647+
void QgsComposerMap::setGridAnnotationPosition( GridAnnotationPosition p, QgsComposerMap::Border border )
1648+
{
1649+
switch ( border )
1650+
{
1651+
case QgsComposerMap::Left:
1652+
mLeftGridAnnotationPosition = p;
1653+
break;
1654+
case QgsComposerMap::Right:
1655+
mRightGridAnnotationPosition = p;
1656+
break;
1657+
case QgsComposerMap::Top:
1658+
mTopGridAnnotationPosition = p;
1659+
break;
1660+
case QgsComposerMap::Bottom:
1661+
mBottomGridAnnotationPosition = p;
1662+
break;
1663+
default:
1664+
return;
1665+
}
1666+
updateBoundingRect();
1667+
update();
1668+
}
1669+
1670+
QgsComposerMap::GridAnnotationPosition QgsComposerMap::gridAnnotationPosition( QgsComposerMap::Border border ) const
1671+
{
1672+
switch ( border )
1673+
{
1674+
case QgsComposerMap::Left:
1675+
return mLeftGridAnnotationPosition;
1676+
break;
1677+
case QgsComposerMap::Right:
1678+
return mRightGridAnnotationPosition;
1679+
break;
1680+
case QgsComposerMap::Top:
1681+
return mTopGridAnnotationPosition;
1682+
break;
1683+
case QgsComposerMap::Bottom:
1684+
default:
1685+
return mBottomGridAnnotationPosition;
1686+
break;
1687+
}
1688+
}
1689+
1690+
void QgsComposerMap::setGridAnnotationDirection( GridAnnotationDirection d, QgsComposerMap::Border border )
1691+
{
1692+
switch ( border )
1693+
{
1694+
case QgsComposerMap::Left:
1695+
mLeftGridAnnotationDirection = d;
1696+
break;
1697+
case QgsComposerMap::Right:
1698+
mRightGridAnnotationDirection = d;
1699+
break;
1700+
case QgsComposerMap::Top:
1701+
mTopGridAnnotationDirection = d;
1702+
break;
1703+
case QgsComposerMap::Bottom:
1704+
mBottomGridAnnotationDirection = d;
1705+
break;
1706+
default:
1707+
return;
1708+
break;
1709+
}
1710+
updateBoundingRect();
1711+
update();
1712+
}
1713+
1714+
QgsComposerMap::GridAnnotationDirection QgsComposerMap::gridAnnotationDirection( QgsComposerMap::Border border ) const
1715+
{
1716+
switch ( border )
1717+
{
1718+
case QgsComposerMap::Left:
1719+
return mLeftGridAnnotationDirection;
1720+
break;
1721+
case QgsComposerMap::Right:
1722+
return mRightGridAnnotationDirection;
1723+
break;
1724+
case QgsComposerMap::Top:
1725+
return mTopGridAnnotationDirection;
1726+
break;
1727+
case QgsComposerMap::Bottom:
1728+
default:
1729+
return mBottomGridAnnotationDirection;
1730+
break;
1731+
}
1732+
}

‎src/core/composer/qgscomposermap.h

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
6666
enum GridAnnotationPosition
6767
{
6868
InsideMapFrame = 0,
69-
OutsideMapFrame
69+
OutsideMapFrame,
70+
Disabled
7071
};
7172

7273
enum GridAnnotationDirection
@@ -77,6 +78,15 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
7778
BoundaryDirection
7879
};
7980

81+
/**Enum for different frame borders*/
82+
enum Border
83+
{
84+
Left,
85+
Right,
86+
Bottom,
87+
Top
88+
};
89+
8090
/**This function is deprecated*/
8191
void draw( QPainter *painter, const QgsRectangle& extent, const QSize& size, int dpi );
8292

@@ -232,6 +242,9 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
232242
void setGridAnnotationPosition( GridAnnotationPosition p ) {mGridAnnotationPosition = p;}
233243
GridAnnotationPosition gridAnnotationPosition() const {return mGridAnnotationPosition;}
234244

245+
void setGridAnnotationPosition( GridAnnotationPosition p, QgsComposerMap::Border border );
246+
GridAnnotationPosition gridAnnotationPosition( QgsComposerMap::Border border ) const;
247+
235248
/**Sets distance between map frame and annotations
236249
@note this function was added in version 1.4*/
237250
void setAnnotationFrameDistance( double d ) {mAnnotationFrameDistance = d;}
@@ -242,6 +255,9 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
242255
void setGridAnnotationDirection( GridAnnotationDirection d ) {mGridAnnotationDirection = d;}
243256
GridAnnotationDirection gridAnnotationDirection() const {return mGridAnnotationDirection;}
244257

258+
void setGridAnnotationDirection( GridAnnotationDirection d, QgsComposerMap::Border border );
259+
GridAnnotationDirection gridAnnotationDirection( QgsComposerMap::Border border ) const;
260+
245261
/**In case of annotations, the bounding rectangle can be larger than the map item rectangle
246262
@note this function was added in version 1.4*/
247263
QRectF boundingRect() const;
@@ -279,15 +295,6 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
279295

280296
private:
281297

282-
/**Enum for different frame borders*/
283-
enum Border
284-
{
285-
Left,
286-
Right,
287-
Bottom,
288-
Top
289-
};
290-
291298
// Pointer to map renderer of the QGIS main map. Note that QgsComposerMap uses a different map renderer,
292299
//it just copies some properties from the main map renderer.
293300
QgsMapRenderer *mMapRenderer;
@@ -354,10 +361,30 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
354361
bool mShowGridAnnotation;
355362
/**Annotation position inside or outside of map frame*/
356363
GridAnnotationPosition mGridAnnotationPosition;
364+
365+
/**Annotation position for left map side (inside / outside / not shown)*/
366+
GridAnnotationPosition mLeftGridAnnotationPosition;
367+
/**Annotation position for right map side (inside / outside / not shown)*/
368+
GridAnnotationPosition mRightGridAnnotationPosition;
369+
/**Annotation position for top map side (inside / outside / not shown)*/
370+
GridAnnotationPosition mTopGridAnnotationPosition;
371+
/**Annotation position for bottom map side (inside / outside / not shown)*/
372+
GridAnnotationPosition mBottomGridAnnotationPosition;
373+
357374
/**Distance between map frame and annotation*/
358375
double mAnnotationFrameDistance;
359376
/**Annotation can be horizontal / vertical or different for axes*/
360377
GridAnnotationDirection mGridAnnotationDirection;
378+
379+
/**Annotation direction on left side ( horizontal or vertical )*/
380+
GridAnnotationDirection mLeftGridAnnotationDirection;
381+
/**Annotation direction on right side ( horizontal or vertical )*/
382+
GridAnnotationDirection mRightGridAnnotationDirection;
383+
/**Annotation direction on top side ( horizontal or vertical )*/
384+
GridAnnotationDirection mTopGridAnnotationDirection;
385+
/**Annotation direction on bottom side ( horizontal or vertical )*/
386+
GridAnnotationDirection mBottomGridAnnotationDirection;
387+
361388
/**Current bounding rectangle. This is used to check if notification to the graphics scene is necessary*/
362389
QRectF mCurrentRectangle;
363390
/**The length of the cross sides for mGridStyle Cross*/

‎src/ui/qgscomposermapwidgetbase.ui

Lines changed: 284 additions & 198 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>309</width>
10-
<height>452</height>
9+
<width>240</width>
10+
<height>400</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -33,8 +33,8 @@
3333
<rect>
3434
<x>0</x>
3535
<y>0</y>
36-
<width>309</width>
37-
<height>365</height>
36+
<width>230</width>
37+
<height>312</height>
3838
</rect>
3939
</property>
4040
<attribute name="label">
@@ -227,8 +227,8 @@
227227
<rect>
228228
<x>0</x>
229229
<y>0</y>
230-
<width>169</width>
231-
<height>169</height>
230+
<width>300</width>
231+
<height>303</height>
232232
</rect>
233233
</property>
234234
<attribute name="label">
@@ -335,20 +335,14 @@
335335
<rect>
336336
<x>0</x>
337337
<y>0</y>
338-
<width>199</width>
339-
<height>581</height>
338+
<width>217</width>
339+
<height>662</height>
340340
</rect>
341341
</property>
342342
<attribute name="label">
343343
<string>Grid</string>
344344
</attribute>
345-
<layout class="QGridLayout" name="gridLayout_7">
346-
<property name="margin">
347-
<number>3</number>
348-
</property>
349-
<property name="horizontalSpacing">
350-
<number>6</number>
351-
</property>
345+
<layout class="QGridLayout" name="gridLayout_6">
352346
<item row="0" column="0">
353347
<widget class="QGroupBox" name="mGridCheckBox">
354348
<property name="title">
@@ -360,14 +354,8 @@
360354
<property name="checked">
361355
<bool>false</bool>
362356
</property>
363-
<layout class="QFormLayout" name="formLayout">
364-
<property name="fieldGrowthPolicy">
365-
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
366-
</property>
367-
<property name="margin">
368-
<number>3</number>
369-
</property>
370-
<item row="0" column="0">
357+
<layout class="QGridLayout" name="gridLayout_4">
358+
<item row="0" column="2">
371359
<widget class="QLabel" name="mGridTypeLabel">
372360
<property name="accessibleName">
373361
<string extracomment="Hello translotor"/>
@@ -383,132 +371,146 @@
383371
</property>
384372
</widget>
385373
</item>
386-
<item row="0" column="1">
374+
<item row="0" column="3">
387375
<widget class="QComboBox" name="mGridTypeComboBox"/>
388376
</item>
389-
<item row="2" column="0">
390-
<widget class="QLabel" name="mIntervalXLabel">
391-
<property name="text">
392-
<string>Interval X</string>
393-
</property>
394-
<property name="wordWrap">
395-
<bool>true</bool>
396-
</property>
397-
<property name="buddy">
398-
<cstring>mIntervalXSpinBox</cstring>
399-
</property>
400-
</widget>
401-
</item>
402-
<item row="2" column="1">
403-
<widget class="QDoubleSpinBox" name="mIntervalXSpinBox">
404-
<property name="decimals">
405-
<number>5</number>
406-
</property>
407-
<property name="maximum">
408-
<double>9999999.000000000000000</double>
409-
</property>
410-
</widget>
377+
<item row="1" column="0" colspan="4">
378+
<layout class="QGridLayout" name="gridLayout_3">
379+
<item row="0" column="0">
380+
<widget class="QLabel" name="mIntervalXLabel">
381+
<property name="text">
382+
<string>Interval X</string>
383+
</property>
384+
<property name="wordWrap">
385+
<bool>true</bool>
386+
</property>
387+
<property name="buddy">
388+
<cstring>mIntervalXSpinBox</cstring>
389+
</property>
390+
</widget>
391+
</item>
392+
<item row="0" column="1">
393+
<widget class="QDoubleSpinBox" name="mIntervalXSpinBox">
394+
<property name="decimals">
395+
<number>5</number>
396+
</property>
397+
<property name="maximum">
398+
<double>9999999.000000000000000</double>
399+
</property>
400+
</widget>
401+
</item>
402+
<item row="1" column="0">
403+
<widget class="QLabel" name="mIntervalYLabel">
404+
<property name="text">
405+
<string>Interval Y</string>
406+
</property>
407+
<property name="wordWrap">
408+
<bool>true</bool>
409+
</property>
410+
<property name="buddy">
411+
<cstring>mIntervalYSpinBox</cstring>
412+
</property>
413+
</widget>
414+
</item>
415+
<item row="1" column="1">
416+
<widget class="QDoubleSpinBox" name="mIntervalYSpinBox">
417+
<property name="decimals">
418+
<number>5</number>
419+
</property>
420+
<property name="maximum">
421+
<double>9999999.000000000000000</double>
422+
</property>
423+
</widget>
424+
</item>
425+
<item row="2" column="0">
426+
<widget class="QLabel" name="mOffsetXLabel">
427+
<property name="text">
428+
<string>Offset X</string>
429+
</property>
430+
<property name="wordWrap">
431+
<bool>true</bool>
432+
</property>
433+
<property name="buddy">
434+
<cstring>mOffsetXSpinBox</cstring>
435+
</property>
436+
</widget>
437+
</item>
438+
<item row="2" column="1">
439+
<widget class="QDoubleSpinBox" name="mOffsetXSpinBox">
440+
<property name="decimals">
441+
<number>5</number>
442+
</property>
443+
<property name="maximum">
444+
<double>9999999.000000000000000</double>
445+
</property>
446+
</widget>
447+
</item>
448+
<item row="3" column="0">
449+
<widget class="QLabel" name="mOffsetYLabel">
450+
<property name="text">
451+
<string>Offset Y</string>
452+
</property>
453+
<property name="wordWrap">
454+
<bool>true</bool>
455+
</property>
456+
<property name="buddy">
457+
<cstring>mOffsetYSpinBox</cstring>
458+
</property>
459+
</widget>
460+
</item>
461+
<item row="3" column="1">
462+
<widget class="QDoubleSpinBox" name="mOffsetYSpinBox">
463+
<property name="decimals">
464+
<number>5</number>
465+
</property>
466+
<property name="maximum">
467+
<double>9999999.000000000000000</double>
468+
</property>
469+
</widget>
470+
</item>
471+
<item row="4" column="0">
472+
<widget class="QLabel" name="mCrossWidthLabel">
473+
<property name="text">
474+
<string>Cross width</string>
475+
</property>
476+
<property name="wordWrap">
477+
<bool>true</bool>
478+
</property>
479+
<property name="buddy">
480+
<cstring>mCrossWidthSpinBox</cstring>
481+
</property>
482+
</widget>
483+
</item>
484+
<item row="4" column="1">
485+
<widget class="QDoubleSpinBox" name="mCrossWidthSpinBox">
486+
<property name="decimals">
487+
<number>5</number>
488+
</property>
489+
</widget>
490+
</item>
491+
<item row="5" column="0">
492+
<widget class="QLabel" name="mLineWidthLabel">
493+
<property name="text">
494+
<string>Line width</string>
495+
</property>
496+
<property name="wordWrap">
497+
<bool>true</bool>
498+
</property>
499+
<property name="buddy">
500+
<cstring>mLineWidthSpinBox</cstring>
501+
</property>
502+
</widget>
503+
</item>
504+
<item row="5" column="1">
505+
<widget class="QDoubleSpinBox" name="mLineWidthSpinBox">
506+
<property name="decimals">
507+
<number>5</number>
508+
</property>
509+
</widget>
510+
</item>
511+
</layout>
411512
</item>
412-
<item row="4" column="0">
413-
<widget class="QLabel" name="mIntervalYLabel">
414-
<property name="text">
415-
<string>Interval Y</string>
416-
</property>
417-
<property name="wordWrap">
418-
<bool>true</bool>
419-
</property>
420-
<property name="buddy">
421-
<cstring>mIntervalYSpinBox</cstring>
422-
</property>
423-
</widget>
424-
</item>
425-
<item row="6" column="0">
426-
<widget class="QLabel" name="mOffsetXLabel">
427-
<property name="text">
428-
<string>Offset X</string>
429-
</property>
430-
<property name="wordWrap">
431-
<bool>true</bool>
432-
</property>
433-
<property name="buddy">
434-
<cstring>mOffsetXSpinBox</cstring>
435-
</property>
436-
</widget>
437-
</item>
438-
<item row="6" column="1">
439-
<widget class="QDoubleSpinBox" name="mOffsetXSpinBox">
440-
<property name="decimals">
441-
<number>5</number>
442-
</property>
443-
<property name="maximum">
444-
<double>9999999.000000000000000</double>
445-
</property>
446-
</widget>
447-
</item>
448-
<item row="8" column="0">
449-
<widget class="QLabel" name="mOffsetYLabel">
450-
<property name="text">
451-
<string>Offset Y</string>
452-
</property>
453-
<property name="wordWrap">
454-
<bool>true</bool>
455-
</property>
456-
<property name="buddy">
457-
<cstring>mOffsetYSpinBox</cstring>
458-
</property>
459-
</widget>
460-
</item>
461-
<item row="8" column="1">
462-
<widget class="QDoubleSpinBox" name="mOffsetYSpinBox">
463-
<property name="decimals">
464-
<number>5</number>
465-
</property>
466-
<property name="maximum">
467-
<double>9999999.000000000000000</double>
468-
</property>
469-
</widget>
470-
</item>
471-
<item row="10" column="0">
472-
<widget class="QLabel" name="mCrossWidthLabel">
473-
<property name="text">
474-
<string>Cross width</string>
475-
</property>
476-
<property name="wordWrap">
477-
<bool>true</bool>
478-
</property>
479-
<property name="buddy">
480-
<cstring>mCrossWidthSpinBox</cstring>
481-
</property>
482-
</widget>
483-
</item>
484-
<item row="10" column="1">
485-
<widget class="QDoubleSpinBox" name="mCrossWidthSpinBox">
486-
<property name="decimals">
487-
<number>5</number>
488-
</property>
489-
</widget>
490-
</item>
491-
<item row="12" column="0">
492-
<widget class="QLabel" name="mLineWidthLabel">
493-
<property name="text">
494-
<string>Line width</string>
495-
</property>
496-
<property name="wordWrap">
497-
<bool>true</bool>
498-
</property>
499-
<property name="buddy">
500-
<cstring>mLineWidthSpinBox</cstring>
501-
</property>
502-
</widget>
503-
</item>
504-
<item row="12" column="1">
505-
<widget class="QDoubleSpinBox" name="mLineWidthSpinBox">
506-
<property name="decimals">
507-
<number>5</number>
508-
</property>
509-
</widget>
510-
</item>
511-
<item row="14" column="0">
513+
<item row="2" column="2">
512514
<widget class="QLabel" name="mLineColorLabel">
513515
<property name="text">
514516
<string>Line color</string>
@@ -521,7 +523,7 @@
521523
</property>
522524
</widget>
523525
</item>
524-
<item row="14" column="1">
526+
<item row="2" column="3">
525527
<widget class="QgsColorButton" name="mLineColorButton">
526528
<property name="sizePolicy">
527529
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -534,56 +536,150 @@
534536
</property>
535537
</widget>
536538
</item>
537-
<item row="16" column="0" colspan="2">
539+
<item row="3" column="0" colspan="3">
538540
<widget class="QCheckBox" name="mDrawAnnotationCheckBox">
539541
<property name="text">
540542
<string>Draw annotation</string>
541543
</property>
542544
</widget>
543545
</item>
544-
<item row="17" column="0">
545-
<widget class="QLabel" name="mAnnotationPositionLabel">
546-
<property name="text">
547-
<string>Annotation position</string>
548-
</property>
549-
<property name="wordWrap">
550-
<bool>true</bool>
551-
</property>
552-
<property name="buddy">
553-
<cstring>mAnnotationPositionComboBox</cstring>
554-
</property>
555-
</widget>
556-
</item>
557-
<item row="17" column="1">
558-
<widget class="QComboBox" name="mAnnotationPositionComboBox"/>
546+
<item row="4" column="0" colspan="4">
547+
<layout class="QGridLayout" name="gridLayout_2">
548+
<item row="0" column="0">
549+
<widget class="QLabel" name="mAnnotationPositionLabelLeft">
550+
<property name="text">
551+
<string>Annotation position left side</string>
552+
</property>
553+
<property name="wordWrap">
554+
<bool>true</bool>
555+
</property>
556+
<property name="buddy">
557+
<cstring>mAnnotationPositionLeftComboBox</cstring>
558+
</property>
559+
</widget>
560+
</item>
561+
<item row="0" column="1">
562+
<widget class="QComboBox" name="mAnnotationPositionLeftComboBox"/>
563+
</item>
564+
<item row="1" column="0">
565+
<widget class="QLabel" name="mAnnotationPositionLabelRight">
566+
<property name="text">
567+
<string>Annotation position right side</string>
568+
</property>
569+
<property name="wordWrap">
570+
<bool>true</bool>
571+
</property>
572+
<property name="buddy">
573+
<cstring>mAnnotationPositionRightComboBox</cstring>
574+
</property>
575+
</widget>
576+
</item>
577+
<item row="1" column="1">
578+
<widget class="QComboBox" name="mAnnotationPositionRightComboBox"/>
579+
</item>
580+
<item row="2" column="0">
581+
<widget class="QLabel" name="mAnnotationPositionLabelTop">
582+
<property name="text">
583+
<string>Annotation position top side</string>
584+
</property>
585+
<property name="wordWrap">
586+
<bool>true</bool>
587+
</property>
588+
<property name="buddy">
589+
<cstring>mAnnotationPositionTopComboBox</cstring>
590+
</property>
591+
</widget>
592+
</item>
593+
<item row="2" column="1">
594+
<widget class="QComboBox" name="mAnnotationPositionTopComboBox"/>
595+
</item>
596+
<item row="3" column="0">
597+
<widget class="QLabel" name="mAnnotationPositionLabelBottom">
598+
<property name="text">
599+
<string>Annotation position bottom side</string>
600+
</property>
601+
<property name="wordWrap">
602+
<bool>true</bool>
603+
</property>
604+
<property name="buddy">
605+
<cstring>mAnnotationPositionRightComboBox</cstring>
606+
</property>
607+
</widget>
608+
</item>
609+
<item row="3" column="1">
610+
<widget class="QComboBox" name="mAnnotationPositionBottomComboBox"/>
611+
</item>
612+
<item row="4" column="0">
613+
<widget class="QLabel" name="mAnnotationDirectionLabelLeft">
614+
<property name="frameShape">
615+
<enum>QFrame::NoFrame</enum>
616+
</property>
617+
<property name="text">
618+
<string>Annotation direction left side</string>
619+
</property>
620+
<property name="wordWrap">
621+
<bool>true</bool>
622+
</property>
623+
<property name="buddy">
624+
<cstring>mAnnotationDirectionComboBoxLeft</cstring>
625+
</property>
626+
</widget>
627+
</item>
628+
<item row="4" column="1">
629+
<widget class="QComboBox" name="mAnnotationDirectionComboBoxLeft"/>
630+
</item>
631+
<item row="5" column="0">
632+
<widget class="QLabel" name="mAnnotationDirectionLabelRight">
633+
<property name="text">
634+
<string>Annotation direction right side</string>
635+
</property>
636+
<property name="wordWrap">
637+
<bool>true</bool>
638+
</property>
639+
<property name="buddy">
640+
<cstring>mAnnotationDirectionComboBoxRight</cstring>
641+
</property>
642+
</widget>
643+
</item>
644+
<item row="5" column="1">
645+
<widget class="QComboBox" name="mAnnotationDirectionComboBoxRight"/>
646+
</item>
647+
<item row="6" column="0">
648+
<widget class="QLabel" name="mAnnotationDirectionLabelTop">
649+
<property name="text">
650+
<string>Annotation direction top side</string>
651+
</property>
652+
<property name="wordWrap">
653+
<bool>true</bool>
654+
</property>
655+
</widget>
656+
</item>
657+
<item row="6" column="1">
658+
<widget class="QComboBox" name="mAnnotationDirectionComboBoxTop"/>
659+
</item>
660+
<item row="7" column="0">
661+
<widget class="QLabel" name="mAnnotationDirectionLabeBottom">
662+
<property name="text">
663+
<string>Annotation direction bottom side</string>
664+
</property>
665+
<property name="wordWrap">
666+
<bool>true</bool>
667+
</property>
668+
</widget>
669+
</item>
670+
<item row="7" column="1">
671+
<widget class="QComboBox" name="mAnnotationDirectionComboBoxBottom"/>
672+
</item>
673+
</layout>
559674
</item>
560-
<item row="19" column="0">
561-
<widget class="QLabel" name="mAnnotationDirectionLabel">
562-
<property name="frameShape">
563-
<enum>QFrame::NoFrame</enum>
564-
</property>
565-
<property name="text">
566-
<string>Annotation direction</string>
567-
</property>
568-
<property name="wordWrap">
569-
<bool>true</bool>
570-
</property>
571-
<property name="buddy">
572-
<cstring>mAnnotationDirectionComboBox</cstring>
573-
</property>
574-
</widget>
575-
</item>
576-
<item row="19" column="1">
577-
<widget class="QComboBox" name="mAnnotationDirectionComboBox"/>
578-
</item>
579-
<item row="21" column="0" colspan="2">
675+
<item row="5" column="0" colspan="2">
580676
<widget class="QPushButton" name="mAnnotationFontButton">
581677
<property name="text">
582678
<string>Font...</string>
583679
</property>
584680
</widget>
585681
</item>
586-
<item row="22" column="0">
682+
<item row="6" column="0" colspan="3">
587683
<widget class="QLabel" name="mDistanceToFrameLabel">
588684
<property name="text">
589685
<string>Distance to map frame</string>
@@ -596,10 +692,10 @@
596692
</property>
597693
</widget>
598694
</item>
599-
<item row="22" column="1">
695+
<item row="6" column="3">
600696
<widget class="QDoubleSpinBox" name="mDistanceToMapFrameSpinBox"/>
601697
</item>
602-
<item row="24" column="0">
698+
<item row="7" column="1" colspan="2">
603699
<widget class="QLabel" name="mCoordinatePrecisionLabel">
604700
<property name="text">
605701
<string>Coordinate precision</string>
@@ -612,10 +708,10 @@
612708
</property>
613709
</widget>
614710
</item>
615-
<item row="24" column="1">
711+
<item row="7" column="3">
616712
<widget class="QSpinBox" name="mCoordinatePrecisionSpinBox"/>
617713
</item>
618-
<item row="26" column="0" colspan="2">
714+
<item row="8" column="0">
619715
<spacer name="verticalSpacer_2">
620716
<property name="orientation">
621717
<enum>Qt::Vertical</enum>
@@ -628,16 +724,6 @@
628724
</property>
629725
</spacer>
630726
</item>
631-
<item row="4" column="1">
632-
<widget class="QDoubleSpinBox" name="mIntervalYSpinBox">
633-
<property name="decimals">
634-
<number>5</number>
635-
</property>
636-
<property name="maximum">
637-
<double>9999999.000000000000000</double>
638-
</property>
639-
</widget>
640-
</item>
641727
</layout>
642728
</widget>
643729
</item>

0 commit comments

Comments
 (0)
Please sign in to comment.