MuseScore  3.4
Music composition and notation
stafflines.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2016 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 #include "element.h"
14 
15 namespace Ms {
16 
17 //-------------------------------------------------------------------
18 // @@ StaffLines
21 //-------------------------------------------------------------------
22 
23 class StaffLines final : public Element {
24  qreal lw;
25  QVector<QLineF> lines;
26 
27  public:
28  StaffLines(Score*);
29  virtual StaffLines* clone() const override { return new StaffLines(*this); }
30  virtual ElementType type() const override { return ElementType::STAFF_LINES; }
31  virtual void layout() override;
32  virtual void draw(QPainter*) const override;
33  virtual QPointF pagePos() const override;
34  virtual QPointF canvasPos() const override;
35 
36  QVector<QLineF>& getLines() { return lines; }
37  Measure* measure() const { return (Measure*)parent(); }
38  qreal y1() const;
39  void layoutForWidth(qreal width);
40  };
41 
42 } // namespace Ms
43 
virtual void draw(QPainter *) const override
Definition: stafflines.cpp:130
one measure in a system
Definition: measure.h:65
Base class of score layout elements.
Definition: element.h:158
StaffLines(Score *)
Definition: stafflines.cpp:40
Element * parent() const
Definition: element.h:192
Definition: score.h:391
Measure * measure() const
Definition: stafflines.h:37
The StaffLines class is the graphic representation of a staff, it draws the horizontal staff lines...
Definition: stafflines.h:23
virtual void layout() override
Definition: stafflines.cpp:78
qreal y1() const
Definition: stafflines.cpp:140
virtual qreal width() const
Definition: element.h:261
Definition: aeolus.cpp:26
virtual StaffLines * clone() const override
Definition: stafflines.h:29
virtual QPointF canvasPos() const override
position in page coordinates
Definition: stafflines.cpp:60
virtual ElementType type() const override
Definition: stafflines.h:30
virtual QPointF pagePos() const override
position in page coordinates
Definition: stafflines.cpp:50
QVector< QLineF > lines
Definition: stafflines.h:25
ElementType
Definition: types.h:34
void layoutForWidth(qreal width)
Definition: stafflines.cpp:87
qreal lw
Definition: stafflines.h:24
QVector< QLineF > & getLines()
Definition: stafflines.h:36