libkpl  5.0
A Library for Graphical Presentation of Data Sets and Functions
kplview.h
1 /***************************************************************************
2  kplview.h - description
3  -------------------
4 
5  This file is a part of kpl - a program for graphical presentation of
6  data sets and functions.
7 
8  begin : Sat Apr 24 15:14:00 MEST 1999
9 
10  copyright : (C) 2017 by Werner Stille
11  email : kpl@werner-stille.de
12  ***************************************************************************/
13 
14 /***************************************************************************
15  * *
16  * This program is free software; you can redistribute it and/or modify *
17  * it under the terms of the GNU General Public License as published by *
18  * the Free Software Foundation; either version 2 of the License, or *
19  * (at your option) any later version. *
20  * *
21  ***************************************************************************/
22 
23 #ifndef KPLVIEW_H
24 #define KPLVIEW_H
25 
26 #include <QGraphicsView>
27 #include <QPoint>
28 #include <QUrl>
29 
30 class QRectF;
31 class QRubberBand;
32 
38 class Q_DECL_EXPORT KplView : public QGraphicsView
39 {
40  Q_OBJECT
41 public:
47  KplView(double f = 1, QWidget* parent = 0);
49  virtual ~KplView();
54  void setZoomFactor(double f);
56  virtual QSize sizeHint() const;
58  inline double zoomFactor() const { return m_zoomFactor; };
59 
60 signals:
62  void mouseLeaved();
67  void urlsDropped(QList<QUrl>* list);
74  void regionSelected(const QRectF& rect);
75 
76 protected:
78  virtual void dragEnterEvent(QDragEnterEvent* e);
80  virtual void dragMoveEvent(QDragMoveEvent* e);
85  virtual void dropEvent(QDropEvent* e);
97  virtual void keyPressEvent(QKeyEvent* e);
102  virtual void leaveEvent(QEvent* e);
108  virtual void mouseMoveEvent(QMouseEvent* e);
114  virtual void mousePressEvent(QMouseEvent* e);
121  virtual void mouseReleaseEvent(QMouseEvent* e);
122  double m_zoomFactor;
123  QPoint startPos;
124  QRubberBand* rubberBand;
125 };
126 
127 #endif // KPLVIEW_H
virtual void mouseMoveEvent(QMouseEvent *event)
virtual void dragEnterEvent(QDragEnterEvent *event)
double zoomFactor() const
Returns zoom factor.
Definition: kplview.h:58
virtual void mouseReleaseEvent(QMouseEvent *event)
virtual QSize sizeHint() const
virtual void keyPressEvent(QKeyEvent *event)
virtual void dragMoveEvent(QDragMoveEvent *event)
virtual void dropEvent(QDropEvent *event)
virtual void mousePressEvent(QMouseEvent *event)
virtual void leaveEvent(QEvent *event)
Kpl main view class.
Definition: kplview.h:38