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;
216 composerItemElem.
setAttribute(
"positionLock",
"true" );
220 composerItemElem.
setAttribute(
"positionLock",
"false" );
274 mTemplateUuid = itemElem.
attribute(
"templateUuid" );
282 if ( frame.
compare(
"true", Qt::CaseInsensitive ) == 0 )
293 if ( background.
compare(
"true", Qt::CaseInsensitive ) == 0 )
304 if ( positionLock.
compare(
"true", Qt::CaseInsensitive ) == 0 )
318 double x,
y, pagex, pagey, width, height;
319 bool xOk, yOk, pageOk, pagexOk, pageyOk, widthOk, heightOk, positionModeOK;
329 if ( !positionModeOK )
333 if ( pageOk && pagexOk && pageyOk )
341 if ( !xOk || !yOk || !widthOk || !heightOk )
352 if ( !frameColorList.isEmpty() )
355 bool redOk, greenOk, blueOk, alphaOk, widthOk;
356 int penRed, penGreen, penBlue, penAlpha;
366 if ( redOk && greenOk && blueOk && alphaOk && widthOk )
368 QPen framePen(
QColor( penRed, penGreen, penBlue, penAlpha ) );
380 bool redOk, greenOk, blueOk, alphaOk;
381 int bgRed, bgGreen, bgBlue, bgAlpha;
386 if ( redOk && greenOk && blueOk && alphaOk )
388 QColor brushColor( bgRed, bgGreen, bgBlue, bgAlpha );
410 if ( drawFrame ==
mFrame )
423 if ( itemPen.
color() == color )
474 return rect().
adjusted( -frameBleed, -frameBleed, frameBleed, frameBleed );
524 selectedItemPen.
setStyle( Qt::DotLine );
526 p->
setPen( selectedItemPen );
578 double y =
pos().
y();
581 while ( y - h >= 0. )
593 p.
ry() -= (
page() - 1 ) * h;
599 Q_UNUSED( newPageWidth )
601 int curPage =
page() - 1;
619 double upperLeftX =
x;
620 double upperLeftY =
y;
625 upperLeftY += ( page - 1 ) * h;
634 upperLeftX -= width / 2.0;
644 upperLeftY -= height / 2.0;
648 upperLeftY -= height;
651 if ( posIncludesFrame )
665 upperLeftX += lineToItemOrigin.
x2();
666 upperLeftY += lineToItemOrigin.
y2();
682 double newWidth = rectangle.
width();
683 double newHeight = rectangle.
height();
684 double xTranslation = rectangle.
x();
685 double yTranslation = rectangle.
y();
688 if ( rectangle.
width() < 0 )
690 newWidth = - rectangle.
width();
691 xTranslation -= newWidth;
694 if ( rectangle.
height() < 0 )
696 newHeight = - rectangle.
height();
697 yTranslation -= newHeight;
717 evalContext = scopedContext.
data();
726 double width = exprVal.
toDouble( &ok );
728 if ( ok && !exprVal.
isNull() )
736 double height = exprVal.
toDouble( &ok );
738 if ( ok && !exprVal.
isNull() )
744 double x = result.
left();
751 x += newRect.
width() / 2.0;
755 x += newRect.
width();
772 double positionX = exprVal.
toDouble( &ok );
774 if ( ok && !exprVal.
isNull() )
780 double y = result.
top();
787 y += newRect.
height() / 2.0;
808 double positionY = exprVal.
toDouble( &ok );
810 if ( ok && !exprVal.
isNull() )
819 x -= result.
width() / 2.0;
829 y -= result.
height() / 2.0;
895 refreshBlendMode( *context.
data() );
910 blendMode = blendModeD;
921 refreshTransparency(
true, *context.
data() );
933 int transparencyD = exprVal.
toInt( &ok );
935 if ( ok && !exprVal.
isNull() )
937 transparency = transparencyD;
1024 double rectHandlerSize = 10.0 / viewScaleFactor;
1027 if ( rectHandlerSize > (
rect().width() / 3 ) )
1031 if ( rectHandlerSize > (
rect().height() / 3 ) )
1035 return rectHandlerSize;
1042 if ( lockSymbolSize > (
rect().width() / 3 ) )
1046 if ( lockSymbolSize > (
rect().height() / 3 ) )
1072 refreshRotation(
true, adjustPosition, *context.
data() );
1084 double rotD = exprVal.
toDouble( &ok );
1086 if ( ok && !exprVal.
isNull() )
1097 if ( adjustPosition )
1105 QPointF rotatedReferencePoint = refLine.
p2();
1106 setPos( rotatedReferencePoint );
1136 if ( qAbs( rotation ) <= 0.0 )
1157 double midX = width / 2.0;
1158 double midY = height / 2.0;
1181 double distM1 = sqrt(( x1 - midX ) * ( x1 - midX ) + ( y1 - midY ) * ( y1 - midY ) );
1184 if ( p2.
x() < width && p2.
x() > 0 && p2.
y() < height && p2.
y() > 0 )
1186 width = sqrt(( p2.
x() - x1 ) * ( p2.
x() - x1 ) + ( p2.
y() - y1 ) * ( p2.
y() - y1 ) );
1187 height = sqrt(( x3 - p2.
x() ) * ( x3 - p2.
x() ) + ( y3 - p2.
y() ) * ( y3 - p2.
y() ) );
1192 double distM2 = sqrt(( x2 - midX ) * ( x2 - midX ) + ( y2 - midY ) * ( y2 - midY ) );
1195 width = sqrt(( x2 - p1.
x() ) * ( x2 - p1.
x() ) + ( y2 - p1.
y() ) * ( y2 - p1.
y() ) );
1196 height = sqrt(( p3.
x() - x2 ) * ( p3.
x() - x2 ) + ( p3.
y() - y2 ) * ( p3.
y() - y2 ) );
1216 double rotToRad = rotation *
M_PI / 180.0;
1217 QPointF midpoint( width / 2.0, height / 2.0 );
1218 double xVector = x - midpoint.
x();
1219 double yVector = y - midpoint.
y();
1222 double xRotated = cos( rotToRad ) * xVector - sin( rotToRad ) * yVector;
1223 double yRotated = sin( rotToRad ) * xVector + cos( rotToRad ) * yVector;
1226 QLineF line( midpoint.
x(), midpoint.
y(), midpoint.
x() + xRotated, midpoint.
y() + yRotated );
1230 borders <<
QLineF( 0, 0, width, 0 );
1231 borders << QLineF( width, 0, width, height );
1232 borders << QLineF( width, height, 0, height );
1233 borders << QLineF( 0, height, 0, 0 );
1238 for ( ; it != borders.constEnd(); ++it )
1240 if ( line.intersect( *it, &intersectionPoint ) == QLineF::BoundedIntersection )
1242 x = intersectionPoint.
x();
1243 y = intersectionPoint.
y();
1260 if ( rotation == 0.0 )
1266 double x1 = -width / 2.0;
1267 double y1 = -height / 2.0;
1270 double x2 = width / 2.0;
1271 double y2 = -height / 2.0;
1274 double x3 = width / 2.0;
1275 double y3 = height / 2.0;
1278 double x4 = -width / 2.0;
1279 double y4 = height / 2.0;
1283 QPointF midpoint( width / 2.0, height / 2.0 );
1286 rotatedRectPoly <<
QPointF( midpoint.
x() + x1, midpoint.
y() + y1 );
1287 rotatedRectPoly <<
QPointF( midpoint.
x() + x2, midpoint.
y() + y2 );
1288 rotatedRectPoly <<
QPointF( midpoint.
x() + x3, midpoint.
y() + y3 );
1289 rotatedRectPoly <<
QPointF( midpoint.
x() + x4, midpoint.
y() + y4 );
1291 width = boundingRect.
width();
1292 height = boundingRect.height();
1364 evalContext = scopedContext.
data();
1374 if ( evaluatedRect != beforeRect )
1381 refreshRotation(
false,
true, *evalContext );
1385 refreshTransparency(
false, *evalContext );
1389 refreshBlendMode( *evalContext );
1398 exclude = exprVal.
toBool();
1428 setFlag( QGraphicsItem::ItemIsSelectable, !isGroupMember );
1434 if ( !
id().isEmpty() )
1444 return tr(
"<arrow>" );
1446 return tr(
"<group>" );
1448 return tr(
"<label>" );
1450 return tr(
"<legend>" );
1452 return tr(
"<map>" );
1454 return tr(
"<picture>" );
1456 return tr(
"<scale bar>" );
1458 return tr(
"<shape>" );
1460 return tr(
"<table>" );
1462 return tr(
"<attribute table>" );
1464 return tr(
"<text table>" );
1466 return tr(
"<frame>" );
1469 return tr(
"<item>" );
bool positionLock() const
Returns whether position lock for mouse drags is enabled returns true if item is locked for mouse mov...
bool mExcludeFromExports
Whether item should be excluded in exports.
QDomNodeList elementsByTagName(const QString &tagname) const
void setSelected(bool selected)
bool effectsEnabled() const
Returns whether effects (eg blend modes) are enabled for the item.
Q_DECL_DEPRECATED bool imageSizeConsideringRotation(double &width, double &height, double rotation) const
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the give...
void setCompositionMode(QPainter::CompositionMode compositionMode)
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
void setStyle(Qt::PenStyle style)
int mTransparency
Item transparency.
A base class for objects which belong to a map composition.
void itemRotationChanged(double newRotation)
Is emitted on item rotation change.
Q_DECL_DEPRECATED double pixelFontSize(double pointSize) const
Calculates font size in mm from a font point size.
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)
virtual double estimatedFrameBleed() const
Returns the estimated amount the item's frame bleeds outside the item's actual rectangle.
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.
Q_DECL_DEPRECATED double fontHeightCharacterMM(const QFont &font, QChar c) const
Returns the font height of a character in millimeters.
Q_DECL_DEPRECATED double lockSymbolSize() const
Returns the size of the lock symbol depending on the composer zoom level and the item size...
QPointF pagePos() const
Returns the item's position relative to its current page.
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 ...
double mLastValidViewScaleFactor
Backup to restore item appearance if no view scale factor is available.
ItemPositionMode mLastUsedPositionMode
The item's position mode.
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule)
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.
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...
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.
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 ...
QColor backgroundColor() const
Gets the background color for this item.
QPainter::CompositionMode mBlendMode
Composition blend mode for item.
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
double spaceBetweenPages() const
Returns the vertical space between pages in a composer view.
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...
double itemRotation(const QgsComposerObject::PropertyValueType valueType=QgsComposerObject::EvaluatedValue) const
Returns the current rotation for the composer item.
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)
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)
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.
Q_DECL_DEPRECATED double fontDescentMillimeters(const QFont &font) const
Returns the font descent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCA...
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.
virtual QgsExpressionContext * createExpressionContext() const
Creates an expression context relating to the objects' current state.
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)
double horizontalViewScaleFactor() const
Returns the zoom factor of the graphics view.
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.
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.
int transparency() const
Returns the item's transparency.
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 double textWidthMillimeters(const QFont &font, const QString &text) const
Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE...
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)
const QgsComposition * composition() const
Returns the composition the item is attached to.
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)
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.
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...
void setWidthF(qreal width)
void setBrush(const QBrush &brush)
double mEvaluatedItemRotation
Temporary evaluated item rotation in degrees, clockwise.
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
bool shouldDrawItem() const
Returns whether the item should be drawn in the current context.
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.
Graphics scene for map printing.
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.
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.
bool dataDefinedEvaluate(const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue, const QgsExpressionContext &context=QgsExpressionContext()) const
Evaluate a data defined property and return the calculated value.
virtual QString displayName() const
Get item display name.
virtual QRectF rectWithFrame() const
Returns the item's rectangular bounds, including any bleed caused by the item's frame.
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.
Q_DECL_DEPRECATED double rotation() const
Returns the rotation for the composer item.
#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
Q_DECL_DEPRECATED double angle(QPointF p1, QPointF p2) const
Returns angle of the line from p1 to p2 (clockwise, starting at N)
static double fontHeightMM(const QFont &font)
Calculate font height in millimeters, including workarounds for QT font rendering issues The font hei...
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect(double &x, double &y, double width, double height, double rotation) const
Calculates corner point after rotation and scaling.
QGraphicsLineItem * mHAlignSnapItem
QRectF boundingRect() const
QPointF mapToScene(const QPointF &point) const
void setBackgroundColor(const QColor &backgroundColor)
Sets the background color for this item.
bool _writeXML(QDomElement &itemElem, QDomDocument &doc) const
Writes parameter that are not subclass specific in document.
int mCurrentExportLayer
The layer that needs to be exported.
void setPen(const QPen &pen)
bool mItemPositionLocked
True if item position and size cannot be changed with mouse move.
QPainter::CompositionMode blendMode() const
Returns the item's composition blending mode.
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()
bool hasFrame() const
Whether this item has a frame or not.
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 fontHeightMillimeters(const QFont &font) const
Returns the font height in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCAL...
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.
double paperHeight() const
Height of paper item.
void setIsGroupMember(const bool isGroupMember)
Sets whether this item is part of a group.
static double pointsToMM(const double pointSize)
Returns the size in mm corresponding to a font point size.
int page() const
Gets the page the item is currently on.
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.
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)
void setBrush(const QBrush &brush)
QgsComposerEffect * mEffect
Q_DECL_DEPRECATED void drawArrowHead(QPainter *p, double x, double y, double angle, double arrowHeadWidth) const
Draws arrowhead.
QgsComposerItem(QgsComposition *composition, bool manageZValue=true)
Constructor.
QDomElement createElement(const QString &tagName)
void lockChanged()
Emitted if the item's lock status changes.
void addItem(QGraphicsItem *item)
QgsComposition::PlotStyle plotStyle() const
double rectHandlerBorderTolerance() const
Returns the current (zoom level dependent) tolerance to decide if mouse position is close enough to t...
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.
bool isGroupMember() const
Returns whether this item is part of a group.
virtual void setVisibility(const bool visible)
Sets visibility for item.
bool mIsGroupMember
Whether or not this item is part of a group.
Q_DECL_DEPRECATED void drawText(QPainter *p, double x, double y, const QString &text, const QFont &font, const QColor &c=QColor()) const
Draws Text.
double mItemRotation
Item rotation in degrees, clockwise.
QGraphicsLineItem * vAlignSnapItem()
Return vertical align snap item.
Q_DECL_DEPRECATED double fontAscentMillimeters(const QFont &font) const
Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCAL...
bool mEvaluatedExcludeFromExports
Temporary evaluated item exclusion.
void setTransparency(const int transparency)
Sets the item's transparency.
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
void beginCommand(QgsComposerItem *item, const QString &commandText, const QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown)
Allocates new item command and saves initial state in it.
QString id() const
Get item's id (which is not necessarly unique)