MuseScore  3.4
Music composition and notation
stafftypechange.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 #ifndef __STAFFTYPECHANGE_H__
14 #define __STAFFTYPECHANGE_H__
15 
16 #include "element.h"
17 
18 namespace Ms {
19 
20 class StaffType;
21 
22 //---------------------------------------------------------
23 // @@ StaffTypeChange
24 //---------------------------------------------------------
25 
26 class StaffTypeChange final : public Element {
28  qreal lw;
29 
30  virtual void layout() override;
31  virtual void spatiumChanged(qreal oldValue, qreal newValue) override;
32  virtual void draw(QPainter*) const override;
33 
34  public:
35  StaffTypeChange(Score* = 0);
37  virtual StaffTypeChange* clone() const override { return new StaffTypeChange(*this); }
38 
39  virtual ElementType type() const override { return ElementType::STAFFTYPE_CHANGE; }
40 
41  virtual void write(XmlWriter&) const override;
42  virtual void read(XmlReader&) override;
43 
44  const StaffType* staffType() const { return _staffType; }
45  void setStaffType(StaffType* st) { _staffType = st; }
46 
47  Measure* measure() const { return toMeasure(parent()); }
48 
49  virtual QVariant getProperty(Pid propertyId) const override;
50  virtual bool setProperty(Pid propertyId, const QVariant&) override;
51  virtual QVariant propertyDefault(Pid) const override;
52  };
53 
54 
55 } // namespace Ms
56 
57 #endif
58 
const StaffType * staffType() const
Definition: stafftypechange.h:44
virtual bool setProperty(Pid propertyId, const QVariant &) override
Definition: stafftypechange.cpp:158
Pid
Definition: property.h:62
Definition: xml.h:67
one measure in a system
Definition: measure.h:65
virtual StaffTypeChange * clone() const override
Definition: stafftypechange.h:37
StaffTypeChange(Score *=0)
Definition: stafftypechange.cpp:27
virtual QVariant getProperty(Pid propertyId) const override
Definition: stafftypechange.cpp:120
Base class of score layout elements.
Definition: element.h:158
virtual void read(XmlReader &) override
Definition: stafftypechange.cpp:56
virtual ElementType type() const override
Definition: stafftypechange.h:39
Element * parent() const
Definition: element.h:192
Definition: score.h:391
Definition: stafftypechange.h:26
Measure * measure() const
Definition: stafftypechange.h:47
virtual Pid propertyId(const QStringRef &xmlName) const override
Definition: element.cpp:1326
Definition: aeolus.cpp:26
Definition: stafftype.h:173
StaffType * _staffType
Definition: stafftypechange.h:27
Definition: xml.h:218
virtual QVariant propertyDefault(Pid) const override
Definition: stafftypechange.cpp:224
virtual void spatiumChanged(qreal oldValue, qreal newValue) override
Definition: stafftypechange.cpp:75
qreal lw
Definition: stafftypechange.h:28
void setStaffType(StaffType *st)
Definition: stafftypechange.h:45
virtual void write(XmlWriter &) const override
Definition: stafftypechange.cpp:43
virtual void draw(QPainter *) const override
Definition: stafftypechange.cpp:100
ElementType
Definition: types.h:34
virtual void layout() override
Definition: stafftypechange.cpp:84