42 #include <QGraphicsScene>
43 #include <QGraphicsView>
53 , mEvaluatedMapRotation( 0 )
54 , mKeepLayerSet( false )
55 , mKeepLayerStyles( false )
56 , mUpdatesEnabled( true )
58 , mDrawCanvasItems( true )
59 , mAtlasDriven( false )
60 , mAtlasScalingMode( Auto )
61 , mAtlasMargin( 0.10 )
69 mCurrentRectangle =
rect();
72 mCacheUpdated =
false;
98 , mEvaluatedMapRotation( 0 )
99 , mKeepLayerSet( false )
100 , mKeepLayerStyles( false )
101 , mUpdatesEnabled( true )
103 , mDrawCanvasItems( true )
104 , mAtlasDriven( false )
105 , mAtlasScalingMode( Auto )
106 , mAtlasMargin( 0.10 )
115 mCurrentRectangle =
rect();
121 void QgsComposerMap::init()
139 void QgsComposerMap::updateToolTip()
144 void QgsComposerMap::adjustExtentToItemShape(
double itemWidth,
double itemHeight,
QgsRectangle& extent )
const
146 double itemWidthHeightRatio = itemWidth / itemHeight;
147 double newWidthHeightRatio = extent.
width() / extent.
height();
149 if ( itemWidthHeightRatio <= newWidthHeightRatio )
152 double newHeight = extent.
width() / itemWidthHeightRatio;
153 double deltaHeight = newHeight - extent.
height();
160 double newWidth = itemWidthHeightRatio * extent.
height();
161 double deltaWidth = newWidth - extent.
width();
169 delete mOverviewStack;
177 Q_UNUSED( forceWidthScale );
210 jobMapSettings.
setRotation( mEvaluatedMapRotation );
219 ( layerIdx >= 0 && layerIdx < theLayerSet.length() )
220 ?
QStringList( theLayerSet[ theLayerSet.length() - layerIdx - 1 ] )
248 return jobMapSettings;
266 if ( horizontalVScaleFactor < 0 )
276 int w = widthMM * horizontalVScaleFactor;
277 int h = heightMM * horizontalVScaleFactor;
280 if ( w > 5000 || h > 5000 )
285 h = w * heightMM / widthMM;
290 w = h * widthMM / heightMM;
294 mCacheImage =
QImage( w, h, QImage::Format_ARGB32 );
309 mCacheImage.
fill(
QColor( 255, 255, 255, 0 ).rgba() );
316 mCacheUpdated =
true;
342 QFont messageFont(
"", 12 );
343 painter->
setFont( messageFont );
345 painter->
drawText( thisPaintRect,
tr(
"Map will be printed here" ) );
356 double imagePixelWidth = mCacheImage.
width();
361 painter->
translate( mXOffset, mYOffset );
362 painter->
scale( scale, scale );
381 if ( !thePaintDevice )
387 if ( shouldDrawPart( Background ) )
397 painter->
translate( mXOffset, mYOffset );
399 double dotsPerMM = thePaintDevice->
logicalDpiX() / 25.4;
400 theSize *= dotsPerMM;
401 painter->
scale( 1 / dotsPerMM, 1 / dotsPerMM );
414 if ( shouldDrawPart( OverviewMapExtent ) &&
419 if ( shouldDrawPart( Grid ) &&
424 if ( shouldDrawPart( Frame ) )
428 if (
isSelected() && shouldDrawPart( SelectionBoxes ) )
440 + layersToRender().
length()
448 bool QgsComposerMap::shouldDrawPart( PartType part )
const
460 if ( SelectionBoxes == part )
475 if ( OverviewMapExtent == part )
486 if ( Background == part )
497 mCacheUpdated =
false;
504 if ( mPreviewMode ==
Render )
535 evalContext = scopedContext.
data();
550 if ( renderLayerSet.
isEmpty() )
554 renderLayerSet = mLayerSet;
564 renderLayerSet.
clear();
573 renderLayerSet << layer->
id();
586 if ( removeAt != -1 )
588 renderLayerSet.
removeAt( removeAt );
593 return renderLayerSet;
607 return mLayerStyleOverrides;
614 calculator.
setDpi( 25.4 );
631 transformShift( dx, dy );
659 double zoomFactor = settings.
value(
"/qgis/zoom_factor", 2.0 ).
toDouble();
660 zoomFactor = delta > 0 ? zoomFactor : 1 / zoomFactor;
695 centerX = mapX + ( centerX - mapX ) * ( 1.0 / factor );
696 centerY = mapY + ( centerY - mapY ) * ( 1.0 / factor );
700 double newIntervalX, newIntervalY;
724 calculator.
setDpi( 25.4 );
726 mExtent.
scale( scaleRatio );
740 double w = rectangle.
width();
741 double h = rectangle.
height();
747 double newHeight = mExtent.
width() * h / w;
752 mCacheUpdated =
false;
786 double newWidthHeightRatio = newExtent.
width() / newExtent.
height();
788 if ( currentWidthHeightRatio < newWidthHeightRatio )
791 double newHeight = newExtent.
width() / currentWidthHeightRatio;
792 double deltaHeight = newHeight - newExtent.
height();
799 double newWidth = currentWidthHeightRatio * newExtent.
height();
800 double deltaWidth = newWidth - newExtent.
width();
814 mCacheUpdated =
false;
822 if ( mAtlasFeatureExtent != extent )
829 double newWidthHeightRatio = newExtent.
width() / newExtent.
height();
831 if ( currentWidthHeightRatio < newWidthHeightRatio )
834 double newHeight = newExtent.
width() / currentWidthHeightRatio;
835 double deltaHeight = newHeight - newExtent.
height();
839 else if ( currentWidthHeightRatio >= newWidthHeightRatio )
842 double newWidth = currentWidthHeightRatio * newExtent.
height();
843 double deltaWidth = newWidth - newExtent.
width();
848 mAtlasFeatureExtent = newExtent;
854 mCacheUpdated =
false;
868 return &mAtlasFeatureExtent;
884 return &mAtlasFeatureExtent;
895 double currentScaleDenominator =
scale();
897 if ( scaleDenominator == currentScaleDenominator || scaleDenominator == 0 )
902 double scaleRatio = scaleDenominator / currentScaleDenominator;
912 calculator.
setDpi( 25.4 );
913 scaleRatio = scaleDenominator / calculator.
calculate( mExtent,
rect().width() );
914 mExtent.
scale( scaleRatio );
917 mCacheUpdated =
false;
948 mEvaluatedMapRotation = mMapRotation;
966 evalContext = scopedContext.
data();
973 bool useDdXMin =
false;
974 bool useDdXMax =
false;
975 bool useDdYMin =
false;
976 bool useDdYMax =
false;
987 if ( ok && !exprVal.
isNull() )
998 if ( ok && !exprVal.
isNull() )
1009 if ( ok && !exprVal.
isNull() )
1020 if ( ok && !exprVal.
isNull() )
1034 double newWidthHeightRatio = newExtent.
width() / newExtent.
height();
1036 if ( currentWidthHeightRatio < newWidthHeightRatio )
1039 double newHeight = newExtent.
width() / currentWidthHeightRatio;
1040 double deltaHeight = newHeight - newExtent.
height();
1047 double newWidth = currentWidthHeightRatio * newExtent.
height();
1048 double deltaWidth = newWidth - newExtent.
width();
1062 double scaleD = exprVal.
toDouble( &ok );
1064 if ( ok && !exprVal.
isNull() )
1071 if ( useDdXMax || useDdXMin || useDdYMax || useDdYMin )
1075 if ( useDdXMin && !useDdXMax )
1081 else if ( !useDdXMin && useDdXMax )
1087 if ( useDdYMin && !useDdYMax )
1093 else if ( !useDdYMin && useDdYMax )
1113 double rotationD = exprVal.
toDouble( &ok );
1115 if ( ok && !exprVal.
isNull() )
1117 mapRotation = rotationD;
1121 if ( mEvaluatedMapRotation != mapRotation )
1131 if ( !mUpdatesEnabled )
1150 for ( ; layer_it != layers.
constEnd(); ++layer_it )
1156 if ( currentRasterLayer )
1159 if (( rasterProvider = currentRasterLayer->
dataProvider() ) )
1161 if ( rasterProvider->
name() ==
"wms" )
1195 for ( ; layer_it != layers.
constEnd(); ++layer_it )
1200 if ( currentLayer->
blendMode() != QPainter::CompositionMode_SourceOver )
1206 if ( currentVectorLayer )
1212 if ( currentVectorLayer->
featureBlendMode() != QPainter::CompositionMode_SourceOver )
1221 if (( layerSettings.
blendMode != QPainter::CompositionMode_SourceOver ) ||
1236 void QgsComposerMap::connectUpdateSlot()
1240 if ( layerRegistry )
1258 if ( mPreviewMode ==
Cache )
1260 composerMapElem.
setAttribute(
"previewMode",
"Cache" );
1262 else if ( mPreviewMode ==
Render )
1264 composerMapElem.
setAttribute(
"previewMode",
"Render" );
1268 composerMapElem.
setAttribute(
"previewMode",
"Rectangle" );
1271 if ( mKeepLayerSet )
1273 composerMapElem.
setAttribute(
"keepLayerSet",
"true" );
1277 composerMapElem.
setAttribute(
"keepLayerSet",
"false" );
1280 if ( mDrawCanvasItems )
1282 composerMapElem.
setAttribute(
"drawCanvasItems",
"true" );
1286 composerMapElem.
setAttribute(
"drawCanvasItems",
"false" );
1303 for ( ; layerIt != mLayerSet.
constEnd(); ++layerIt )
1313 if ( mKeepLayerStyles )
1317 for ( ; styleIt != mLayerStyleOverrides.
constEnd(); ++styleIt )
1333 mGridStack->
writeXML( composerMapElem, doc );
1336 mOverviewStack->
writeXML( composerMapElem, doc );
1341 atlasElem.
setAttribute(
"scalingMode", mAtlasScalingMode );
1346 return _writeXML( composerMapElem, doc );
1357 if ( idRead !=
"not found" )
1359 mId = idRead.
toInt();
1366 if ( previewMode ==
"Cache" )
1368 mPreviewMode =
Cache;
1370 else if ( previewMode ==
"Render" )
1381 if ( extentNodeList.
size() > 0 )
1384 double xmin, xmax, ymin, ymax;
1400 if ( keepLayerSetFlag.
compare(
"true", Qt::CaseInsensitive ) == 0 )
1402 mKeepLayerSet =
true;
1406 mKeepLayerSet =
false;
1409 QString drawCanvasItemsFlag = itemElem.
attribute(
"drawCanvasItems",
"true" );
1410 if ( drawCanvasItemsFlag.
compare(
"true", Qt::CaseInsensitive ) == 0 )
1412 mDrawCanvasItems =
true;
1416 mDrawCanvasItems =
false;
1419 mLayerStyleOverrides.
clear();
1424 if ( layerSetNodeList.
size() > 0 )
1429 for (
int i = 0; i < layerIdNodeList.
size(); ++i )
1432 layerSet << layerIdElement.
text();
1439 mKeepLayerStyles = layerStylesNodeList.
size() > 0;
1440 if ( mKeepLayerStyles )
1444 for (
int i = 0; i < layerStyleNodeList.
size(); ++i )
1449 style.
readXml( layerStyleElement );
1455 mNumCachedLayers = 0;
1456 mCacheUpdated =
false;
1459 mOverviewStack->
readXML( itemElem, doc );
1462 mGridStack->
readXML( itemElem, doc );
1468 if ( mGridStack->
size() == 0 && gridNodeList.
size() > 0 )
1488 if ( gridSymbolElem.
isNull() )
1499 lineSymbol = QgsSymbolLayerV2Utils::loadSymbol<QgsLineSymbolV2>( gridSymbolElem );
1505 if ( annotationNodeList.
size() > 0 )
1519 QFont annotationFont;
1526 mGridStack->
addGrid( mapGrid );
1531 if ( !overviewFrameElem.
isNull() )
1542 if ( !overviewFrameSymbolElem.
isNull() )
1544 fillSymbol = QgsSymbolLayerV2Utils::loadSymbol<QgsFillSymbolV2>( overviewFrameSymbolElem );
1552 if ( atlasNodeList.
size() > 0 )
1555 mAtlasDriven = ( atlasElem.
attribute(
"atlasDriven",
"0" ) !=
"0" );
1558 mAtlasScalingMode = ( atlasElem.
attribute(
"fixedScale",
"0" ) !=
"0" ) ?
Fixed :
Auto;
1569 if ( composerItemList.
size() > 0 )
1591 if ( mKeepLayerStyles )
1601 if ( overrides == mLayerStyleOverrides )
1604 mLayerStyleOverrides = overrides;
1611 mLayerStyleOverrides.
clear();
1612 Q_FOREACH (
const QString& layerID, mLayerSet )
1623 void QgsComposerMap::syncLayerSet()
1625 if ( mLayerSet.
size() < 1 )
1632 if ( mKeepLayerSet )
1641 for (
int i = mLayerSet.
size() - 1; i >= 0; --i )
1643 if ( !currentLayerSet.
contains( mLayerSet.
at( i ) ) )
1645 mLayerStyleOverrides.
remove( mLayerSet.
at( i ) );
1653 if ( mGridStack->
size() < 1 )
1658 return mGridStack->
grid( 0 );
1970 if ( mOverviewStack->
size() < 1 )
1975 return mOverviewStack->
overview( 0 );
1997 return mCurrentRectangle;
2005 double topExtension = 0.0;
2006 double rightExtension = 0.0;
2007 double bottomExtension = 0.0;
2008 double leftExtension = 0.0;
2013 topExtension = qMax( topExtension, frameExtension );
2014 rightExtension = qMax( rightExtension, frameExtension );
2015 bottomExtension = qMax( bottomExtension, frameExtension );
2016 leftExtension = qMax( leftExtension, frameExtension );
2018 rectangle.
setLeft( rectangle.
left() - leftExtension );
2020 rectangle.
setTop( rectangle.
top() - topExtension );
2022 if ( rectangle != mCurrentRectangle )
2025 mCurrentRectangle = rectangle;
2037 double dx = mXOffset;
2038 double dy = mYOffset;
2039 transformShift( dx, dy );
2045 double dx = mXOffset;
2046 double dy = mYOffset;
2050 transformShift( dx, dy );
2062 if ( mEvaluatedMapRotation == 0 )
2078 dx = rotationPoint.x() - extent.
xMinimum();
2079 dy = rotationPoint.y() - extent.
yMaximum();
2081 poly <<
QPointF( rotationPoint.x() - dx, rotationPoint.y() - dy );
2084 dx = rotationPoint.
x() - extent.
xMaximum();
2085 dy = rotationPoint.y() - extent.
yMaximum();
2087 poly <<
QPointF( rotationPoint.x() - dx, rotationPoint.y() - dy );
2090 dx = rotationPoint.
x() - extent.
xMaximum();
2091 dy = rotationPoint.y() - extent.
yMinimum();
2093 poly <<
QPointF( rotationPoint.x() - dx, rotationPoint.y() - dy );
2096 dx = rotationPoint.
x() - extent.
xMinimum();
2097 dy = rotationPoint.y() - extent.
yMinimum();
2099 poly <<
QPointF( rotationPoint.x() - dx, rotationPoint.y() - dy );
2119 return tr(
"Map %1" ).
arg( mId );
2125 if ( mEvaluatedMapRotation == 0 )
2132 mapPolygon( newExtent, poly );
2162 if ( extentWidth <= 0 )
2188 evalContext = scopedContext.
data();
2199 refreshMapExtents( evalContext );
2208 mCacheUpdated =
false;
2286 void QgsComposerMap::transformShift(
double& xShift,
double& yShift )
const
2289 double dxScaled = xShift * mmToMapUnits;
2290 double dyScaled = - yShift * mmToMapUnits;
2301 if ( mapPoly.
size() < 1 )
2308 double dx = mapCoords.
x() - rotationPoint.
x();
2309 double dy = mapCoords.
y() - rotationPoint.
y();
2311 QgsPoint backRotatedCoords( rotationPoint.
x() + dx, rotationPoint.
y() + dy );
2314 double xItem =
rect().
width() * ( backRotatedCoords.x() - unrotatedExtent.xMinimum() ) / unrotatedExtent.width();
2315 double yItem =
rect().
height() * ( 1 - ( backRotatedCoords.y() - unrotatedExtent.yMinimum() ) / unrotatedExtent.height() );
2316 return QPointF( xItem, yItem );
2326 if ( !mMapCanvas || !mDrawCanvasItems )
2332 if ( itemList.
size() < 1 )
2338 for (
int i = itemList.
size() - 1; i >= 0; --i )
2340 currentItem = itemList.
at( i );
2342 if ( !currentItem || currentItem->
data( 0 ).
toString() !=
"AnnotationItem" )
2346 drawCanvasItem( currentItem, painter, itemStyle );
2352 if ( !item || !mMapCanvas || !item->
isVisible() )
2361 double scaleFactor = 1.0 / mMapCanvas->
logicalDpiX() * 25.4;
2363 double itemX, itemY;
2367 QPointF mapPos = composerMapPosForItem( item );
2376 QPointF mapPos = composerMapPosForItem( parent );
2378 itemX = mapPos.
x() + ( itemScenePos.
x() - parentScenePos.
x() ) * scaleFactor;
2379 itemY = mapPos.
y() + ( itemScenePos.
y() - parentScenePos.
y() ) * scaleFactor;
2383 painter->
scale( scaleFactor, scaleFactor );
2386 item->
setData( 1,
"composer" );
2387 item->
paint( painter, itemStyle, 0 );
2394 if ( !item || !mMapCanvas )
2408 double mapX = itemScenePos.
x() / graphicsSceneRect.
width() * mapRendererExtent.
width() + mapRendererExtent.
xMinimum();
2409 double mapY = mapRendererExtent.
yMaximum() - itemScenePos.
y() / graphicsSceneRect.
height() * mapRendererExtent.
height();
2429 for ( ; mapIt != mapList.
constEnd(); ++mapIt )
2431 if (( *mapIt )->id() > maxId )
2433 maxId = ( *mapIt )->id();
2466 mAtlasDriven = enabled;
2472 refreshMapExtents();
2478 return mAtlasScalingMode ==
Fixed;
2484 mAtlasScalingMode = fixed ?
Fixed :
Auto;
2494 double margin = mAtlasMargin;
2500 double ddMargin = exprVal.
toDouble( &ok );
2502 if ( ok && !exprVal.
isNull() )
2505 margin = ddMargin / 100;
2512 return mAtlasMargin;
Q_DECL_DEPRECATED void setGridFrameWidth(double w)
Set grid frame width.
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.
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)
QgsComposition::AtlasMode atlasMode() const
Returns the current atlas mode of the composition.
QDomNodeList elementsByTagName(const QString &tagname) const
Single variable definition for use within a QgsExpressionContextScope.
const QgsDatumTransformStore & datumTransformStore() const
QColor frameFillColor1() const
Retrieves the first fill color for the grid frame.
void draw(QPainter *painter, const QgsRectangle &extent, const QSizeF &size, double dpi, double *forceWidthScale=0)
Draw to paint device.
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...
void setDestinationCrs(const QgsCoordinateReferenceSystem &crs)
sets destination coordinate reference system
A rectangle specified with double values.
Base class for all map layer types.
void setDotsPerMeterX(int x)
void setDotsPerMeterY(int y)
Job implementation that renders everything sequentially using a custom painter.
void setAnnotationDirection(const AnnotationDirection direction, const BorderSide border)
Sets the direction for drawing frame annotations.
virtual void refreshDataDefinedProperty(const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties, const QgsExpressionContext *context=0) override
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...
double intervalX() const
Gets the interval between grid lines in the x-direction.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blending mode used for drawing the grid.
Q_DECL_DEPRECATED GridAnnotationDirection gridAnnotationDirection(QgsComposerMap::Border border) const
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 objects's current state.
Q_DECL_DEPRECATED void setOverviewCentered(bool centered)
Set the overview's centering mode.
void setLineSymbol(QgsLineSymbolV2 *symbol)
Sets the line symbol used for drawing grid lines.
GridStyle
Grid drawing style.
bool containsWMSLayer() const
True if composer map renders a WMS layer.
QgsComposerMapGrid * grid(const QString &gridId) const
Returns a reference to a grid within the stack.
QList< QGraphicsItem * > items() const
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)=0
Q_DECL_DEPRECATED void setGridAnnotationFormat(GridAnnotationFormat f)
Q_DECL_DEPRECATED void setGridFrameFillColor1(const QColor &c)
Sets first fill color for grid zebra frame.
bool containsAdvancedEffects() const
Returns whether any items within the stack contain advanced effects, such as blending modes...
void setRenderHint(RenderHint hint, bool on)
Q_DECL_DEPRECATED double gridIntervalX() const
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.
double mapUnitsToMM() const
Returns the conversion factor map units -> mm.
bool hideCoverage() const
Returns true if the atlas is set to hide the coverage layer.
Q_DECL_DEPRECATED void setGridEnabled(bool enabled)
Enables a coordinate grid that is shown on top of this composermap.
const QgsLineSymbolV2 * lineSymbol() const
Gets the line symbol used for drawing grid lines.
Q_DECL_DEPRECATED double gridFramePenSize() const
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.
int size() const
Returns the number of items in the stack.
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.
void setData(int key, const QVariant &value)
double yMaximum() const
Get the y maximum value (top side of rectangle)
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.
void requestedExtent(QgsRectangle &extent) const
Calculates the extent to request and the yShift of the top-left point in case of rotation.
QMap< QString, QString > presetStyleOverrides(const QString &name)
Get layer style overrides (for QgsMapSettings) of the visible layers for given preset.
Q_DECL_DEPRECATED QColor gridFrameFillColor1() const
Get first fill color for grid zebra frame.
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()
const QgsMapSettings & mapSettings() const
Return setting of QGIS map canvas.
QPainter::CompositionMode bufferBlendMode
A collection of grids which is drawn above the map content in a QgsComposerMap.
FrameStyle
Style for grid frame.
QStringList layerSet() const
Getter for stored layer set that is used if mKeepLayerSet is true.
Q_DECL_DEPRECATED void setAnnotationFontColor(const QColor &c)
Sets font color for grid annotations.
void scale(qreal sx, qreal sy)
void cache()
Create cache image.
Q_DECL_DEPRECATED bool showGridAnnotation() const
const_iterator constBegin() const
bool centered() const
Returns whether the extent of the map is forced to center on the overview.
const T & at(int i) const
Q_DECL_DEPRECATED void setGridStyle(GridStyle style)
Sets coordinate grid style to solid or cross.
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...
QList< const QgsComposerMap * > composerMapItems() const
Returns pointers to all composer maps in the scene.
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.
#define Q_NOWARN_DEPRECATED_PUSH
bool contains(const QString &str, Qt::CaseSensitivity cs) const
Border
Enum for different frame borders.
QgsRectangle visibleExtent() const
Return the actual extent derived from requested extent that takes takes output image size into accoun...
double annotationFrameDistance() const
Gets the distance between the map frame and annotations.
void setDpi(double dpi)
Set the dpi to be used in scale calculations.
double mLastValidViewScaleFactor
Backup to restore item appearance if no view scale factor is available.
QColor frameFillColor2() const
Retrieves the second fill color for the grid frame.
void drawItems(QPainter *painter)
Draws the items from the stack on a specified painter.
bool hasCrsTransformEnabled() const
returns true if projections are enabled for this layer set
void mapRotationChanged(double newRotation)
Is emitted on rotation change to notify north arrow pictures.
static QgsPalLayerSettings fromLayer(QgsVectorLayer *layer)
FrameStyle frameStyle() const
Gets the grid frame style.
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.
Flags flags() const
Return combination of flags used for rendering.
DataDefinedProperty
Data defined properties for different item types.
Q_DECL_DEPRECATED double annotationFrameDistance() 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...
QColor framePenColor() const
Retrieves the color of the outline drawn in the grid frame.
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect(double &x, double &y, double width, double height) const
Calculates corner point after rotation and scaling.
QPolygonF transformedMapPolygon() const
Returns extent that considers rotation and shift with mOffsetX / mOffsetY.
QColor backgroundColor() const
Gets the background color for this item.
A non GUI class for rendering a map layer set onto a QPainter.
AnnotationDirection
Direction of grid annotations.
void setLayers(const QStringList &layers)
Set list of layer IDs for map rendering.
Enable layer transparency and blending effects.
double toDouble(bool *ok) const
virtual QgsExpressionContext * createExpressionContext() const override
Creates an expression context relating to the objects's current state.
void setGridLineColor(const QColor &color)
Sets color of grid lines.
Q_DECL_DEPRECATED double gridOffsetX() const
bool containsAdvancedEffects() const
True if composer map contains layers with blend modes or flattened layers for vectors.
AnnotationFormat annotationFormat() const
Gets the format for drawing grid annotations.
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...
Q_DECL_DEPRECATED GridFrameStyle gridFrameStyle() const
AnnotationFormat
Format for displaying grid annotations.
int readNumEntry(const QString &scope, const QString &key, int def=0, bool *ok=0) const
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)
double x() const
Get the x value of the point.
AnnotationPosition annotationPosition(const BorderSide border) const
Gets the position for the grid annotations on a specified side of the map frame.
Q_DECL_DEPRECATED void setGridPenColor(const QColor &c)
Sets the color of the grid pen.
virtual QString name() const =0
Return a provider name.
void setWidth(double width)
double intervalY() const
Gets the interval between grid lines in the y-direction.
void setCrossLength(const double length)
Sets the length of the cross segments drawn for the grid.
QFont annotationFont() const
Gets the font used for drawing grid annotations.
Vector graphics should not be cached and drawn as raster images.
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 void setGridAnnotationPrecision(int p)
Sets coordinate precision for grid annotations.
Q_DECL_DEPRECATED QFont gridAnnotationFont() const
The QgsMapSettings class contains configuration for rendering of the map.
Q_DECL_DEPRECATED bool overviewInverted() const
Returns true if the overview frame is inverted.
bool _readXML(const QDomElement &itemElem, const QDomDocument &doc)
Reads parameter that are not subclass specific in document.
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)
Q_DECL_DEPRECATED const QgsMapRenderer * mapRenderer() const
Q_DECL_DEPRECATED QPainter::CompositionMode gridBlendMode() const
Returns the grid's blending mode.
QStringList presetVisibleLayers(const QString &name) const
Returns the list of layer IDs that should be visible for the specified preset.
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)
Stores style information (renderer, transparency, labeling, diagrams etc.) applicable to a map layer...
Q_DECL_DEPRECATED QColor gridFrameFillColor2() const
Get second fill color for grid zebra frame.
const char * name() const
void setFont(const QFont &font)
Q_DECL_DEPRECATED int overviewFrameMapId() const
Returns id of overview frame (or -1 if no overfiew frame)
QString number(int n, int base)
double scale() const
Scale.
Q_DECL_DEPRECATED double gridFrameWidth() const
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
double horizontalViewScaleFactor() const
Returns the zoom factor of the graphics view.
An individual overview which is drawn above the map content in a QgsComposerMap, and shows the extent...
void setFrameSymbol(QgsFillSymbolV2 *symbol)
Sets the fill symbol used for drawing the overview extent.
QPainter::CompositionMode featureBlendMode() const
Returns the current blending mode for features.
double calculate(const QgsRectangle &mapExtent, int canvasWidth)
Calculate the scale denominator.
QgsFillSymbolV2 * frameSymbol()
Gets the fill symbol used for drawing the overview extent.
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
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
QPainter::CompositionMode blendMode() const
Retrieves the blending mode used for drawing the overview.
void fill(uint pixelValue)
Q_DECL_DEPRECATED QColor annotationFontColor() const
Get font color for grid annotations.
bool hasAttribute(const QString &name) const
double xMaximum() const
Get the x maximum value (right side of rectangle)
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.
Q_DECL_DEPRECATED QPainter::CompositionMode overviewBlendMode() const
Returns the overview's blending mode.
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.
void layersChanged()
Called when layers are added or removed from the layer registry.
const QgsComposition * composition() const
Returns the composition the item is attached to.
bool drawCanvasItems() const
void setCacheUpdated(bool u=false)
const QgsCoordinateReferenceSystem & destinationCrs() const
returns CRS of destination coordinate reference system
int toInt(bool *ok, int base) const
void setYMinimum(double y)
Set the minimum y value.
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.
AnnotationPosition
Position for grid annotations.
const_iterator constEnd() const
double offsetX() const
Gets the offset for grid lines in the x-direction.
void setCentered(const bool centered)
Sets whether the extent of the map is forced to center on the overview.
QPaintDevice * device() const
void setAnnotationEnabled(const bool enabled)
Sets whether annotations should be shown for the grid.
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)
QString id() const
Get this layer's unique ID, this ID is used to access this layer from map layer registry.
GridStyle style() const
Gets the grid's style, which controls how the grid is drawn over the map's contents.
PropertyValueType
Specifies whether the value returned by a function should be the original, user set value...
Q_DECL_DEPRECATED bool atlasFixedScale() const
Returns true if the map uses a fixed scale when in atlas mode.
QGis::UnitType mapUnits() const
Get units of map's geographical coordinates - used for scale calculation.
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...
void moveContent(double dx, double dy) override
Move content of map.
An individual grid which is drawn above the map content in a QgsComposerMap.
QPainter::CompositionMode shapeBlendMode
bool shouldDrawItem() const
Returns whether the item should be drawn in the current context.
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)
double offsetY() const
Gets the offset for grid lines in the y-direction.
Q_DECL_DEPRECATED void setGridFramePenSize(double w)
Set grid frame pen thickness.
void setGridLineWidth(const double width)
Sets width of grid lines.
double mapRotation(QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue) const
Returns the rotation used for drawing the map within the composer item.
double framePenSize() const
Retrieves the width of the outline drawn in the grid frame.
PreviewMode
Preview style.
Q_DECL_DEPRECATED GridAnnotationPosition gridAnnotationPosition(QgsComposerMap::Border border) const
QPolygonF visibleExtentPolygon() const
Returns a polygon representing the current visible map extent, considering map extents and rotation...
A class to represent a point.
void setFrameWidth(const double width)
Sets the grid frame width.
void setAnnotationFontColor(const QColor &color)
Sets the font color used for drawing grid annotations.
void prepareGeometryChange()
Graphics scene for map printing.
Q_DECL_DEPRECATED QColor gridFramePenColor() const
Get pen color for grid frame.
This class tracks map layers that are currently loaded and provides a means to fetch a pointer to a m...
QList< QgsMapLayer * > mapLayersByName(const QString &layerName)
Retrieve a pointer to a loaded layer by name.
Object representing map window.
BlendMode
Blending modes enum defining the available composition modes that can be used when rendering a layer...
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.
Q_DECL_DEPRECATED QPen gridPen() const
QgsRectangle * currentMapExtent()
Returns a pointer to the current map extent, which is either the original user specified extent or th...
QString xmlData() const
Return XML content of the style.
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.
BorderSide
Border sides for annotations.
QString qgsDoubleToString(const double &a, const int &precision=17)
PreviewMode previewMode() const
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()
Q_DECL_DEPRECATED int gridAnnotationPrecision() const
bool dataDefinedEvaluate(const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue, const QgsExpressionContext &context=QgsExpressionContext()) const
Evaluate a data defined property and return the calculated value.
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.
Q_DECL_DEPRECATED void setCrossLength(double l)
Sets length of the cross segments (if grid style is cross)
int layerTransparency() const
Returns the current transparency for the vector layer.
Q_DECL_DEPRECATED bool gridEnabled() const
static QPainter::CompositionMode getCompositionMode(const QgsMapRenderer::BlendMode &blendMode)
Returns a QPainter::CompositionMode corresponding to a BlendMode.
int annotationPrecision() const
Returns the coordinate precision for grid annotations.
virtual void setFrameOutlineWidth(const double outlineWidth)
Sets frame outline width.
#define Q_NOWARN_DEPRECATED_POP
const Key key(const T &value) const
bool useAdvancedEffects() const
Returns true if a composition should use advanced effects such as blend modes.
QPainter::CompositionMode blendMode() const
Retrieves the blending mode used for drawing the grid.
QgsComposition * mComposition
void layerStyleOverridesChanged()
Emitted when layer style overrides are changed...
virtual bool enabled() const
Returns whether the item will be drawn.
void setBackgroundColor(const QColor &color)
Set the background color of the map.
QColor annotationFontColor() const
Gets the font color used for drawing grid annotations.
const T & at(int i) const
QVariant value(const QString &key, const QVariant &defaultValue) const
void writeXml(QDomElement &styleElement) const
Write style configuration (for project file writing)
QVariant data(int key) const
QgsComposerMapOverview * overview(const QString &overviewId) const
Returns a reference to an overview within the stack.
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect(double &x, double &y, double width, double height, double rotation) const
Calculates corner point after rotation and scaling.
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.
bool _writeXML(QDomElement &itemElem, QDomDocument &doc) const
Writes parameter that are not subclass specific in document.
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.
QgsRectangle extent() const
virtual QString displayName() const override
Get item display name.
void setOutputSize(const QSize &size)
Set the size of the resulting map image.
virtual void refreshDataDefinedProperty(const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties, const QgsExpressionContext *context=0) override
void setYMaximum(double y)
Set the maximum y value.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores the state of the item stack in a DOM node.
virtual void drawBackground(QPainter *p)
Draw background.
bool hasFrame() const
Whether this item has a frame or not.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
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 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)
Q_DECL_DEPRECATED double gridIntervalY() const
bool hasBackground() const
Whether this item has a Background or not.
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)
bool annotationEnabled() const
Gets whether annotations are shown for the grid.
QgsComposerMap(QgsComposition *composition, int x, int y, int width, int height)
Constructor.
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 ...
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...
double y() const
Get the y value of the point.
double crossLength() const
Retrieves the length of the cross segments drawn for the grid.
QStringList layers() const
Get list of layer IDs for map rendering The layers are stored in the reverse order of how they are re...
QgsAtlasComposition & atlasComposition()
Q_DECL_DEPRECATED double crossLength()
Q_DECL_DEPRECATED double gridOffsetY() const
int indexOf(const QRegExp &rx, int from) const
double toDouble(bool *ok) const
static QColor decodeColor(const QString &str)
QGraphicsItem * parentItem() const
Q_DECL_DEPRECATED void setGridOffsetX(double offset)
Sets x-coordinate offset for composer grid.
iterator insert(const Key &key, const T &value)
Enable vector simplification and other rendering optimizations.
QPainter::CompositionMode shadowBlendMode
QgsRasterDataProvider * dataProvider()
Returns the data provider.
Q_DECL_DEPRECATED QgsFillSymbolV2 * overviewFrameMapSymbol()
Q_DECL_DEPRECATED void setOverviewBlendMode(QPainter::CompositionMode blendMode)
Sets the overview's blending mode.
QgsVectorLayer * coverageLayer() const
Returns the coverage layer used for the atlas features.
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
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.
Q_DECL_DEPRECATED void setGridOffsetY(double offset)
Sets y-coordinate offset for composer grid.
QPointF mapToItemCoords(const QPointF &mapCoords) const
Transforms map coordinates to item coordinates (considering rotation and move offset) ...
const QgsComposerMap * getComposerMapById(const int id) const
Returns the composer map with specified id.
void setPreviewMode(PreviewMode m)
QgsComposition::PlotStyle plotStyle() const
double width() const
Width of the rectangle.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
AnnotationDirection annotationDirection(const BorderSide border) const
Gets the direction for drawing frame annotations.
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.
int compare(const QString &other) const
Q_DECL_DEPRECATED void setGridFrameStyle(GridFrameStyle style)
Set grid frame style (NoGridFrame or Zebra)
virtual QgsSymbolV2 * clone() const override
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
double xMinimum() const
Get the x minimum value (left side of rectangle)
ZoomMode
Modes for zooming item content.
Q_DECL_DEPRECATED GridAnnotationFormat gridAnnotationFormat() const
void renderSynchronously()
Render the map synchronously in this thread.
void setIntervalX(const double interval)
Sets the interval between grid lines in the x-direction.
int frameMapId() const
Returns id of source map.
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 void setGridBlendMode(QPainter::CompositionMode blendMode)
Sets the grid's blending mode.
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.
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.
double frameWidth() const
Gets the grid frame width.
double height() const
Height of the rectangle.
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
Q_DECL_DEPRECATED GridStyle gridStyle() const
Base class for raster data providers.
uint toUInt(bool *ok, int base) const
int remove(const Key &key)
QgsMapSettings mapSettings(const QgsRectangle &extent, const QSizeF &size, int dpi) const
Return map settings that would be used for drawing of the map.
bool inverted() const
Returns whether the overview frame is inverted, ie, whether the shaded area is drawn outside the exte...
QList< Key > uniqueKeys() const
QgsComposerMapOverview * overview()
Returns the map item's first overview.
void scale(double scaleFactor, const QgsPoint *c=0)
Scale the rectangle around its center point.
Q_DECL_DEPRECATED bool overviewCentered() const
Returns true if the extent is forced to center on the overview.
A collection of overviews which are drawn above the map content in a QgsComposerMap.
QString id() const
Get item's id (which is not necessarly unique)