QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgslayoutitem.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayoutitem.h
3  -------------------
4  begin : June 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSLAYOUTITEM_H
18 #define QGSLAYOUTITEM_H
19 
20 #include "qgis_core.h"
21 #include "qgslayoutobject.h"
22 #include "qgslayoutsize.h"
23 #include "qgslayoutpoint.h"
24 #include "qgsrendercontext.h"
25 #include "qgslayoutundocommand.h"
26 #include "qgslayoutmeasurement.h"
27 #include "qgsapplication.h"
28 #include <QGraphicsRectItem>
29 #include <QIcon>
30 #include <QPainter>
31 
32 class QgsLayout;
33 class QPainter;
34 class QgsLayoutItemGroup;
35 class QgsLayoutEffect;
37 
44 class CORE_EXPORT QgsLayoutItemRenderContext
45 {
46  public:
47 
58  QgsLayoutItemRenderContext( QgsRenderContext &context, double viewScaleFactor = 1.0 );
59 
62 
64  QgsLayoutItemRenderContext &operator=( const QgsLayoutItemRenderContext &other ) = delete;
65 
72  QgsRenderContext &renderContext() { return mRenderContext; }
73 
82  const QgsRenderContext &renderContext() const { return mRenderContext; } SIP_SKIP
83 
94  double viewScaleFactor() const { return mViewScaleFactor; }
95 
96  private:
97 
98 #ifdef SIP_RUN
100 #endif
101 
102  QgsRenderContext &mRenderContext;
103  double mViewScaleFactor = 1.0;
104 };
105 
112 class CORE_EXPORT QgsLayoutItem : public QgsLayoutObject, public QGraphicsRectItem, public QgsLayoutUndoObjectInterface
113 {
114 #ifdef SIP_RUN
115 #include "qgslayoutitemgroup.h"
116 #include "qgslayoutitemmap.h"
117 #include "qgslayoutitempicture.h"
118 #include "qgslayoutitemlabel.h"
119 #include "qgslayoutitemlegend.h"
120 #include "qgslayoutitempolygon.h"
121 #include "qgslayoutitempolyline.h"
122 #include "qgslayoutitemscalebar.h"
123 #include "qgslayoutframe.h"
124 #include "qgslayoutitemshape.h"
125 #include "qgslayoutitempage.h"
126 #endif
127 
128 #ifdef SIP_RUN
130 
131  // FREAKKKKIIN IMPORTANT!!!!!!!!!!!
132  // IF YOU PUT SOMETHING HERE, PUT IT IN QgsLayoutObject CASTING *****ALSO******
133  // (it's not enough for it to be in only one of the places, as sip inconsistently
134  // decides which casting code to perform here)
135 
136  // the conversions have to be static, because they're using multiple inheritance
137  // (seen in PyQt4 .sip files for some QGraphicsItem classes)
138  switch ( sipCpp->type() )
139  {
140  // really, these *should* use the constants from QgsLayoutItemRegistry, but sip doesn't like that!
141  case QGraphicsItem::UserType + 101:
142  sipType = sipType_QgsLayoutItemGroup;
143  *sipCppRet = static_cast<QgsLayoutItemGroup *>( sipCpp );
144  break;
145  case QGraphicsItem::UserType + 102:
146  sipType = sipType_QgsLayoutItemPage;
147  *sipCppRet = static_cast<QgsLayoutItemPage *>( sipCpp );
148  break;
149  case QGraphicsItem::UserType + 103:
150  sipType = sipType_QgsLayoutItemMap;
151  *sipCppRet = static_cast<QgsLayoutItemMap *>( sipCpp );
152  break;
153  case QGraphicsItem::UserType + 104:
154  sipType = sipType_QgsLayoutItemPicture;
155  *sipCppRet = static_cast<QgsLayoutItemPicture *>( sipCpp );
156  break;
157  case QGraphicsItem::UserType + 105:
158  sipType = sipType_QgsLayoutItemLabel;
159  *sipCppRet = static_cast<QgsLayoutItemLabel *>( sipCpp );
160  break;
161  case QGraphicsItem::UserType + 106:
162  sipType = sipType_QgsLayoutItemLegend;
163  *sipCppRet = static_cast<QgsLayoutItemLegend *>( sipCpp );
164  break;
165  case QGraphicsItem::UserType + 107:
166  sipType = sipType_QgsLayoutItemShape;
167  *sipCppRet = static_cast<QgsLayoutItemShape *>( sipCpp );
168  break;
169  case QGraphicsItem::UserType + 108:
170  sipType = sipType_QgsLayoutItemPolygon;
171  *sipCppRet = static_cast<QgsLayoutItemPolygon *>( sipCpp );
172  break;
173  case QGraphicsItem::UserType + 109:
174  sipType = sipType_QgsLayoutItemPolyline;
175  *sipCppRet = static_cast<QgsLayoutItemPolyline *>( sipCpp );
176  break;
177  case QGraphicsItem::UserType + 110:
178  sipType = sipType_QgsLayoutItemScaleBar;
179  *sipCppRet = static_cast<QgsLayoutItemScaleBar *>( sipCpp );
180  break;
181  case QGraphicsItem::UserType + 111:
182  sipType = sipType_QgsLayoutFrame;
183  *sipCppRet = static_cast<QgsLayoutFrame *>( sipCpp );
184  break;
185 
186  // did you read that comment above? NO? Go read it now. You're about to break stuff.
187 
188  default:
189  sipType = NULL;
190  }
191  SIP_END
192 #endif
193 
194 
195  Q_OBJECT
196  Q_PROPERTY( bool locked READ isLocked WRITE setLocked NOTIFY lockChanged )
197 
198  public:
199 
202  {
212  };
213 
216  {
217  UndoNone = -1,
218  UndoIncrementalMove = 1,
291 
293  };
294 
299  enum Flag
300  {
301  FlagOverridesPaint = 1 << 1,
302  };
303  Q_DECLARE_FLAGS( Flags, Flag )
304 
305 
311  explicit QgsLayoutItem( QgsLayout *layout, bool manageZValue = true );
312 
313  ~QgsLayoutItem() override;
314 
319  virtual void cleanup();
320 
326  int type() const override;
327 
331  virtual QIcon icon() const { return QgsApplication::getThemeIcon( QStringLiteral( "/mLayoutItem.svg" ) ); }
332 
340  virtual QString uuid() const { return mUuid; }
341 
346  virtual Flags itemFlags() const;
347 
354  QString id() const { return mId; }
355 
362  virtual void setId( const QString &id );
363 
370  virtual QString displayName() const;
371 
375  virtual void setSelected( bool selected );
376 
383  virtual void setVisibility( bool visible );
384 
390  void setLocked( bool locked );
391 
397  bool isLocked() const { return mIsLocked; }
398 
404  bool isGroupMember() const;
405 
411  QgsLayoutItemGroup *parentGroup() const;
412 
418  void setParentGroup( QgsLayoutItemGroup *group );
419 
425  {
430  };
431 
438  virtual ExportLayerBehavior exportLayerBehavior() const;
439 
453  Q_DECL_DEPRECATED virtual int numberExportLayers() const SIP_DEPRECATED;
454 
462  virtual void startLayeredExport();
463 
471  virtual void stopLayeredExport();
472 
480  virtual bool nextExportPart();
481 
487  struct CORE_EXPORT ExportLayerDetail
488  {
490  QString name;
491 
493  QString mapLayerId;
494 
499  QPainter::CompositionMode compositionMode = QPainter::CompositionMode_SourceOver;
500 
505  double opacity = 1.0;
506 
508  QString mapTheme;
509  };
510 
518  virtual QgsLayoutItem::ExportLayerDetail exportLayerDetails() const;
519 
525  void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget ) override;
526 
533  void setReferencePoint( ReferencePoint point );
534 
541  ReferencePoint referencePoint() const { return mReferencePoint; }
542 
549  virtual QgsLayoutSize fixedSize() const { return mFixedSize; }
550 
557  virtual QgsLayoutSize minimumSize() const { return mMinimumSize; }
558 
573  virtual void attemptResize( const QgsLayoutSize &size, bool includesFrame = false );
574 
600  virtual void attemptMove( const QgsLayoutPoint &point, bool useReferencePoint = true, bool includesFrame = false, int page = -1 );
601 
617  void attemptSetSceneRect( const QRectF &rect, bool includesFrame = false );
618 
631  void attemptMoveBy( double deltaX, double deltaY );
632 
641  QgsLayoutPoint positionWithUnits() const { return mItemPosition; }
642 
647  int page() const;
648 
654  QPointF pagePos() const;
655 
661  QgsLayoutPoint pagePositionWithUnits() const;
662 
668  QgsLayoutSize sizeWithUnits() const { return mItemSize; }
669 
680  double itemRotation() const;
681 
689  bool writeXml( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
690 
706  bool readXml( const QDomElement &itemElement, const QDomDocument &document, const QgsReadWriteContext &context );
707 
716  virtual void finalizeRestoreFromXml();
717 
718  QgsAbstractLayoutUndoCommand *createCommand( const QString &text, int id, QUndoCommand *parent = nullptr ) override SIP_FACTORY;
719 
727  bool frameEnabled() const { return mFrame; }
728 
736  virtual void setFrameEnabled( bool drawFrame );
737 
745  void setFrameStrokeColor( const QColor &color );
746 
754  QColor frameStrokeColor() const { return mFrameColor; }
755 
763  virtual void setFrameStrokeWidth( QgsLayoutMeasurement width );
764 
772  QgsLayoutMeasurement frameStrokeWidth() const { return mFrameWidth; }
773 
781  Qt::PenJoinStyle frameJoinStyle() const { return mFrameJoinStyle; }
782 
790  void setFrameJoinStyle( Qt::PenJoinStyle style );
791 
797  bool hasBackground() const { return mBackground; }
798 
804  void setBackgroundEnabled( bool drawBackground );
805 
812  QColor backgroundColor() const { return mBackgroundColor; }
813 
819  void setBackgroundColor( const QColor &color );
820 
825  QPainter::CompositionMode blendMode() const { return mBlendMode; }
826 
831  void setBlendMode( QPainter::CompositionMode mode );
832 
840  double itemOpacity() const { return mOpacity; }
841 
849  void setItemOpacity( double opacity );
850 
855  bool excludeFromExports() const;
856 
861  void setExcludeFromExports( bool exclude );
862 
872  virtual bool containsAdvancedEffects() const;
873 
879  virtual bool requiresRasterization() const;
880 
891  virtual double estimatedFrameBleed() const;
892 
902  virtual QRectF rectWithFrame() const;
903 
910  virtual void moveContent( double dx, double dy );
911 
918  virtual void setMoveContentPreviewOffset( double dx, double dy );
919 
926  virtual void zoomContent( double factor, QPointF point );
927 
936  void beginCommand( const QString &commandText, UndoCommand command = UndoNone );
937 
943  void endCommand();
944 
950  void cancelCommand();
951 
955  bool shouldDrawItem() const;
956 
958 
968  virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
969 
970  public slots:
971 
976  void refresh() override;
977 
981  virtual void invalidateCache();
982 
986  virtual void redraw();
987 
994  virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
995 
1005  virtual void setItemRotation( double rotation, bool adjustPosition = true );
1006 
1012  virtual void rotateItem( double angle, QPointF transformOrigin );
1013 
1014  signals:
1015 
1019  void frameChanged();
1020 
1026  void lockChanged();
1027 
1031  void rotationChanged( double newRotation );
1032 
1036  void sizePositionChanged();
1037 
1043  void backgroundTaskCountChanged( int count );
1044 
1045  protected:
1046 
1052  virtual void drawDebugRect( QPainter *painter );
1053 
1060  virtual void draw( QgsLayoutItemRenderContext &context ) = 0;
1061 
1065  virtual void drawFrame( QgsRenderContext &context );
1066 
1070  virtual void drawBackground( QgsRenderContext &context );
1071 
1078  virtual void setFixedSize( const QgsLayoutSize &size );
1079 
1086  virtual void setMinimumSize( const QgsLayoutSize &size );
1087 
1096  virtual QSizeF applyItemSizeConstraint( QSizeF targetSize );
1097 
1105  void refreshItemSize();
1106 
1112  void refreshItemPosition();
1113 
1124  void refreshItemRotation( QPointF *origin = nullptr );
1125 
1131  void refreshOpacity( bool updateItem = true );
1132 
1138  void refreshFrame( bool updateItem = true );
1139 
1145  void refreshBackgroundColor( bool updateItem = true );
1146 
1150  void refreshBlendMode();
1151 
1156  QPointF adjustPointForReferencePosition( QPointF point, QSizeF size, ReferencePoint reference ) const;
1157 
1161  QPointF positionAtReferencePoint( ReferencePoint reference ) const;
1162 
1167  QgsLayoutPoint topLeftToReferencePoint( const QgsLayoutPoint &point ) const;
1168 
1177  virtual bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const;
1178 
1194  virtual bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context );
1195 
1199  QgsLayoutSize applyDataDefinedSize( const QgsLayoutSize &size );
1200 
1201  private:
1202 
1203  // true if layout manages the z value for this item
1204  bool mLayoutManagesZValue = false;
1205 
1207  QString mId;
1208 
1210  QString mUuid;
1211 
1213  QString mTemplateUuid;
1214 
1216  QString mParentGroupUuid;
1217 
1218  ReferencePoint mReferencePoint = UpperLeft;
1219  QgsLayoutSize mFixedSize;
1220  QgsLayoutSize mMinimumSize;
1221 
1222  QgsLayoutSize mItemSize;
1223  QgsLayoutPoint mItemPosition;
1224  double mItemRotation = 0.0;
1225 
1227  bool mExcludeFromExports = false;
1228 
1233  bool mEvaluatedExcludeFromExports = false;
1234 
1236  QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
1237  std::unique_ptr< QgsLayoutEffect > mEffect;
1238 
1240  double mOpacity = 1.0;
1241  double mEvaluatedOpacity = 1.0;
1242 
1243  QImage mItemCachedImage;
1244  double mItemCacheDpi = -1;
1245 
1246  bool mIsLocked = false;
1247 
1249  bool mFrame = false;
1251  QColor mFrameColor = QColor( 0, 0, 0 );
1255  Qt::PenJoinStyle mFrameJoinStyle = Qt::MiterJoin;
1256 
1258  bool mBackground = true;
1260  QColor mBackgroundColor = QColor( 255, 255, 255 );
1261 
1262  bool mBlockUndoCommands = false;
1263 
1264  void initConnectionsToLayout();
1265 
1267  void preparePainter( QPainter *painter );
1268  bool shouldDrawAntialiased() const;
1269  bool shouldDrawDebugRect() const;
1270  QSizeF applyMinimumSize( QSizeF targetSize );
1271  QSizeF applyFixedSize( QSizeF targetSize );
1272  QgsLayoutPoint applyDataDefinedPosition( const QgsLayoutPoint &position );
1273 
1274  double applyDataDefinedRotation( double rotation );
1275  void updateStoredItemPosition();
1276  QPointF itemPositionAtReferencePoint( ReferencePoint reference, QSizeF size ) const;
1277  void setScenePos( QPointF destinationPos );
1278  bool shouldBlockUndoCommands() const;
1279 
1280  void applyDataDefinedOrientation( double &width, double &height, const QgsExpressionContext &context );
1281 
1282  friend class TestQgsLayoutItem;
1283  friend class TestQgsLayoutView;
1284  friend class QgsLayout;
1285  friend class QgsLayoutItemGroup;
1287 };
1288 
1289 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsLayoutItem::Flags )
1290 
1291 #endif //QGSLAYOUTITEM_H
1292 
1293 
1294 
QgsLayoutItemRenderContext::viewScaleFactor
double viewScaleFactor() const
Returns the current view zoom (scale factor).
Definition: qgslayoutitem.h:94
QgsLayoutItem::UndoLegendSymbolSpace
@ UndoLegendSymbolSpace
Legend symbol spacing.
Definition: qgslayoutitem.h:260
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:369
QgsLayoutItem::itemOpacity
double itemOpacity() const
Returns the item's opacity.
Definition: qgslayoutitem.h:840
QgsLayoutItem::id
QString id() const
Returns the item's ID name.
Definition: qgslayoutitem.h:354
qgslayoutitemgroup.h
QgsLayoutUndoObjectInterface::createCommand
virtual QgsAbstractLayoutUndoCommand * createCommand(const QString &text, int id=0, QUndoCommand *parent=nullptr)=0
Creates a new layout undo command with the specified text and parent.
qgslayoutitempolygon.h
QgsLayoutItemShape
Layout item for basic filled shapes (e.g. rectangles, ellipses).
Definition: qgslayoutitemshape.h:32
QgsLayoutItem::UndoCommand
UndoCommand
Layout item undo commands, used for collapsing undo commands.
Definition: qgslayoutitem.h:215
QgsApplication::getThemeIcon
static QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
Definition: qgsapplication.cpp:605
QgsLayoutItemPage
Item representing the paper in a layout.
Definition: qgslayoutitempage.h:54
QgsLayoutObject::refresh
virtual void refresh()
Refreshes the object, causing a recalculation of any property overrides.
Definition: qgslayoutobject.h:304
QgsLayoutItem::UndoPictureStrokeColor
@ UndoPictureStrokeColor
Picture stroke color.
Definition: qgslayoutitem.h:244
QgsReadWriteContext
Definition: qgsreadwritecontext.h:34
QgsLayoutItem::UndoScaleBarStrokeColor
@ UndoScaleBarStrokeColor
Scalebar stroke color.
Definition: qgslayoutitem.h:282
QgsLayoutItem::Middle
@ Middle
Center of item.
Definition: qgslayoutitem.h:207
QgsLayoutItem::UndoLegendBoxSpace
@ UndoLegendBoxSpace
Legend box space.
Definition: qgslayoutitem.h:263
QgsLayoutItem::UndoLegendText
@ UndoLegendText
Legend text.
Definition: qgslayoutitem.h:251
QgsLayoutItem::MiddleRight
@ MiddleRight
Middle right of item.
Definition: qgslayoutitem.h:208
QgsLayoutEffect
Definition: qgslayouteffect.h:35
QgsLayoutItem::icon
virtual QIcon icon() const
Returns the item's icon.
Definition: qgslayoutitem.h:331
QgsLayoutItem::UndoShapeStyle
@ UndoShapeStyle
Shape symbol style.
Definition: qgslayoutitem.h:226
QgsLayoutItem::UndoMapGridAnnotationFontColor
@ UndoMapGridAnnotationFontColor
Map frame annotation color.
Definition: qgslayoutitem.h:237
QgsLayoutItemPolyline
Definition: qgslayoutitempolyline.h:32
QgsLayoutItem::UndoLabelFontColor
@ UndoLabelFontColor
Label color.
Definition: qgslayoutitem.h:250
QgsLayoutItem::UndoArrowHeadStrokeColor
@ UndoArrowHeadStrokeColor
Arrow head stroke color.
Definition: qgslayoutitem.h:290
QgsLayoutItem::UndoPictureStrokeWidth
@ UndoPictureStrokeWidth
Picture stroke width.
Definition: qgslayoutitem.h:245
QgsLayoutItem::CanGroupWithAnyOtherItem
@ CanGroupWithAnyOtherItem
Item can be placed on a layer with any other item (default behavior)
Definition: qgslayoutitem.h:426
QgsLayoutItem::UndoScaleBarUnitText
@ UndoScaleBarUnitText
Scalebar unit text.
Definition: qgslayoutitem.h:283
QgsLayoutItem::MiddleLeft
@ MiddleLeft
Middle left of item.
Definition: qgslayoutitem.h:206
QgsLayoutItemRenderContext
Definition: qgslayoutitem.h:44
QgsLayoutItem::UndoScaleBarMapUnitsSegment
@ UndoScaleBarMapUnitsSegment
Scalebar map units per segment.
Definition: qgslayoutitem.h:284
QgsLayoutItem::ExportLayerDetail::mapTheme
QString mapTheme
Associated map theme, or an empty string if this export layer does not need to be associated with a m...
Definition: qgslayoutitem.h:508
QgsLayoutItem::UndoPictureNorthOffset
@ UndoPictureNorthOffset
Picture north offset.
Definition: qgslayoutitem.h:246
QgsRenderContext
Definition: qgsrendercontext.h:57
QgsLayoutItem::UndoStrokeColor
@ UndoStrokeColor
Stroke color adjustment.
Definition: qgslayoutitem.h:220
QgsStyleEntityVisitorInterface
Definition: qgsstyleentityvisitor.h:33
QgsLayoutItem::UndoZoomContent
@ UndoZoomContent
Item content zoomed.
Definition: qgslayoutitem.h:231
qgslayoutitemlabel.h
QgsLayoutItem::UndoLegendTitleFont
@ UndoLegendTitleFont
Legend title font.
Definition: qgslayoutitem.h:268
QgsLayoutItem::UndoScaleBarBoxContentSpace
@ UndoScaleBarBoxContentSpace
Scalebar box context space.
Definition: qgslayoutitem.h:286
QgsLayoutItem::UndoIncrementalResize
@ UndoIncrementalResize
Incremental resize.
Definition: qgslayoutitem.h:219
QgsLayoutItem::ReferencePoint
ReferencePoint
Fixed position reference point.
Definition: qgslayoutitem.h:201
QgsLayoutItem::UndoLegendRasterStrokeWidth
@ UndoLegendRasterStrokeWidth
Legend raster stroke width.
Definition: qgslayoutitem.h:266
QgsLayoutItem::sizeWithUnits
QgsLayoutSize sizeWithUnits() const
Returns the item's current size, including units.
Definition: qgslayoutitem.h:668
QgsLayoutItem::Flag
Flag
Flags for controlling how an item behaves.
Definition: qgslayoutitem.h:299
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
qgslayoutsize.h
QgsLayoutItem::minimumSize
virtual QgsLayoutSize minimumSize() const
Returns the minimum allowed size of the item, if applicable, or an empty size if item can be freely r...
Definition: qgslayoutitem.h:557
QgsLayoutItem::UndoLegendLineSpacing
@ UndoLegendLineSpacing
Legend line spacing.
Definition: qgslayoutitem.h:265
QgsLayoutItem::UndoBackgroundColor
@ UndoBackgroundColor
Background color adjustment.
Definition: qgslayoutitem.h:222
qgslayoutpoint.h
QgsLayoutItem::UndoMapGridIntervalRange
@ UndoMapGridIntervalRange
Grid interval range.
Definition: qgslayoutitem.h:240
qgslayoutframe.h
qgsapplication.h
QgsLayoutItemLegend
Definition: qgslayoutitemlegend.h:113
QgsLayoutItem::UndoLegendItemFont
@ UndoLegendItemFont
Legend item font.
Definition: qgslayoutitem.h:271
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
QgsLayoutItem::UndoMapAnnotationDistance
@ UndoMapAnnotationDistance
Map frame annotation distance.
Definition: qgslayoutitem.h:236
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
QgsLayoutItem::UndoScaleBarSegmentSize
@ UndoScaleBarSegmentSize
Scalebar segment size.
Definition: qgslayoutitem.h:273
QgsLayoutItem::hasBackground
bool hasBackground() const
Returns true if the item has a background.
Definition: qgslayoutitem.h:797
QgsLayoutItem::UndoGridFramePenColor
@ UndoGridFramePenColor
Map grid frame pen color.
Definition: qgslayoutitem.h:233
QgsLayoutObject::AllProperties
@ AllProperties
All properties for item.
Definition: qgslayoutobject.h:135
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsLayoutItem::UndoSetId
@ UndoSetId
Change item ID.
Definition: qgslayoutitem.h:224
QgsLayoutItem::UndoArrowHeadWidth
@ UndoArrowHeadWidth
Arrow head width.
Definition: qgslayoutitem.h:288
QgsLayoutItem::backgroundColor
QColor backgroundColor() const
Returns the background color for this item.
Definition: qgslayoutitem.h:812
QgsLayoutItem::UndoLabelText
@ UndoLabelText
Label text.
Definition: qgslayoutitem.h:247
QgsLayoutItem::frameStrokeWidth
QgsLayoutMeasurement frameStrokeWidth() const
Returns the frame's stroke width.
Definition: qgslayoutitem.h:772
QgsLayoutItem::ExportLayerDetail
Contains details of a particular export layer relating to a layout item.
Definition: qgslayoutitem.h:487
QgsLayoutItem::ExportLayerDetail::name
QString name
User-friendly name for the export layer.
Definition: qgslayoutitem.h:490
QgsLayoutItem::ExportLayerBehavior
ExportLayerBehavior
Behavior of item when exporting to layered outputs.
Definition: qgslayoutitem.h:424
QgsLayoutFrame
Definition: qgslayoutframe.h:31
QgsCompositionConverter
QgsCompositionConverter class converts a QGIS 2.x composition to a QGIS 3.x layout.
Definition: qgscompositionconverter.h:54
QgsLayoutItem::UndoScaleBarSegmentsLeft
@ UndoScaleBarSegmentsLeft
Scalebar segments left.
Definition: qgslayoutitem.h:274
QgsLayoutItem::UndoLegendLayerSpace
@ UndoLegendLayerSpace
Legend layer spacing.
Definition: qgslayoutitem.h:259
QgsLayoutItem::frameJoinStyle
Qt::PenJoinStyle frameJoinStyle() const
Returns the join style used for drawing the item's frame.
Definition: qgslayoutitem.h:781
QgsLayoutItem::UndoRotation
@ UndoRotation
Rotation adjustment.
Definition: qgslayoutitem.h:225
QgsLayoutItem::UndoLegendIconSymbolSpace
@ UndoLegendIconSymbolSpace
Legend icon symbol space.
Definition: qgslayoutitem.h:261
QgsLayoutItem::UndoLegendColumnCount
@ UndoLegendColumnCount
Legend column count.
Definition: qgslayoutitem.h:252
QgsLayoutItem::positionWithUnits
QgsLayoutPoint positionWithUnits() const
Returns the item's current position, including units.
Definition: qgslayoutitem.h:641
qgsrendercontext.h
QgsLayoutItem::UndoLegendFontColor
@ UndoLegendFontColor
Legend font color.
Definition: qgslayoutitem.h:262
QgsLayoutItem::UndoAtlasMargin
@ UndoAtlasMargin
Map atlas margin changed.
Definition: qgslayoutitem.h:229
QgsLayoutItem::UndoScaleBarFillColor
@ UndoScaleBarFillColor
Scalebar fill color.
Definition: qgslayoutitem.h:280
QgsLayoutItem::UndoScaleBarFillColor2
@ UndoScaleBarFillColor2
Scalebar secondary fill color.
Definition: qgslayoutitem.h:281
QgsLayoutItem::referencePoint
ReferencePoint referencePoint() const
Returns the reference point for positioning of the layout item.
Definition: qgslayoutitem.h:541
QgsLayoutItem::UndoScaleBarSubdivisions
@ UndoScaleBarSubdivisions
Scalebar number of subdivisions.
Definition: qgslayoutitem.h:277
QgsLayoutItem::UndoScaleBarSegments
@ UndoScaleBarSegments
Scalebar number of segments.
Definition: qgslayoutitem.h:275
QgsLayoutItem::UndoMapGridMarkerSymbol
@ UndoMapGridMarkerSymbol
Grid marker symbol.
Definition: qgslayoutitem.h:239
QgsLayoutItem::MustPlaceInOwnLayer
@ MustPlaceInOwnLayer
Item must be placed in its own individual layer.
Definition: qgslayoutitem.h:428
QgsLayoutItem::ItemContainsSubLayers
@ ItemContainsSubLayers
Item contains multiple sublayers which must be individually exported.
Definition: qgslayoutitem.h:429
QgsLayoutItem::UndoMapRotation
@ UndoMapRotation
Map rotation changed.
Definition: qgslayoutitem.h:230
QgsLayoutItem::UndoScaleBarLabelBarSize
@ UndoScaleBarLabelBarSize
Scalebar label bar size.
Definition: qgslayoutitem.h:285
QgsLayoutItem::UndoLabelMargin
@ UndoLabelMargin
Label margin.
Definition: qgslayoutitem.h:249
QgsLayoutItem
Base class for graphical items within a QgsLayout.
Definition: qgslayoutitem.h:112
QgsLayoutItem::UndoStrokeWidth
@ UndoStrokeWidth
Stroke width adjustment.
Definition: qgslayoutitem.h:221
qgslayoutmeasurement.h
QgsLayoutItem::UndoLegendSymbolHeight
@ UndoLegendSymbolHeight
Legend symbol height.
Definition: qgslayoutitem.h:254
qgslayoutundocommand.h
QgsLayoutUndoObjectInterface
Definition: qgslayoutundocommand.h:128
QgsLayoutItem::UndoMapGridLineSymbol
@ UndoMapGridLineSymbol
Grid line symbol.
Definition: qgslayoutitem.h:238
QgsLayoutItemGroup
Definition: qgslayoutitemgroup.h:28
QgsLayoutItem::UndoScaleBarFontColor
@ UndoScaleBarFontColor
Scalebar font color.
Definition: qgslayoutitem.h:279
QgsLayoutItem::LowerRight
@ LowerRight
Lower right corner of item.
Definition: qgslayoutitem.h:211
QgsLayoutItem::UndoLegendColumnSpace
@ UndoLegendColumnSpace
Legend column space.
Definition: qgslayoutitem.h:264
QgsLayoutItem::LowerLeft
@ LowerLeft
Lower left corner of item.
Definition: qgslayoutitem.h:209
QgsLayoutItemPicture
Definition: qgslayoutitempicture.h:35
QgsLayoutItem::UndoLegendSymbolWidth
@ UndoLegendSymbolWidth
Legend symbol width.
Definition: qgslayoutitem.h:253
QgsLayoutObject::createExpressionContext
QgsExpressionContext createExpressionContext() const override
Creates an expression context relating to the objects' current state.
Definition: qgslayoutobject.cpp:148
qgslayoutitemlegend.h
QgsLayoutItemMap
Layout graphical items for displaying a map.
Definition: qgslayoutitemmap.h:39
QgsLayoutItem::blendMode
QPainter::CompositionMode blendMode() const
Returns the item's composition blending mode.
Definition: qgslayoutitem.h:825
qgslayoutitempage.h
QgsLayoutItem::UndoArrowHeadFillColor
@ UndoArrowHeadFillColor
Arrow head fill color.
Definition: qgslayoutitem.h:289
QgsLayoutItemRenderContext::renderContext
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Definition: qgslayoutitem.h:72
QgsLayoutItem::uuid
virtual QString uuid() const
Returns the item identification string.
Definition: qgslayoutitem.h:340
QgsLayoutItem::UndoOpacity
@ UndoOpacity
Opacity adjustment.
Definition: qgslayoutitem.h:223
QgsAbstractLayoutUndoCommand
Definition: qgslayoutundocommand.h:34
SIP_FORCE
#define SIP_FORCE
Definition: qgis_sip.h:131
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:49
QgsLayoutItem::UndoPictureRotation
@ UndoPictureRotation
Picture rotation.
Definition: qgslayoutitem.h:242
QgsLayoutItem::UndoLabelFont
@ UndoLabelFont
Label font.
Definition: qgslayoutitem.h:248
QgsLayoutItem::UndoLegendWmsLegendHeight
@ UndoLegendWmsLegendHeight
Legend WMS height.
Definition: qgslayoutitem.h:256
QgsLayoutItem::UpperRight
@ UpperRight
Upper right corner of item.
Definition: qgslayoutitem.h:205
QgsLayoutItem::UndoShapeCornerRadius
@ UndoShapeCornerRadius
Shape corner radius.
Definition: qgslayoutitem.h:227
qgslayoutitempicture.h
QgsLayoutItem::UndoScaleBarSubdivisionsHeight
@ UndoScaleBarSubdivisionsHeight
Scalebar subdivisions height.
Definition: qgslayoutitem.h:278
qgslayoutitempolyline.h
QgsLayoutItem::UndoLegendGroupFont
@ UndoLegendGroupFont
Legend group font.
Definition: qgslayoutitem.h:269
qgslayoutitemshape.h
QgsLayoutItemPolygon
Definition: qgslayoutitempolygon.h:30
QgsLayoutSize
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layo...
Definition: qgslayoutsize.h:40
QgsLayoutItem::UndoLegendTitleSpaceBottom
@ UndoLegendTitleSpaceBottom
Legend title space.
Definition: qgslayoutitem.h:257
QgsLayoutItem::frameStrokeColor
QColor frameStrokeColor() const
Returns the frame's stroke color.
Definition: qgslayoutitem.h:754
QgsLayoutItem::UpperMiddle
@ UpperMiddle
Upper center of item.
Definition: qgslayoutitem.h:204
QgsUnitTypes::LayoutMillimeters
@ LayoutMillimeters
Millimeters.
Definition: qgsunittypes.h:182
qgslayoutobject.h
QgsLayoutItemLabel
Definition: qgslayoutitemlabel.h:34
QgsLayoutItemScaleBar
Definition: qgslayoutitemscalebar.h:35
QgsLayoutItem::UndoMapGridFrameFill1Color
@ UndoMapGridFrameFill1Color
Map grid frame fill color 1.
Definition: qgslayoutitem.h:234
QgsLayoutItemRenderContext::renderContext
const QgsRenderContext & renderContext() const
Returns a reference to the context's render context.
Definition: qgslayoutitem.h:82
QgsLayoutItem::UndoOverviewStyle
@ UndoOverviewStyle
Map overview style.
Definition: qgslayoutitem.h:232
QgsLayoutItem::UndoScaleBarHeight
@ UndoScaleBarHeight
Scalebar height.
Definition: qgslayoutitem.h:276
QgsLayoutItem::UndoLegendWmsLegendWidth
@ UndoLegendWmsLegendWidth
Legend WMS width.
Definition: qgslayoutitem.h:255
QgsLayoutItem::ExportLayerDetail::mapLayerId
QString mapLayerId
Associated map layer ID, or an empty string if this export layer is not associated with a map layer.
Definition: qgslayoutitem.h:493
QgsLayoutItem::UndoCustomCommand
@ UndoCustomCommand
Base id for plugin based item undo commands.
Definition: qgslayoutitem.h:292
QgsLayoutPoint
This class provides a method of storing points, consisting of an x and y coordinate,...
Definition: qgslayoutpoint.h:39
QgsLayoutItem::UndoScaleBarLineWidth
@ UndoScaleBarLineWidth
Scalebar line width.
Definition: qgslayoutitem.h:272
QgsLayoutItem::UndoLegendRasterStrokeColor
@ UndoLegendRasterStrokeColor
Legend raster stroke color.
Definition: qgslayoutitem.h:267
MathUtils::angle
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
Definition: MathUtils.cpp:786
SIP_END
#define SIP_END
Definition: qgis_sip.h:189
QgsLayoutItem::UndoMapGridFrameFill2Color
@ UndoMapGridFrameFill2Color
Map grid frame fill color 2.
Definition: qgslayoutitem.h:235
QgsLayoutItem::CanGroupWithItemsOfSameType
@ CanGroupWithItemsOfSameType
Item can only be placed on layers with other items of the same type, but multiple items of this type ...
Definition: qgslayoutitem.h:427
qgslayoutitemscalebar.h
QgsLayoutItem::UpperLeft
@ UpperLeft
Upper left corner of item.
Definition: qgslayoutitem.h:203
QgsLayoutItem::UndoLegendLayerFont
@ UndoLegendLayerFont
Legend layer font.
Definition: qgslayoutitem.h:270
QgsLayoutItem::UndoNodeMove
@ UndoNodeMove
Node move.
Definition: qgslayoutitem.h:228
QgsLayoutMeasurement
This class provides a method of storing measurements for use in QGIS layouts using a variety of diffe...
Definition: qgslayoutmeasurement.h:33
QgsLayoutItem::isLocked
bool isLocked() const
Returns true if the item is locked, and cannot be interacted with using the mouse.
Definition: qgslayoutitem.h:397
QgsLayoutItem::UndoArrowStrokeWidth
@ UndoArrowStrokeWidth
Arrow stroke width.
Definition: qgslayoutitem.h:287
QgsLayoutItem::UndoLegendGroupSpace
@ UndoLegendGroupSpace
Legend group spacing.
Definition: qgslayoutitem.h:258
QgsLayoutObject::DataDefinedProperty
DataDefinedProperty
Data defined properties for different item types.
Definition: qgslayoutobject.h:132
QgsLayoutObject
Definition: qgslayoutobject.h:39
QgsLayoutItem::UndoMapLabelMargin
@ UndoMapLabelMargin
Margin for labels from edge of map.
Definition: qgslayoutitem.h:241
qgslayoutitemmap.h
QgsLayoutItem::LowerMiddle
@ LowerMiddle
Lower center of item.
Definition: qgslayoutitem.h:210
QgsLayoutItem::fixedSize
virtual QgsLayoutSize fixedSize() const
Returns the fixed size of the item, if applicable, or an empty size if item can be freely resized.
Definition: qgslayoutitem.h:549
QgsLayoutItem::UndoPictureFillColor
@ UndoPictureFillColor
Picture fill color.
Definition: qgslayoutitem.h:243