43 #include <QGraphicsScene> 44 #include <QGraphicsView> 51 , mGridStack( nullptr )
52 , mOverviewStack( nullptr )
54 , mEvaluatedMapRotation( 0 )
55 , mKeepLayerSet( false )
56 , mKeepLayerStyles( false )
57 , mUpdatesEnabled( true )
58 , mMapCanvas( nullptr )
59 , mDrawCanvasItems( true )
60 , mAtlasDriven( false )
61 , mAtlasScalingMode( Auto )
62 , mAtlasMargin( 0.10 )
70 mCurrentRectangle =
rect();
73 mCacheUpdated =
false;
96 , mGridStack( nullptr )
97 , mOverviewStack( nullptr )
99 , mEvaluatedMapRotation( 0 )
100 , mKeepLayerSet( false )
101 , mKeepLayerStyles( false )
102 , mUpdatesEnabled( true )
103 , mMapCanvas( nullptr )
104 , mDrawCanvasItems( true )
105 , mAtlasDriven( false )
106 , mAtlasScalingMode(
Auto )
107 , mAtlasMargin( 0.10 )
116 mCurrentRectangle =
rect();
122 void QgsComposerMap::init()
140 void QgsComposerMap::updateToolTip()
145 void QgsComposerMap::adjustExtentToItemShape(
double itemWidth,
double itemHeight,
QgsRectangle&
extent )
const 147 double itemWidthHeightRatio = itemWidth / itemHeight;
148 double newWidthHeightRatio = extent.
width() / extent.
height();
150 if ( itemWidthHeightRatio <= newWidthHeightRatio )
153 double newHeight = extent.
width() / itemWidthHeightRatio;
154 double deltaHeight = newHeight - extent.
height();
161 double newWidth = itemWidthHeightRatio * extent.
height();
162 double deltaWidth = newWidth - extent.
width();
170 delete mOverviewStack;
178 Q_UNUSED( forceWidthScale );
211 jobMapSettings.
setRotation( mEvaluatedMapRotation );
220 ( layerIdx >= 0 && layerIdx < theLayerSet.length() )
221 ?
QStringList( theLayerSet[ theLayerSet.length() - layerIdx - 1 ] )
249 return jobMapSettings;
267 if ( horizontalVScaleFactor < 0 )
277 int w = widthMM * horizontalVScaleFactor;
278 int h = heightMM * horizontalVScaleFactor;
281 if ( w > 5000 || h > 5000 )
286 h = w * heightMM / widthMM;
291 w = h * widthMM / heightMM;
295 mCacheImage =
QImage( w, h, QImage::Format_ARGB32 );
310 mCacheImage.
fill(
QColor( 255, 255, 255, 0 ).rgba() );
317 mCacheUpdated =
true;
343 QFont messageFont(
"", 12 );
344 painter->
setFont( messageFont );
346 painter->
drawText( thisPaintRect,
tr(
"Map will be printed here" ) );
357 double imagePixelWidth = mCacheImage.
width();
362 painter->
translate( mXOffset, mYOffset );
363 painter->
scale( scale, scale );
382 if ( !thePaintDevice )
388 if ( shouldDrawPart( Background ) )
398 painter->
translate( mXOffset, mYOffset );
400 double dotsPerMM = thePaintDevice->
logicalDpiX() / 25.4;
401 theSize *= dotsPerMM;
402 painter->
scale( 1 / dotsPerMM, 1 / dotsPerMM );
415 if ( shouldDrawPart( OverviewMapExtent ) &&
420 if ( shouldDrawPart( Grid ) &&
425 if ( shouldDrawPart( Frame ) )
429 if (
isSelected() && shouldDrawPart( SelectionBoxes ) )
441 + layersToRender().
length()
449 bool QgsComposerMap::shouldDrawPart( PartType part )
const 461 if ( SelectionBoxes == part )
476 if ( OverviewMapExtent == part )
487 if ( Background == part )
498 mCacheUpdated =
false;
505 if ( mPreviewMode ==
Render )
536 evalContext = scopedContext.
data();
551 if ( renderLayerSet.
isEmpty() )
555 renderLayerSet = mLayerSet;
565 renderLayerSet.
clear();
574 renderLayerSet << layer->
id();
587 if ( removeAt != -1 )
589 renderLayerSet.
removeAt( removeAt );
594 return renderLayerSet;
608 return mLayerStyleOverrides;
615 calculator.
setDpi( 25.4 );
632 transformShift( dx, dy );
660 double zoomFactor = settings.
value(
"/qgis/zoom_factor", 2.0 ).
toDouble();
661 zoomFactor = delta > 0 ? zoomFactor : 1 / zoomFactor;
696 centerX = mapX + ( centerX - mapX ) * ( 1.0 / factor );
697 centerY = mapY + ( centerY - mapY ) * ( 1.0 / factor );
701 double newIntervalX, newIntervalY;
725 calculator.
setDpi( 25.4 );
727 mExtent.
scale( scaleRatio );
741 double w = rectangle.
width();
742 double h = rectangle.
height();
748 double newHeight = mExtent.
width() * h / w;
753 mCacheUpdated =
false;
787 double newWidthHeightRatio = newExtent.
width() / newExtent.
height();
789 if ( currentWidthHeightRatio < newWidthHeightRatio )
792 double newHeight = newExtent.
width() / currentWidthHeightRatio;
793 double deltaHeight = newHeight - newExtent.
height();
800 double newWidth = currentWidthHeightRatio * newExtent.
height();
801 double deltaWidth = newWidth - newExtent.
width();
815 mCacheUpdated =
false;
823 if ( mAtlasFeatureExtent != extent )
830 double newWidthHeightRatio = newExtent.
width() / newExtent.
height();
832 if ( currentWidthHeightRatio < newWidthHeightRatio )
835 double newHeight = newExtent.
width() / currentWidthHeightRatio;
836 double deltaHeight = newHeight - newExtent.
height();
840 else if ( currentWidthHeightRatio >= newWidthHeightRatio )
843 double newWidth = currentWidthHeightRatio * newExtent.
height();
844 double deltaWidth = newWidth - newExtent.
width();
849 mAtlasFeatureExtent = newExtent;
855 mCacheUpdated =
false;
869 return &mAtlasFeatureExtent;
885 return &mAtlasFeatureExtent;
896 double currentScaleDenominator =
scale();
903 double scaleRatio = scaleDenominator / currentScaleDenominator;
913 calculator.
setDpi( 25.4 );
914 scaleRatio = scaleDenominator / calculator.
calculate( mExtent,
rect().width() );
915 mExtent.
scale( scaleRatio );
918 mCacheUpdated =
false;
949 mEvaluatedMapRotation = mMapRotation;
967 evalContext = scopedContext.
data();
974 bool useDdXMin =
false;
975 bool useDdXMax =
false;
976 bool useDdYMin =
false;
977 bool useDdYMax =
false;
988 if ( ok && !exprVal.
isNull() )
999 if ( ok && !exprVal.
isNull() )
1010 if ( ok && !exprVal.
isNull() )
1021 if ( ok && !exprVal.
isNull() )
1035 double newWidthHeightRatio = newExtent.
width() / newExtent.
height();
1037 if ( currentWidthHeightRatio < newWidthHeightRatio )
1040 double newHeight = newExtent.
width() / currentWidthHeightRatio;
1041 double deltaHeight = newHeight - newExtent.
height();
1048 double newWidth = currentWidthHeightRatio * newExtent.
height();
1049 double deltaWidth = newWidth - newExtent.
width();
1063 double scaleD = exprVal.
toDouble( &ok );
1065 if ( ok && !exprVal.
isNull() )
1072 if ( useDdXMax || useDdXMin || useDdYMax || useDdYMin )
1076 if ( useDdXMin && !useDdXMax )
1082 else if ( !useDdXMin && useDdXMax )
1088 if ( useDdYMin && !useDdYMax )
1094 else if ( !useDdYMin && useDdYMax )
1114 double rotationD = exprVal.
toDouble( &ok );
1116 if ( ok && !exprVal.
isNull() )
1118 mapRotation = rotationD;
1132 if ( !mUpdatesEnabled )
1151 for ( ; layer_it != layers.
constEnd(); ++layer_it )
1157 if ( currentRasterLayer )
1160 if (( rasterProvider = currentRasterLayer->
dataProvider() ) )
1162 if ( rasterProvider->
name() ==
"wms" )
1196 for ( ; layer_it != layers.
constEnd(); ++layer_it )
1201 if ( currentLayer->
blendMode() != QPainter::CompositionMode_SourceOver )
1207 if ( currentVectorLayer )
1213 if ( currentVectorLayer->
featureBlendMode() != QPainter::CompositionMode_SourceOver )
1222 if (( layerSettings.
blendMode != QPainter::CompositionMode_SourceOver ) ||
1237 void QgsComposerMap::connectUpdateSlot()
1241 if ( layerRegistry )
1259 if ( mPreviewMode ==
Cache )
1261 composerMapElem.
setAttribute(
"previewMode",
"Cache" );
1263 else if ( mPreviewMode ==
Render )
1265 composerMapElem.
setAttribute(
"previewMode",
"Render" );
1269 composerMapElem.
setAttribute(
"previewMode",
"Rectangle" );
1272 if ( mKeepLayerSet )
1274 composerMapElem.
setAttribute(
"keepLayerSet",
"true" );
1278 composerMapElem.
setAttribute(
"keepLayerSet",
"false" );
1281 if ( mDrawCanvasItems )
1283 composerMapElem.
setAttribute(
"drawCanvasItems",
"true" );
1287 composerMapElem.
setAttribute(
"drawCanvasItems",
"false" );
1304 for ( ; layerIt != mLayerSet.
constEnd(); ++layerIt )
1314 if ( mKeepLayerStyles )
1318 for ( ; styleIt != mLayerStyleOverrides.
constEnd(); ++styleIt )
1334 mGridStack->
writeXML( composerMapElem, doc );
1337 mOverviewStack->
writeXML( composerMapElem, doc );
1342 atlasElem.
setAttribute(
"scalingMode", mAtlasScalingMode );
1347 return _writeXML( composerMapElem, doc );
1358 if ( idRead !=
"not found" )
1360 mId = idRead.
toInt();
1367 if ( previewMode ==
"Cache" )
1369 mPreviewMode =
Cache;
1371 else if ( previewMode ==
"Render" )
1382 if ( !extentNodeList.
isEmpty() )
1385 double xmin, xmax, ymin, ymax;
1401 if ( keepLayerSetFlag.
compare(
"true", Qt::CaseInsensitive ) == 0 )
1403 mKeepLayerSet =
true;
1407 mKeepLayerSet =
false;
1410 QString drawCanvasItemsFlag = itemElem.
attribute(
"drawCanvasItems",
"true" );
1411 if ( drawCanvasItemsFlag.
compare(
"true", Qt::CaseInsensitive ) == 0 )
1413 mDrawCanvasItems =
true;
1417 mDrawCanvasItems =
false;
1420 mLayerStyleOverrides.
clear();
1425 if ( !layerSetNodeList.
isEmpty() )
1430 for (
int i = 0; i < layerIdNodeList.
size(); ++i )
1433 layerSet << layerIdElement.
text();
1440 mKeepLayerStyles = !layerStylesNodeList.
isEmpty();
1441 if ( mKeepLayerStyles )
1445 for (
int i = 0; i < layerStyleNodeList.
size(); ++i )
1450 style.
readXml( layerStyleElement );
1456 mNumCachedLayers = 0;
1457 mCacheUpdated =
false;
1460 mOverviewStack->
readXML( itemElem, doc );
1463 mGridStack->
readXML( itemElem, doc );
1469 if ( mGridStack->
size() == 0 && !gridNodeList.
isEmpty() )
1489 if ( gridSymbolElem.
isNull() )
1500 lineSymbol = QgsSymbolLayerV2Utils::loadSymbol<QgsLineSymbolV2>( gridSymbolElem );
1506 if ( !annotationNodeList.
isEmpty() )
1520 QFont annotationFont;
1527 mGridStack->
addGrid( mapGrid );
1532 if ( !overviewFrameElem.
isNull() )
1543 if ( !overviewFrameSymbolElem.
isNull() )
1545 fillSymbol = QgsSymbolLayerV2Utils::loadSymbol<QgsFillSymbolV2>( overviewFrameSymbolElem );
1553 if ( !atlasNodeList.
isEmpty() )
1556 mAtlasDriven = ( atlasElem.
attribute(
"atlasDriven",
"0" ) !=
"0" );
1559 mAtlasScalingMode = ( atlasElem.
attribute(
"fixedScale",
"0" ) !=
"0" ) ?
Fixed :
Auto;
1570 if ( !composerItemList.
isEmpty() )
1592 if ( mKeepLayerStyles )
1602 if ( overrides == mLayerStyleOverrides )
1605 mLayerStyleOverrides = overrides;
1612 mLayerStyleOverrides.
clear();
1613 Q_FOREACH (
const QString& layerID, mLayerSet )
1624 void QgsComposerMap::syncLayerSet()
1626 if ( mLayerSet.
size() < 1 )
1633 if ( mKeepLayerSet )
1642 for (
int i = mLayerSet.
size() - 1; i >= 0; --i )
1644 if ( !currentLayerSet.
contains( mLayerSet.
at( i ) ) )
1646 mLayerStyleOverrides.
remove( mLayerSet.
at( i ) );
1654 if ( mGridStack->
size() < 1 )
1659 return mGridStack->
grid( 0 );
1818 g->
setAnnotationPosition( static_cast< QgsComposerMapGrid::AnnotationPosition >( p ), static_cast< QgsComposerMapGrid::BorderSide >( border ) );
1888 g->
setFrameStyle( static_cast< QgsComposerMapGrid::FrameStyle >( style ) );
1971 if ( mOverviewStack->
size() < 1 )
1976 return mOverviewStack->
overview( 0 );
1998 return mCurrentRectangle;
2006 double topExtension = 0.0;
2007 double rightExtension = 0.0;
2008 double bottomExtension = 0.0;
2009 double leftExtension = 0.0;
2014 topExtension = qMax( topExtension, frameExtension );
2015 rightExtension = qMax( rightExtension, frameExtension );
2016 bottomExtension = qMax( bottomExtension, frameExtension );
2017 leftExtension = qMax( leftExtension, frameExtension );
2019 rectangle.
setLeft( rectangle.
left() - leftExtension );
2021 rectangle.
setTop( rectangle.
top() - topExtension );
2023 if ( rectangle != mCurrentRectangle )
2026 mCurrentRectangle = rectangle;
2038 double dx = mXOffset;
2039 double dy = mYOffset;
2040 transformShift( dx, dy );
2046 double dx = mXOffset;
2047 double dy = mYOffset;
2051 transformShift( dx, dy );
2079 dx = rotationPoint.
x() - extent.
xMinimum();
2080 dy = rotationPoint.
y() - extent.
yMaximum();
2082 poly <<
QPointF( rotationPoint.
x() - dx, rotationPoint.
y() - dy );
2085 dx = rotationPoint.
x() - extent.
xMaximum();
2086 dy = rotationPoint.
y() - extent.
yMaximum();
2088 poly <<
QPointF( rotationPoint.
x() - dx, rotationPoint.
y() - dy );
2091 dx = rotationPoint.
x() - extent.
xMaximum();
2092 dy = rotationPoint.
y() - extent.
yMinimum();
2094 poly <<
QPointF( rotationPoint.
x() - dx, rotationPoint.
y() - dy );
2097 dx = rotationPoint.
x() - extent.
xMinimum();
2098 dy = rotationPoint.
y() - extent.
yMinimum();
2100 poly <<
QPointF( rotationPoint.
x() - dx, rotationPoint.
y() - dy );
2120 return tr(
"Map %1" ).
arg( mId );
2133 mapPolygon( newExtent, poly );
2171 if ( extentWidth <= 0 )
2197 evalContext = scopedContext.
data();
2208 refreshMapExtents( evalContext );
2217 mCacheUpdated =
false;
2295 void QgsComposerMap::transformShift(
double& xShift,
double& yShift )
const 2298 double dxScaled = xShift * mmToMapUnits;
2299 double dyScaled = - yShift * mmToMapUnits;
2310 if ( mapPoly.
size() < 1 )
2317 double dx = mapCoords.
x() - rotationPoint.
x();
2318 double dy = mapCoords.
y() - rotationPoint.
y();
2320 QgsPoint backRotatedCoords( rotationPoint.
x() + dx, rotationPoint.
y() + dy );
2323 double xItem =
rect().
width() * ( backRotatedCoords.x() - unrotatedExtent.xMinimum() ) / unrotatedExtent.width();
2324 double yItem =
rect().
height() * ( 1 - ( backRotatedCoords.y() - unrotatedExtent.yMinimum() ) / unrotatedExtent.height() );
2325 return QPointF( xItem, yItem );
2335 if ( !mMapCanvas || !mDrawCanvasItems )
2341 if ( itemList.
size() < 1 )
2347 for (
int i = itemList.
size() - 1; i >= 0; --i )
2349 currentItem = itemList.
at( i );
2356 drawCanvasItem( annotation, painter, itemStyle );
2362 if ( !annotation || !annotation->
showItem() )
2372 double itemX, itemY;
2375 QPointF mapPos = composerMapPosForItem( annotation );
2386 painter->
scale( scaleFactor, scaleFactor );
2389 const_cast< QgsAnnotation*
>( annotation )->setItemData( 1,
"composer" );
2391 const_cast< QgsAnnotation*
>( annotation )->setItemData( 1,
"" );
2435 for ( ; mapIt != mapList.
constEnd(); ++mapIt )
2437 if (( *mapIt )->id() > maxId )
2439 maxId = ( *mapIt )->id();
2472 mAtlasDriven = enabled;
2478 refreshMapExtents();
2484 return mAtlasScalingMode ==
Fixed;
2490 mAtlasScalingMode = fixed ?
Fixed :
Auto;
2500 double margin = mAtlasMargin;
2506 double ddMargin = exprVal.
toDouble( &ok );
2508 if ( ok && !exprVal.
isNull() )
2511 margin = ddMargin / 100;
2518 return mAtlasMargin;
Q_DECL_DEPRECATED void setGridFrameWidth(double w)
Set grid frame width.
Q_DECL_DEPRECATED int overviewFrameMapId() const
Returns id of overview frame (or -1 if no overfiew frame)
double scale() const
Scale.
virtual QgsPoint mapPosition() const
Returns the map position of the annotation, if it is attached to a fixed map position.
void setMapUnits(QGis::UnitType mapUnits)
Set the map units.
void setStyle(const GridStyle style)
Sets the grid style, which controls how the grid is drawn over the map's contents.
bool centered() const
Returns whether the extent of the map is forced to center on the overview.
Q_DECL_DEPRECATED QFont gridAnnotationFont() const
void preparedForAtlas()
Is emitted when the map has been prepared for atlas rendering, just before actual rendering...
void updateItem() override
Updates item, with the possibility to do custom update for subclasses.
void addGrid(QgsComposerMapGrid *grid)
Adds a new map grid to the stack and takes ownership of the grid.
AtlasScalingMode
Scaling modes used for the serial rendering (atlas)
QDomNodeList elementsByTagName(const QString &tagname) const
QgsMapSettings mapSettings(const QgsRectangle &extent, QSizeF size, int dpi) const
Return map settings that would be used for drawing of the map.
Single variable definition for use within a QgsExpressionContextScope.
void setDestinationCrs(const QgsCoordinateReferenceSystem &crs)
sets destination coordinate reference system
QColor annotationFontColor() const
Gets the font color used for drawing grid annotations.
A rectangle specified with double values.
void calculateMaxGridExtension(double &top, double &right, double &bottom, double &left) const
Calculates the maximum distance grids within the stack extend beyond the QgsComposerMap's item rect...
Base class for all map layer types.
void setDotsPerMeterX(int x)
void setDotsPerMeterY(int y)
QFont annotationFont() const
Gets the font used for drawing grid annotations.
Job implementation that renders everything sequentially using a custom painter.
double horizontalViewScaleFactor() const
Returns the zoom factor of the graphics view.
double mapUnitsToMM() const
Returns the conversion factor map units -> mm.
QgsPoint center() const
Center point of the rectangle.
const QgsLineSymbolV2 * lineSymbol() const
Gets the line symbol used for drawing grid lines.
void setAnnotationDirection(const AnnotationDirection direction, const BorderSide border)
Sets the direction for drawing frame annotations.
QColor frameFillColor2() const
Retrieves the second fill color for the grid frame.
const QgsComposerMap * getComposerMapById(const int id) const
Returns the composer map with specified id.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blending mode used for drawing the grid.
Q_DECL_DEPRECATED QgsLineSymbolV2 * gridLineSymbol()
double atlasMargin(const QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue)
Returns the margin size (percentage) used when the map is in atlas mode.
Q_DECL_DEPRECATED void setGridIntervalY(double interval)
Sets coordinate interval in y-direction for composergrid.
virtual QgsExpressionContext * createExpressionContext() const override
Creates an expression context relating to the item's current state.
Q_DECL_DEPRECATED void setOverviewCentered(bool centered)
Set the overview's centering mode.
double intervalY() const
Gets the interval between grid lines in the y-direction.
bool shouldDrawItem() const
Returns whether the item should be drawn in the current context.
void setLineSymbol(QgsLineSymbolV2 *symbol)
Sets the line symbol used for drawing grid lines.
bool drawCanvasItems() const
GridStyle
Grid drawing style.
QList< QGraphicsItem * > items() const
virtual QgsLineSymbolV2 * clone() const override
QPainter::CompositionMode blendMode() const
Retrieves the blending mode used for drawing the grid.
Q_DECL_DEPRECATED void setGridAnnotationFormat(GridAnnotationFormat f)
Q_DECL_DEPRECATED void setGridFrameFillColor1(const QColor &c)
Sets first fill color for grid zebra frame.
void setRenderHint(RenderHint hint, bool on)
void setOffsetY(const double offset)
Sets the offset for grid lines in the y-direction.
QDomNode appendChild(const QDomNode &newChild)
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
void setXMaximum(double x)
Set the maximum x value.
Q_DECL_DEPRECATED void setGridEnabled(bool enabled)
Enables a coordinate grid that is shown on top of this composermap.
void setFramePenSize(const double width)
Sets the width of the outline drawn in the grid frame.
void assignFreeId()
Sets mId to a number not yet used in the composition.
QString xmlData() const
Return XML content of the style.
QStringList layerSet() const
Getter for stored layer set that is used if mKeepLayerSet is true.
Q_DECL_DEPRECATED double gridFrameWidth() const
void setNewAtlasFeatureExtent(const QgsRectangle &extent)
Sets new Extent for the current atlas preview and changes width, height (and implicitely also scale)...
void readXml(const QDomElement &styleElement)
Read style configuration (for project file reading)
QString attribute(const QString &name, const QString &defValue) const
void setOffset(double xOffset, double yOffset)
Sets offset values to shift image (useful for live updates when moving item content) ...
Q_DECL_DEPRECATED QgsMapRenderer * mapRenderer()
Returns pointer to map renderer of qgis map canvas.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
void setOutputDpi(int dpi)
Set DPI used for conversion between real world units (e.g. mm) and pixels.
void itemChanged()
Emitted when the item changes.
Q_DECL_DEPRECATED QColor gridFramePenColor() const
Get pen color for grid frame.
QMap< QString, QString > presetStyleOverrides(const QString &name)
Get layer style overrides (for QgsMapSettings) of the visible layers for given preset.
void addOverview(QgsComposerMapOverview *overview)
Adds a new map overview to the stack and takes ownership of the overview.
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
Q_DECL_DEPRECATED void connectMapOverviewSignals()
QPolygonF visibleExtentPolygon() const
Returns a polygon representing the current visible map extent, considering map extents and rotation...
QPainter::CompositionMode bufferBlendMode
QgsRectangle extent() const
ZoomMode
Modes for zooming item content.
A collection of grids which is drawn above the map content in a QgsComposerMap.
Q_DECL_DEPRECATED void setAnnotationFontColor(const QColor &c)
Sets font color for grid annotations.
Q_DECL_DEPRECATED bool gridEnabled() const
void scale(qreal sx, qreal sy)
void cache()
Create cache image.
const_iterator constBegin() const
Q_DECL_DEPRECATED GridAnnotationPosition gridAnnotationPosition(QgsComposerMap::Border border) const
const T & at(int i) const
Q_DECL_DEPRECATED void setGridStyle(GridStyle style)
Sets coordinate grid style to solid or cross.
QMap< QgsComposerObject::DataDefinedProperty, QString > mDataDefinedNames
Map of data defined properties for the item to string name to use when exporting item to xml...
A item that forms part of a map composition.
void scale(double scaleFactor, const QgsPoint *c=nullptr)
Scale the rectangle around its center point.
#define Q_NOWARN_DEPRECATED_PUSH
bool contains(const QString &str, Qt::CaseSensitivity cs) const
Border
Enum for different frame borders.
bool hasCrsTransformEnabled() const
returns true if projections are enabled for this layer set
void setDpi(double dpi)
Set the dpi to be used in scale calculations.
const QgsDatumTransformStore & datumTransformStore() const
double mLastValidViewScaleFactor
Backup to restore item appearance if no view scale factor is available.
QGis::UnitType mapUnits() const
Get units of map's geographical coordinates - used for scale calculation.
virtual bool mapPositionFixed() const =0
Returns true if the annotation is attached to a fixed map position, or false if the annotation uses a...
void drawItems(QPainter *painter)
Draws the items from the stack on a specified painter.
QColor frameFillColor1() const
Retrieves the first fill color for the grid frame.
void mapRotationChanged(double newRotation)
Is emitted on rotation change to notify north arrow pictures.
static QgsPalLayerSettings fromLayer(QgsVectorLayer *layer)
A geometry is the spatial representation of a feature.
double intervalX() const
Gets the interval between grid lines in the x-direction.
Q_DECL_DEPRECATED QColor gridFrameFillColor1() const
Get first fill color for grid zebra frame.
QColor backgroundColor() const
Gets the background color for this item.
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect(double &x, double &y, double width, double height, double rotation) const
Calculates corner point after rotation and scaling.
Q_DECL_DEPRECATED double annotationFrameDistance() const
virtual void drawFrame(QPainter *p)
Draw black frame around item.
void updateCachedImage()
Forces an update of the cached map image.
void setAnnotationFont(const QFont &font)
Sets the font used for drawing grid annotations.
Q_DECL_DEPRECATED QPen gridPen() const
void setLayerStyleOverrides(const QMap< QString, QString > &overrides)
Set map of map layer style overrides (key: layer ID, value: style name) where a different style shoul...
Q_DECL_DEPRECATED const QgsMapRenderer * mapRenderer() const
A non GUI class for rendering a map layer set onto a QPainter.
AnnotationDirection
Direction of grid annotations.
bool _writeXML(QDomElement &itemElem, QDomDocument &doc) const
Writes parameter that are not subclass specific in document.
void setLayers(const QStringList &layers)
Set list of layer IDs for map rendering.
Enable layer transparency and blending effects.
AnnotationPosition annotationPosition(const BorderSide border) const
Gets the position for the grid annotations on a specified side of the map frame.
virtual double scaleFactor() const =0
Returns a scaling factor which should be applied to painters before rendering the item...
QColor framePenColor() const
Retrieves the color of the outline drawn in the grid frame.
double toDouble(bool *ok) const
virtual QgsExpressionContext * createExpressionContext() const override
Creates an expression context relating to the item's current state.
Q_DECL_DEPRECATED bool overviewCentered() const
Returns true if the extent is forced to center on the overview.
void setGridLineColor(const QColor &color)
Sets color of grid lines.
double crossLength() const
Retrieves the length of the cross segments drawn for the grid.
Q_DECL_DEPRECATED GridAnnotationDirection gridAnnotationDirection(QgsComposerMap::Border border) const
QString tr(const char *sourceText, const char *disambiguation, int n)
QMap< QString, QString > QgsStringMap
void setAnnotationDisplay(const DisplayMode display, const BorderSide border)
Sets what types of grid annotations should be drawn for a specified side of the map frame...
QList< const QgsComposerMap * > composerMapItems() const
Returns pointers to all composer maps in the scene.
AnnotationFormat
Format for displaying grid annotations.
QgsRectangle visibleExtent() const
Return the actual extent derived from requested extent that takes takes output image size into accoun...
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Q_DECL_DEPRECATED void zoomContent(int delta, double x, double y) override
Zoom content of map.
void addVariable(const QgsExpressionContextScope::StaticVariable &variable)
Adds a variable into the context scope.
void update(const QRectF &rect)
QgsComposition::AtlasMode atlasMode() const
Returns the current atlas mode of the composition.
DataDefinedProperty
Data defined properties for different item types.
Q_DECL_DEPRECATED void setGridPenColor(const QColor &c)
Sets the color of the grid pen.
virtual QString name() const =0
Return a provider name.
int readNumEntry(const QString &scope, const QString &key, int def=0, bool *ok=nullptr) const
void setWidth(double width)
void setCrossLength(const double length)
Sets the length of the cross segments drawn for the grid.
Vector graphics should not be cached and drawn as raster images.
double y() const
Get the y value of the point.
QgsMapLayer * mapLayer(const QString &theLayerId)
Retrieve a pointer to a loaded layer by id.
void setFlag(Flag flag, bool on=true)
Enable or disable a particular flag (other flags are not affected)
Q_DECL_DEPRECATED QColor annotationFontColor() const
Get font color for grid annotations.
An interface for annotation items which are drawn over a map.
QgsComposition::PlotStyle plotStyle() const
Q_DECL_DEPRECATED void setGridAnnotationPrecision(int p)
Sets coordinate precision for grid annotations.
Q_DECL_DEPRECATED QPainter::CompositionMode gridBlendMode() const
Returns the grid's blending mode.
Q_DECL_DEPRECATED GridFrameStyle gridFrameStyle() const
The QgsMapSettings class contains configuration for rendering of the map.
virtual bool enabled() const
Returns whether the item will be drawn.
bool _readXML(const QDomElement &itemElem, const QDomDocument &doc)
Reads parameter that are not subclass specific in document.
Q_DECL_DEPRECATED GridAnnotationFormat gridAnnotationFormat() const
static bool staticWillUseLayer(QgsVectorLayer *layer)
called to find out whether the layer is used for labeling
QDomElement toElement() const
void readFromLayer(QgsMapLayer *layer)
Store layer's active style information in the instance.
void zoomToExtent(const QgsRectangle &extent)
Zooms the map so that the specified extent is fully visible within the map item.
void setCapStyle(Qt::PenCapStyle style)
bool containsAdvancedEffects() const
Returns whether any items within the stack contain advanced effects, such as blending modes...
void storeCurrentLayerSet()
Stores the current layer set of the qgis mapcanvas in mLayerSet.
virtual void setFrameOutlineWidth(const double outlineWidth) override
Sets frame outline width.
void setColor(const QColor &color)
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores the state of the item stack in a DOM node.
Stores style information (renderer, transparency, labeling, diagrams etc.) applicable to a map layer...
const char * name() const
Q_DECL_DEPRECATED bool showGridAnnotation() const
void setFont(const QFont &font)
QString number(int n, int base)
void setOutputSize(QSize size)
Set the size of the resulting map image.
An individual overview which is drawn above the map content in a QgsComposerMap, and shows the extent...
QString id() const
Get this layer's unique ID, this ID is used to access this layer from map layer registry.
void setFrameSymbol(QgsFillSymbolV2 *symbol)
Sets the fill symbol used for drawing the overview extent.
double calculate(const QgsRectangle &mapExtent, int canvasWidth)
Calculate the scale denominator.
QgsFillSymbolV2 * frameSymbol()
Gets the fill symbol used for drawing the overview extent.
QVariant property(const char *name) const
void updateBoundingRect()
Updates the bounding rect of this item.
Q_DECL_DEPRECATED void setGridAnnotationFont(const QFont &f)
Sets font for grid annotations.
bool fromString(const QString &descrip)
int toInt(bool *ok) const
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect(double &x, double &y, double width, double height) const
Calculates corner point after rotation and scaling.
void fill(uint pixelValue)
bool hasAttribute(const QString &name) const
virtual void updateItem()
Updates item, with the possibility to do custom update for subclasses.
virtual void drawSelectionBoxes(QPainter *p)
Draws additional graphics on selected items.
void setRotation(double degrees)
Set the rotation of the resulting map image Units are clockwise degrees.
static QgsLineSymbolV2 * createSimple(const QgsStringMap &properties)
Create a line symbol with one symbol layer: SimpleLine with specified properties. ...
QPainter::CompositionMode blendMode
friend class QgsComposerMapOverview
void setPen(const QColor &color)
void setNewScale(double scaleDenominator, bool forceUpdate=true)
Sets new scale and changes only mExtent.
bool mFrame
True if item fram needs to be painted.
Whether vector selections should be shown in the rendered map.
void setAttribute(const QString &name, const QString &value)
void setMapUnits(QGis::UnitType u)
Set units of map's geographical coordinates - used for scale calculation.
double offsetY() const
Gets the offset for grid lines in the y-direction.
void layersChanged()
Called when layers are added or removed from the layer registry.
FrameStyle frameStyle() const
Gets the grid frame style.
double width() const
Width of the rectangle.
void setCacheUpdated(bool u=false)
int toInt(bool *ok, int base) const
QString qgsDoubleToString(double a, int precision=17)
void setYMinimum(double y)
Set the minimum y value.
bool useAdvancedEffects() const
Returns true if a composition should use advanced effects such as blend modes.
virtual void setEnabled(const bool enabled)
Controls whether the item will be drawn.
Q_DECL_DEPRECATED void setAnnotationFrameDistance(double d)
Sets distance between map frame and annotations.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setAnnotationFormat(const AnnotationFormat format)
Sets the format for drawing grid annotations.
bool readXML(const QDomElement &elem, const QDomDocument &doc) override
Sets the grid stack's state from a DOM document.
bool hideCoverage() const
Returns true if the atlas is set to hide the coverage layer.
bool containsWMSLayer() const
True if composer map renders a WMS layer.
Q_DECL_DEPRECATED GridStyle gridStyle() const
AnnotationPosition
Position for grid annotations.
const_iterator constEnd() const
double frameWidth() const
Gets the grid frame width.
void setCentered(const bool centered)
Sets whether the extent of the map is forced to center on the overview.
Q_DECL_DEPRECATED double gridIntervalY() const
Q_DECL_DEPRECATED bool atlasFixedScale() const
Returns true if the map uses a fixed scale when in atlas mode.
bool dataDefinedEvaluate(const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue, const QgsExpressionContext &context=QgsExpressionContext()) const
Evaluate a data defined property and return the calculated value.
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
QPaintDevice * device() const
void setAnnotationEnabled(const bool enabled)
Sets whether annotations should be shown for the grid.
virtual void refreshDataDefinedProperty(const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties, const QgsExpressionContext *context=nullptr) override
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...
GridStyle style() const
Gets the grid's style, which controls how the grid is drawn over the map's contents.
void setNewExtent(const QgsRectangle &extent)
Sets new extent for the map.
void translate(qreal dx, qreal dy)
Q_DECL_DEPRECATED void setGridPen(const QPen &p)
Sets the pen to draw composer grid.
void setWidthF(qreal width)
Q_DECL_DEPRECATED void setGridFrameFillColor2(const QColor &c)
Sets second fill color for grid zebra frame.
Q_DECL_DEPRECATED void setGridIntervalX(double interval)
Sets coordinate interval in x-direction for composergrid.
void drawText(const QPointF &position, const QString &text)
bool hasBackground() const
Whether this item has a Background or not.
int layerTransparency() const
Returns the current transparency for the vector layer.
Q_DECL_DEPRECATED double gridOffsetY() const
Q_DECL_DEPRECATED bool imageSizeConsideringRotation(double &width, double &height) const
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the give...
void moveContent(double dx, double dy) override
Move content of map.
An individual grid which is drawn above the map content in a QgsComposerMap.
PropertyValueType
Specifies whether the value returned by a function should be the original, user set value...
QPainter::CompositionMode shapeBlendMode
AnnotationDirection annotationDirection(const BorderSide border) const
Gets the direction for drawing frame annotations.
void setOutputImageFormat(QImage::Format format)
sets format of internal QImage
Q_DECL_DEPRECATED void sizeChangedByRotation(double &width, double &height)
Calculates width / height of the bounding box of a rotated rectangle.
void setColor(const QColor &color)
Single scope for storing variables and functions for use within a QgsExpressionContext.
Q_DECL_DEPRECATED void setOverviewFrameMapSymbol(QgsFillSymbolV2 *symbol)
Q_DECL_DEPRECATED void setGridFramePenSize(double w)
Set grid frame pen thickness.
void setGridLineWidth(const double width)
Sets width of grid lines.
virtual QPointF relativePosition() const
Returns the relative position of the annotation, if it is not attached to a fixed map position...
static QPainter::CompositionMode getCompositionMode(BlendMode blendMode)
Returns a QPainter::CompositionMode corresponding to a BlendMode.
PreviewMode
Preview style.
A class to represent a point.
void setFrameWidth(const double width)
Sets the grid frame width.
bool annotationEnabled() const
Gets whether annotations are shown for the grid.
void setAnnotationFontColor(const QColor &color)
Sets the font color used for drawing grid annotations.
void prepareGeometryChange()
Graphics scene for map printing.
int annotationPrecision() const
Returns the coordinate precision for grid annotations.
QPainter::CompositionMode featureBlendMode() const
Returns the current blending mode for features.
This class tracks map layers that are currently loaded and provides a means to fetch a pointer to a m...
const QgsMapSettings & mapSettings() const
Return setting of QGIS map canvas.
QList< QgsMapLayer * > mapLayersByName(const QString &layerName)
Retrieve a pointer to a loaded layer by name.
static QgsGeometry * fromPoint(const QgsPoint &point)
Creates a new geometry from a QgsPoint object.
Object representing map window.
Enable drawing of vertex markers for layers in editing mode.
QDomText createTextNode(const QString &value)
static void rotate(const double angle, double &x, double &y)
Rotates a point / vector around the origin.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget) override
Reimplementation of QCanvasItem::paint - draw on canvas.
void renderModeUpdateCachedImage()
Updates the cached map image if the map is set to Render mode.
void draw(QPainter *painter, const QgsRectangle &extent, QSizeF size, double dpi, double *forceWidthScale=nullptr)
Draw to paint device.
void setFrameFillColor1(const QColor &color)
Sets the first fill color used for the grid frame.
void setFramePenColor(const QColor &color)
Sets the color of the outline drawn in the grid frame.
void setAnnotationPosition(const AnnotationPosition position, const BorderSide border)
Sets the position for the grid annotations on a specified side of the map frame.
virtual ~QgsComposerMap()
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
Q_DECL_DEPRECATED void setGridAnnotationDirection(GridAnnotationDirection d, QgsComposerMap::Border border)
bool readXML(const QDomElement &itemElem, const QDomDocument &doc) override
Sets state from Dom document.
Calculates scale for a given combination of canvas size, map extent, and monitor dpi.
QVariant fromValue(const T &value)
Q_DECL_DEPRECATED void setCrossLength(double l)
Sets length of the cross segments (if grid style is cross)
double xMaximum() const
Get the x maximum value (right side of rectangle)
double annotationFrameDistance() const
Gets the distance between the map frame and annotations.
virtual void setFrameOutlineWidth(const double outlineWidth)
Sets frame outline width.
QPointF mapToItemCoords(QPointF mapCoords) const
Transforms map coordinates to item coordinates (considering rotation and move offset) ...
QgsComposerMapOverview * overview(const QString &overviewId) const
Returns a reference to an overview within the stack.
double offsetX() const
Gets the offset for grid lines in the x-direction.
#define Q_NOWARN_DEPRECATED_POP
const Key key(const T &value) const
QgsComposition * mComposition
void layerStyleOverridesChanged()
Emitted when layer style overrides are changed...
void setBackgroundColor(const QColor &color)
Set the background color of the map.
const T & at(int i) const
QVariant value(const QString &key, const QVariant &defaultValue) const
AnnotationFormat annotationFormat() const
Gets the format for drawing grid annotations.
virtual void refreshDataDefinedProperty(const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties, const QgsExpressionContext *context=nullptr) override
virtual QgsCoordinateReferenceSystem mapPositionCrs() const
Returns the CRS of the map position, or an invalid CRS if the annotation does not have a fixed map po...
QRectF boundingRect() const
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
void drawImage(const QRectF &target, const QImage &image, const QRectF &source, QFlags< Qt::ImageConversionFlag > flags)
void setClipRect(const QRectF &rectangle, Qt::ClipOperation operation)
int numberExportLayers() const override
Get the number of layers that this item requires for exporting as layers.
void setBackgroundColor(const QColor &backgroundColor)
Sets the background color for this item.
Q_DECL_DEPRECATED void setOverviewInverted(bool inverted)
Sets the overview's inversion mode.
int mCurrentExportLayer
The layer that needs to be exported.
void setFlags(const QgsMapSettings::Flags &flags)
Set combination of flags that will be used for rendering.
const QgsComposition * composition() const
Returns the composition the item is attached to.
virtual QString displayName() const override
Get item display name.
virtual bool showItem() const =0
Returns true if the annotation should be shown.
void writeXml(QDomElement &styleElement) const
Write style configuration (for project file writing)
PreviewMode previewMode() const
void setYMaximum(double y)
Set the maximum y value.
virtual void drawBackground(QPainter *p)
Draw background.
bool inverted() const
Returns whether the overview frame is inverted, ie, whether the shaded area is drawn outside the exte...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
Q_DECL_DEPRECATED void setShowGridAnnotation(bool show)
Sets flag if grid annotation should be shown.
static QgsProject * instance()
access to canonical QgsProject instance
QDomElement firstChildElement(const QString &tagName) const
void requestedExtent(QgsRectangle &extent) const
Calculates the extent to request and the yShift of the top-left point in case of rotation.
Q_DECL_DEPRECATED QColor gridFrameFillColor2() const
Get second fill color for grid zebra frame.
Class for storing a coordinate reference system (CRS)
void setExtent(const QgsRectangle &rect)
Set coordinates of the rectangle which should be rendered.
void setMapRotation(double r)
Sets rotation for the map - this does not affect the composer item shape, only the way the map is dra...
virtual void setSceneRect(const QRectF &rectangle)
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size un...
void setAnnotationPrecision(const int precision)
Sets the coordinate precision for grid annotations.
Q_DECL_DEPRECATED void setGridAnnotationPosition(GridAnnotationPosition p, QgsComposerMap::Border border)
void setIntervalY(const double interval)
Sets the interval between grid lines in the y-direction.
const QMap< QString, QgsMapLayer * > & mapLayers()
Retrieve the mapLayers collection (mainly intended for use by projection)
QgsComposerMap(QgsComposition *composition, int x, int y, int width, int height)
Constructor.
Flags flags() const
Return combination of flags used for rendering.
void translate(const QPointF &offset)
void setInverted(const bool inverted)
Sets whether the overview frame is inverted, ie, whether the shaded area is drawn outside the extent ...
double xMinimum() const
Get the x minimum value (left side of rectangle)
int frameMapId() const
Returns id of source map.
Q_DECL_DEPRECATED void setAtlasFixedScale(bool fixed)
Set to true if the map should use a fixed scale when in atlas mode.
void setFrameMap(const int mapId)
Sets overview frame map.
void resize(double dx, double dy)
Resizes an item in x- and y direction (canvas coordinates)
void setSceneRect(const QRectF &rectangle) override
Sets new scene rectangle bounds and recalculates hight and extent.
Q_DECL_DEPRECATED void setRotation(double r) override
Sets rotation for the map - this does not affect the composer item shape, only the way the map is dra...
QgsVectorLayer * coverageLayer() const
Returns the coverage layer used for the atlas features.
QgsAtlasComposition & atlasComposition()
Q_DECL_DEPRECATED double crossLength()
double yMaximum() const
Get the y maximum value (top side of rectangle)
int indexOf(const QRegExp &rx, int from) const
double toDouble(bool *ok) const
static QColor decodeColor(const QString &str)
Q_DECL_DEPRECATED void setGridOffsetX(double offset)
Sets x-coordinate offset for composer grid.
Q_DECL_DEPRECATED bool overviewInverted() const
Returns true if the overview frame is inverted.
iterator insert(const Key &key, const T &value)
Enable vector simplification and other rendering optimizations.
QPainter::CompositionMode shadowBlendMode
QStringList presetVisibleLayers(const QString &name) const
Returns the list of layer IDs that should be visible for the specified preset.
QgsRasterDataProvider * dataProvider()
Returns the data provider.
Q_DECL_DEPRECATED QgsFillSymbolV2 * overviewFrameMapSymbol()
bool hasFrame() const
Whether this item has a frame or not.
bool containsAdvancedEffects() const
True if composer map contains layers with blend modes or flattened layers for vectors.
Q_DECL_DEPRECATED void setOverviewBlendMode(QPainter::CompositionMode blendMode)
Sets the overview's blending mode.
Q_DECL_DEPRECATED void setGridLineSymbol(QgsLineSymbolV2 *symbol)
Q_DECL_DEPRECATED void setGridPenWidth(double w)
Sets width of grid pen.
void setAtlasDriven(bool enabled)
Sets whether the map extent will follow the current atlas feature.
const_iterator constEnd() const
QDomElement createElement(const QString &tagName)
void setFrameFillColor2(const QColor &color)
Sets the second fill color used for the grid frame.
const_iterator constBegin() const
QStringList layers() const
Get list of layer IDs for map rendering The layers are stored in the reverse order of how they are re...
void setLayerStyleOverrides(const QMap< QString, QString > &overrides)
Setter for stored overrides of styles for layers.
void setFrameStyle(const FrameStyle style)
Sets the grid frame style.
double mapRotation(QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue) const
Returns the rotation used for drawing the map within the composer item.
Q_DECL_DEPRECATED void setGridOffsetY(double offset)
Sets y-coordinate offset for composer grid.
void setPreviewMode(PreviewMode m)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QRectF boundingRect() const override
In case of annotations, the bounding rectangle can be larger than the map item rectangle.
QgsVisibilityPresetCollection * visibilityPresetCollection()
Returns pointer to the project's visibility preset collection.
bool writeXML(QDomElement &elem, QDomDocument &doc) const override
Stores state in Dom node.
Represents a vector layer which manages a vector based data sets.
void storeCurrentLayerStyles()
Stores the current layer styles into style overrides.
Q_DECL_DEPRECATED int gridAnnotationPrecision() const
int compare(const QString &other) const
Q_DECL_DEPRECATED void setGridFrameStyle(GridFrameStyle style)
Set grid frame style (NoGridFrame or Zebra)
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QPainter::CompositionMode blendMode() const
Returns the item's composition blending mode.
Q_DECL_DEPRECATED QPainter::CompositionMode overviewBlendMode() const
Returns the overview's blending mode.
void renderSynchronously()
Render the map synchronously in this thread.
void setIntervalX(const double interval)
Sets the interval between grid lines in the x-direction.
QString id() const
Get item's id (which is not necessarly unique)
const QgsRectangle * currentMapExtent() const
Returns a pointer to the current map extent, which is either the original user specified extent or th...
const QgsCoordinateReferenceSystem & destinationCrs() const
returns CRS of destination coordinate reference system
QgsComposerMapGrid * grid(const QString &gridId) const
Returns a reference to a grid within the stack.
QPolygonF transformedMapPolygon() const
Returns extent that considers rotation and shift with mOffsetX / mOffsetY.
Q_DECL_DEPRECATED double gridIntervalX() const
bool readXML(const QDomElement &elem, const QDomDocument &doc) override
Sets the overview stack's state from a DOM document.
void setOffsetX(const double offset)
Sets the offset for grid lines in the x-direction.
Q_DECL_DEPRECATED bool imageSizeConsideringRotation(double &width, double &height, double rotation) const
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the give...
Q_DECL_DEPRECATED void setGridBlendMode(QPainter::CompositionMode blendMode)
Sets the grid's blending mode.
double x() const
Get the x value of the point.
Q_DECL_DEPRECATED void setOverviewFrameMap(int mapId)
Sets overview frame map.
void setBlendMode(const QPainter::CompositionMode blendMode)
Sets the blending mode used for drawing the overview.
void setXMinimum(double x)
Set the minimum x value.
double framePenSize() const
Retrieves the width of the outline drawn in the grid frame.
QPainter::CompositionMode blendMode() const
Retrieves the blending mode used for drawing the overview.
QgsComposerMapGrid * grid()
Returns the map item's first grid.
Q_DECL_DEPRECATED void setGridFramePenColor(const QColor &c)
Sets pen color for grid frame.
void setAnnotationFrameDistance(const double distance)
Sets the distance between the map frame and annotations.
Q_DECL_DEPRECATED void sizeChangedByRotation(double &width, double &height, double rotation)
Calculates width / height of the bounding box of a rotated rectangle.
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
double height() const
Height of the rectangle.
int size() const
Returns the number of items in the stack.
void setCrsTransformEnabled(bool enabled)
sets whether to use projections for this layer set
QDomNode at(int index) const
const T value(const Key &key) const
Base class for raster data providers.
uint toUInt(bool *ok, int base) const
int remove(const Key &key)
Q_DECL_DEPRECATED double gridOffsetX() const
QList< Key > uniqueKeys() const
QgsComposerMapOverview * overview()
Returns the map item's first overview.
Q_DECL_DEPRECATED double gridFramePenSize() const
A collection of overviews which are drawn above the map content in a QgsComposerMap.