18 #include <QApplication>
19 #include <QMainWindow>
20 #include <QMouseEvent>
24 #include <QGridLayout>
26 #include <QDesktopWidget>
52 , mCurrentTool( Select )
53 , mPreviousTool( Select )
54 , mRubberBandItem( 0 )
55 , mRubberBandLineItem( 0 )
56 , mMoveContentItem( 0 )
57 , mMarqueeSelect( false )
58 , mMarqueeZoom( false )
60 , mPaintingEnabled( true )
61 , mHorizontalRuler( 0 )
63 , mToolPanning( false )
64 , mMousePanning( false )
65 , mKeyPanning( false )
66 , mMovingItemContent( false )
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.
size() > 0 )
207 previousSelectedItem = selectedItems.
at( 0 );
211 if ( previousSelectedItem )
232 startMarqueeSelect( scenePoint );
236 if (( !selectedItem->
selected() ) &&
237 !( e->
modifiers() & Qt::ShiftModifier ) )
249 if ( selectedItems.
size() > 0 )
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.
size() == 0 )
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 ) );
373 if ( mapItemList.
size() > 0 )
393 QCursor QgsComposerView::defaultCursorForTool( Tool currentTool )
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;
432 void QgsComposerView::addShape( Tool currentTool )
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;
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.
size() > 0 )
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 = 0;
734 mMovingItemContent =
false;
742 delete mRubberBandLineItem;
743 mRubberBandLineItem = 0;
756 delete mRubberBandLineItem;
757 mRubberBandLineItem = 0;
766 addShape( mCurrentTool );
825 double labelWidth = qMax( mRubberBandItem->
rect().
width(), newLabelItem->
rect().
width() );
851 if ( mapItemList.
size() > 0 )
879 if ( mapItemList.
size() > 0 )
907 if ( mapItemList.
size() > 0 )
968 bool shiftModifier =
false;
969 bool altModifier =
false;
970 if ( e->
modifiers() & Qt::ShiftModifier )
973 shiftModifier =
true;
981 mMouseCurrentXY = e->
pos();
986 if ( mHorizontalRuler )
990 if ( mVerticalRuler )
995 if ( mToolPanning || mMousePanning || mKeyPanning )
1000 mMouseLastXY = e->
pos();
1003 else if ( e->
buttons() == Qt::NoButton )
1005 if ( mCurrentTool ==
Select )
1014 if ( mMarqueeSelect || mMarqueeZoom )
1016 updateRubberBandRect( scenePoint );
1020 switch ( mCurrentTool )
1028 updateRubberBandLine( scenePoint, shiftModifier );
1044 updateRubberBandRect( scenePoint, shiftModifier, altModifier );
1054 composerMap->
setOffset( scenePoint.
x() - mMoveContentStartPos.
x(), scenePoint.
y() - mMoveContentStartPos.
y() );
1065 void QgsComposerView::updateRubberBandRect(
QPointF & pos,
const bool constrainSquare,
const bool fromCenter )
1067 if ( !mRubberBandItem )
1077 double dx = pos.
x() - mRubberBandStartPos.
x();
1078 double dy = pos.
y() - mRubberBandStartPos.
y();
1080 if ( constrainSquare )
1082 if ( fabs( dx ) > fabs( dy ) )
1089 height = fabs( dy );
1093 x = mRubberBandStartPos.
x() - (( dx < 0 ) ? width : 0 );
1094 y = mRubberBandStartPos.
y() - (( dy < 0 ) ? height : 0 );
1106 x = mRubberBandStartPos.
x();
1117 y = mRubberBandStartPos.
y();
1124 x = mRubberBandStartPos.
x() -
width;
1125 y = mRubberBandStartPos.
y() -
height;
1130 mRubberBandItem->
setRect( 0, 0, width, height );
1136 void QgsComposerView::updateRubberBandLine(
const QPointF &pos,
const bool constrainAngles )
1138 if ( !mRubberBandLineItem )
1146 QLineF newLine =
QLineF( mRubberBandStartPos, snappedScenePoint );
1148 if ( constrainAngles )
1155 mRubberBandLineItem->
setLine( newLine );
1175 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1183 for ( ; it != groupedItems.
end(); ++it )
1185 ( *it )->writeXML( documentElement, doc );
1188 ( *itemIt )->writeXML( documentElement, doc );
1201 for (
int i = 0; i < composerItemsNodes.
count(); ++i )
1203 QDomNode composerItemNode = composerItemsNodes.
at( i );
1229 if ( docElem.
tagName() ==
"ComposerItemClipboard" )
1265 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1284 for ( ; itemIt != itemList.
end(); ++itemIt )
1288 if ( mypItem && !paperItem )
1324 for ( ; itemIt != itemList.
end(); ++itemIt )
1328 if ( mypItem && !paperItem )
1352 if ( mKeyPanning || mMousePanning || mToolPanning || mMovingItemContent ||
1367 if ( !( e->
modifiers() & Qt::ControlModifier ) && !mMarqueeZoom )
1373 else if ( !( e->
modifiers() & Qt::ControlModifier ) && mMarqueeZoom )
1398 if ( !( e->
modifiers() & Qt::ControlModifier ) )
1402 mMouseLastXY = mMouseCurrentXY;
1415 mPreviousTool = mCurrentTool;
1441 double increment = 1.0;
1442 if ( e->
modifiers() & Qt::ShiftModifier )
1447 else if ( e->
modifiers() & Qt::AltModifier )
1451 if ( viewScale > 0 )
1453 increment = 1 / viewScale;
1457 if ( e->
key() == Qt::Key_Left )
1459 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1462 ( *itemIt )->move( -1 * increment, 0.0 );
1463 ( *itemIt )->endCommand();
1466 else if ( e->
key() == Qt::Key_Right )
1468 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1471 ( *itemIt )->move( increment, 0.0 );
1472 ( *itemIt )->endCommand();
1475 else if ( e->
key() == Qt::Key_Down )
1477 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1480 ( *itemIt )->move( 0.0, increment );
1481 ( *itemIt )->endCommand();
1484 else if ( e->
key() == Qt::Key_Up )
1486 for ( ; itemIt != composerItemList.
end(); ++itemIt )
1489 ( *itemIt )->move( 0.0, -1 * increment );
1490 ( *itemIt )->endCommand();
1500 mKeyPanning =
false;
1503 if ( mCurrentTool !=
Pan )
1545 if ( mRubberBandItem || mRubberBandLineItem )
1551 if (
composition()->selectionHandles()->isDragging() ||
composition()->selectionHandles()->isResizing() )
1566 if ( theItem->isSelected() )
1577 double zoomFactor = settings.
value(
"/qgis/zoom_factor", 2.0 ).
toDouble();
1578 if ( event->
modifiers() & Qt::ControlModifier )
1581 zoomFactor = 1.0 + ( zoomFactor - 1.0 ) / 20.0;
1583 zoomFactor =
event->delta() > 0 ? zoomFactor : 1 / zoomFactor;
1585 QPointF itemPoint = theItem->mapFromScene( scenePoint );
1587 theItem->zoomContent( zoomFactor, itemPoint, zoomMode );
1588 theItem->endCommand();
1599 void QgsComposerView::wheelZoom(
QWheelEvent * event )
1603 int wheelAction = mySettings.
value(
"/qgis/wheel_action", 2 ).
toInt();
1604 double zoomFactor = mySettings.
value(
"/qgis/zoom_factor", 2 ).
toDouble();
1611 if ( event->
modifiers() & Qt::ControlModifier )
1614 zoomFactor = 1.0 + ( zoomFactor - 1.0 ) / 10.0;
1618 bool zoomIn =
event->delta() > 0;
1619 double scaleFactor = ( zoomIn ? 1 / zoomFactor : zoomFactor );
1640 QgsPoint newCenter( scenePoint.
x() + (( oldCenter.x() - scenePoint.
x() ) * scaleFactor ),
1641 scenePoint.
y() + (( oldCenter.y() - scenePoint.
y() ) * scaleFactor ) );
1642 centerOn( newCenter.x(), newCenter.y() );
1653 scale( zoomFactor, zoomFactor );
1657 scale( 1 / zoomFactor, 1 / zoomFactor );
1667 for ( ; itemIt != itemList.
end(); ++itemIt )
1681 if (( dpi < 60 ) || ( dpi > 250 ) )
1685 double scale = zoomLevel * dpi / 25.4;
1695 if ( !mPreviewEffect )
1705 if ( !mPreviewEffect )
1710 mPreviewEffect->
setMode( mode );
1715 if ( mPaintingEnabled )
1754 if ( mHorizontalRuler )
1758 if ( mVerticalRuler )
1811 for ( ; itemIter != selectionList.
end(); ++itemIter )
1825 if ( !currentObject )
1827 return qobject_cast<
QMainWindow *>( currentObject );
1832 composerObject = qobject_cast<
QMainWindow*>( currentObject );
1833 if ( composerObject || currentObject->
parent() == 0 )
1835 return composerObject;
1837 currentObject = currentObject->
parent();
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.
QgsComposerItem * composerItemAt(const QPointF &position, const bool ignoreLocked=false) const
Returns the topmost composer item at a specified position.
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 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) ...
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 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%.
void updateMarker(const QPointF &pos)
virtual void mouseReleaseEvent(QMouseEvent *event)
QPointF snapPointToGrid(const QPointF &scenePoint) const
Snaps a scene coordinate point to grid.
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...
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.
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 addItemsFromXML(const QDomElement &elem, const QDomDocument &doc, QMap< QgsComposerMap *, int > *mapsToRestore=0, bool addUndoCommands=false, QPointF *pos=0, bool pasteInPlace=false)
Add items from XML representation to the graphics scene (for project file reading, pasting items from clipboard)
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()
QgsComposerView(QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0)
void resizeEvent(QResizeEvent *event) override
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 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.
QgsComposerMouseHandles::MouseAction mouseActionForScenePos(const QPointF &sceneCoordPos)
Finds out which mouse move action to choose depending on the scene cursor position.
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
void scale(double scaleFactor, const QgsPoint *c=0)
Scale the rectangle around its center point.
virtual void resizeEvent(QResizeEvent *event)
void beginMultiFrameCommand(QgsComposerMultiFrame *multiFrame, const QString &text, const QgsComposerMultiFrameMergeCommand::Context c=QgsComposerMultiFrameMergeCommand::Unknown)