MuseScore  3.4
Music composition and notation
hook.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 __HOOK_H__
14 #define __HOOK_H__
15 
16 #include "symbol.h"
17 
18 namespace Ms {
19 
20 class Chord;
21 
22 //---------------------------------------------------------
23 // @@ Hook
24 //---------------------------------------------------------
25 
26 class Hook final : public Symbol {
27  int _hookType;
28 
29  public:
30  Hook(Score* = 0);
31  virtual Hook* clone() const override { return new Hook(*this); }
32  virtual qreal mag() const override { return parent()->mag(); }
33  virtual ElementType type() const override { return ElementType::HOOK; }
34  void setHookType(int v);
35  int hookType() const { return _hookType; }
36  virtual void layout() override;
37  virtual void draw(QPainter*) const override;
38  Chord* chord() const { return (Chord*)parent(); }
39  };
40 
41 
42 } // namespace Ms
43 #endif
44 
virtual Hook * clone() const override
Definition: hook.h:31
virtual qreal mag() const
Definition: element.h:389
virtual void layout() override
Definition: hook.cpp:67
void setHookType(int v)
Definition: hook.cpp:35
virtual void draw(QPainter *) const override
Definition: hook.cpp:76
Element * parent() const
Definition: element.h:192
Definition: score.h:391
Chord * chord() const
Definition: hook.h:38
int _hookType
Definition: hook.h:27
int hookType() const
Definition: hook.h:35
Definition: aeolus.cpp:26
Hook(Score *=0)
Definition: hook.cpp:25
Definition: hook.h:26
Symbol constructed from builtin symbol.
Definition: symbol.h:31
Graphic representation of a chord.
Definition: chord.h:55
ElementType
Definition: types.h:34
virtual ElementType type() const override
Definition: hook.h:33
virtual qreal mag() const override
Definition: hook.h:32