18 #include <QApplication>
19 #include <QMainWindow>
20 #include <QMouseEvent>
24 #include <QGridLayout>
48 : QGraphicsView( parent )
49 , mRubberBandItem( 0 )
50 , mRubberBandLineItem( 0 )
51 , mMoveContentItem( 0 )
52 , mMarqueeSelect( false )
53 , mMarqueeZoom( false )
55 , mPaintingEnabled( true )
56 , mHorizontalRuler( 0 )
58 , mToolPanning( false )
59 , mMousePanning( false )
60 , mKeyPanning( false )
61 , mMovingItemContent( false )
66 setResizeAnchor( QGraphicsView::AnchorViewCenter );
67 setMouseTracking(
true );
68 viewport()->setMouseTracking(
true );
69 setFrameShape( QFrame::NoFrame );
120 viewport()->setCursor( Qt::ArrowCursor );
144 QPointF scenePoint = mapToScene( e->pos() );
149 if ( e->button() == Qt::RightButton )
154 bool lock = selectedItem->
positionLock() ?
false :
true;
156 selectedItem->update();
160 else if ( e->button() == Qt::MidButton )
170 viewport()->setCursor( Qt::ClosedHandCursor );
180 if (
composition()->selectionHandles()->isVisible() )
188 QGraphicsView::mousePressEvent( e );
196 if ( e->modifiers() & Qt::ControlModifier )
201 if ( selectedItems.size() > 0 )
203 previousSelectedItem = selectedItems.at( 0 );
207 if ( previousSelectedItem )
232 if (( !selectedItem->
selected() ) &&
233 !( e->modifiers() & Qt::ShiftModifier ) )
238 if (( e->modifiers() & Qt::ShiftModifier ) && ( selectedItem->
selected() ) )
245 if ( selectedItems.size() > 0 )
253 QGraphicsView::mousePressEvent( e );
261 if ( !( e->modifiers() & Qt::ShiftModifier ) )
269 double scaleFactor = 2;
271 QRect viewportRect( 0, 0, viewport()->width(), viewport()->height() );
275 QPointF scenePoint = mapToScene( e->pos() );
277 visibleRect.
scale( scaleFactor, scenePoint.x(), scenePoint.y() );
278 QRectF boundsRect = visibleRect.
toRectF();
281 fitInView( boundsRect, Qt::KeepAspectRatio );
291 viewport()->setCursor( Qt::ClosedHandCursor );
298 QList<QGraphicsItem *> itemsAtCursorPos = items( e->pos() );
299 if ( itemsAtCursorPos.size() == 0 )
307 QList<QGraphicsItem*>::iterator itemIter = itemsAtCursorPos.begin();
308 for ( ; itemIter != itemsAtCursorPos.end(); ++itemIter )
328 mRubberBandLineItem =
new QGraphicsLineItem( snappedScenePoint.x(), snappedScenePoint.y(), snappedScenePoint.x(), snappedScenePoint.y() );
329 mRubberBandLineItem->setZValue( 1000 );
330 scene()->addItem( mRubberBandLineItem );
345 t.translate( snappedScenePoint.x(), snappedScenePoint.y() );
359 newLabelItem->
setSceneRect( QRectF( snappedScenePoint.x(), snappedScenePoint.y(), newLabelItem->rect().width(), newLabelItem->rect().height() ) );
375 newScaleBar->
setSceneRect( QRectF( snappedScenePoint.x(), snappedScenePoint.y(), 20, 20 ) );
378 if ( mapItemList.size() > 0 )
398 newLegend->
setSceneRect( QRectF( snappedScenePoint.x(), snappedScenePoint.y(), newLegend->rect().width(), newLegend->rect().height() ) );
415 newPicture->
setSceneRect( QRectF( snappedScenePoint.x(), snappedScenePoint.y(), 30, 30 ) );
430 newTable->
setSceneRect( QRectF( snappedScenePoint.x(), snappedScenePoint.y(), 50, 50 ) );
448 switch ( currentTool )
451 return Qt::ArrowCursor;
455 QPixmap myZoomQPixmap = QPixmap((
const char ** )(
zoom_in ) );
456 return QCursor( myZoomQPixmap, 7, 7 );
460 return Qt::OpenHandCursor;
463 return Qt::ArrowCursor;
478 return QCursor( myCrosshairQPixmap, 8, 8 );
481 return Qt::ArrowCursor;
547 t.translate( scenePoint.x(), scenePoint.y() );
558 bool subtractingSelection =
false;
559 if ( e->modifiers() & Qt::ShiftModifier )
563 else if ( e->modifiers() & Qt::ControlModifier )
566 subtractingSelection =
true;
585 Qt::ItemSelectionMode selectionMode = Qt::IntersectsItemShape;
586 if ( e->modifiers() & Qt::AltModifier )
589 selectionMode = Qt::ContainsItemShape;
593 QList<QGraphicsItem *> itemList =
composition()->items( boundsRect, selectionMode );
594 QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
595 for ( ; itemIt != itemList.end(); ++itemIt )
599 if ( mypItem && !paperItem )
603 if ( subtractingSelection )
618 if ( selectedItemList.size() > 0 )
633 t.translate( scenePoint.x(), scenePoint.y() );
649 double scaleFactor = 0.5;
651 QRect viewportRect( 0, 0, viewport()->width(), viewport()->height() );
655 QPointF scenePoint = mapToScene( e->pos() );
657 visibleRect.
scale( scaleFactor, scenePoint.x(), scenePoint.y() );
658 boundsRect = visibleRect.
toRectF();
670 fitInView( boundsRect, Qt::KeepAspectRatio );
688 if ( e->button() != Qt::LeftButton &&
695 QPoint mousePressStopPoint = e->pos();
700 bool clickOnly =
false;
701 if ( qAbs( diffX ) < 2 && qAbs( diffY ) < 2 )
706 QPointF scenePoint = mapToScene( e->pos() );
713 if ( clickOnly && e->button() == Qt::MidButton )
718 QRect viewportRect( 0, 0, viewport()->width(), viewport()->height() );
720 visibleRect.
scale( 1, scenePoint.x(), scenePoint.y() );
721 QRectF boundsRect = visibleRect.
toRectF();
724 fitInView( boundsRect, Qt::KeepAspectRatio );
740 if ( e->button() != Qt::LeftButton )
755 QGraphicsView::mouseReleaseEvent( e );
793 QPointF scenePoint = mapToScene( e->pos() );
887 horizontalScrollBar()->setValue( horizontalScrollBar()->value() - ( e->x() -
mMouseLastXY.x() ) );
888 verticalScrollBar()->setValue( verticalScrollBar()->value() - ( e->y() -
mMouseLastXY.y() ) );
892 else if ( e->buttons() == Qt::NoButton )
896 QGraphicsView::mouseMoveEvent( e );
901 QPointF scenePoint = mapToScene( e->pos() );
912 QGraphicsView::mouseMoveEvent( e );
942 composerMap->update();
1006 QList<QgsComposerItem*>::iterator itemIt = composerItemList.begin();
1009 QDomElement documentElement = doc.createElement(
"ComposerItemClipboard" );
1010 for ( ; itemIt != composerItemList.end(); ++itemIt )
1016 QSet<QgsComposerItem*> groupedItems = itemGroup->
items();
1017 QSet<QgsComposerItem*>::iterator it = groupedItems.begin();
1018 for ( ; it != groupedItems.end(); ++it )
1020 ( *it )->writeXML( documentElement, doc );
1023 ( *itemIt )->writeXML( documentElement, doc );
1029 doc.appendChild( documentElement );
1035 QDomNodeList composerItemsNodes = doc.elementsByTagName(
"ComposerItem" );
1036 for (
int i = 0; i < composerItemsNodes.count(); ++i )
1038 QDomNode composerItemNode = composerItemsNodes.at( i );
1039 if ( composerItemNode.isElement() )
1041 composerItemNode.toElement().removeAttribute(
"uuid" );
1046 QMimeData *mimeData =
new QMimeData;
1047 mimeData->setData(
"text/xml", doc.toByteArray() );
1048 QClipboard *clipboard = QApplication::clipboard();
1049 clipboard->setMimeData( mimeData );
1060 QClipboard *clipboard = QApplication::clipboard();
1061 if ( doc.setContent( clipboard->mimeData()->data(
"text/xml" ) ) )
1063 QDomElement docElem = doc.documentElement();
1064 if ( docElem.tagName() ==
"ComposerItemClipboard" )
1072 pt = mapToScene( mapFromGlobal( QCursor::pos() ) );
1077 pt = mapToScene( viewport()->rect().center() );
1097 QList<QgsComposerItem*>::iterator itemIt = composerItemList.begin();
1100 for ( ; itemIt != composerItemList.end(); ++itemIt )
1117 QList<QGraphicsItem *> itemList =
composition()->items();
1118 QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
1119 for ( ; itemIt != itemList.end(); ++itemIt )
1123 if ( mypItem && !paperItem )
1157 QList<QGraphicsItem *> itemList =
composition()->items();
1158 QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
1159 for ( ; itemIt != itemList.end(); ++itemIt )
1163 if ( mypItem && !paperItem )
1196 if ( e->isAutoRepeat() )
1202 if ( !( e->modifiers() & Qt::ControlModifier ) && !
mMarqueeZoom )
1208 else if ( !( e->modifiers() & Qt::ControlModifier ) &&
mMarqueeZoom )
1218 QPixmap myZoomQPixmap = QPixmap((
const char ** )( e->modifiers() & Qt::ShiftModifier ?
zoom_out :
zoom_in ) );
1219 QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
1220 viewport()->setCursor( zoomCursor );
1231 if ( e->key() == Qt::Key_Space && ! e->isAutoRepeat() )
1233 if ( !( e->modifiers() & Qt::ControlModifier ) )
1243 viewport()->setCursor( Qt::ClosedHandCursor );
1253 QPixmap myZoomQPixmap = QPixmap((
const char ** )( e->modifiers() & Qt::ShiftModifier ?
zoom_out :
zoom_in ) );
1254 QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
1255 viewport()->setCursor( zoomCursor );
1263 if ( ! e->isAutoRepeat() )
1265 QPixmap myZoomQPixmap = QPixmap((
const char ** )( e->modifiers() & Qt::ShiftModifier ?
zoom_out :
zoom_in ) );
1266 QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
1267 viewport()->setCursor( zoomCursor );
1273 QList<QgsComposerItem*>::iterator itemIt = composerItemList.begin();
1276 double increment = 1.0;
1277 if ( e->modifiers() & Qt::ShiftModifier )
1283 if ( e->key() == Qt::Key_Left )
1285 for ( ; itemIt != composerItemList.end(); ++itemIt )
1288 ( *itemIt )->move( -1 * increment, 0.0 );
1289 ( *itemIt )->endCommand();
1292 else if ( e->key() == Qt::Key_Right )
1294 for ( ; itemIt != composerItemList.end(); ++itemIt )
1297 ( *itemIt )->move( increment, 0.0 );
1298 ( *itemIt )->endCommand();
1301 else if ( e->key() == Qt::Key_Down )
1303 for ( ; itemIt != composerItemList.end(); ++itemIt )
1306 ( *itemIt )->move( 0.0, increment );
1307 ( *itemIt )->endCommand();
1310 else if ( e->key() == Qt::Key_Up )
1312 for ( ; itemIt != composerItemList.end(); ++itemIt )
1315 ( *itemIt )->move( 0.0, -1 * increment );
1316 ( *itemIt )->endCommand();
1323 if ( e->key() == Qt::Key_Space && !e->isAutoRepeat() &&
mKeyPanning )
1359 if ( ! e->isAutoRepeat() )
1361 QPixmap myZoomQPixmap = QPixmap((
const char ** )( e->modifiers() & Qt::ShiftModifier ?
zoom_out :
zoom_in ) );
1362 QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
1363 viewport()->setCursor( zoomCursor );
1377 if (
composition()->selectionHandles()->isDragging() ||
composition()->selectionHandles()->isResizing() )
1387 QPointF scenePoint = mapToScene( event->pos() );
1392 if ( theItem->isSelected() )
1394 QPointF itemPoint = theItem->mapFromScene( scenePoint );
1396 theItem->zoomContent( event->delta(), itemPoint.x(), itemPoint.y() );
1397 theItem->endCommand();
1411 QSettings mySettings;
1412 int wheelAction = mySettings.value(
"/qgis/wheel_action", 2 ).toInt();
1413 double zoomFactor = mySettings.value(
"/qgis/zoom_factor", 2 ).toDouble();
1420 if ( event->modifiers() & Qt::ControlModifier )
1423 zoomFactor = 1.0 + ( zoomFactor - 1.0 ) / 10.0;
1427 bool zoomIn =
event->delta() > 0;
1428 double scaleFactor = ( zoomIn ? 1 / zoomFactor : zoomFactor );
1431 QRect viewportRect( 0, 0, viewport()->width(), viewport()->height() );
1435 QPointF scenePoint = mapToScene( event->pos() );
1442 centerOn( scenePoint.x(), scenePoint.y() );
1449 QgsPoint newCenter( scenePoint.x() + (( oldCenter.x() - scenePoint.x() ) * scaleFactor ),
1450 scenePoint.y() + (( oldCenter.y() - scenePoint.y() ) * scaleFactor ) );
1451 centerOn( newCenter.x(), newCenter.y() );
1462 scale( zoomFactor, zoomFactor );
1466 scale( 1 / zoomFactor, 1 / zoomFactor );
1474 QList<QGraphicsItem *> itemList =
composition()->items();
1475 QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
1476 for ( ; itemIt != itemList.end(); ++itemIt )
1488 double dpi = QgsApplication::desktop()->logicalDpiX();
1490 if (( dpi < 60 ) || ( dpi > 250 ) )
1494 double scale = zoomLevel * dpi / 25.4;
1495 setTransform( QTransform::fromScale( scale , scale ) );
1506 QGraphicsView::paintEvent( event );
1529 QGraphicsView::resizeEvent( event );
1536 QGraphicsView::scrollContentsBy( dx, dy );
1574 if ( selectionList.size() < 2 )
1580 QList<QgsComposerItem*>::iterator itemIter = selectionList.begin();
1581 for ( ; itemIter != selectionList.end(); ++itemIter )
1583 itemGroup->
addItem( *itemIter );
1599 QList<QgsComposerItem*>::iterator itemIter = selectionList.begin();
1600 for ( ; itemIter != selectionList.end(); ++itemIter )
1607 delete( *itemIter );
1615 QMainWindow* composerObject = 0;
1616 QObject* currentObject = parent();
1617 if ( !currentObject )
1619 return qobject_cast<QMainWindow *>( currentObject );
1624 composerObject = qobject_cast<QMainWindow*>( currentObject );
1625 if ( composerObject || currentObject->parent() == 0 )
1627 return composerObject;
1629 currentObject = currentObject->parent();
void mouseDoubleClickEvent(QMouseEvent *e)
bool positionLock() const
Returns position lock for mouse drags (true means locked)
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.
QPointF mMoveContentStartPos
Start position of content move.
A rectangle specified with double values.
void setSceneRect(const QRectF &rectangle)
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size un...
QRectF toRectF() const
returns a QRectF with same coordinates.
QMainWindow * composerWindow()
Returns the composer main window.
QgsComposerRuler * mVerticalRuler
An item that draws an arrow between to points.
const char * zoom_in[]
Bitmap cursors for map operations.
void wheelZoom(QWheelEvent *event)
Zoom composition from a mouse wheel event.
QPoint mMousePressStartPos
bool mToolPanning
True if user is currently panning by clicking and dragging with the pan tool.
void zoomLevelChanged()
Is emitted when the view zoom changes.
void selectAll()
Selects all items.
void mouseReleaseEvent(QMouseEvent *)
void removeItems()
Removes the items but does not delete them.
void setOffset(double xOffset, double yOffset)
Sets offset values to shift image (useful for live updates when moving item content) ...
QgsComposerView::Tool mCurrentTool
Current composer tool.
virtual bool selected() const
Is selected.
void selectInvert()
Inverts current selection.
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.
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 setZoomLevel(double zoomLevel)
Set zoom level, where a zoom level of 1.0 corresponds to 100%.
void updateMarker(const QPointF &pos)
QPointF snapPointToGrid(const QPointF &scenePoint) const
Snaps a scene coordinate point to grid.
void removeComposerItem(QgsComposerItem *item, bool createCommand=true)
Remove item from the graphics scene.
bool mKeyPanning
True if user is currently panning by holding the space key.
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...
void updateCachedImage()
Called if map canvas has changed.
void setCurrentTool(QgsComposerView::Tool t)
void groupItems()
Add an item group containing the selected items.
void paintEvent(QPaintEvent *event)
QGraphicsLineItem * mRubberBandLineItem
Rubber band item for arrows.
void updateLegend()
Updates the model and all legend entries.
void beginMultiFrameCommand(QgsComposerMultiFrame *multiFrame, const QString &text)
void selectNone()
Deselects all items.
void composerViewHide(QgsComposerView *)
Emitted before composerview is hidden.
void scrollContentsBy(int dx, int dy)
A composer class that displays svg files or raster format (jpg, png, ...)
QgsComposerView::Tool mPreviousTool
Previous composer tool.
bool isResizing()
Returns true is user is currently resizing with the handles.
void endMultiFrameCommand()
QSet< QgsComposerItem * > items()
QgsComposerItem * composerItemAt(const QPointF &position)
Returns the topmost composer item.
void addComposerShape(QgsComposerShape *shape)
Adds a composer shape to the graphics scene and advices composer to create a widget for it (through s...
virtual void moveContent(double dx, double dy)
Move Content of item.
void updateRubberBand(QPointF &pos)
Redraws the rubber band.
void addShape(Tool currentTool)
Draw a shape on the canvas.
void hideEvent(QHideEvent *e)
void setSceneRect(const QRectF &rectangle)
Adapts mMaximumNumberOfFeatures depending on the rectangle height.
void endMarqueeSelect(QMouseEvent *e)
Finalises a marquee selection.
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 resizeEvent(QResizeEvent *event)
void mousePressEvent(QMouseEvent *)
bool mMousePanning
True if user is currently panning by holding the middle mouse button.
void selectedItemChanged(QgsComposerItem *selected)
Is emitted when selected item changed.
void setSceneTransform(const QTransform &transform)
Widget to display the composer items.
QCursor defaultCursorForTool(Tool currentTool)
Returns the default mouse cursor for a tool.
void beginCommand(const QString &commandText, QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown)
Starts new composer undo command.
QPointF mRubberBandStartPos
Start of rubber band creation.
void wheelEvent(QWheelEvent *event)
void endMarqueeZoom(QMouseEvent *e)
Finalises a marquee zoom.
void pasteItems(PasteMode mode)
Pastes items from clipboard.
A class to represent a point geometry.
Graphics scene for map printing.
bool mMovingItemContent
True if user is currently dragging with the move item content tool.
Object representing map window.
Frame for html, table, text which can be divided onto several frames.
QgsComposerView(QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
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.
void setPositionLock(bool lock)
Locks / unlocks the item position for mouse drags.
PreviewMode previewMode() const
QgsComposerItem * mMoveContentItem
Item to move content.
void startMarqueeZoom(QPointF &scenePoint)
Starts a zoom in marquee.
void copyItems(ClipboardMode mode)
Cuts or copies the selected items.
void setPreventCursorChange(bool preventChange)
If true, prevents any mouse cursor changes by the composition or by any composer items Used by QgsCom...
void removeRubberBand()
Removes the rubber band and cleans up.
A table class that displays a vector attribute table.
void addItem(QgsComposerItem *item)
Adds an item to the group.
A composer items that draws common shapes (ellipse, triangle, rectangle)
void keyReleaseEvent(QKeyEvent *e)
void keyPressEvent(QKeyEvent *e)
void addFrame(QgsComposerFrame *frame, bool recalcFrameSizes=true)
void cursorPosChanged(QPointF)
Is emitted when mouse cursor coordinates change.
void setComposition(QgsComposition *c)
Sets composition (derived from QGraphicsScene)
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 startMarqueeSelect(QPointF &scenePoint)
Starts a marquee selection.
void setText(const QString &text)
void showEvent(QShowEvent *e)
void pushAddRemoveCommand(QgsComposerItem *item, const QString &text, QgsAddRemoveItemCommand::State state=QgsAddRemoveItemCommand::Added)
Convenience function to create a QgsAddRemoveItemCommand, connect its signals and push it to the undo...
A label that can be placed onto a map composition.
void addComposerPicture(QgsComposerPicture *picture)
Adds picture to the graphics scene and advices composer to create a widget for it (through signal) ...
void addComposerTable(QgsComposerAttributeTable *table)
Adds a composer table to the graphics scene and advices composer to create a widget for it (through s...
bool mMarqueeZoom
True if user is currently zooming by marquee.
QgsComposition * composition()
Returns the composition or 0 in case of error.
const char * cross_hair_cursor[]
void mouseMoveEvent(QMouseEvent *)
void actionFinished()
Current action (e.g.
QList< QgsComposerItem * > selectedComposerItems()
QgsComposerRuler * mHorizontalRuler
QgsComposerView::ToolStatus mTemporaryZoomStatus
True if user is currently temporarily activating the zoom tool by holding control+space.
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.
bool mMarqueeSelect
True if user is currently selecting by marquee.
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
QGraphicsRectItem * mRubberBandItem
Rubber band item.
void addComposerMap(QgsComposerMap *map, bool setDefaultPreviewStyle=true)
Adds map to the graphics scene and advices composer to create a widget for it (through signal) ...
void addComposerLegend(QgsComposerLegend *legend)
Adds legend to the graphics scene and advices composer to create a widget for it (through signal) ...
void adjustSizeToText()
resizes the widget such that the text fits to the item.
void beginCommand(QgsComposerItem *item, const QString &commandText, QgsComposerMergeCommand::Context c=QgsComposerMergeCommand::Unknown)
Allocates new item command and saves initial state in it.
void composerViewShow(QgsComposerView *)
Emitted before composerview is shown.
void scale(double scaleFactor, const QgsPoint *c=0)
Scale the rectangle around its center point.
void itemRemoved(QgsComposerItem *)
Is emitted when a composer item has been removed from the scene.