@@ -813,15 +813,15 @@ void QgsComposerMapWidget::handleChangedAnnotationPosition( QgsComposerMap::Bord
813
813
mComposerMap ->beginCommand ( tr ( " Annotation position changed" ) );
814
814
if ( text == tr ( " Inside frame" ) )
815
815
{
816
- grid->setGridAnnotationPosition ( QgsComposerMap::InsideMapFrame, border );
816
+ grid->setAnnotationPosition ( QgsComposerMap::InsideMapFrame, border );
817
817
}
818
818
else if ( text == tr ( " Disabled" ) )
819
819
{
820
- grid->setGridAnnotationPosition ( QgsComposerMap::Disabled, border );
820
+ grid->setAnnotationPosition ( QgsComposerMap::Disabled, border );
821
821
}
822
822
else // Outside frame
823
823
{
824
- grid->setGridAnnotationPosition ( QgsComposerMap::OutsideMapFrame, border );
824
+ grid->setAnnotationPosition ( QgsComposerMap::OutsideMapFrame, border );
825
825
}
826
826
827
827
mComposerMap ->updateBoundingRect ();
@@ -840,11 +840,11 @@ void QgsComposerMapWidget::handleChangedAnnotationDirection( QgsComposerMap::Bor
840
840
mComposerMap ->beginCommand ( tr ( " Changed annotation direction" ) );
841
841
if ( text == tr ( " Horizontal" ) )
842
842
{
843
- grid->setGridAnnotationDirection ( QgsComposerMap::Horizontal, border );
843
+ grid->setAnnotationDirection ( QgsComposerMap::Horizontal, border );
844
844
}
845
845
else if ( text == tr ( " Vertical" ) )
846
846
{
847
- grid->setGridAnnotationDirection ( QgsComposerMap::Vertical, border );
847
+ grid->setAnnotationDirection ( QgsComposerMap::Vertical, border );
848
848
}
849
849
850
850
mComposerMap ->updateBoundingRect ();
@@ -888,6 +888,7 @@ void QgsComposerMapWidget::initAnnotationDirectionBox( QComboBox* c, QgsComposer
888
888
{
889
889
c->setCurrentIndex ( c->findText ( tr ( " Horizontal" ) ) );
890
890
}
891
+
891
892
}
892
893
893
894
void QgsComposerMapWidget::refreshMapComboBox ()
@@ -1153,19 +1154,19 @@ void QgsComposerMapWidget::setGridItems( const QgsComposerMapGrid* grid )
1153
1154
blockGridItemsSignals ( true );
1154
1155
1155
1156
mGridCheckBox ->setTitle ( QString ( tr ( " Draw \" %1\" grid" ) ).arg ( grid->name () ) );
1156
- mGridCheckBox ->setChecked ( grid->gridEnabled () );
1157
- mIntervalXSpinBox ->setValue ( grid->gridIntervalX () );
1158
- mIntervalYSpinBox ->setValue ( grid->gridIntervalY () );
1159
- mOffsetXSpinBox ->setValue ( grid->gridOffsetX () );
1160
- mOffsetYSpinBox ->setValue ( grid->gridOffsetY () );
1157
+ mGridCheckBox ->setChecked ( grid->enabled () );
1158
+ mIntervalXSpinBox ->setValue ( grid->intervalX () );
1159
+ mIntervalYSpinBox ->setValue ( grid->intervalY () );
1160
+ mOffsetXSpinBox ->setValue ( grid->offsetX () );
1161
+ mOffsetYSpinBox ->setValue ( grid->offsetY () );
1161
1162
mCrossWidthSpinBox ->setValue ( grid->crossLength () );
1162
1163
mFrameWidthSpinBox ->setValue ( grid->gridFrameWidth () );
1163
1164
mGridFramePenSizeSpinBox ->setValue ( grid->gridFramePenSize () );
1164
1165
mGridFramePenColorButton ->setColor ( grid->gridFramePenColor () );
1165
1166
mGridFrameFill1ColorButton ->setColor ( grid->gridFrameFillColor1 () );
1166
1167
mGridFrameFill2ColorButton ->setColor ( grid->gridFrameFillColor2 () );
1167
1168
1168
- QgsComposerMap::GridStyle gridStyle = grid->gridStyle ();
1169
+ QgsComposerMap::GridStyle gridStyle = grid->style ();
1169
1170
switch ( gridStyle )
1170
1171
{
1171
1172
case QgsComposerMap::Cross:
@@ -1257,21 +1258,21 @@ void QgsComposerMapWidget::setGridItems( const QgsComposerMapGrid* grid )
1257
1258
1258
1259
mGridBlendComboBox ->setBlendMode ( grid->blendMode () );
1259
1260
1260
- mDrawAnnotationGroupBox ->setChecked ( grid->showGridAnnotation () );
1261
- initAnnotationPositionBox ( mAnnotationPositionLeftComboBox , grid->gridAnnotationPosition ( QgsComposerMap::Left ) );
1262
- initAnnotationPositionBox ( mAnnotationPositionRightComboBox , grid->gridAnnotationPosition ( QgsComposerMap::Right ) );
1263
- initAnnotationPositionBox ( mAnnotationPositionTopComboBox , grid->gridAnnotationPosition ( QgsComposerMap::Top ) );
1264
- initAnnotationPositionBox ( mAnnotationPositionBottomComboBox , grid->gridAnnotationPosition ( QgsComposerMap::Bottom ) );
1261
+ mDrawAnnotationGroupBox ->setChecked ( grid->annotationEnabled () );
1262
+ initAnnotationPositionBox ( mAnnotationPositionLeftComboBox , grid->annotationPosition ( QgsComposerMap::Left ) );
1263
+ initAnnotationPositionBox ( mAnnotationPositionRightComboBox , grid->annotationPosition ( QgsComposerMap::Right ) );
1264
+ initAnnotationPositionBox ( mAnnotationPositionTopComboBox , grid->annotationPosition ( QgsComposerMap::Top ) );
1265
+ initAnnotationPositionBox ( mAnnotationPositionBottomComboBox , grid->annotationPosition ( QgsComposerMap::Bottom ) );
1265
1266
1266
- initAnnotationDirectionBox ( mAnnotationDirectionComboBoxLeft , grid->gridAnnotationDirection ( QgsComposerMap::Left ) );
1267
- initAnnotationDirectionBox ( mAnnotationDirectionComboBoxRight , grid->gridAnnotationDirection ( QgsComposerMap::Right ) );
1268
- initAnnotationDirectionBox ( mAnnotationDirectionComboBoxTop , grid->gridAnnotationDirection ( QgsComposerMap::Top ) );
1269
- initAnnotationDirectionBox ( mAnnotationDirectionComboBoxBottom , grid->gridAnnotationDirection ( QgsComposerMap::Bottom ) );
1267
+ initAnnotationDirectionBox ( mAnnotationDirectionComboBoxLeft , grid->annotationDirection ( QgsComposerMap::Left ) );
1268
+ initAnnotationDirectionBox ( mAnnotationDirectionComboBoxRight , grid->annotationDirection ( QgsComposerMap::Right ) );
1269
+ initAnnotationDirectionBox ( mAnnotationDirectionComboBoxTop , grid->annotationDirection ( QgsComposerMap::Top ) );
1270
+ initAnnotationDirectionBox ( mAnnotationDirectionComboBoxBottom , grid->annotationDirection ( QgsComposerMap::Bottom ) );
1270
1271
1271
- mAnnotationFontColorButton ->setColor ( grid->gridAnnotationFontColor () );
1272
+ mAnnotationFontColorButton ->setColor ( grid->annotationFontColor () );
1272
1273
1273
1274
// mAnnotationFormatComboBox
1274
- switch ( grid->gridAnnotationFormat () )
1275
+ switch ( grid->annotationFormat () )
1275
1276
{
1276
1277
case QgsComposerMap::Decimal:
1277
1278
mAnnotationFormatComboBox ->setCurrentIndex ( 0 );
@@ -1299,7 +1300,7 @@ void QgsComposerMapWidget::setGridItems( const QgsComposerMapGrid* grid )
1299
1300
break ;
1300
1301
}
1301
1302
mDistanceToMapFrameSpinBox ->setValue ( grid->annotationFrameDistance () );
1302
- mCoordinatePrecisionSpinBox ->setValue ( grid->gridAnnotationPrecision () );
1303
+ mCoordinatePrecisionSpinBox ->setValue ( grid->annotationPrecision () );
1303
1304
1304
1305
// Unit
1305
1306
QgsComposerMapGrid::GridUnit gridUnit = grid->gridUnit ();
@@ -1403,7 +1404,7 @@ void QgsComposerMapWidget::on_mIntervalXSpinBox_editingFinished()
1403
1404
}
1404
1405
1405
1406
mComposerMap ->beginCommand ( tr ( " Grid interval changed" ) );
1406
- grid->setGridIntervalX ( mIntervalXSpinBox ->value () );
1407
+ grid->setIntervalX ( mIntervalXSpinBox ->value () );
1407
1408
mComposerMap ->updateBoundingRect ();
1408
1409
mComposerMap ->update ();
1409
1410
mComposerMap ->endCommand ();
@@ -1418,7 +1419,7 @@ void QgsComposerMapWidget::on_mIntervalYSpinBox_editingFinished()
1418
1419
}
1419
1420
1420
1421
mComposerMap ->beginCommand ( tr ( " Grid interval changed" ) );
1421
- grid->setGridIntervalY ( mIntervalYSpinBox ->value () );
1422
+ grid->setIntervalY ( mIntervalYSpinBox ->value () );
1422
1423
mComposerMap ->updateBoundingRect ();
1423
1424
mComposerMap ->update ();
1424
1425
mComposerMap ->endCommand ();
@@ -1433,7 +1434,7 @@ void QgsComposerMapWidget::on_mOffsetXSpinBox_valueChanged( double value )
1433
1434
}
1434
1435
1435
1436
mComposerMap ->beginCommand ( tr ( " Grid offset changed" ) );
1436
- grid->setGridOffsetX ( value );
1437
+ grid->setOffsetX ( value );
1437
1438
mComposerMap ->updateBoundingRect ();
1438
1439
mComposerMap ->update ();
1439
1440
mComposerMap ->endCommand ();
@@ -1448,7 +1449,7 @@ void QgsComposerMapWidget::on_mOffsetYSpinBox_valueChanged( double value )
1448
1449
}
1449
1450
1450
1451
mComposerMap ->beginCommand ( tr ( " Grid offset changed" ) );
1451
- grid->setGridOffsetY ( value );
1452
+ grid->setOffsetY ( value );
1452
1453
mComposerMap ->updateBoundingRect ();
1453
1454
mComposerMap ->update ();
1454
1455
mComposerMap ->endCommand ();
@@ -1690,7 +1691,7 @@ void QgsComposerMapWidget::on_mGridTypeComboBox_currentIndexChanged( const QStri
1690
1691
mComposerMap ->beginCommand ( tr ( " Grid type changed" ) );
1691
1692
if ( text == tr ( " Cross" ) )
1692
1693
{
1693
- grid->setGridStyle ( QgsComposerMap::Cross );
1694
+ grid->setStyle ( QgsComposerMap::Cross );
1694
1695
mCrossWidthSpinBox ->setVisible ( true );
1695
1696
mCrossWidthLabel ->setVisible ( true );
1696
1697
mGridLineStyleButton ->setVisible ( true );
@@ -1702,7 +1703,7 @@ void QgsComposerMapWidget::on_mGridTypeComboBox_currentIndexChanged( const QStri
1702
1703
}
1703
1704
else if ( text == tr ( " Markers" ) )
1704
1705
{
1705
- grid->setGridStyle ( QgsComposerMap::Markers );
1706
+ grid->setStyle ( QgsComposerMap::Markers );
1706
1707
mCrossWidthSpinBox ->setVisible ( false );
1707
1708
mCrossWidthLabel ->setVisible ( false );
1708
1709
mGridLineStyleButton ->setVisible ( false );
@@ -1714,7 +1715,7 @@ void QgsComposerMapWidget::on_mGridTypeComboBox_currentIndexChanged( const QStri
1714
1715
}
1715
1716
else if ( text == tr ( " Solid" ) )
1716
1717
{
1717
- grid->setGridStyle ( QgsComposerMap::Solid );
1718
+ grid->setStyle ( QgsComposerMap::Solid );
1718
1719
mCrossWidthSpinBox ->setVisible ( false );
1719
1720
mCrossWidthLabel ->setVisible ( false );
1720
1721
mGridLineStyleButton ->setVisible ( true );
@@ -1726,7 +1727,7 @@ void QgsComposerMapWidget::on_mGridTypeComboBox_currentIndexChanged( const QStri
1726
1727
}
1727
1728
else
1728
1729
{
1729
- grid->setGridStyle ( QgsComposerMap::FrameAnnotationsOnly );
1730
+ grid->setStyle ( QgsComposerMap::FrameAnnotationsOnly );
1730
1731
mCrossWidthSpinBox ->setVisible ( false );
1731
1732
mCrossWidthLabel ->setVisible ( false );
1732
1733
mGridLineStyleButton ->setVisible ( false );
@@ -1773,7 +1774,7 @@ void QgsComposerMapWidget::on_mDrawAnnotationGroupBox_toggled( bool state )
1773
1774
}
1774
1775
1775
1776
mComposerMap ->beginCommand ( tr ( " Annotation toggled" ) );
1776
- grid->setShowGridAnnotation ( state );
1777
+ grid->setAnnotationEnabled ( state );
1777
1778
mComposerMap ->updateBoundingRect ();
1778
1779
mComposerMap ->update ();
1779
1780
mComposerMap ->endCommand ();
@@ -1847,12 +1848,12 @@ void QgsComposerMapWidget::on_mAnnotationFontButton_clicked()
1847
1848
// Native Mac dialog works only for Qt Carbon
1848
1849
QFont newFont = QFontDialog::getFont ( &ok, grid->gridAnnotationFont (), 0 , QString (), QFontDialog::DontUseNativeDialog );
1849
1850
#else
1850
- QFont newFont = QFontDialog::getFont ( &ok, grid->gridAnnotationFont () );
1851
+ QFont newFont = QFontDialog::getFont ( &ok, grid->annotationFont () );
1851
1852
#endif
1852
1853
if ( ok )
1853
1854
{
1854
1855
mComposerMap ->beginCommand ( tr ( " Annotation font changed" ) );
1855
- grid->setGridAnnotationFont ( newFont );
1856
+ grid->setAnnotationFont ( newFont );
1856
1857
mComposerMap ->updateBoundingRect ();
1857
1858
mComposerMap ->update ();
1858
1859
mComposerMap ->endCommand ();
@@ -1868,7 +1869,7 @@ void QgsComposerMapWidget::on_mAnnotationFontColorButton_colorChanged( const QCo
1868
1869
}
1869
1870
1870
1871
mComposerMap ->beginCommand ( tr ( " Annotation color changed" ) );
1871
- grid->setGridAnnotationFontColor ( color );
1872
+ grid->setAnnotationFontColor ( color );
1872
1873
mComposerMap ->update ();
1873
1874
mComposerMap ->endCommand ();
1874
1875
}
@@ -1886,28 +1887,28 @@ void QgsComposerMapWidget::on_mAnnotationFormatComboBox_currentIndexChanged( int
1886
1887
switch ( index )
1887
1888
{
1888
1889
case 0 :
1889
- grid->setGridAnnotationFormat ( QgsComposerMap::Decimal );
1890
+ grid->setAnnotationFormat ( QgsComposerMap::Decimal );
1890
1891
break ;
1891
1892
case 3 :
1892
- grid->setGridAnnotationFormat ( QgsComposerMap::DegreeMinute );
1893
+ grid->setAnnotationFormat ( QgsComposerMap::DegreeMinute );
1893
1894
break ;
1894
1895
case 6 :
1895
- grid->setGridAnnotationFormat ( QgsComposerMap::DegreeMinuteSecond );
1896
+ grid->setAnnotationFormat ( QgsComposerMap::DegreeMinuteSecond );
1896
1897
break ;
1897
1898
case 1 :
1898
- grid->setGridAnnotationFormat ( QgsComposerMap::DecimalWithSuffix );
1899
+ grid->setAnnotationFormat ( QgsComposerMap::DecimalWithSuffix );
1899
1900
break ;
1900
1901
case 2 :
1901
- grid->setGridAnnotationFormat ( QgsComposerMap::DegreeMinuteNoSuffix );
1902
+ grid->setAnnotationFormat ( QgsComposerMap::DegreeMinuteNoSuffix );
1902
1903
break ;
1903
1904
case 4 :
1904
- grid->setGridAnnotationFormat ( QgsComposerMap::DegreeMinutePadded );
1905
+ grid->setAnnotationFormat ( QgsComposerMap::DegreeMinutePadded );
1905
1906
break ;
1906
1907
case 5 :
1907
- grid->setGridAnnotationFormat ( QgsComposerMap::DegreeMinuteSecondNoSuffix );
1908
+ grid->setAnnotationFormat ( QgsComposerMap::DegreeMinuteSecondNoSuffix );
1908
1909
break ;
1909
1910
case 7 :
1910
- grid->setGridAnnotationFormat ( QgsComposerMap::DegreeMinuteSecondPadded );
1911
+ grid->setAnnotationFormat ( QgsComposerMap::DegreeMinuteSecondPadded );
1911
1912
break ;
1912
1913
}
1913
1914
@@ -1926,7 +1927,7 @@ void QgsComposerMapWidget::on_mCoordinatePrecisionSpinBox_valueChanged( int valu
1926
1927
return ;
1927
1928
}
1928
1929
mComposerMap ->beginCommand ( tr ( " Changed annotation precision" ) );
1929
- grid->setGridAnnotationPrecision ( value );
1930
+ grid->setAnnotationPrecision ( value );
1930
1931
mComposerMap ->updateBoundingRect ();
1931
1932
mComposerMap ->update ();
1932
1933
mComposerMap ->endCommand ();
@@ -1992,11 +1993,11 @@ void QgsComposerMapWidget::on_mGridCheckBox_toggled( bool state )
1992
1993
mComposerMap ->beginCommand ( tr ( " Grid checkbox toggled" ) );
1993
1994
if ( state )
1994
1995
{
1995
- grid->setGridEnabled ( true );
1996
+ grid->setEnabled ( true );
1996
1997
}
1997
1998
else
1998
1999
{
1999
- grid->setGridEnabled ( false );
2000
+ grid->setEnabled ( false );
2000
2001
}
2001
2002
mComposerMap ->updateBoundingRect ();
2002
2003
mComposerMap ->update ();
0 commit comments