4 changes: 3 additions & 1 deletion src/app/composer/qgscomposerscalebarwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ void QgsComposerScaleBarWidget::on_mLineWidthSpinBox_valueChanged( double d )

mComposerScaleBar->beginCommand( tr( "Scalebar line width" ), QgsComposerMergeCommand::ScaleBarLineWidth );
disconnectUpdateSignal();
mComposerScaleBar->setFrameOutlineWidth( d );
QPen newPen = mComposerScaleBar->pen();
newPen.setWidthF( d );
mComposerScaleBar->setPen( newPen );
mComposerScaleBar->update();
connectUpdateSignal();
mComposerScaleBar->endCommand();
Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposeritem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ void QgsComposerItem::init( bool manageZValue )
setBrush( QBrush( QColor( 255, 255, 255, 255 ) ) );
QPen defaultPen( QColor( 0, 0, 0 ) );
defaultPen.setWidthF( 0.3 );
defaultPen.setJoinStyle( Qt::MiterJoin );
setPen( defaultPen );
//let z-Value be managed by composition
if ( mComposition && manageZValue )
Expand Down Expand Up @@ -318,6 +319,7 @@ bool QgsComposerItem::_readXML( const QDomElement& itemElem, const QDomDocument&
{
QPen framePen( QColor( penRed, penGreen, penBlue, penAlpha ) );
framePen.setWidthF( penWidth );
framePen.setJoinStyle( Qt::MiterJoin );
setPen( framePen );
}
}
Expand Down
18 changes: 13 additions & 5 deletions src/core/composer/qgscomposermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,7 @@ void QgsComposerMap::drawGridFrameBorder( QPainter* p, const QMap< double, doubl
//set pen to current frame pen
QPen framePen = QPen( mGridFramePenColor );
framePen.setWidthF( mGridFramePenThickness );
framePen.setJoinStyle( Qt::MiterJoin );
p->setPen( framePen );

QMap< double, double >::const_iterator posIt = pos.constBegin();
Expand Down Expand Up @@ -1918,6 +1919,12 @@ void QgsComposerMap::updateBoundingRect()
}
}

void QgsComposerMap::setFrameOutlineWidth( double outlineWidth )
{
QgsComposerItem::setFrameOutlineWidth( outlineWidth );
updateBoundingRect();
}

QgsRectangle QgsComposerMap::transformedExtent() const
{
double dx = mXOffset;
Expand Down Expand Up @@ -1945,10 +1952,11 @@ QPolygonF QgsComposerMap::transformedMapPolygon() const

double QgsComposerMap::maxExtension() const
{
if ( !mGridEnabled || !mShowGridAnnotation || ( mLeftGridAnnotationPosition != OutsideMapFrame && mRightGridAnnotationPosition != OutsideMapFrame
&& mTopGridAnnotationPosition != OutsideMapFrame && mBottomGridAnnotationPosition != OutsideMapFrame ) )
double frameExtension = mFrame ? pen().widthF() / 2.0 : 0.0;
if ( !mGridEnabled || ( mGridFrameStyle == QgsComposerMap::NoGridFrame && ( !mShowGridAnnotation || ( mLeftGridAnnotationPosition != OutsideMapFrame && mRightGridAnnotationPosition != OutsideMapFrame
&& mTopGridAnnotationPosition != OutsideMapFrame && mBottomGridAnnotationPosition != OutsideMapFrame ) ) ) )
{
return 0;
return frameExtension;
}

QList< QPair< double, QLineF > > xLines;
Expand All @@ -1959,7 +1967,7 @@ double QgsComposerMap::maxExtension() const

if ( xGridReturn != 0 && yGridReturn != 0 )
{
return 0;
return frameExtension;
}

double maxExtension = 0;
Expand All @@ -1984,7 +1992,7 @@ double QgsComposerMap::maxExtension() const

//grid frame
double gridFrameDist = ( mGridFrameStyle == NoGridFrame ) ? 0 : mGridFrameWidth + ( mGridFramePenThickness / 2.0 );
return maxExtension + mAnnotationFrameDistance + gridFrameDist;
return qMax( frameExtension, maxExtension + mAnnotationFrameDistance + gridFrameDist );
}

void QgsComposerMap::mapPolygon( const QgsRectangle& extent, QPolygonF& poly ) const
Expand Down
3 changes: 3 additions & 0 deletions src/core/composer/qgscomposermap.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
@note this function was added in version 1.4*/
void updateBoundingRect();

/* reimplement setFrameOutlineWidth, so that updateBoundingRect() is called after setting the frame width */
virtual void setFrameOutlineWidth( double outlineWidth );

/**Sets length of the cros segments (if grid style is cross)
@note this function was added in version 1.4*/
void setCrossLength( double l ) {mCrossLength = l;}
Expand Down
13 changes: 11 additions & 2 deletions src/core/composer/qgscomposerscalebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@ void QgsComposerScaleBar::setBoxContentSpace( double space )

void QgsComposerScaleBar::setComposerMap( const QgsComposerMap* map )
{
disconnect( mComposerMap, SIGNAL( extentChanged() ), this, SLOT( updateSegmentSize() ) );
disconnect( mComposerMap, SIGNAL( destroyed( QObject* ) ), this, SLOT( invalidateCurrentMap() ) );
if ( mComposerMap )
{
disconnect( mComposerMap, SIGNAL( extentChanged() ), this, SLOT( updateSegmentSize() ) );
disconnect( mComposerMap, SIGNAL( destroyed( QObject* ) ), this, SLOT( invalidateCurrentMap() ) );
}
mComposerMap = map;

if ( !map )
Expand All @@ -154,6 +157,11 @@ void QgsComposerScaleBar::setComposerMap( const QgsComposerMap* map )

void QgsComposerScaleBar::invalidateCurrentMap()
{
if ( !mComposerMap )
{
return;
}

disconnect( mComposerMap, SIGNAL( extentChanged() ), this, SLOT( updateSegmentSize() ) );
disconnect( mComposerMap, SIGNAL( destroyed( QObject* ) ), this, SLOT( invalidateCurrentMap() ) );
mComposerMap = 0;
Expand Down Expand Up @@ -234,6 +242,7 @@ void QgsComposerScaleBar::applyDefaultSettings()
mHeight = 3;

mPen = QPen( QColor( 0, 0, 0 ) );
mPen.setJoinStyle( Qt::MiterJoin );
mPen.setWidthF( 1.0 );

mBrush.setColor( QColor( 0, 0, 0 ) );
Expand Down
1 change: 1 addition & 0 deletions src/core/composer/qgscomposertable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void QgsComposerTable::paint( QPainter* painter, const QStyleOptionGraphicsItem*
QPen gridPen;
gridPen.setWidthF( mGridStrokeWidth );
gridPen.setColor( mGridColor );
gridPen.setJoinStyle( Qt::MiterJoin );
painter->setPen( gridPen );
drawHorizontalGridLines( painter, attributeMaps.size() );
drawVerticalGridLines( painter, maxColumnWidthMap );
Expand Down
16 changes: 8 additions & 8 deletions src/ui/qgscomposerlegendwidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-309</y>
<width>373</width>
<height>1387</height>
<y>0</y>
<width>375</width>
<height>1287</height>
</rect>
</property>
<layout class="QVBoxLayout" name="mainLayout">
Expand Down Expand Up @@ -352,7 +352,7 @@
<item>
<widget class="QCheckBox" name="mCheckBoxAutoUpdate">
<property name="text">
<string>Auto Update</string>
<string>Auto update</string>
</property>
<property name="checked">
<bool>true</bool>
Expand Down Expand Up @@ -383,28 +383,28 @@
</sizepolicy>
</property>
<property name="text">
<string>Title Font...</string>
<string>Title font...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mLayerFontButton">
<property name="text">
<string>Subgroup Font...</string>
<string>Subgroup font...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mGroupFontButton">
<property name="text">
<string>Group Font...</string>
<string>Group font...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mItemFontButton">
<property name="text">
<string>Item Font...</string>
<string>Item font...</string>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgscomposermapwidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<item row="2" column="0">
<widget class="QLabel" name="mMapRotationLabel">
<property name="text">
<string>Map Rotation</string>
<string>Map rotation</string>
</property>
</widget>
</item>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/qgscomposerpicturewidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<x>0</x>
<y>0</y>
<width>310</width>
<height>553</height>
<height>549</height>
</rect>
</property>
<layout class="QVBoxLayout" name="mainLayout">
Expand Down Expand Up @@ -213,7 +213,7 @@
<item>
<widget class="QgsCollapsibleGroupBoxBasic" name="groupBox">
<property name="title">
<string>Image Rotation</string>
<string>Image rotation</string>
</property>
<property name="syncGroup" stdset="0">
<string notr="true">composeritem</string>
Expand Down
16 changes: 8 additions & 8 deletions src/ui/qgscomposertablewidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<x>0</x>
<y>0</y>
<width>408</width>
<height>573</height>
<height>572</height>
</rect>
</property>
<layout class="QVBoxLayout" name="mainLayout">
Expand Down Expand Up @@ -217,14 +217,14 @@
<item>
<widget class="QPushButton" name="mHeaderFontPushButton">
<property name="text">
<string>Header Font...</string>
<string>Header font...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mContentFontPushButton">
<property name="text">
<string>Content Font...</string>
<string>Content font...</string>
</property>
</widget>
</item>
Expand All @@ -240,17 +240,17 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsColorButton</class>
<extends>QPushButton</extends>
<header>qgscolorbutton.h</header>
</customwidget>
<customwidget>
<class>QgsCollapsibleGroupBoxBasic</class>
<extends>QGroupBox</extends>
<header location="global">qgscollapsiblegroupbox.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorButton</class>
<extends>QPushButton</extends>
<header>qgscolorbutton.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
Expand Down