MuseScore  3.4
Music composition and notation
keycanvas.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2009 Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __KEYCANVAS_H__
21 #define __KEYCANVAS_H__
22 
23 namespace Ms {
24 
25 class Accidental;
26 class Clef;
27 
28 //---------------------------------------------------------
29 // KeyCanvas
30 //---------------------------------------------------------
31 
32 class KeyCanvas : public QFrame {
33  Q_OBJECT
34 
37  QTransform _matrix, imatrix;
38  double extraMag;
39  QList<Accidental*> accidentals;
40  QPointF startMove;
41  QPointF base;
43 
44  virtual void paintEvent(QPaintEvent*);
45  virtual void mousePressEvent(QMouseEvent*);
46  virtual void mouseMoveEvent(QMouseEvent*);
47  virtual void mouseReleaseEvent(QMouseEvent*);
48 
49  virtual void dragEnterEvent(QDragEnterEvent*);
50  virtual void dragMoveEvent(QDragMoveEvent*);
51  virtual void dropEvent(QDropEvent*);
52  void snap(Accidental*);
53 
54  private slots:
55  void deleteElement();
56 
57  public:
58  KeyCanvas(QWidget* parent = 0);
59  void clear();
60  const QList<Accidental*> getAccidentals() const { return accidentals; }
61  };
62 
63 
64 } // namespace Ms
65 #endif
66 
virtual void dropEvent(QDropEvent *)
Definition: keyedit.cpp:239
Accidental * moveElement
Definition: keycanvas.h:36
virtual void mouseReleaseEvent(QMouseEvent *)
Definition: keyedit.cpp:180
double extraMag
Definition: keycanvas.h:38
Accidental * dragElement
Definition: keycanvas.h:35
QTransform imatrix
Definition: keycanvas.h:37
void snap(Accidental *)
Definition: keyedit.cpp:254
virtual void mousePressEvent(QMouseEvent *)
Definition: keyedit.cpp:145
QPointF base
Definition: keycanvas.h:41
virtual void dragEnterEvent(QDragEnterEvent *)
Definition: keyedit.cpp:192
virtual void paintEvent(QPaintEvent *)
Definition: keyedit.cpp:93
Graphic representation of a clef.
Definition: clef.h:132
KeyCanvas(QWidget *parent=0)
Definition: keyedit.cpp:43
Definition: accidental.h:65
const QList< Accidental * > getAccidentals() const
Definition: keycanvas.h:60
void clear()
Definition: keyedit.cpp:81
virtual void dragMoveEvent(QDragMoveEvent *)
Definition: keyedit.cpp:225
QTransform _matrix
Definition: keycanvas.h:37
QList< Accidental * > accidentals
Definition: keycanvas.h:39
QPointF startMove
Definition: keycanvas.h:40
Definition: aeolus.cpp:26
Definition: keycanvas.h:32
virtual void mouseMoveEvent(QMouseEvent *)
Definition: keyedit.cpp:165
void deleteElement()
Definition: keyedit.cpp:65
Clef * clef
Definition: keycanvas.h:42