MuseScore  3.4
Music composition and notation
stemslash.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2013 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 __STEMSLASH_H__
14 #define __STEMSLASH_H__
15 
16 #include "element.h"
17 #include "stem.h"
18 
19 namespace Ms {
20 
21 //---------------------------------------------------------
22 // @@ StemSlash
24 //---------------------------------------------------------
25 
26 class StemSlash final : public Element {
27  QLineF line;
28 
29  public:
30  StemSlash(Score* s = 0) : Element(s) {}
31 
32  virtual qreal mag() const { return parent()->mag(); }
33  void setLine(const QLineF& l);
34 
35  virtual StemSlash* clone() const { return new StemSlash(*this); }
36  virtual ElementType type() const { return ElementType::STEM_SLASH; }
37  virtual void draw(QPainter*) const;
38  virtual void layout();
39  Chord* chord() const { return (Chord*)parent(); }
40  };
41 
42 
43 } // namespace Ms
44 #endif
45 
Chord * chord() const
Definition: stemslash.h:39
virtual qreal mag() const
Definition: element.h:389
StemSlash(Score *s=0)
Definition: stemslash.h:30
Base class of score layout elements.
Definition: element.h:158
Element * parent() const
Definition: element.h:192
void setLine(const QLineF &l)
Definition: stemslash.cpp:34
virtual ElementType type() const
Definition: stemslash.h:36
Definition: score.h:391
virtual void draw(QPainter *) const
Definition: stemslash.cpp:23
used for grace notes of type acciaccatura
Definition: stemslash.h:26
Definition: aeolus.cpp:26
Graphic representation of a chord.
Definition: chord.h:55
virtual void layout()
Definition: stemslash.cpp:45
virtual qreal mag() const
Definition: stemslash.h:32
virtual StemSlash * clone() const
Definition: stemslash.h:35
ElementType
Definition: types.h:34
QLineF line
Definition: stemslash.h:27