libkpl  5.0
A Library for Graphical Presentation of Data Sets and Functions
Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KplView Class Reference

Kpl main view class. More...

#include <kplview.h>

Inheritance diagram for KplView:
Inheritance graph
[legend]

Signals

void mouseLeaved ()
 Emitted when mouse cursor leaves the widget.
 
void urlsDropped (QList< QUrl > *list)
 Emitted at drop event.
 
void regionSelected (const QRectF &rect)
 Emitted when rectangular region was selected using the mouse with its right button pressed.
 

Public Member Functions

 KplView (double f=1, QWidget *parent=0)
 Constructor.
 
virtual ~KplView ()
 Destructor.
 
void setZoomFactor (double f)
 Sets zoom factor.
 
virtual QSize sizeHint () const
 Calculates recommended size of the widget.
 
double zoomFactor () const
 Returns zoom factor.
 

Protected Member Functions

virtual void dragEnterEvent (QDragEnterEvent *e)
 
virtual void dragMoveEvent (QDragMoveEvent *e)
 
virtual void dropEvent (QDropEvent *e)
 Emits the signal urlsDropped, transferring a list of URLs.
 
virtual void keyPressEvent (QKeyEvent *e)
 Implements scrolling of the window by key sequences.
 
virtual void leaveEvent (QEvent *e)
 Emits the signal mouseLeaved.
 
virtual void mouseMoveEvent (QMouseEvent *e)
 Implements selection of a rectangular region using the mouse with its right button pressed.
 
virtual void mousePressEvent (QMouseEvent *e)
 Implements initiation of selection of a rectangular region using the mouse with its right button pressed.
 
virtual void mouseReleaseEvent (QMouseEvent *e)
 Implements finishing of selection of a rectangular region using the mouse with its right button pressed.
 

Protected Attributes

double m_zoomFactor
 
QPoint startPos
 
QRubberBand * rubberBand
 

Detailed Description

Kpl main view class.

Displays the plot items of a KplScene. Provides methods for scrolling and zooming.

Author
Werner Stille

Constructor & Destructor Documentation

◆ KplView()

KplView::KplView ( double  f = 1,
QWidget *  parent = 0 
)

Constructor.

Parameters
fzoom factor.
parentpointer to parent widget.

Member Function Documentation

◆ dragEnterEvent()

virtual void KplView::dragEnterEvent ( QDragEnterEvent *  e)
protectedvirtual
Parameters
epointer to event.

◆ dragMoveEvent()

virtual void KplView::dragMoveEvent ( QDragMoveEvent *  e)
protectedvirtual
Parameters
epointer to event.

◆ dropEvent()

virtual void KplView::dropEvent ( QDropEvent *  e)
protectedvirtual

Emits the signal urlsDropped, transferring a list of URLs.

Parameters
epointer to event.

◆ keyPressEvent()

virtual void KplView::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Implements scrolling of the window by key sequences.

  • Home scrolls to bottom margin.
  • End scrolls to top margin.
  • Ctrl+Home scrolls to left margin.
  • Ctrl+End scrolls to right margin.
  • PgUp scrolls page up.
  • PgDown scrolls page down.
Parameters
epointer to event.

◆ leaveEvent()

virtual void KplView::leaveEvent ( QEvent *  e)
protectedvirtual

Emits the signal mouseLeaved.

Parameters
epointer to event.

◆ mouseMoveEvent()

virtual void KplView::mouseMoveEvent ( QMouseEvent *  e)
protectedvirtual

Implements selection of a rectangular region using the mouse with its right button pressed.

Parameters
epointer to event.

◆ mousePressEvent()

virtual void KplView::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Implements initiation of selection of a rectangular region using the mouse with its right button pressed.

Parameters
epointer to event.

◆ mouseReleaseEvent()

virtual void KplView::mouseReleaseEvent ( QMouseEvent *  e)
protectedvirtual

Implements finishing of selection of a rectangular region using the mouse with its right button pressed.

In this case the signal regionSelected is emitted, transferring the rectangle.

Parameters
epointer to event.

◆ regionSelected

void KplView::regionSelected ( const QRectF &  rect)
signal

Emitted when rectangular region was selected using the mouse with its right button pressed.

Parameters
rectrectangle in pixel units. units.

◆ setZoomFactor()

void KplView::setZoomFactor ( double  f)

Sets zoom factor.

Parameters
fzoom factor.

◆ urlsDropped

void KplView::urlsDropped ( QList< QUrl > *  list)
signal

Emitted at drop event.

Parameters
listpointer to list of dropped URLs.

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