44 #include <QGraphicsScene> 45 #include <QGraphicsView> 52 , mGridStack( nullptr )
53 , mOverviewStack( nullptr )
55 , mEvaluatedMapRotation( 0 )
56 , mKeepLayerSet( false )
57 , mKeepLayerStyles( false )
58 , mFollowVisibilityPreset( false )
59 , mUpdatesEnabled( true )
60 , mMapCanvas( nullptr )
61 , mDrawCanvasItems( true )
62 , mDrawSelection( false )
63 , mAtlasDriven( false )
64 , mAtlasScalingMode( Auto )
65 , mAtlasMargin( 0.10 )
73 mCurrentRectangle =
rect();
76 mCacheUpdated =
false;
99 , mGridStack( nullptr )
100 , mOverviewStack( nullptr )
102 , mEvaluatedMapRotation( 0 )
103 , mKeepLayerSet( false )
104 , mKeepLayerStyles( false )
105 , mFollowVisibilityPreset( false )
106 , mUpdatesEnabled( true )
107 , mMapCanvas( nullptr )
108 , mDrawCanvasItems( true )
109 , mAtlasDriven( false )
110 , mAtlasScalingMode(
Auto )
111 , mAtlasMargin( 0.10 )
120 mCurrentRectangle =
rect();
126 void QgsComposerMap::init()
144 void QgsComposerMap::updateToolTip()
149 void QgsComposerMap::adjustExtentToItemShape(
double itemWidth,
double itemHeight,
QgsRectangle&
extent )
const 151 double itemWidthHeightRatio = itemWidth / itemHeight;
152 double newWidthHeightRatio = extent.
width() / extent.
height();
154 if ( itemWidthHeightRatio <= newWidthHeightRatio )
157 double newHeight = extent.
width() / itemWidthHeightRatio;
158 double deltaHeight = newHeight - extent.
height();
165 double newWidth = itemWidthHeightRatio * extent.
height();
166 double deltaWidth = newWidth - extent.
width();
174 delete mOverviewStack;
182 Q_UNUSED( forceWidthScale );
215 jobMapSettings.
setRotation( mEvaluatedMapRotation );
224 ( layerIdx >= 0 && layerIdx < theLayerSet.length() )
225 ?
QStringList( theLayerSet[ theLayerSet.length() - layerIdx - 1 ] )
255 return jobMapSettings;
273 if ( horizontalVScaleFactor < 0 )
283 int w = widthMM * horizontalVScaleFactor;
284 int h = heightMM * horizontalVScaleFactor;
287 if ( w > 5000 || h > 5000 )
292 h = w * heightMM / widthMM;
297 w = h * widthMM / heightMM;
301 mCacheImage =
QImage( w, h, QImage::Format_ARGB32 );
316 mCacheImage.
fill(
QColor( 255, 255, 255, 0 ).rgba() );
323 mCacheUpdated =
true;
349 QFont messageFont(
"", 12 );
350 painter->
setFont( messageFont );
352 painter->
drawText( thisPaintRect,
tr(
"Map will be printed here" ) );
363 double imagePixelWidth = mCacheImage.
width();
368 painter->
translate( mXOffset, mYOffset );
369 painter->
scale( scale, scale );
388 if ( !thePaintDevice )
394 if ( shouldDrawPart( Background ) )
404 painter->
translate( mXOffset, mYOffset );
406 double dotsPerMM = thePaintDevice->
logicalDpiX() / 25.4;
407 theSize *= dotsPerMM;
408 painter->
scale( 1 / dotsPerMM, 1 / dotsPerMM );
421 if ( shouldDrawPart( OverviewMapExtent ) &&
426 if ( shouldDrawPart( Grid ) &&
431 if ( shouldDrawPart( Frame ) )
435 if (
isSelected() && shouldDrawPart( SelectionBoxes ) )
447 + layersToRender().
length()
455 bool QgsComposerMap::shouldDrawPart( PartType part )
const 467 if ( SelectionBoxes == part )
482 if ( OverviewMapExtent == part )
493 if ( Background == part )
504 mCacheUpdated =
false;
511 if ( mPreviewMode ==
Render )
542 evalContext = scopedContext.
data();
547 if ( mFollowVisibilityPreset )
549 QString presetName = mFollowVisibilityPresetName;
563 else if ( mKeepLayerSet )
565 renderLayerSet = mLayerSet;
575 renderLayerSet.
clear();
584 renderLayerSet << layer->
id();
597 if ( removeAt != -1 )
599 renderLayerSet.
removeAt( removeAt );
604 return renderLayerSet;
609 if ( mFollowVisibilityPreset )
611 QString presetName = mFollowVisibilityPresetName;
624 else if ( mKeepLayerStyles )
626 return mLayerStyleOverrides;
638 calculator.
setDpi( 25.4 );
655 transformShift( dx, dy );
683 double zoomFactor = settings.
value(
"/qgis/zoom_factor", 2.0 ).
toDouble();
684 zoomFactor = delta > 0 ? zoomFactor : 1 / zoomFactor;
719 centerX = mapX + ( centerX - mapX ) * ( 1.0 / factor );
720 centerY = mapY + ( centerY - mapY ) * ( 1.0 / factor );
724 double newIntervalX, newIntervalY;
748 calculator.
setDpi( 25.4 );
750 mExtent.
scale( scaleRatio );
764 double w = rectangle.
width();
765 double h = rectangle.
height();
771 double newHeight = mExtent.
width() * h / w;
776 mCacheUpdated =
false;
810 double newWidthHeightRatio = newExtent.
width() / newExtent.
height();
812 if ( currentWidthHeightRatio < newWidthHeightRatio )
815 double newHeight = newExtent.
width() / currentWidthHeightRatio;
816 double deltaHeight = newHeight - newExtent.
height();
823 double newWidth = currentWidthHeightRatio * newExtent.
height();
824 double deltaWidth = newWidth - newExtent.
width();
838 mCacheUpdated =
false;
846 if ( mAtlasFeatureExtent != extent )
853 double newWidthHeightRatio = newExtent.
width() / newExtent.
height();
855 if ( currentWidthHeightRatio < newWidthHeightRatio )
858 double newHeight = newExtent.
width() / currentWidthHeightRatio;
859 double deltaHeight = newHeight - newExtent.
height();
866 double newWidth = currentWidthHeightRatio * newExtent.
height();
867 double deltaWidth = newWidth - newExtent.
width();
872 mAtlasFeatureExtent = newExtent;
878 mCacheUpdated =
false;
892 return &mAtlasFeatureExtent;
908 return &mAtlasFeatureExtent;
919 double currentScaleDenominator =
scale();
926 double scaleRatio = scaleDenominator / currentScaleDenominator;
936 calculator.
setDpi( 25.4 );
937 scaleRatio = scaleDenominator / calculator.
calculate( mExtent,
rect().width() );
938 mExtent.
scale( scaleRatio );
941 mCacheUpdated =
false;
972 mEvaluatedMapRotation = mMapRotation;
990 evalContext = scopedContext.
data();
997 bool useDdXMin =
false;
998 bool useDdXMax =
false;
999 bool useDdYMin =
false;
1000 bool useDdYMax =
false;
1011 if ( ok && !exprVal.
isNull() )
1022 if ( ok && !exprVal.
isNull() )
1033 if ( ok && !exprVal.
isNull() )
1044 if ( ok && !exprVal.
isNull() )
1058 double newWidthHeightRatio = newExtent.
width() / newExtent.
height();
1060 if ( currentWidthHeightRatio < newWidthHeightRatio )
1063 double newHeight = newExtent.
width() / currentWidthHeightRatio;
1064 double deltaHeight = newHeight - newExtent.
height();
1071 double newWidth = currentWidthHeightRatio * newExtent.
height();
1072 double deltaWidth = newWidth - newExtent.
width();
1086 double scaleD = exprVal.
toDouble( &ok );
1088 if ( ok && !exprVal.
isNull() )
1095 if ( useDdXMax || useDdXMin || useDdYMax || useDdYMin )
1099 if ( useDdXMin && !useDdXMax )
1105 else if ( !useDdXMin && useDdXMax )
1111 if ( useDdYMin && !useDdYMax )
1117 else if ( !useDdYMin && useDdYMax )
1137 double rotationD = exprVal.
toDouble( &ok );
1139 if ( ok && !exprVal.
isNull() )
1141 mapRotation = rotationD;
1155 if ( !mUpdatesEnabled )
1174 for ( ; layer_it != layers.
constEnd(); ++layer_it )
1180 if ( currentRasterLayer )
1183 if (( rasterProvider = currentRasterLayer->
dataProvider() ) )
1185 if ( rasterProvider->
name() ==
"wms" )
1219 for ( ; layer_it != layers.
constEnd(); ++layer_it )
1224 if ( currentLayer->
blendMode() != QPainter::CompositionMode_SourceOver )
1230 if ( currentVectorLayer )
1236 if ( currentVectorLayer->
featureBlendMode() != QPainter::CompositionMode_SourceOver )
1245 if (( layerSettings.
blendMode != QPainter::CompositionMode_SourceOver ) ||
1260 void QgsComposerMap::connectUpdateSlot()
1264 if ( layerRegistry )
1282 if ( mPreviewMode ==
Cache )
1284 composerMapElem.
setAttribute(
"previewMode",
"Cache" );
1286 else if ( mPreviewMode ==
Render )
1288 composerMapElem.
setAttribute(
"previewMode",
"Render" );
1292 composerMapElem.
setAttribute(
"previewMode",
"Rectangle" );
1295 if ( mKeepLayerSet )
1297 composerMapElem.
setAttribute(
"keepLayerSet",
"true" );
1301 composerMapElem.
setAttribute(
"keepLayerSet",
"false" );
1304 if ( mDrawCanvasItems )
1306 composerMapElem.
setAttribute(
"drawCanvasItems",
"true" );
1310 composerMapElem.
setAttribute(
"drawCanvasItems",
"false" );
1322 composerMapElem.
setAttribute(
"followPreset", mFollowVisibilityPreset ?
"true" :
"false" );
1323 composerMapElem.
setAttribute(
"followPresetName", mFollowVisibilityPresetName );
1330 Q_FOREACH (
const QString &layerId, mLayerSet )
1350 if ( mKeepLayerStyles )
1354 for ( ; styleIt != mLayerStyleOverrides.
constEnd(); ++styleIt )
1378 mGridStack->
writeXML( composerMapElem, doc );
1381 mOverviewStack->
writeXML( composerMapElem, doc );
1386 atlasElem.
setAttribute(
"scalingMode", mAtlasScalingMode );
1391 return _writeXML( composerMapElem, doc );
1402 if ( idRead !=
"not found" )
1404 mId = idRead.
toInt();
1411 if ( previewMode ==
"Cache" )
1413 mPreviewMode =
Cache;
1415 else if ( previewMode ==
"Render" )
1426 if ( !extentNodeList.
isEmpty() )
1429 double xmin, xmax, ymin, ymax;
1444 mFollowVisibilityPreset = itemElem.
attribute(
"followPreset" ).
compare(
"true" ) == 0;
1445 mFollowVisibilityPresetName = itemElem.
attribute(
"followPresetName" );
1449 if ( keepLayerSetFlag.
compare(
"true", Qt::CaseInsensitive ) == 0 )
1451 mKeepLayerSet =
true;
1455 mKeepLayerSet =
false;
1458 QString drawCanvasItemsFlag = itemElem.
attribute(
"drawCanvasItems",
"true" );
1459 if ( drawCanvasItemsFlag.
compare(
"true", Qt::CaseInsensitive ) == 0 )
1461 mDrawCanvasItems =
true;
1465 mDrawCanvasItems =
false;
1468 mLayerStyleOverrides.
clear();
1473 if ( !layerSetNodeList.
isEmpty() )
1478 for (
int i = 0; i < layerIdNodeList.
size(); ++i )
1486 QgsMapLayerRef ref( layerId, layerName, layerSource, layerProvider );
1495 mKeepLayerStyles = !layerStylesNodeList.
isEmpty();
1496 if ( mKeepLayerStyles )
1500 for (
int i = 0; i < layerStyleNodeList.
size(); ++i )
1507 QgsMapLayerRef ref( layerId, layerName, layerSource, layerProvider );
1511 style.
readXml( layerStyleElement );
1517 mNumCachedLayers = 0;
1518 mCacheUpdated =
false;
1521 mOverviewStack->
readXML( itemElem, doc );
1524 mGridStack->
readXML( itemElem, doc );
1530 if ( mGridStack->
size() == 0 && !gridNodeList.
isEmpty() )
1550 if ( gridSymbolElem.
isNull() )
1561 lineSymbol = QgsSymbolLayerV2Utils::loadSymbol<QgsLineSymbolV2>( gridSymbolElem );
1567 if ( !annotationNodeList.
isEmpty() )
1581 QFont annotationFont;
1588 mGridStack->
addGrid( mapGrid );
1593 if ( !overviewFrameElem.
isNull() )
1604 if ( !overviewFrameSymbolElem.
isNull() )
1606 fillSymbol = QgsSymbolLayerV2Utils::loadSymbol<QgsFillSymbolV2>( overviewFrameSymbolElem );
1614 if ( !atlasNodeList.
isEmpty() )
1617 mAtlasDriven = ( atlasElem.
attribute(
"atlasDriven",
"0" ) !=
"0" );
1620 mAtlasScalingMode = ( atlasElem.
attribute(
"fixedScale",
"0" ) !=
"0" ) ?
Fixed :
Auto;
1631 if ( !composerItemList.
isEmpty() )
1653 if ( mKeepLayerStyles )
1663 if ( overrides == mLayerStyleOverrides )
1666 mLayerStyleOverrides = overrides;
1673 mLayerStyleOverrides.
clear();
1674 Q_FOREACH (
const QString& layerID, mLayerSet )
1685 void QgsComposerMap::syncLayerSet()
1687 if ( mLayerSet.
size() < 1 )
1694 if ( mKeepLayerSet )
1703 for (
int i = mLayerSet.
size() - 1; i >= 0; --i )
1705 if ( !currentLayerSet.
contains( mLayerSet.
at( i ) ) )
1707 mLayerStyleOverrides.
remove( mLayerSet.
at( i ) );
1715 if ( mGridStack->
size() < 1 )
1720 return mGridStack->
grid( 0 );
1879 g->
setAnnotationPosition( static_cast< QgsComposerMapGrid::AnnotationPosition >( p ), static_cast< QgsComposerMapGrid::BorderSide >( border ) );
1949 g->
setFrameStyle( static_cast< QgsComposerMapGrid::FrameStyle >( style ) );
2032 if ( mOverviewStack->
size() < 1 )
2037 return mOverviewStack->
overview( 0 );
2059 return mCurrentRectangle;
2067 double topExtension = 0.0;
2068 double rightExtension = 0.0;
2069 double bottomExtension = 0.0;
2070 double leftExtension = 0.0;
2075 topExtension = qMax( topExtension, frameExtension );
2076 rightExtension = qMax( rightExtension, frameExtension );
2077 bottomExtension = qMax( bottomExtension, frameExtension );
2078 leftExtension = qMax( leftExtension, frameExtension );
2080 rectangle.
setLeft( rectangle.
left() - leftExtension );
2082 rectangle.
setTop( rectangle.
top() - topExtension );
2084 if ( rectangle != mCurrentRectangle )
2087 mCurrentRectangle = rectangle;
2099 double dx = mXOffset;
2100 double dy = mYOffset;
2101 transformShift( dx, dy );
2107 double dx = mXOffset;
2108 double dy = mYOffset;
2112 transformShift( dx, dy );
2140 dx = rotationPoint.
x() - extent.
xMinimum();
2141 dy = rotationPoint.
y() - extent.
yMaximum();
2143 poly <<
QPointF( rotationPoint.
x() - dx, rotationPoint.
y() - dy );
2146 dx = rotationPoint.
x() - extent.
xMaximum();
2147 dy = rotationPoint.
y() - extent.
yMaximum();
2149 poly <<
QPointF( rotationPoint.
x() - dx, rotationPoint.
y() - dy );
2152 dx = rotationPoint.
x() - extent.
xMaximum();
2153 dy = rotationPoint.
y() - extent.
yMinimum();
2155 poly <<
QPointF( rotationPoint.
x() - dx, rotationPoint.
y() - dy );
2158 dx = rotationPoint.
x() - extent.
xMinimum();
2159 dy = rotationPoint.
y() - extent.
yMinimum();
2161 poly <<
QPointF( rotationPoint.
x() - dx, rotationPoint.
y() - dy );
2181 return tr(
"Map %1" ).
arg( mId );
2194 mapPolygon( newExtent, poly );
2232 if ( extentWidth <= 0 )
2258 evalContext = scopedContext.
data();
2269 refreshMapExtents( evalContext );
2278 mCacheUpdated =
false;
2356 void QgsComposerMap::transformShift(
double& xShift,
double& yShift )
const 2359 double dxScaled = xShift * mmToMapUnits;
2360 double dyScaled = - yShift * mmToMapUnits;
2371 if ( mapPoly.
size() < 1 )
2378 double dx = mapCoords.
x() - rotationPoint.
x();
2379 double dy = mapCoords.
y() - rotationPoint.
y();
2381 QgsPoint backRotatedCoords( rotationPoint.
x() + dx, rotationPoint.
y() + dy );
2384 double xItem =
rect().
width() * ( backRotatedCoords.x() - unrotatedExtent.xMinimum() ) / unrotatedExtent.width();
2385 double yItem =
rect().
height() * ( 1 - ( backRotatedCoords.y() - unrotatedExtent.yMinimum() ) / unrotatedExtent.height() );
2386 return QPointF( xItem, yItem );
2396 if ( !mMapCanvas || !mDrawCanvasItems )
2402 if ( itemList.
size() < 1 )
2408 for (
int i = itemList.
size() - 1; i >= 0; --i )
2410 currentItem = itemList.
at( i );
2417 drawCanvasItem( annotation, painter, itemStyle );
2423 if ( !annotation || !annotation->
showItem() )
2433 double itemX, itemY;
2436 QPointF mapPos = composerMapPosForItem( annotation );
2447 painter->
scale( scaleFactor, scaleFactor );
2450 const_cast< QgsAnnotation*
>( annotation )->setItemData( 1,
"composer" );
2452 const_cast< QgsAnnotation*
>( annotation )->setItemData( 1,
"" );
2496 for ( ; mapIt != mapList.
constEnd(); ++mapIt )
2498 if (( *mapIt )->id() > maxId )
2500 maxId = ( *mapIt )->id();
2533 mAtlasDriven = enabled;
2539 refreshMapExtents();
2545 return mAtlasScalingMode ==
Fixed;
2551 mAtlasScalingMode = fixed ?
Fixed :
Auto;
2561 double margin = mAtlasMargin;
2567 double ddMargin = exprVal.
toDouble( &ok );
2569 if ( ok && !exprVal.
isNull() )
2572 margin = ddMargin / 100;
2579 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.
void setExtent(const QgsRectangle &rect, bool magnified=true)
Set coordinates of the rectangle which should be rendered.
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.
Internal structure to keep weak pointer to QgsMapLayer or layerId if the layer is not available yet...
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 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.
QgsMapLayer * mapLayer(const QString &theLayerId) const
Retrieve a pointer to a registered layer by layer ID.
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.
Whether to make extra effort to update map image with partially rendered layers (better for interacti...
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.
void setOutputDpi(double dpi)
Set DPI used for conversion between real world units (e.g. mm) and pixels.
#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)
QMap< QString, QgsMapLayer * > mapLayers() const
Returns a map of all registered layers by layer ID.
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)
Compare two doubles (but allow some difference)
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.
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.
QString provider
Weak reference to layer provider.
QString layerId
Original layer ID.
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
TYPE * resolveWeakly()
Resolves the map layer by attempting to find a matching layer in the map layer registry using a weak ...
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)
Returns a string representation of a double.
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
QString name
Weak reference to layer name.
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.
QString source
Weak reference to layer public source.
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 various methods to retrieve match...
const QgsMapSettings & mapSettings() const
Return setting of QGIS map canvas.
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.
TYPE * resolve()
Resolves the map layer by attempting to find a layer with matching ID within the map layer registry...
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.
void setSelectionColor(const QColor &color)
Set color that is used for drawing of selected vector features.
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()
Returns the QgsProject singleton 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 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.
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)
QColor selectionColor() const
Get color that is used for drawing of selected vector features.
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)
QList< QgsMapLayer * > mapLayersByName(const QString &layerName) const
Retrieve a list of matching registered layers by layer name.
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.