libkpl  6.0
A Library for Graphical Presentation of Data Sets and Functions
KplView Class Reference

Kpl main view class. More...

#include <kplview.h>

Inheritance diagram for KplView:

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=nullptr)
 Constructor.
 
virtual ~KplView ()
 Destructor.
 
void setZoomFactor (double f)
 Sets zoom factor.
 
virtual QSize sizeHint () const override
 Calculates recommended size of the widget.
 
double zoomFactor () const
 Returns zoom factor.
 

Protected Member Functions

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

Constructor.

Parameters
fzoom factor.
parentpointer to parent widget.

Member Function Documentation

◆ dragEnterEvent()

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

◆ dragMoveEvent()

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

◆ dropEvent()

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

Emits the signal urlsDropped, transferring a list of URLs.

Parameters
epointer to event.

◆ keyPressEvent()

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

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)
overrideprotectedvirtual

Emits the signal mouseLeaved.

Parameters
epointer to event.

◆ mouseMoveEvent()

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

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)
overrideprotectedvirtual

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)
overrideprotectedvirtual

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: