13 changes: 9 additions & 4 deletions src/core/composer/qgscomposermap.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class QDomDocument;
class QGraphicsView;
class QPainter;
class QgsFillSymbolV2;
class QgsLineSymbolV2;
class QgsVectorLayer;

/** \ingroup MapComposer
Expand Down Expand Up @@ -228,8 +229,8 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem

/**Sets the pen to draw composer grid
@note this function was added in version 1.4*/
void setGridPen( const QPen& p ) { mGridPen = p; }
QPen gridPen() const { return mGridPen; }
void setGridPen( const QPen& p );
QPen gridPen() const;

/**Sets with of grid pen
@note this function was added in version 1.4*/
Expand Down Expand Up @@ -313,6 +314,9 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
void setOverviewFrameMapSymbol( QgsFillSymbolV2* symbol );
QgsFillSymbolV2* overviewFrameMapSymbol() { return mOverviewFrameMapSymbol; }

void setGridLineSymbol( QgsLineSymbolV2* symbol );
QgsLineSymbolV2* gridLineSymbol() { return mGridLineSymbol; }

/**Sets mId to a number not yet used in the composition. mId is kept if it is not in use.
Usually, this function is called before adding the composer map to the composition*/
void assignFreeId();
Expand Down Expand Up @@ -377,6 +381,7 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
int mOverviewFrameMapId;
/**Drawing style for overview farme*/
QgsFillSymbolV2* mOverviewFrameMapSymbol;
QgsLineSymbolV2* mGridLineSymbol;

/**Establishes signal/slot connection for update in case of layer change*/
void connectUpdateSlot();
Expand All @@ -396,8 +401,6 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
double mGridOffsetX;
/**Grid line offset in y-direction*/
double mGridOffsetY;
/**Grid line pen*/
QPen mGridPen;
/**Font for grid line annotation*/
QFont mGridAnnotationFont;
/**Digits after the dot*/
Expand Down Expand Up @@ -487,8 +490,10 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
void sortGridLinesOnBorders( const QList< QPair< double, QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines, QMap< double, double >& leftFrameEntries,
QMap< double, double >& rightFrameEntries, QMap< double, double >& topFrameEntries, QMap< double, double >& bottomFrameEntries ) const;
void drawGridFrameBorder( QPainter* p, const QMap< double, double >& borderPos, Border border );
void drawGridLine( const QLineF& line, QPainter* p );
void drawOverviewMapExtent( QPainter* p );
void createDefaultOverviewFrameSymbol();
void createDefaultGridLineSymbol();
void initGridAnnotationFormatFromProject();
};

Expand Down
82 changes: 23 additions & 59 deletions src/ui/qgscomposermapwidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>450</width>
<height>408</height>
<width>440</width>
<height>413</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -254,8 +254,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>199</width>
<height>177</height>
<width>440</width>
<height>413</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -362,8 +362,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>277</width>
<height>921</height>
<width>423</width>
<height>702</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -403,6 +403,16 @@
</item>
<item row="1" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="mOffsetXSpinBox">
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>9999999.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="mIntervalXLabel">
<property name="text">
Expand Down Expand Up @@ -462,16 +472,6 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="mOffsetXSpinBox">
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>9999999.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mOffsetYLabel">
<property name="text">
Expand Down Expand Up @@ -516,72 +516,43 @@
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="mLineWidthLabel">
<property name="text">
<string>Line width</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="buddy">
<cstring>mLineWidthSpinBox</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="mLineWidthSpinBox">
<property name="decimals">
<number>5</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="mFrameStyleLabel">
<property name="text">
<string>Frame style</string>
</property>
</widget>
</item>
<item row="6" column="1">
<item row="5" column="1">
<widget class="QComboBox" name="mFrameStyleComboBox"/>
</item>
<item row="7" column="0">
<item row="6" column="0">
<widget class="QLabel" name="mFrameWidthLabel">
<property name="text">
<string>Frame width</string>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="6" column="1">
<widget class="QDoubleSpinBox" name="mFrameWidthSpinBox"/>
</item>
</layout>
</item>
<item row="2" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="mLineColorLabel">
<widget class="QLabel" name="mLineStyleLabel">
<property name="text">
<string>Line color</string>
<string>Line style</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="buddy">
<cstring>mLineColorButton</cstring>
</property>
</widget>
</item>
<item>
<widget class="QgsColorButton" name="mLineColorButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QPushButton" name="mGridLineStyleButton">
<property name="text">
<string/>
<string>change...</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -795,13 +766,6 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
<header>qgscolorbutton.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mDrawAnnotationCheckBox</tabstop>
<tabstop>mAnnotationFontButton</tabstop>
Expand Down