20 #include <QGraphicsLineItem> 21 #include <QGraphicsScene> 22 #include <QGraphicsSceneMouseEvent> 23 #include <QGraphicsView> 26 #include <QGraphicsEffect> 50 , mRemovedFromComposition( false )
51 , mBoundingResizeRectangle( nullptr )
52 , mHAlignSnapItem( nullptr )
53 , mVAlignSnapItem( nullptr )
56 , mBackgroundColor(
QColor( 255, 255, 255, 255 ) )
57 , mFrameJoinStyle(
Qt::MiterJoin )
58 , mItemPositionLocked( false )
59 , mLastValidViewScaleFactor( -1 )
61 , mEvaluatedItemRotation( 0 )
62 , mBlendMode(
QPainter::CompositionMode_SourceOver )
63 , mEffectsEnabled( true )
65 , mExcludeFromExports( false )
66 , mEvaluatedExcludeFromExports( false )
67 , mLastUsedPositionMode( UpperLeft )
68 , mIsGroupMember( false )
69 , mCurrentExportLayer( -1 )
71 , mUuid(
QUuid::createUuid().toString() )
100 , mUuid(
QUuid::createUuid().toString() )
102 init( manageZValue );
106 void QgsComposerItem::init(
const bool manageZValue )
108 setFlag( QGraphicsItem::ItemIsSelectable,
true );
118 mCompositionManagesZValue =
true;
123 mCompositionManagesZValue =
false;
215 composerItemElem.
setAttribute(
"positionLock",
"true" );
219 composerItemElem.
setAttribute(
"positionLock",
"false" );
273 mTemplateUuid = itemElem.
attribute(
"templateUuid" );
281 if ( frame.
compare(
"true", Qt::CaseInsensitive ) == 0 )
292 if ( background.
compare(
"true", Qt::CaseInsensitive ) == 0 )
303 if ( positionLock.
compare(
"true", Qt::CaseInsensitive ) == 0 )
317 double x,
y, pagex, pagey, width, height;
318 bool xOk, yOk, pageOk, pagexOk, pageyOk, widthOk, heightOk, positionModeOK;
328 if ( !positionModeOK )
332 if ( pageOk && pagexOk && pageyOk )
340 if ( !xOk || !yOk || !widthOk || !heightOk )
351 if ( !frameColorList.isEmpty() )
354 bool redOk, greenOk, blueOk, alphaOk, widthOk;
355 int penRed, penGreen, penBlue, penAlpha;
365 if ( redOk && greenOk && blueOk && alphaOk && widthOk )
367 QPen framePen(
QColor( penRed, penGreen, penBlue, penAlpha ) );
379 bool redOk, greenOk, blueOk, alphaOk;
380 int bgRed, bgGreen, bgBlue, bgAlpha;
385 if ( redOk && greenOk && blueOk && alphaOk )
387 QColor brushColor( bgRed, bgGreen, bgBlue, bgAlpha );
409 if ( drawFrame ==
mFrame )
422 if ( itemPen.
color() == color )
473 return rect().
adjusted( -frameBleed, -frameBleed, frameBleed, frameBleed );
523 selectedItemPen.
setStyle( Qt::DotLine );
525 p->
setPen( selectedItemPen );
583 double y =
pos().
y();
586 while ( y - h >= 0. )
598 p.
ry() -= (
page() - 1 ) * h;
604 Q_UNUSED( newPageWidth )
606 int curPage =
page() - 1;
624 double upperLeftX =
x;
625 double upperLeftY =
y;
630 upperLeftY += ( page - 1 ) * h;
639 upperLeftX -= width / 2.0;
649 upperLeftY -= height / 2.0;
653 upperLeftY -= height;
656 if ( posIncludesFrame )
670 upperLeftX += lineToItemOrigin.
x2();
671 upperLeftY += lineToItemOrigin.
y2();
687 double newWidth = rectangle.
width();
688 double newHeight = rectangle.
height();
689 double xTranslation = rectangle.
x();
690 double yTranslation = rectangle.
y();
693 if ( rectangle.
width() < 0 )
695 newWidth = - rectangle.
width();
696 xTranslation -= newWidth;
699 if ( rectangle.
height() < 0 )
701 newHeight = - rectangle.
height();
702 yTranslation -= newHeight;
722 evalContext = scopedContext.
data();
731 double width = exprVal.
toDouble( &ok );
733 if ( ok && !exprVal.
isNull() )
741 double height = exprVal.
toDouble( &ok );
743 if ( ok && !exprVal.
isNull() )
749 double x = result.
left();
756 x += newRect.
width() / 2.0;
760 x += newRect.
width();
777 double positionX = exprVal.
toDouble( &ok );
779 if ( ok && !exprVal.
isNull() )
785 double y = result.
top();
792 y += newRect.
height() / 2.0;
813 double positionY = exprVal.
toDouble( &ok );
815 if ( ok && !exprVal.
isNull() )
824 x -= result.
width() / 2.0;
834 y -= result.
height() / 2.0;
900 refreshBlendMode( *context.
data() );
915 blendMode = blendModeD;
926 refreshTransparency(
true, *context.
data() );
938 int transparencyD = exprVal.
toInt( &ok );
940 if ( ok && !exprVal.
isNull() )
942 transparency = transparencyD;
1029 double rectHandlerSize = 10.0 / viewScaleFactor;
1032 if ( rectHandlerSize > (
rect().width() / 3 ) )
1036 if ( rectHandlerSize > (
rect().height() / 3 ) )
1040 return rectHandlerSize;
1047 if ( lockSymbolSize > (
rect().width() / 3 ) )
1051 if ( lockSymbolSize > (
rect().height() / 3 ) )
1077 refreshRotation(
true, adjustPosition, *context.
data() );
1089 double rotD = exprVal.
toDouble( &ok );
1091 if ( ok && !exprVal.
isNull() )
1102 if ( adjustPosition )
1110 QPointF rotatedReferencePoint = refLine.
p2();
1111 setPos( rotatedReferencePoint );
1141 if ( qAbs( rotation ) <= 0.0 )
1162 double midX = width / 2.0;
1163 double midY = height / 2.0;
1186 double distM1 = sqrt(( x1 - midX ) * ( x1 - midX ) + ( y1 - midY ) * ( y1 - midY ) );
1189 if ( p2.
x() < width && p2.
x() > 0 && p2.
y() < height && p2.
y() > 0 )
1191 width = sqrt(( p2.
x() - x1 ) * ( p2.
x() - x1 ) + ( p2.
y() - y1 ) * ( p2.
y() - y1 ) );
1192 height = sqrt(( x3 - p2.
x() ) * ( x3 - p2.
x() ) + ( y3 - p2.
y() ) * ( y3 - p2.
y() ) );
1197 double distM2 = sqrt(( x2 - midX ) * ( x2 - midX ) + ( y2 - midY ) * ( y2 - midY ) );
1200 width = sqrt(( x2 - p1.
x() ) * ( x2 - p1.
x() ) + ( y2 - p1.
y() ) * ( y2 - p1.
y() ) );
1201 height = sqrt(( p3.
x() - x2 ) * ( p3.
x() - x2 ) + ( p3.
y() - y2 ) * ( p3.
y() - y2 ) );
1221 double rotToRad = rotation *
M_PI / 180.0;
1222 QPointF midpoint( width / 2.0, height / 2.0 );
1223 double xVector = x - midpoint.
x();
1224 double yVector = y - midpoint.
y();
1227 double xRotated = cos( rotToRad ) * xVector - sin( rotToRad ) * yVector;
1228 double yRotated = sin( rotToRad ) * xVector + cos( rotToRad ) * yVector;
1231 QLineF line( midpoint.
x(), midpoint.
y(), midpoint.
x() + xRotated, midpoint.
y() + yRotated );
1235 borders <<
QLineF( 0, 0, width, 0 );
1236 borders << QLineF( width, 0, width, height );
1237 borders << QLineF( width, height, 0, height );
1238 borders << QLineF( 0, height, 0, 0 );
1243 for ( ; it != borders.constEnd(); ++it )
1245 if ( line.intersect( *it, &intersectionPoint ) == QLineF::BoundedIntersection )
1247 x = intersectionPoint.
x();
1248 y = intersectionPoint.
y();
1265 if ( rotation == 0.0 )
1271 double x1 = -width / 2.0;
1272 double y1 = -height / 2.0;
1275 double x2 = width / 2.0;
1276 double y2 = -height / 2.0;
1279 double x3 = width / 2.0;
1280 double y3 = height / 2.0;
1283 double x4 = -width / 2.0;
1284 double y4 = height / 2.0;
1288 QPointF midpoint( width / 2.0, height / 2.0 );
1291 rotatedRectPoly <<
QPointF( midpoint.
x() + x1, midpoint.
y() + y1 );
1292 rotatedRectPoly <<
QPointF( midpoint.
x() + x2, midpoint.
y() + y2 );
1293 rotatedRectPoly <<
QPointF( midpoint.
x() + x3, midpoint.
y() + y3 );
1294 rotatedRectPoly <<
QPointF( midpoint.
x() + x4, midpoint.
y() + y4 );
1296 width = boundingRect.
width();
1297 height = boundingRect.height();
1369 evalContext = scopedContext.
data();
1379 if ( evaluatedRect != beforeRect )
1386 refreshRotation(
false,
true, *evalContext );
1390 refreshTransparency(
false, *evalContext );
1394 refreshBlendMode( *evalContext );
1403 exclude = exprVal.
toBool();
1433 setFlag( QGraphicsItem::ItemIsSelectable, !isGroupMember );
1439 if ( !
id().isEmpty() )
1449 return tr(
"<arrow>" );
1451 return tr(
"<group>" );
1453 return tr(
"<label>" );
1455 return tr(
"<legend>" );
1457 return tr(
"<map>" );
1459 return tr(
"<picture>" );
1461 return tr(
"<scale bar>" );
1463 return tr(
"<shape>" );
1465 return tr(
"<table>" );
1467 return tr(
"<attribute table>" );
1469 return tr(
"<text table>" );
1471 return tr(
"<frame>" );
1474 return tr(
"<item>" );
bool mExcludeFromExports
Whether item should be excluded in exports.
QDomNodeList elementsByTagName(const QString &tagname) const
void setSelected(bool selected)
void setCompositionMode(QPainter::CompositionMode compositionMode)
double horizontalViewScaleFactor() const
Returns the zoom factor of the graphics view.
virtual QString displayName() const
Get item display name.
void setStyle(Qt::PenStyle style)
int mTransparency
Item transparency.
A base class for objects which belong to a map composition.
bool isGroupMember() const
Returns whether this item is part of a group.
bool shouldDrawItem() const
Returns whether the item should be drawn in the current context.
void itemRotationChanged(double newRotation)
Is emitted on item rotation change.
void setCompositionMode(CompositionMode mode)
void setRenderHint(RenderHint hint, bool on)
void setGraphicsEffect(QGraphicsEffect *effect)
QDomNode appendChild(const QDomNode &newChild)
void addItemToZList(QgsComposerItem *item)
Adds item to z list.
virtual void setRotation(double r)
Sets the item rotation.
void setFlag(GraphicsItemFlag flag, bool enabled)
Q_DECL_DEPRECATED void drawText(QPainter *p, double x, double y, const QString &text, const QFont &font, const QColor &c=QColor()) const
Draws Text.
QPointF pagePos() const
Returns the item's position relative to its current page.
QString attribute(const QString &name, const QString &defValue) const
static double angle(QPointF p1, QPointF p2)
Calculates the angle of the line from p1 to p2 (counter clockwise, starting from a line from north to...
QgsComposerModel * itemsModel()
Returns the items model attached to the composition.
void itemChanged()
Emitted when the item changes.
bool effectsEnabled() const
Returns whether effects (eg blend modes) are enabled for the item.
const T & at(int i) const
QMap< QgsComposerObject::DataDefinedProperty, QString > mDataDefinedNames
Map of data defined properties for the item to string name to use when exporting item to xml...
#define Q_NOWARN_DEPRECATED_PUSH
QRectF evalItemRect(const QRectF &newRect, const bool resizeOnly=false, const QgsExpressionContext *context=nullptr)
Evaluates an item's bounding rect to consider data defined position and size of item and reference po...
static QgsMapRenderer::BlendMode getBlendModeEnum(QPainter::CompositionMode blendMode)
Returns a BlendMode corresponding to a QPainter::CompositionMode.
void removeItemFromZList(QgsComposerItem *item)
Removes item from z list.
static void drawText(QPainter *painter, QPointF pos, const QString &text, const QFont &font, const QColor &color=QColor())
Draws text on a painter at a specific position, taking care of composer specific issues (calculation ...
virtual double estimatedFrameBleed() const
Returns the estimated amount the item's frame bleeds outside the item's actual rectangle.
double mLastValidViewScaleFactor
Backup to restore item appearance if no view scale factor is available.
ItemPositionMode mLastUsedPositionMode
The item's position mode.
void updateBounds()
Updates the scene bounds of the composition.
void setJoinStyle(Qt::PenJoinStyle style)
void updateItemVisibility(QgsComposerItem *item)
Must be called when an item's visibility changes.
QColor backgroundColor() const
Gets the background color for this item.
virtual void setSelected(bool s)
Set selected, selected item should be highlighted.
static Qt::PenJoinStyle decodePenJoinStyle(const QString &str)
static double fontAscentMM(const QFont &font)
Calculate font ascent in millimeters, including workarounds for QT font rendering issues...
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect(double &x, double &y, double width, double height, double rotation) const
Calculates corner point after rotation and scaling.
virtual void drawFrame(QPainter *p)
Draw black frame around item.
virtual void setFrameEnabled(const bool drawFrame)
Set whether this item has a frame drawn around it or not.
double itemRotation(const QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue) const
Returns the current rotation for the composer item.
static QFont scaledFontPixelSize(const QFont &font)
Returns a font where size is set in pixels and the size has been upscaled with FONT_WORKAROUND_SCALE ...
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
Q_DECL_DEPRECATED double fontAscentMillimeters(const QFont &font) const
Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCAL...
QPainter::CompositionMode mBlendMode
Composition blend mode for item.
bool _writeXML(QDomElement &itemElem, QDomDocument &doc) const
Writes parameter that are not subclass specific in document.
Q_DECL_DEPRECATED double fontHeightMillimeters(const QFont &font) const
Returns the font height in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCAL...
QGraphicsScene * scene() const
bool excludeFromExports(const QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue)
Returns whether the item should be excluded from composer exports and prints.
double toDouble(bool *ok) const
virtual QgsExpressionContext * createExpressionContext() const override
Creates an expression context relating to the item's current state.
static double fontDescentMM(const QFont &font)
Calculate font descent in millimeters, including workarounds for QT font rendering issues...
QString tr(const char *sourceText, const char *disambiguation, int n)
void setEnabled(bool enable)
void setBlendMode(const QPainter::CompositionMode blendMode)
Sets the item's composition blending mode.
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Compare two doubles (but allow some difference)
void update(const QRectF &rect)
void updateItemDisplayName(QgsComposerItem *item)
Must be called when an item's display name is modified.
DataDefinedProperty
Data defined properties for different item types.
void setRect(const QRectF &rectangle)
QgsComposition::PlotStyle plotStyle() const
void setHeight(qreal height)
void setItemPosition(double x, double y, ItemPositionMode itemPoint=UpperLeft, int page=-1)
Moves the item to a new position (in canvas coordinates)
bool _readXML(const QDomElement &itemElem, const QDomDocument &doc)
Reads parameter that are not subclass specific in document.
const QColor & color() const
void deleteHAlignSnapItem()
QDomElement toElement() const
static QPointF pointOnLineWithDistance(QPointF startPoint, QPointF directionPoint, double distance)
Returns a point on the line from startPoint to directionPoint that is a certain distance away from th...
void updateItemLockStatus(QgsComposerItem *item)
Must be called when an item's lock status changes.
void drawRect(const QRectF &rectangle)
virtual QRectF boundingRect() const
static void drawArrowHead(QPainter *p, const double x, const double y, const double angle, const double arrowHeadWidth)
Draws an arrow head on to a QPainter.
int page() const
Gets the page the item is currently on.
static double fontHeightCharacterMM(const QFont &font, QChar character)
Calculate font height in millimeters of a single character, including workarounds for QT font renderi...
void frameChanged()
Emitted if the item's frame style changes.
static QPainter::CompositionMode decodeBlendMode(const QString &s)
QString number(int n, int base)
void addPolygon(const QPolygonF &polygon)
QVariant property(const char *name) const
void setFrameJoinStyle(const Qt::PenJoinStyle style)
Sets join style used when drawing the item's frame.
int toInt(bool *ok) const
void removeItem(QGraphicsItem *item)
void cancelCommand()
Deletes current command.
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.
Q_DECL_DEPRECATED void rotate(double angle, double &x, double &y) const
Rotates a point / vector.
void endCommand()
Saves end state of item and pushes command to the undo history.
QGraphicsRectItem * mBoundingResizeRectangle
Rectangle used during move and resize actions.
void setPen(const QColor &color)
void updatePagePos(double newPageWidth, double newPageHeight)
Moves the item so that it retains its relative position on the page when the paper size changes...
bool mFrame
True if item fram needs to be painted.
void setAttribute(const QString &name, const QString &value)
void setPos(const QPointF &pos)
QList< QGraphicsView * > views() const
int toInt(bool *ok, int base) const
void setAngle(qreal angle)
void endCommand()
Finish current command and push it onto the undo stack.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
virtual void setFrameOutlineColor(const QColor &color)
Sets frame outline color.
static QString encodePenJoinStyle(Qt::PenJoinStyle style)
Q_DECL_DEPRECATED QRectF largestRotatedRectWithinBounds(const QRectF &originalRect, const QRectF &boundsRect, double rotation) const
Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by a specified amount.
static QRectF largestRotatedRectWithinBounds(const QRectF &originalRect, const QRectF &boundsRect, const double rotation)
Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by a specified amount.
bool dataDefinedEvaluate(const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue, const QgsExpressionContext &context=QgsExpressionContext()) const
Evaluate a data defined property and return the calculated value.
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...
Q_DECL_DEPRECATED QFont scaledFontPixelSize(const QFont &font) const
Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE.
void setWidthF(qreal width)
Q_DECL_DEPRECATED double lockSymbolSize() const
Returns the size of the lock symbol depending on the composer zoom level and the item size...
void setBrush(const QBrush &brush)
double mEvaluatedItemRotation
Temporary evaluated item rotation in degrees, clockwise.
Q_DECL_DEPRECATED double textWidthMillimeters(const QFont &font, const QString &text) const
Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE...
bool mRemovedFromComposition
True if item has been removed from the composition.
virtual ~QgsComposerItem()
void beginCommand(const QString &commandText, QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown)
Starts new composer undo command.
PropertyValueType
Specifies whether the value returned by a function should be the original, user set value...
GraphicsItemFlags flags() const
void setOpacity(qreal opacity)
void setColor(const QColor &color)
static QPainter::CompositionMode getCompositionMode(BlendMode blendMode)
Returns a QPainter::CompositionMode corresponding to a BlendMode.
static QgsExpressionContextScope * composerItemScope(const QgsComposerItem *composerItem)
Creates a new scope which contains variables and functions relating to a QgsComposerItem.
Q_DECL_DEPRECATED double fontDescentMillimeters(const QFont &font) const
Returns the font descent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCA...
Graphics scene for map printing.
void setPen(const QPen &pen)
static void rotate(const double angle, double &x, double &y)
Rotates a point / vector around the origin.
virtual void setExcludeFromExports(const bool exclude)
Sets whether the item should be excluded from composer exports and prints.
Q_DECL_DEPRECATED double fontHeightCharacterMM(const QFont &font, QChar c) const
Returns the font height of a character in millimeters.
QGraphicsLineItem * hAlignSnapItem()
Return horizontal align snap item.
void setPositionLock(const bool lock)
Locks / unlocks the item position for mouse drags.
virtual void setFrameOutlineWidth(const double outlineWidth)
Sets frame outline width.
#define Q_NOWARN_DEPRECATED_POP
static double textWidthMM(const QFont &font, const QString &text)
Calculate font width in millimeters for a string, including workarounds for QT font rendering issues...
QgsComposition * mComposition
Qt::PenJoinStyle mFrameJoinStyle
Frame join style.
QColor mBackgroundColor
Background color.
QGraphicsLineItem * mVAlignSnapItem
static double fontHeightMM(const QFont &font)
Calculate font height in millimeters, including workarounds for QT font rendering issues The font hei...
QGraphicsLineItem * mHAlignSnapItem
QRectF boundingRect() const
QPointF mapToScene(const QPointF &point) const
void drawPath(const QPainterPath &path)
void setBackgroundColor(const QColor &backgroundColor)
Sets the background color for this item.
int mCurrentExportLayer
The layer that needs to be exported.
const QgsComposition * composition() const
Returns the composition the item is attached to.
void setPen(const QPen &pen)
bool mItemPositionLocked
True if item position and size cannot be changed with mouse move.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets item state from DOM element.
virtual void setItemRotation(const double r, const bool adjustPosition=false)
Sets the item rotation.
void setWidth(qreal width)
virtual void drawBackground(QPainter *p)
Draw background.
void deleteVAlignSnapItem()
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
virtual void setId(const QString &id)
Set item's id (which is not necessarly unique)
Q_DECL_DEPRECATED double rotation() const
Returns the rotation for the composer item.
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 sizeChanged()
Emitted if the rectangle changes.
void setIsGroupMember(const bool isGroupMember)
Sets whether this item is part of a group.
Q_DECL_DEPRECATED double pixelFontSize(double pointSize) const
Calculates font size in mm from a font point size.
static double pointsToMM(const double pointSize)
Returns the size in mm corresponding to a font point size.
Q_DECL_DEPRECATED void drawArrowHead(QPainter *p, double x, double y, double angle, double arrowHeadWidth) const
Draws arrowhead.
void setVisible(bool visible)
void setEffectsEnabled(const bool effectsEnabled)
Sets whether effects (eg blend modes) are enabled for the item.
void updateItemSelectStatus(QgsComposerItem *item)
Must be called when an item's selection status changes.
double paperHeight() const
Height of paper item.
QRectF adjusted(qreal dx1, qreal dy1, qreal dx2, qreal dy2) const
void setRotation(qreal angle)
double toDouble(bool *ok) const
iterator insert(const Key &key, const T &value)
bool hasFrame() const
Whether this item has a frame or not.
void setBrush(const QBrush &brush)
QgsComposerEffect * mEffect
QgsComposerItem(QgsComposition *composition, bool manageZValue=true)
Constructor.
QDomElement createElement(const QString &tagName)
bool positionLock() const
Returns whether position lock for mouse drags is enabled returns true if item is locked for mouse mov...
void lockChanged()
Emitted if the item's lock status changes.
void addItem(QGraphicsItem *item)
int compare(const QString &other) const
bool mBackground
True if item background needs to be painted.
void move(double dx, double dy)
Moves item in canvas coordinates.
QPainter::CompositionMode blendMode() const
Returns the item's composition blending mode.
Q_DECL_DEPRECATED double angle(QPointF p1, QPointF p2) const
Returns angle of the line from p1 to p2 (clockwise, starting at N)
virtual void setVisibility(const bool visible)
Sets visibility for item.
bool mIsGroupMember
Whether or not this item is part of a group.
QString id() const
Get item's id (which is not necessarly unique)
double mItemRotation
Item rotation in degrees, clockwise.
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...
double spaceBetweenPages() const
Returns the vertical space between pages in a composer view.
QGraphicsLineItem * vAlignSnapItem()
Return vertical align snap item.
virtual QgsExpressionContext * createExpressionContext() const
Creates an expression context relating to the objects' current state.
bool mEvaluatedExcludeFromExports
Temporary evaluated item exclusion.
void setTransparency(const int transparency)
Sets the item's transparency.
virtual QRectF rectWithFrame() const
Returns the item's rectangular bounds, including any bleed caused by the item's frame.
Q_DECL_DEPRECATED void sizeChangedByRotation(double &width, double &height, double rotation)
Calculates width / height of the bounding box of a rotated rectangle.
virtual int type() const override
Return correct graphics item type.
QDomNode at(int index) const
uint toUInt(bool *ok, int base) const
double rectHandlerBorderTolerance() const
Returns the current (zoom level dependent) tolerance to decide if mouse position is close enough to t...
int transparency() const
Returns the item's transparency.
void beginCommand(QgsComposerItem *item, const QString &commandText, const QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown)
Allocates new item command and saves initial state in it.