QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
QgsComposerView Class Reference

Widget to display the composer items. More...

#include <qgscomposerview.h>

Inheritance diagram for QgsComposerView:
Inheritance graph
[legend]

Public Types

enum  ClipboardMode { ClipboardModeCut, ClipboardModeCopy }
 
enum  PasteMode { PasteModeCursor, PasteModeCenter, PasteModeInPlace }
 
enum  Tool {
  Select = 0, AddArrow, AddHtml, AddMap,
  AddLegend, AddLabel, AddScalebar, AddPicture,
  AddRectangle, AddEllipse, AddTriangle, AddTable,
  AddAttributeTable, MoveItemContent, Pan, Zoom
}
 Current tool. More...
 
enum  ToolStatus { Inactive, Active, ActiveUntilMouseRelease }
 

Signals

void actionFinished ()
 Current action (e.g. More...
 
void composerViewHide (QgsComposerView *)
 Emitted before composerview is hidden. More...
 
void composerViewShow (QgsComposerView *)
 Emitted before composerview is shown. More...
 
void compositionSet (QgsComposition *)
 Emitted when the composition is set for the view. More...
 
void cursorPosChanged (QPointF)
 Is emitted when mouse cursor coordinates change. More...
 
void itemRemoved (QgsComposerItem *)
 Is emitted when a composer item has been removed from the scene. More...
 
void selectedItemChanged (QgsComposerItem *selected)
 Is emitted when selected item changed. More...
 
void zoomLevelChanged ()
 Is emitted when the view zoom changes. More...
 

Public Member Functions

 QgsComposerView (QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0)
 
QMainWindow * composerWindow ()
 Returns the composer main window. More...
 
QgsCompositioncomposition ()
 Returns the composition or 0 in case of error. More...
 
void copyItems (ClipboardMode mode)
 Cuts or copies the selected items. More...
 
QgsComposerView::Tool currentTool () const
 
void deleteSelectedItems ()
 Deletes selected items. More...
 
void groupItems ()
 Add an item group containing the selected items. More...
 
bool paintingEnabled () const
 
void pasteItems (PasteMode mode)
 Pastes items from clipboard. More...
 
void selectAll ()
 Selects all items. More...
 
void selectInvert ()
 Inverts current selection. More...
 
void selectNone ()
 Deselects all items. More...
 
void setComposition (QgsComposition *c)
 Sets the composition for the view. More...
 
void setCurrentTool (QgsComposerView::Tool t)
 
void setHorizontalRuler (QgsComposerRuler *r)
 
void setPaintingEnabled (bool enabled)
 
void setPreviewMode (QgsPreviewEffect::PreviewMode mode)
 Sets the preview mode which should be used to modify the view's appearance. More...
 
void setPreviewModeEnabled (bool enabled)
 Sets whether a preview effect should be used to alter the view's appearance. More...
 
void setVerticalRuler (QgsComposerRuler *r)
 
void setZoomLevel (double zoomLevel)
 Set zoom level, where a zoom level of 1.0 corresponds to 100%. More...
 
void ungroupItems ()
 Ungroups the selected items. More...
 
void updateRulers ()
 Update rulers with current scene rect. More...
 

Protected Member Functions

void hideEvent (QHideEvent *e)
 
void keyPressEvent (QKeyEvent *e)
 
void keyReleaseEvent (QKeyEvent *e)
 
void mouseDoubleClickEvent (QMouseEvent *e)
 
void mouseMoveEvent (QMouseEvent *)
 
void mousePressEvent (QMouseEvent *)
 
void mouseReleaseEvent (QMouseEvent *)
 
void paintEvent (QPaintEvent *event)
 
void resizeEvent (QResizeEvent *event)
 
void scrollContentsBy (int dx, int dy)
 
void showEvent (QShowEvent *e)
 
void wheelEvent (QWheelEvent *event)
 

Detailed Description

Widget to display the composer items.

Manages the composer tools and the mouse/key events. Creates the composer items according to the current map tools and keeps track of the rubber band item.

Definition at line 47 of file qgscomposerview.h.

Constructor & Destructor Documentation

QgsComposerView::QgsComposerView ( QWidget *  parent = 0,
const char *  name = 0,
Qt::WindowFlags  f = 0 
)

Definition at line 50 of file qgscomposerview.cpp.

Member Function Documentation

void QgsComposerView::actionFinished ( )
signal

Current action (e.g.

adding composer map) has been finished. The purpose of this signal is that QgsComposer may set the selection tool again

void QgsComposerView::composerViewHide ( QgsComposerView )
signal

Emitted before composerview is hidden.

void QgsComposerView::composerViewShow ( QgsComposerView )
signal

Emitted before composerview is shown.

QMainWindow * QgsComposerView::composerWindow ( )

Returns the composer main window.

Definition at line 1819 of file qgscomposerview.cpp.

QgsComposition * QgsComposerView::composition ( )

Returns the composition or 0 in case of error.

Definition at line 1765 of file qgscomposerview.cpp.

void QgsComposerView::compositionSet ( QgsComposition )
signal

Emitted when the composition is set for the view.

void QgsComposerView::copyItems ( ClipboardMode  mode)

Cuts or copies the selected items.

Definition at line 1161 of file qgscomposerview.cpp.

QgsComposerView::Tool QgsComposerView::currentTool ( ) const
inline

Definition at line 120 of file qgscomposerview.h.

void QgsComposerView::cursorPosChanged ( QPointF  )
signal

Is emitted when mouse cursor coordinates change.

void QgsComposerView::deleteSelectedItems ( )

Deletes selected items.

Definition at line 1252 of file qgscomposerview.cpp.

void QgsComposerView::groupItems ( )

Add an item group containing the selected items.

Definition at line 1778 of file qgscomposerview.cpp.

void QgsComposerView::hideEvent ( QHideEvent *  e)
protected

Definition at line 1724 of file qgscomposerview.cpp.

void QgsComposerView::itemRemoved ( QgsComposerItem )
signal

Is emitted when a composer item has been removed from the scene.

void QgsComposerView::keyPressEvent ( QKeyEvent *  e)
protected

Definition at line 1343 of file qgscomposerview.cpp.

void QgsComposerView::keyReleaseEvent ( QKeyEvent *  e)
protected

Definition at line 1493 of file qgscomposerview.cpp.

void QgsComposerView::mouseDoubleClickEvent ( QMouseEvent *  e)
protected

Definition at line 1156 of file qgscomposerview.cpp.

void QgsComposerView::mouseMoveEvent ( QMouseEvent *  e)
protected

Definition at line 959 of file qgscomposerview.cpp.

void QgsComposerView::mousePressEvent ( QMouseEvent *  e)
protected

Definition at line 133 of file qgscomposerview.cpp.

void QgsComposerView::mouseReleaseEvent ( QMouseEvent *  e)
protected

Definition at line 627 of file qgscomposerview.cpp.

void QgsComposerView::paintEvent ( QPaintEvent *  event)
protected

Definition at line 1711 of file qgscomposerview.cpp.

bool QgsComposerView::paintingEnabled ( ) const
inline

Definition at line 135 of file qgscomposerview.h.

void QgsComposerView::pasteItems ( PasteMode  mode)

Pastes items from clipboard.

Definition at line 1215 of file qgscomposerview.cpp.

void QgsComposerView::resizeEvent ( QResizeEvent *  event)
protected

Definition at line 1736 of file qgscomposerview.cpp.

void QgsComposerView::scrollContentsBy ( int  dx,
int  dy 
)
protected

Definition at line 1743 of file qgscomposerview.cpp.

void QgsComposerView::selectAll ( )

Selects all items.

Definition at line 1272 of file qgscomposerview.cpp.

void QgsComposerView::selectedItemChanged ( QgsComposerItem selected)
signal

Is emitted when selected item changed.

If 0, no item is selected

void QgsComposerView::selectInvert ( )

Inverts current selection.

Definition at line 1312 of file qgscomposerview.cpp.

void QgsComposerView::selectNone ( )

Deselects all items.

Definition at line 1302 of file qgscomposerview.cpp.

void QgsComposerView::setComposition ( QgsComposition c)

Sets the composition for the view.

If the composition is being set manually and not by a QgsComposer, then this must be set BEFORE adding any items to the composition.

Definition at line 1749 of file qgscomposerview.cpp.

void QgsComposerView::setCurrentTool ( QgsComposerView::Tool  t)

Definition at line 79 of file qgscomposerview.cpp.

void QgsComposerView::setHorizontalRuler ( QgsComposerRuler r)
inline

Definition at line 140 of file qgscomposerview.h.

void QgsComposerView::setPaintingEnabled ( bool  enabled)
inline

Definition at line 134 of file qgscomposerview.h.

void QgsComposerView::setPreviewMode ( QgsPreviewEffect::PreviewMode  mode)

Sets the preview mode which should be used to modify the view's appearance.

Preview modes are only used if setPreviewMode is set to true.

Parameters
modePreviewMode to be used to draw the view
Note
added in 2.3
See also
setPreviewModeEnabled

Definition at line 1701 of file qgscomposerview.cpp.

void QgsComposerView::setPreviewModeEnabled ( bool  enabled)

Sets whether a preview effect should be used to alter the view's appearance.

Parameters
enabledSet to true to enable the preview effect on the view
Note
added in 2.3
See also
setPreviewMode

Definition at line 1691 of file qgscomposerview.cpp.

void QgsComposerView::setVerticalRuler ( QgsComposerRuler r)
inline

Definition at line 141 of file qgscomposerview.h.

void QgsComposerView::setZoomLevel ( double  zoomLevel)

Set zoom level, where a zoom level of 1.0 corresponds to 100%.

Definition at line 1675 of file qgscomposerview.cpp.

void QgsComposerView::showEvent ( QShowEvent *  e)
protected

Definition at line 1730 of file qgscomposerview.cpp.

void QgsComposerView::ungroupItems ( )

Ungroups the selected items.

Definition at line 1799 of file qgscomposerview.cpp.

void QgsComposerView::updateRulers ( )

Update rulers with current scene rect.

Definition at line 462 of file qgscomposerview.cpp.

void QgsComposerView::wheelEvent ( QWheelEvent *  event)
protected

Definition at line 1541 of file qgscomposerview.cpp.

void QgsComposerView::zoomLevelChanged ( )
signal

Is emitted when the view zoom changes.


The documentation for this class was generated from the following files: