umbrello  2.31.90
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
birdview.h
Go to the documentation of this file.
1 /*
2  Copyright 2014 Andi Fischer <andi.fischer@hispeed.ch>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public License as
6  published by the Free Software Foundation; either version 2 of
7  the License or (at your option) version 3 or any later version
8  accepted by the membership of KDE e.V. (or its successor approved
9  by the membership of KDE e.V.), which shall act as a proxy
10  defined in Section 14 of version 3 of the license.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 #ifndef BIRDVIEW_H
21 #define BIRDVIEW_H
22 
23 #include <QDockWidget>
24 #include <QFrame>
25 
26 class UMLView;
27 
28 QT_BEGIN_NAMESPACE
29 class QGraphicsView;
30 QT_END_NAMESPACE
31 
40 class BirdViewDockWidget : public QDockWidget
41 {
42  Q_OBJECT
43 public:
44  explicit BirdViewDockWidget(const QString& title, QWidget* parent = 0, Qt::WindowFlags flags = 0);
45 
46 signals:
47  void sizeChanged(const QSize& size);
48 
49 protected:
50  virtual void resizeEvent(QResizeEvent *event);
51 };
52 
64 class BirdView : public QFrame
65 {
66  Q_OBJECT
67 public:
68  BirdView(QDockWidget *parent, UMLView *view);
69  virtual ~BirdView();
70 
71  void setSlotsEnabled(bool enabled);
72 
73 signals:
74  void viewPositionChanged(QPointF delta);
75 
76 public slots:
77  void slotViewChanged();
78 
79 protected:
80  virtual void mousePressEvent(QMouseEvent *event);
81  virtual void mouseMoveEvent(QMouseEvent *event);
82  virtual void mouseReleaseEvent(QMouseEvent *event);
83  virtual void keyPressEvent(QKeyEvent *event);
84 
85 private slots:
86  void slotDockSizeChanged(const QSize &size);
87  void slotDestroyed(QObject *object);
88 
89 private:
91  QGraphicsView* m_birdView;
92  QFrame* m_protectFrame;
94 
95  static void setBackgroundColor(QFrame* frame, const QColor& color);
96 };
97 
98 #endif // BIRDVIEW_H
The class BirdViewDockWidget contains the bird view.
Definition: birdview.h:41
virtual void resizeEvent(QResizeEvent *event)
Definition: birdview.cpp:276
void sizeChanged(const QSize &size)
BirdViewDockWidget(const QString &title, QWidget *parent=0, Qt::WindowFlags flags=0)
Definition: birdview.cpp:267
The class BirdView controls the view of the whole scene.
Definition: birdview.h:65
void slotViewChanged()
Definition: birdview.cpp:135
UMLView * m_view
Definition: birdview.h:90
QGraphicsView * m_birdView
Definition: birdview.h:91
static void setBackgroundColor(QFrame *frame, const QColor &color)
Definition: birdview.cpp:254
virtual void mousePressEvent(QMouseEvent *event)
Definition: birdview.cpp:150
QPoint m_moveStartPos
Definition: birdview.h:93
BirdView(QDockWidget *parent, UMLView *view)
Constructor.
Definition: birdview.cpp:42
void slotDestroyed(QObject *object)
Definition: birdview.cpp:89
virtual void keyPressEvent(QKeyEvent *event)
Definition: birdview.cpp:186
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: birdview.cpp:161
QFrame * m_protectFrame
Definition: birdview.h:92
void viewPositionChanged(QPointF delta)
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: birdview.cpp:177
void slotDockSizeChanged(const QSize &size)
Definition: birdview.cpp:102
virtual ~BirdView()
Definition: birdview.cpp:78
void setSlotsEnabled(bool enabled)
Definition: birdview.cpp:232
Definition: umlview.h:35