QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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>

Public Types

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

Signals

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

Public Member Functions

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

Protected Member Functions

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

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.

Member Enumeration Documentation

Enumerator:
ClipboardModeCut 
ClipboardModeCopy 
Enumerator:
PasteModeCursor 
PasteModeCenter 
PasteModeInPlace 

Current tool.

Enumerator:
Select 
AddArrow 
AddHtml 
AddMap 
AddLegend 
AddLabel 
AddScalebar 
AddPicture 
AddRectangle 
AddEllipse 
AddTriangle 
AddTable 
AddAttributeTable 
MoveItemContent 
Pan 
Zoom 
Enumerator:
Inactive 
Active 
ActiveUntilMouseRelease 

Constructor & Destructor Documentation

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

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.

QgsComposition * QgsComposerView::composition ( )

Returns the composition or 0 in case of error.

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.

QgsComposerView::Tool QgsComposerView::currentTool ( ) const
inline
void QgsComposerView::cursorPosChanged ( QPointF  )
signal

Is emitted when mouse cursor coordinates change.

void QgsComposerView::deleteSelectedItems ( )

Deletes selected items.

void QgsComposerView::groupItems ( )

Add an item group containing the selected items.

void QgsComposerView::hideEvent ( QHideEvent *  e)
protected
void QgsComposerView::itemRemoved ( QgsComposerItem )
signal

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

void QgsComposerView::keyPressEvent ( QKeyEvent *  e)
protected
void QgsComposerView::keyReleaseEvent ( QKeyEvent *  e)
protected
void QgsComposerView::mouseDoubleClickEvent ( QMouseEvent *  e)
protected
void QgsComposerView::mouseMoveEvent ( QMouseEvent *  e)
protected
void QgsComposerView::mousePressEvent ( QMouseEvent *  e)
protected
void QgsComposerView::mouseReleaseEvent ( QMouseEvent *  e)
protected
void QgsComposerView::paintEvent ( QPaintEvent *  event)
protected
bool QgsComposerView::paintingEnabled ( ) const
inline
void QgsComposerView::pasteItems ( PasteMode  mode)

Pastes items from clipboard.

void QgsComposerView::resizeEvent ( QResizeEvent *  event)
protected
void QgsComposerView::scrollContentsBy ( int  dx,
int  dy 
)
protected
void QgsComposerView::selectAll ( )

Selects all items.

void QgsComposerView::selectedItemChanged ( QgsComposerItem selected)
signal

Is emitted when selected item changed.

If 0, no item is selected

void QgsComposerView::selectInvert ( )

Inverts current selection.

void QgsComposerView::selectNone ( )

Deselects all items.

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.

void QgsComposerView::setCurrentTool ( QgsComposerView::Tool  t)
void QgsComposerView::setHorizontalRuler ( QgsComposerRuler r)
inline
void QgsComposerView::setPaintingEnabled ( bool  enabled)
inline
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
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
void QgsComposerView::setVerticalRuler ( QgsComposerRuler r)
inline
void QgsComposerView::setZoomLevel ( double  zoomLevel)

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

void QgsComposerView::showEvent ( QShowEvent *  e)
protected
void QgsComposerView::ungroupItems ( )

Ungroups the selected items.

void QgsComposerView::updateRulers ( )

Update rulers with current scene rect.

void QgsComposerView::wheelEvent ( QWheelEvent *  event)
protected
void QgsComposerView::zoomLevelChanged ( )
signal

Is emitted when the view zoom changes.


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