Skip to content

Commit 8ef047d

Browse files
rldhontnyalldawson
authored andcommittedJun 21, 2018
[Server] Use Project selection color in GetPrint for 2.18
QGIS Server uses QgsMapRenderer and not QgsMapSettings to configure maps rendering, and color selection was not transmitted between QgsMapRenderer and QgsMapSettings and between mapSettings and jobMapSettings in QgsMapComposer. This commit completes: * [Server] Reactivate the capability to print selection with Server 2.18 3d0f1b6 * [Server] Read and activate selection color 79a212e
1 parent 9f01039 commit 8ef047d

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed
 

‎src/core/composer/qgscomposermap.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ QgsMapSettings QgsComposerMap::mapSettings( const QgsRectangle& extent, QSizeF s
231231
jobMapSettings.setCrsTransformEnabled( ms.hasCrsTransformEnabled() );
232232
jobMapSettings.setFlags( ms.flags() );
233233
jobMapSettings.setFlag( QgsMapSettings::DrawSelection, mDrawSelection );
234+
jobMapSettings.setSelectionColor( ms.selectionColor() );
234235
jobMapSettings.setFlag( QgsMapSettings::RenderPartialOutput, false );
235236

236237
if ( mComposition->plotStyle() == QgsComposition::Print ||

‎src/core/qgsmaprenderer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,15 @@ const QgsMapSettings& QgsMapRenderer::mapSettings()
12681268
mMapSettings.setCrsTransformEnabled( hasCrsTransformEnabled() );
12691269
mMapSettings.setDestinationCrs( destinationCrs() );
12701270
mMapSettings.setMapUnits( mapUnits() );
1271+
1272+
// set selection color
1273+
QgsProject* prj = QgsProject::instance();
1274+
int myRed = prj->readNumEntry( "Gui", "/SelectionColorRedPart", 255 );
1275+
int myGreen = prj->readNumEntry( "Gui", "/SelectionColorGreenPart", 255 );
1276+
int myBlue = prj->readNumEntry( "Gui", "/SelectionColorBluePart", 0 );
1277+
int myAlpha = prj->readNumEntry( "Gui", "/SelectionColorAlphaPart", 255 );
1278+
mMapSettings.setSelectionColor( QColor( myRed, myGreen, myBlue, myAlpha ) );
1279+
12711280
return mMapSettings;
12721281
}
12731282

Loading

0 commit comments

Comments
 (0)
Please sign in to comment.