18 #include <QApplication> 19 #include <QMainWindow> 20 #include <QMouseEvent> 24 #include <QGridLayout> 26 #include <QDesktopWidget> 50 #define MIN_VIEW_SCALE 0.05 51 #define MAX_VIEW_SCALE 1000.0 55 , mCurrentTool( Select )
56 , mPreviousTool( Select )
57 , mRubberBandItem( nullptr )
58 , mRubberBandLineItem( nullptr )
59 , mMoveContentItem( nullptr )
60 , mMarqueeSelect( false )
61 , mMarqueeZoom( false )
63 , mPaintingEnabled( true )
64 , mHorizontalRuler( nullptr )
65 , mVerticalRuler( nullptr )
66 , mToolPanning( false )
67 , mMousePanning( false )
68 , mKeyPanning( false )
69 , mMovingItemContent( false )
70 , mPreviewEffect( nullptr )
145 if ( mRubberBandItem || mRubberBandLineItem || mKeyPanning || mMousePanning || mToolPanning || mMovingItemContent )
159 mMousePressStartPos = e->
pos();
161 if ( e->
button() == Qt::RightButton )
167 else if ( e->
button() == Qt::MidButton )
170 mMousePanning =
true;
171 mMouseLastXY = e->
pos();
181 switch ( mCurrentTool )
203 if ( e->
modifiers() & Qt::ControlModifier )
208 if ( !selectedItems.
isEmpty() )
210 previousSelectedItem = selectedItems.
at( 0 );
214 if ( previousSelectedItem )
235 startMarqueeSelect( scenePoint );
239 if (( !selectedItem->
selected() ) &&
240 !( e->
modifiers() & Qt::ShiftModifier ) )
252 if ( !selectedItems.
isEmpty() )
268 if ( !( e->
modifiers() & Qt::ShiftModifier ) )
271 startMarqueeZoom( scenePoint );
276 double scaleFactor = 2;
284 visibleRect.
scale( scaleFactor, scenePoint.
x(), scenePoint.
y() );
288 fitInView( boundsRect, Qt::KeepAspectRatio );
297 mMouseLastXY = e->
pos();
306 if ( itemsAtCursorPos.
isEmpty() )
315 for ( ; itemIter != itemsAtCursorPos.
end(); ++itemIter )
321 mMoveContentStartPos = scenePoint;
322 mMoveContentItem = item;
323 mMovingItemContent =
true;
335 mRubberBandStartPos =
QPointF( snappedScenePoint.x(), snappedScenePoint.y() );
336 mRubberBandLineItem =
new QGraphicsLineItem( snappedScenePoint.x(), snappedScenePoint.y(), snappedScenePoint.x(), snappedScenePoint.y() );
337 mRubberBandLineItem->setPen(
QPen(
QBrush(
QColor( 227, 22, 22, 200 ) ), 0 ) );
338 mRubberBandLineItem->setZValue( 1000 );
358 mRubberBandItem->
setBrush( Qt::NoBrush );
360 mRubberBandStartPos =
QPointF( snappedScenePoint.x(), snappedScenePoint.y() );
361 t.
translate( snappedScenePoint.x(), snappedScenePoint.y() );
373 newScaleBar->
setSceneRect(
QRectF( snappedScenePoint.x(), snappedScenePoint.y(), 20, 20 ) );
398 switch ( currentTool )
401 return Qt::ArrowCursor;
406 return QCursor( myZoomQPixmap, 7, 7 );
410 return Qt::OpenHandCursor;
413 return Qt::ArrowCursor;
429 return QCursor( myCrosshairQPixmap, 8, 8 );
432 return Qt::ArrowCursor;
444 if ( !mRubberBandItem || ( mRubberBandItem->
rect().
width() < 0.1 && mRubberBandItem->
rect().
height() < 0.1 ) )
469 if ( mHorizontalRuler )
473 if ( mVerticalRuler )
479 void QgsComposerView::removeRubberBand()
481 if ( mRubberBandItem )
484 delete mRubberBandItem;
485 mRubberBandItem =
nullptr;
489 void QgsComposerView::startMarqueeSelect(
QPointF & scenePoint )
491 mMarqueeSelect =
true;
497 mRubberBandStartPos =
QPointF( scenePoint.
x(), scenePoint.
y() );
505 void QgsComposerView::endMarqueeSelect(
QMouseEvent* e )
507 mMarqueeSelect =
false;
509 bool subtractingSelection =
false;
510 if ( e->
modifiers() & Qt::ShiftModifier )
514 else if ( e->
modifiers() & Qt::ControlModifier )
517 subtractingSelection =
true;
525 if ( !mRubberBandItem || ( mRubberBandItem->
rect().
width() < 0.1 && mRubberBandItem->
rect().
height() < 0.1 ) )
536 Qt::ItemSelectionMode selectionMode = Qt::IntersectsItemShape;
540 selectionMode = Qt::ContainsItemShape;
546 for ( ; itemIt != itemList.
end(); ++itemIt )
550 if ( mypItem && !paperItem )
554 if ( subtractingSelection )
569 if ( !selectedItemList.
isEmpty() )
575 void QgsComposerView::startMarqueeZoom(
QPointF & scenePoint )
583 mRubberBandStartPos =
QPointF( scenePoint.
x(), scenePoint.
y() );
591 void QgsComposerView::endMarqueeZoom(
QMouseEvent* e )
593 mMarqueeZoom =
false;
597 if ( !mRubberBandItem || ( mRubberBandItem->
rect().
width() < 0.1 && mRubberBandItem->
rect().
height() < 0.1 ) )
600 double scaleFactor = 0.5;
608 visibleRect.
scale( scaleFactor, scenePoint.
x(), scenePoint.
y() );
609 boundsRect = visibleRect.
toRectF();
621 fitInView( boundsRect, Qt::KeepAspectRatio );
639 if ( e->
button() != Qt::LeftButton &&
647 int diffX = mousePressStopPoint.
x() - mMousePressStartPos.
x();
648 int diffY = mousePressStopPoint.
y() - mMousePressStartPos.
y();
651 bool clickOnly =
false;
652 if ( qAbs( diffX ) < 2 && qAbs( diffY ) < 2 )
659 if ( mMousePanning || mToolPanning )
661 mMousePanning =
false;
662 mToolPanning =
false;
664 if ( clickOnly && e->
button() == Qt::MidButton )
671 visibleRect.
scale( 1, scenePoint.
x(), scenePoint.
y() );
675 fitInView( boundsRect, Qt::KeepAspectRatio );
679 if ( mCurrentTool !=
Pan )
691 if ( e->
button() != Qt::LeftButton )
696 if ( mMarqueeSelect )
698 endMarqueeSelect( e );
702 switch ( mCurrentTool )
721 if ( mMoveContentItem )
730 double moveX = scenePoint.
x() - mMoveContentStartPos.
x();
731 double moveY = scenePoint.
y() - mMoveContentStartPos.
y();
736 mMoveContentItem =
nullptr;
737 mMovingItemContent =
false;
745 delete mRubberBandLineItem;
746 mRubberBandLineItem =
nullptr;
759 delete mRubberBandLineItem;
760 mRubberBandLineItem =
nullptr;
769 addShape( mCurrentTool );
828 double labelWidth = qMax( mRubberBandItem->
rect().
width(), newLabelItem->
rect().
width() );
972 bool shiftModifier =
false;
973 bool altModifier =
false;
974 if ( e->
modifiers() & Qt::ShiftModifier )
977 shiftModifier =
true;
985 mMouseCurrentXY = e->
pos();
990 if ( mHorizontalRuler )
994 if ( mVerticalRuler )
999 if ( mToolPanning || mMousePanning || mKeyPanning )
1004 mMouseLastXY = e->
pos();
1007 else if ( e->
buttons() == Qt::NoButton )
1009 if ( mCurrentTool ==
Select )
1018 if ( mMarqueeSelect || mMarqueeZoom )
1020 updateRubberBandRect( scenePoint );
1024 switch ( mCurrentTool )
1032 updateRubberBandLine( scenePoint, shiftModifier );
1048 updateRubberBandRect( scenePoint, shiftModifier, altModifier );
1058 composerMap->
setOffset( scenePoint.
x() - mMoveContentStartPos.
x(), scenePoint.
y() - mMoveContentStartPos.
y() );
1069 void QgsComposerView::updateRubberBandRect(
QPointF &
pos,
const bool constrainSquare,
const bool fromCenter )
1071 if ( !mRubberBandItem )
1081 double dx = pos.
x() - mRubberBandStartPos.
x();
1082 double dy = pos.
y() - mRubberBandStartPos.
y();
1084 if ( constrainSquare )
1086 if ( fabs( dx ) > fabs( dy ) )
1093 height = fabs( dy );
1097 x = mRubberBandStartPos.
x() - (( dx < 0 ) ? width : 0 );
1098 y = mRubberBandStartPos.
y() - (( dy < 0 ) ? height : 0 );
1110 x = mRubberBandStartPos.
x();
1121 y = mRubberBandStartPos.
y();
1128 x = mRubberBandStartPos.
x() -
width;
1129 y = mRubberBandStartPos.
y() -
height;
1134 mRubberBandItem->
setRect( 0, 0, width, height );
1140 void QgsComposerView::updateRubberBandLine(
QPointF pos,
const bool constrainAngles )
1142 if ( !mRubberBandLineItem )
1150 QLineF newLine =
QLineF( mRubberBandStartPos, snappedScenePoint );
1152 if ( constrainAngles )
1159 mRubberBandLineItem->
setLine( newLine );
1179 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1187 for ( ; it != groupedItems.
end(); ++it )
1189 ( *it )->writeXML( documentElement, doc );
1192 ( *itemIt )->writeXML( documentElement, doc );
1205 for (
int i = 0; i < composerItemsNodes.
count(); ++i )
1207 QDomNode composerItemNode = composerItemsNodes.
at( i );
1233 if ( docElem.
tagName() ==
"ComposerItemClipboard" )
1269 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1288 for ( ; itemIt != itemList.
end(); ++itemIt )
1292 if ( mypItem && !paperItem )
1328 for ( ; itemIt != itemList.
end(); ++itemIt )
1332 if ( mypItem && !paperItem )
1356 if ( mKeyPanning || mMousePanning || mToolPanning || mMovingItemContent ||
1371 if ( !( e->
modifiers() & Qt::ControlModifier ) && !mMarqueeZoom )
1377 else if ( !( e->
modifiers() & Qt::ControlModifier ) && mMarqueeZoom )
1402 if ( !( e->
modifiers() & Qt::ControlModifier ) )
1406 mMouseLastXY = mMouseCurrentXY;
1419 mPreviousTool = mCurrentTool;
1445 double increment = 1.0;
1446 if ( e->
modifiers() & Qt::ShiftModifier )
1451 else if ( e->
modifiers() & Qt::AltModifier )
1455 if ( viewScale > 0 )
1457 increment = 1 / viewScale;
1461 if ( e->
key() == Qt::Key_Left )
1463 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1466 ( *itemIt )->move( -1 * increment, 0.0 );
1467 ( *itemIt )->endCommand();
1470 else if ( e->
key() == Qt::Key_Right )
1472 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1475 ( *itemIt )->move( increment, 0.0 );
1476 ( *itemIt )->endCommand();
1479 else if ( e->
key() == Qt::Key_Down )
1481 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1484 ( *itemIt )->move( 0.0, increment );
1485 ( *itemIt )->endCommand();
1488 else if ( e->
key() == Qt::Key_Up )
1490 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1493 ( *itemIt )->move( 0.0, -1 * increment );
1494 ( *itemIt )->endCommand();
1504 mKeyPanning =
false;
1507 if ( mCurrentTool !=
Pan )
1549 if ( mRubberBandItem || mRubberBandLineItem )
1555 if (
composition()->selectionHandles()->isDragging() ||
composition()->selectionHandles()->isResizing() )
1570 if ( theItem->isSelected() )
1581 double zoomFactor = settings.
value(
"/qgis/zoom_factor", 2.0 ).
toDouble();
1582 if ( event->
modifiers() & Qt::ControlModifier )
1585 zoomFactor = 1.0 + ( zoomFactor - 1.0 ) / 20.0;
1587 zoomFactor =
event->delta() > 0 ? zoomFactor : 1 / zoomFactor;
1589 QPointF itemPoint = theItem->mapFromScene( scenePoint );
1591 theItem->zoomContent( zoomFactor, itemPoint, zoomMode );
1592 theItem->endCommand();
1607 int wheelAction = mySettings.
value(
"/qgis/wheel_action", 2 ).
toInt();
1608 double zoomFactor = mySettings.
value(
"/qgis/zoom_factor", 2 ).
toDouble();
1615 if ( event->
modifiers() & Qt::ControlModifier )
1618 zoomFactor = 1.0 + ( zoomFactor - 1.0 ) / 10.0;
1622 bool zoomIn =
event->delta() > 0;
1623 double scaleFactor = ( zoomIn ? 1 / zoomFactor : zoomFactor );
1644 QgsPoint newCenter( scenePoint.
x() + (( oldCenter.x() - scenePoint.
x() ) * scaleFactor ),
1645 scenePoint.
y() + (( oldCenter.y() - scenePoint.
y() ) * scaleFactor ) );
1646 centerOn( newCenter.x(), newCenter.y() );
1671 for ( ; itemIt != itemList.
end(); ++itemIt )
1685 if (( dpi < 60 ) || ( dpi > 250 ) )
1700 scale *= currentScale;
1707 if ( !mPreviewEffect )
1717 if ( !mPreviewEffect )
1722 mPreviewEffect->
setMode( mode );
1727 if ( mPaintingEnabled )
1766 if ( mHorizontalRuler )
1770 if ( mVerticalRuler )
1823 for ( ; itemIter != selectionList.
end(); ++itemIter )
1837 if ( !currentObject )
1839 return qobject_cast<
QMainWindow *>( currentObject );
1844 composerObject = qobject_cast<
QMainWindow*>( currentObject );
1845 if ( composerObject || !currentObject->
parent() )
1847 return composerObject;
1849 currentObject = currentObject->
parent();
QgsComposerMouseHandles::MouseAction mouseActionForScenePos(QPointF sceneCoordPos)
Finds out which mouse move action to choose depending on the scene cursor position.
virtual void mouseMoveEvent(QMouseEvent *event)
void setSceneRect(const QRectF &rectangle) override
Adapts mMaximumNumberOfFeatures depending on the rectangle height.
void setShapeType(QgsComposerShape::Shape s)
Item representing the paper.
A scale bar item that can be added to a map composition.
QUndoStack * undoStack()
Returns pointer to undo/redo command storage.
QgsComposerItemGroup * groupItems(QList< QgsComposerItem *> items)
Creates a new group from a list of composer items and adds it to the composition. ...
A rectangle specified with double values.
Qt::KeyboardModifiers modifiers() const
QgsPoint center() const
Center point of the rectangle.
void setAllUnselected()
Clears any selected items in the composition.
QByteArray data(const QString &mimeType) const
QMainWindow * composerWindow()
Returns the composer main window.
An item that draws an arrow between to points.
const char * zoom_in[]
Bitmap cursors for map operations.
QList< QGraphicsItem * > items() const
const QMimeData * mimeData(Mode mode) const
QDomNode appendChild(const QDomNode &newChild)
void addItemsFromXML(const QDomElement &elem, const QDomDocument &doc, QMap< QgsComposerMap *, int > *mapsToRestore=nullptr, bool addUndoCommands=false, QPointF *pos=nullptr, bool pasteInPlace=false)
Add items from XML representation to the graphics scene (for project file reading, pasting items from clipboard)
void centerOn(const QPointF &pos)
void keyPressEvent(QKeyEvent *e) override
void zoomLevelChanged()
Is emitted when the view zoom changes.
void selectAll()
Selects all items.
void setOffset(double xOffset, double yOffset)
Sets offset values to shift image (useful for live updates when moving item content) ...
QList< QGraphicsItem * > items() const
void setFrameShape(Shape)
void selectInvert()
Inverts current selection.
ZoomMode
Modes for zooming item content.
void setComposerMap(const QgsComposerMap *map)
Sets the composer map to use to limit the extent of features shown in the attribute table...
void updateRulers()
Update rulers with current scene rect.
void applyDefaultSize(ScaleBarUnits u=Meters)
Apply default size (scale bar 1/5 of map item width)
QgsComposerMouseHandles * selectionHandles()
Returns pointer to selection handles.
QPointF mapToScene(const QPoint &point) const
void mousePressEvent(QMouseEvent *) override
const T & at(int i) const
void mouseReleaseEvent(QMouseEvent *) override
void addComposerScaleBar(QgsComposerScaleBar *scaleBar)
Adds scale bar to the graphics scene and advices composer to create a widget for it (through signal) ...
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 pushAddRemoveCommand(QgsComposerItem *item, const QString &text, const QgsAddRemoveItemCommand::State state=QgsAddRemoveItemCommand::Added)
Convenience function to create a QgsAddRemoveItemCommand, connect its signals and push it to the undo...
void setZoomLevel(double zoomLevel)
Set zoom level, where a zoom level of 1.0 corresponds to 100%.
virtual void mouseReleaseEvent(QMouseEvent *event)
A container for grouping several QgsComposerItems.
void deleteSelectedItems()
Deletes selected items.
virtual void setSelected(bool s)
Set selected, selected item should be highlighted.
bool isDragging()
Returns true is user is currently dragging the handles.
void setComposition(QgsComposition *c)
MouseAction
Describes the action (move or resize in different directon) to be done during mouse move...
QDomElement documentElement() const
void updateCachedImage()
Forces an update of the cached map image.
void setComposerMap(const QgsComposerMap *map)
Sets the composer map to use to limit the extent of features shown in the attribute table...
void setCurrentTool(QgsComposerView::Tool t)
void groupItems()
Add an item group containing the selected items.
bool isAutoRepeat() const
const QPoint & pos() const
QGraphicsScene * scene() const
void updateLegend()
Updates the model and all legend entries.
void selectNone()
Deselects all items.
void setEnabled(bool enable)
QString tr(const char *sourceText, const char *disambiguation, int n)
QList< const QgsComposerMap * > composerMapItems() const
Returns pointers to all composer maps in the scene.
void update(const QRectF &rect)
A table that displays attributes from a vector layer.
void composerViewHide(QgsComposerView *)
Emitted before composerview is hidden.
A graphics effect which can be applied to a widget to simulate various printing and color blindness m...
void setRect(const QRectF &rectangle)
void compositionSet(QgsComposition *)
Emitted when the composition is set for the view.
A composer class that displays svg files or raster format (jpg, png, ...)
bool isResizing()
Returns true is user is currently resizing with the handles.
void endMultiFrameCommand()
QSet< QgsComposerItem * > items()
QDomElement toElement() const
void addComposerShape(QgsComposerShape *shape)
Adds a composer shape to the graphics scene and advices composer to create a widget for it (through s...
void scale(qreal sx, qreal sy)
virtual void moveContent(double dx, double dy)
Move Content of item.
void showEvent(QShowEvent *e) override
void wheelEvent(QWheelEvent *event) override
void paintEvent(QPaintEvent *event) override
int toInt(bool *ok) const
void removeItem(QGraphicsItem *item)
void setPreventCursorChange(const bool preventChange)
If true, prevents any mouse cursor changes by the composition or by any composer items Used by QgsCom...
virtual bool event(QEvent *event)
void setUseSymbolV2(bool useSymbolV2)
Controls whether the shape should be drawn using a QgsFillSymbolV2.
void endCommand()
Saves end state of item and pushes command to the undo history.
virtual bool selected() const
Is selected.
void setResizeAnchor(ViewportAnchor anchor)
void setAngle(qreal angle)
QDomNodeList elementsByTagName(const QString &tagname) const
void addFrame(QgsComposerFrame *frame, bool recalcFrameSizes=true) override
Adds a frame to the multiframe.
void selectedItemChanged(QgsComposerItem *selected)
Is emitted when selected item changed.
void scaleSafe(double scale)
Scales the view in a safe way, by limiting the acceptable range of the scale applied.
void setLine(const QLineF &line)
void setSceneTransform(const QTransform &transform)
void setComposerMap(const QgsComposerMap *map)
QList< QgsComposerItem * > ungroupItems(QgsComposerItemGroup *group)
Ungroups items by removing them from an item group and removing the group from the composition...
Widget to display the composer items.
void setScene(QGraphicsScene *scene)
void removeComposerItem(QgsComposerItem *item, const bool createCommand=true, const bool removeGroupItems=true)
Remove item from the graphics scene.
void setPreviewModeEnabled(bool enabled)
Sets whether a preview effect should be used to alter the view's appearance.
void setMimeData(QMimeData *src, Mode mode)
void pasteItems(PasteMode mode)
Pastes items from clipboard.
void setMode(PreviewMode mode)
Sets the mode for the preview effect, which controls how the effect modifies a widgets appearance...
A class to represent a point.
Graphics scene for map printing.
Object representing map window.
Frame item for a composer multiframe item.
QgsComposerItem * composerItemAt(QPointF position, const bool ignoreLocked=false) const
Returns the topmost composer item at a specified position.
QgsComposerView(QWidget *parent=nullptr, const char *name=nullptr, const Qt::WindowFlags &f=nullptr)
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
void setComposerMap(const QgsComposerMap *map)
void ungroupItems()
Ungroups the selected items.
virtual void mousePressEvent(QMouseEvent *event)
void copyItems(ClipboardMode mode)
Cuts or copies the selected items.
virtual void paintEvent(QPaintEvent *event)
QVariant value(const QString &key, const QVariant &defaultValue) const
virtual void addFrame(QgsComposerFrame *frame, bool recalcFrameSizes=true) override
Adds a frame to the multiframe.
A table class that displays a vector attribute table.
void setPreviewMode(QgsPreviewEffect::PreviewMode mode)
Sets the preview mode which should be used to modify the view's appearance.
QRectF toRectF() const
returns a QRectF with same coordinates.
A composer items that draws common shapes (ellipse, triangle, rectangle)
void setPen(const QPen &pen)
QDesktopWidget * desktop()
PreviewMode previewMode() const
void resizeEvent(QResizeEvent *event) override
QPointF snapPointToGrid(QPointF scenePoint) const
Snaps a scene coordinate point to grid.
void cursorPosChanged(QPointF)
Is emitted when mouse cursor coordinates change.
void setComposition(QgsComposition *c)
Sets the composition for the view.
void addComposerMap(QgsComposerMap *map, const bool setDefaultPreviewStyle=true)
Adds map to the graphics scene and advices composer to create a widget for it (through signal) ...
void update(qreal x, qreal y, qreal w, qreal h)
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 keyReleaseEvent(QKeyEvent *e) override
void setText(const QString &text)
void setSceneRect(const QRectF &rectangle) override
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size un...
A label that can be placed onto a map composition.
static double snappedAngle(const double angle)
Snaps an angle to its closest 45 degree angle.
void addComposerPicture(QgsComposerPicture *picture)
Adds picture to the graphics scene and advices composer to create a widget for it (through signal) ...
double toDouble(bool *ok) const
void hideEvent(QHideEvent *e) override
void addComposerTable(QgsComposerAttributeTable *table)
Adds a composer table to the graphics scene and advices composer to create a widget for it (through s...
void removeAttribute(const QString &name)
QgsComposerView::Tool currentTool() const
void updateMarker(QPointF pos)
void setSceneRect(const QRectF &rectangle) override
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size un...
void setData(const QString &mimeType, const QByteArray &data)
QgsComposition * composition()
Returns the composition or 0 in case of error.
const QPoint & pos() const
void setBrush(const QBrush &brush)
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 addItem(QGraphicsItem *item)
const char * cross_hair_cursor[]
void actionFinished()
Current action (e.g.
void mouseMoveEvent(QMouseEvent *) override
A legend that can be placed onto a map composition.
void addComposerLabel(QgsComposerLabel *label)
Adds label to the graphics scene and advices composer to create a widget for it (through signal) ...
void addComposerArrow(QgsComposerArrow *arrow)
Adds an arrow item to the graphics scene and advices composer to create a widget for it (through sign...
void addComposerLegend(QgsComposerLegend *legend)
Adds legend to the graphics scene and advices composer to create a widget for it (through signal) ...
virtual void scrollContentsBy(int dx, int dy)
void push(QUndoCommand *cmd)
void adjustSizeToText()
Resizes the widget such that the text fits to the item.
QByteArray toByteArray(int indent) const
bool setContent(const QByteArray &data, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn)
QDomNode at(int index) const
void fitInView(const QRectF &rect, Qt::AspectRatioMode aspectRatioMode)
void composerViewShow(QgsComposerView *)
Emitted before composerview is shown.
void beginCommand(QgsComposerItem *item, const QString &commandText, const QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown)
Allocates new item command and saves initial state in it.
void scrollContentsBy(int dx, int dy) override
QList< QgsComposerItem * > selectedComposerItems(const bool includeLockedItems=true)
Returns list of selected composer items.
void mouseDoubleClickEvent(QMouseEvent *e) override
virtual void resizeEvent(QResizeEvent *event)
void beginMultiFrameCommand(QgsComposerMultiFrame *multiFrame, const QString &text, const QgsComposerMultiFrameMergeCommand::Context c=QgsComposerMultiFrameMergeCommand::Unknown)