18 #include <QApplication> 19 #include <QMainWindow> 20 #include <QMouseEvent> 24 #include <QGridLayout> 26 #include <QDesktopWidget> 52 , mCurrentTool( Select )
53 , mPreviousTool( Select )
54 , mRubberBandItem( nullptr )
55 , mRubberBandLineItem( nullptr )
56 , mMoveContentItem( nullptr )
57 , mMarqueeSelect( false )
58 , mMarqueeZoom( false )
60 , mPaintingEnabled( true )
61 , mHorizontalRuler( nullptr )
62 , mVerticalRuler( nullptr )
63 , mToolPanning( false )
64 , mMousePanning( false )
65 , mKeyPanning( false )
66 , mMovingItemContent( false )
67 , mPreviewEffect( nullptr )
142 if ( mRubberBandItem || mRubberBandLineItem || mKeyPanning || mMousePanning || mToolPanning || mMovingItemContent )
156 mMousePressStartPos = e->
pos();
158 if ( e->
button() == Qt::RightButton )
164 else if ( e->
button() == Qt::MidButton )
167 mMousePanning =
true;
168 mMouseLastXY = e->
pos();
178 switch ( mCurrentTool )
200 if ( e->
modifiers() & Qt::ControlModifier )
205 if ( !selectedItems.
isEmpty() )
207 previousSelectedItem = selectedItems.
at( 0 );
211 if ( previousSelectedItem )
232 startMarqueeSelect( scenePoint );
236 if (( !selectedItem->
selected() ) &&
237 !( e->
modifiers() & Qt::ShiftModifier ) )
249 if ( !selectedItems.
isEmpty() )
265 if ( !( e->
modifiers() & Qt::ShiftModifier ) )
268 startMarqueeZoom( scenePoint );
273 double scaleFactor = 2;
281 visibleRect.
scale( scaleFactor, scenePoint.
x(), scenePoint.
y() );
285 fitInView( boundsRect, Qt::KeepAspectRatio );
294 mMouseLastXY = e->
pos();
303 if ( itemsAtCursorPos.
isEmpty() )
312 for ( ; itemIter != itemsAtCursorPos.
end(); ++itemIter )
318 mMoveContentStartPos = scenePoint;
319 mMoveContentItem = item;
320 mMovingItemContent =
true;
332 mRubberBandStartPos =
QPointF( snappedScenePoint.x(), snappedScenePoint.y() );
333 mRubberBandLineItem =
new QGraphicsLineItem( snappedScenePoint.x(), snappedScenePoint.y(), snappedScenePoint.x(), snappedScenePoint.y() );
334 mRubberBandLineItem->setPen(
QPen(
QBrush(
QColor( 227, 22, 22, 200 ) ), 0 ) );
335 mRubberBandLineItem->setZValue( 1000 );
355 mRubberBandItem->
setBrush( Qt::NoBrush );
357 mRubberBandStartPos =
QPointF( snappedScenePoint.x(), snappedScenePoint.y() );
358 t.
translate( snappedScenePoint.x(), snappedScenePoint.y() );
370 newScaleBar->
setSceneRect(
QRectF( snappedScenePoint.x(), snappedScenePoint.y(), 20, 20 ) );
395 switch ( currentTool )
398 return Qt::ArrowCursor;
403 return QCursor( myZoomQPixmap, 7, 7 );
407 return Qt::OpenHandCursor;
410 return Qt::ArrowCursor;
426 return QCursor( myCrosshairQPixmap, 8, 8 );
429 return Qt::ArrowCursor;
441 if ( !mRubberBandItem || ( mRubberBandItem->
rect().
width() < 0.1 && mRubberBandItem->
rect().
height() < 0.1 ) )
466 if ( mHorizontalRuler )
470 if ( mVerticalRuler )
476 void QgsComposerView::removeRubberBand()
478 if ( mRubberBandItem )
481 delete mRubberBandItem;
482 mRubberBandItem =
nullptr;
486 void QgsComposerView::startMarqueeSelect(
QPointF & scenePoint )
488 mMarqueeSelect =
true;
494 mRubberBandStartPos =
QPointF( scenePoint.
x(), scenePoint.
y() );
502 void QgsComposerView::endMarqueeSelect(
QMouseEvent* e )
504 mMarqueeSelect =
false;
506 bool subtractingSelection =
false;
507 if ( e->
modifiers() & Qt::ShiftModifier )
511 else if ( e->
modifiers() & Qt::ControlModifier )
514 subtractingSelection =
true;
522 if ( !mRubberBandItem || ( mRubberBandItem->
rect().
width() < 0.1 && mRubberBandItem->
rect().
height() < 0.1 ) )
533 Qt::ItemSelectionMode selectionMode = Qt::IntersectsItemShape;
537 selectionMode = Qt::ContainsItemShape;
543 for ( ; itemIt != itemList.
end(); ++itemIt )
547 if ( mypItem && !paperItem )
551 if ( subtractingSelection )
566 if ( !selectedItemList.
isEmpty() )
572 void QgsComposerView::startMarqueeZoom(
QPointF & scenePoint )
580 mRubberBandStartPos =
QPointF( scenePoint.
x(), scenePoint.
y() );
588 void QgsComposerView::endMarqueeZoom(
QMouseEvent* e )
590 mMarqueeZoom =
false;
594 if ( !mRubberBandItem || ( mRubberBandItem->
rect().
width() < 0.1 && mRubberBandItem->
rect().
height() < 0.1 ) )
597 double scaleFactor = 0.5;
605 visibleRect.
scale( scaleFactor, scenePoint.
x(), scenePoint.
y() );
606 boundsRect = visibleRect.
toRectF();
618 fitInView( boundsRect, Qt::KeepAspectRatio );
636 if ( e->
button() != Qt::LeftButton &&
644 int diffX = mousePressStopPoint.
x() - mMousePressStartPos.
x();
645 int diffY = mousePressStopPoint.
y() - mMousePressStartPos.
y();
648 bool clickOnly =
false;
649 if ( qAbs( diffX ) < 2 && qAbs( diffY ) < 2 )
656 if ( mMousePanning || mToolPanning )
658 mMousePanning =
false;
659 mToolPanning =
false;
661 if ( clickOnly && e->
button() == Qt::MidButton )
668 visibleRect.
scale( 1, scenePoint.
x(), scenePoint.
y() );
672 fitInView( boundsRect, Qt::KeepAspectRatio );
676 if ( mCurrentTool !=
Pan )
688 if ( e->
button() != Qt::LeftButton )
693 if ( mMarqueeSelect )
695 endMarqueeSelect( e );
699 switch ( mCurrentTool )
718 if ( mMoveContentItem )
727 double moveX = scenePoint.
x() - mMoveContentStartPos.
x();
728 double moveY = scenePoint.
y() - mMoveContentStartPos.
y();
733 mMoveContentItem =
nullptr;
734 mMovingItemContent =
false;
742 delete mRubberBandLineItem;
743 mRubberBandLineItem =
nullptr;
756 delete mRubberBandLineItem;
757 mRubberBandLineItem =
nullptr;
766 addShape( mCurrentTool );
825 double labelWidth = qMax( mRubberBandItem->
rect().
width(), newLabelItem->
rect().
width() );
969 bool shiftModifier =
false;
970 bool altModifier =
false;
971 if ( e->
modifiers() & Qt::ShiftModifier )
974 shiftModifier =
true;
982 mMouseCurrentXY = e->
pos();
987 if ( mHorizontalRuler )
991 if ( mVerticalRuler )
996 if ( mToolPanning || mMousePanning || mKeyPanning )
1001 mMouseLastXY = e->
pos();
1004 else if ( e->
buttons() == Qt::NoButton )
1006 if ( mCurrentTool ==
Select )
1015 if ( mMarqueeSelect || mMarqueeZoom )
1017 updateRubberBandRect( scenePoint );
1021 switch ( mCurrentTool )
1029 updateRubberBandLine( scenePoint, shiftModifier );
1045 updateRubberBandRect( scenePoint, shiftModifier, altModifier );
1055 composerMap->
setOffset( scenePoint.
x() - mMoveContentStartPos.
x(), scenePoint.
y() - mMoveContentStartPos.
y() );
1066 void QgsComposerView::updateRubberBandRect(
QPointF &
pos,
const bool constrainSquare,
const bool fromCenter )
1068 if ( !mRubberBandItem )
1078 double dx = pos.
x() - mRubberBandStartPos.
x();
1079 double dy = pos.
y() - mRubberBandStartPos.
y();
1081 if ( constrainSquare )
1083 if ( fabs( dx ) > fabs( dy ) )
1090 height = fabs( dy );
1094 x = mRubberBandStartPos.
x() - (( dx < 0 ) ? width : 0 );
1095 y = mRubberBandStartPos.
y() - (( dy < 0 ) ? height : 0 );
1107 x = mRubberBandStartPos.
x();
1118 y = mRubberBandStartPos.
y();
1125 x = mRubberBandStartPos.
x() -
width;
1126 y = mRubberBandStartPos.
y() -
height;
1131 mRubberBandItem->
setRect( 0, 0, width, height );
1137 void QgsComposerView::updateRubberBandLine(
QPointF pos,
const bool constrainAngles )
1139 if ( !mRubberBandLineItem )
1147 QLineF newLine =
QLineF( mRubberBandStartPos, snappedScenePoint );
1149 if ( constrainAngles )
1156 mRubberBandLineItem->
setLine( newLine );
1176 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1184 for ( ; it != groupedItems.
end(); ++it )
1186 ( *it )->writeXML( documentElement, doc );
1189 ( *itemIt )->writeXML( documentElement, doc );
1202 for (
int i = 0; i < composerItemsNodes.
count(); ++i )
1204 QDomNode composerItemNode = composerItemsNodes.
at( i );
1230 if ( docElem.
tagName() ==
"ComposerItemClipboard" )
1266 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1285 for ( ; itemIt != itemList.
end(); ++itemIt )
1289 if ( mypItem && !paperItem )
1325 for ( ; itemIt != itemList.
end(); ++itemIt )
1329 if ( mypItem && !paperItem )
1353 if ( mKeyPanning || mMousePanning || mToolPanning || mMovingItemContent ||
1368 if ( !( e->
modifiers() & Qt::ControlModifier ) && !mMarqueeZoom )
1374 else if ( !( e->
modifiers() & Qt::ControlModifier ) && mMarqueeZoom )
1399 if ( !( e->
modifiers() & Qt::ControlModifier ) )
1403 mMouseLastXY = mMouseCurrentXY;
1416 mPreviousTool = mCurrentTool;
1442 double increment = 1.0;
1443 if ( e->
modifiers() & Qt::ShiftModifier )
1448 else if ( e->
modifiers() & Qt::AltModifier )
1452 if ( viewScale > 0 )
1454 increment = 1 / viewScale;
1458 if ( e->
key() == Qt::Key_Left )
1460 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1463 ( *itemIt )->move( -1 * increment, 0.0 );
1464 ( *itemIt )->endCommand();
1467 else if ( e->
key() == Qt::Key_Right )
1469 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1472 ( *itemIt )->move( increment, 0.0 );
1473 ( *itemIt )->endCommand();
1476 else if ( e->
key() == Qt::Key_Down )
1478 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1481 ( *itemIt )->move( 0.0, increment );
1482 ( *itemIt )->endCommand();
1485 else if ( e->
key() == Qt::Key_Up )
1487 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1490 ( *itemIt )->move( 0.0, -1 * increment );
1491 ( *itemIt )->endCommand();
1501 mKeyPanning =
false;
1504 if ( mCurrentTool !=
Pan )
1546 if ( mRubberBandItem || mRubberBandLineItem )
1552 if (
composition()->selectionHandles()->isDragging() ||
composition()->selectionHandles()->isResizing() )
1567 if ( theItem->isSelected() )
1578 double zoomFactor = settings.
value(
"/qgis/zoom_factor", 2.0 ).
toDouble();
1579 if ( event->
modifiers() & Qt::ControlModifier )
1582 zoomFactor = 1.0 + ( zoomFactor - 1.0 ) / 20.0;
1584 zoomFactor =
event->delta() > 0 ? zoomFactor : 1 / zoomFactor;
1586 QPointF itemPoint = theItem->mapFromScene( scenePoint );
1588 theItem->zoomContent( zoomFactor, itemPoint, zoomMode );
1589 theItem->endCommand();
1604 int wheelAction = mySettings.
value(
"/qgis/wheel_action", 2 ).
toInt();
1605 double zoomFactor = mySettings.
value(
"/qgis/zoom_factor", 2 ).
toDouble();
1612 if ( event->
modifiers() & Qt::ControlModifier )
1615 zoomFactor = 1.0 + ( zoomFactor - 1.0 ) / 10.0;
1619 bool zoomIn =
event->delta() > 0;
1620 double scaleFactor = ( zoomIn ? 1 / zoomFactor : zoomFactor );
1641 QgsPoint newCenter( scenePoint.
x() + (( oldCenter.x() - scenePoint.
x() ) * scaleFactor ),
1642 scenePoint.
y() + (( oldCenter.y() - scenePoint.
y() ) * scaleFactor ) );
1643 centerOn( newCenter.x(), newCenter.y() );
1654 scale( zoomFactor, zoomFactor );
1658 scale( 1 / zoomFactor, 1 / zoomFactor );
1668 for ( ; itemIt != itemList.
end(); ++itemIt )
1682 if (( dpi < 60 ) || ( dpi > 250 ) )
1686 double scale = zoomLevel * dpi / 25.4;
1696 if ( !mPreviewEffect )
1706 if ( !mPreviewEffect )
1711 mPreviewEffect->
setMode( mode );
1716 if ( mPaintingEnabled )
1755 if ( mHorizontalRuler )
1759 if ( mVerticalRuler )
1812 for ( ; itemIter != selectionList.
end(); ++itemIter )
1826 if ( !currentObject )
1828 return qobject_cast<
QMainWindow *>( currentObject );
1833 composerObject = qobject_cast<
QMainWindow*>( currentObject );
1834 if ( composerObject || !currentObject->
parent() )
1836 return composerObject;
1838 currentObject = currentObject->
parent();
QgsComposerMouseHandles::MouseAction mouseActionForScenePos(QPointF sceneCoordPos)
Finds out which mouse move action to choose depending on the scene cursor position.
bool positionLock() const
Returns whether position lock for mouse drags is enabled returns true if item is locked for mouse mov...
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.
A rectangle specified with double values.
Qt::KeyboardModifiers modifiers() const
void setAllUnselected()
Clears any selected items in the composition.
QRectF toRectF() const
returns a QRectF with same coordinates.
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) ...
QPointF snapPointToGrid(QPointF scenePoint) const
Snaps a scene coordinate point to grid.
virtual bool selected() const
Is selected.
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
QgsComposerItemGroup * groupItems(QList< QgsComposerItem * > items)
Creates a new group from a list of composer items and adds it to the composition. ...
QList< const QgsComposerMap * > composerMapItems() const
Returns pointers to all composer maps in the scene.
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)
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.
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 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.
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)
PreviewMode previewMode() const
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.
A composer items that draws common shapes (ellipse, triangle, rectangle)
void setPen(const QPen &pen)
QDesktopWidget * desktop()
void resizeEvent(QResizeEvent *event) override
QgsComposerItem * composerItemAt(QPointF position, const bool ignoreLocked=false) const
Returns the topmost composer item at a specified position.
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)
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)
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) ...
QgsPoint center() const
Center point of the rectangle.
void addComposerArrow(QgsComposerArrow *arrow)
Adds an arrow item to the graphics scene and advices composer to create a widget for it (through sign...
QgsComposerView::Tool currentTool() const
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)