MuseScore  3.4
Music composition and notation
notedot.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2002-2011 Werner Schweer
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 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __NOTEDOT_H__
14 #define __NOTEDOT_H__
15 
16 #include "element.h"
17 
18 namespace Ms {
19 
20 class Note;
21 class Rest;
22 
23 //---------------------------------------------------------
24 // @@ NoteDot
25 //---------------------------------------------------------
26 
27 class NoteDot final : public Element {
28 
29  public:
30  NoteDot(Score* = 0);
31  virtual NoteDot* clone() const override { return new NoteDot(*this); }
32  virtual ElementType type() const override { return ElementType::NOTEDOT; }
33  virtual qreal mag() const;
34 
35  virtual void draw(QPainter*) const override;
36  virtual void read(XmlReader&) override;
37  virtual void layout() override;
38 
39  Note* note() const { return parent()->isNote() ? toNote(parent()) : 0; }
40  Rest* rest() const { return parent()->isRest() ? toRest(parent()) : 0; }
41  };
42 
43 
44 } // namespace Ms
45 #endif
46 
Definition: xml.h:67
virtual NoteDot * clone() const override
Definition: notedot.h:31
Base class of score layout elements.
Definition: element.h:158
Element * parent() const
Definition: element.h:192
virtual qreal mag() const
Definition: notedot.cpp:82
Definition: score.h:391
virtual void layout() override
Definition: notedot.cpp:57
Definition: aeolus.cpp:26
virtual ElementType type() const override
Definition: notedot.h:32
This class implements a rest.
Definition: rest.h:29
virtual void read(XmlReader &) override
Definition: notedot.cpp:66
Rest * rest() const
Definition: notedot.h:40
Definition: notedot.h:27
bool isRest() const
Definition: scoreElement.h:263
virtual void draw(QPainter *) const override
Definition: notedot.cpp:37
Graphic representation of a note.
Definition: note.h:212
NoteDot(Score *=0)
Definition: notedot.cpp:27
ElementType
Definition: types.h:34
bool isNote() const
Definition: scoreElement.h:262
Note * note() const
Definition: notedot.h:39