MuseScore  3.4
Music composition and notation
textcursor.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2013-15 Werner Schweer & others
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 __TEXTCURSOR_H__
14 #define __TEXTCURSOR_H__
15 
16 #include "libmscore/fraction.h"
17 
18 namespace Ms {
19 
20 class ScoreView;
21 
22 //---------------------------------------------------------
23 // CursorType
24 //---------------------------------------------------------
25 
26 enum class CursorType : char {
27  LOOP_IN,
28  LOOP_OUT,
29  POS
30  };
31 
32 //---------------------------------------------------------
33 // PositionCursor
34 //---------------------------------------------------------
35 
38  QRectF _rect;
39  bool _visible { false };
40  QColor _color;
41  Fraction _tick { 0,1 };
43 
44  public:
45  PositionCursor(ScoreView* sv) : _sv(sv) {}
46 
47  void setType(CursorType t);
48  QRectF rect() const { return _rect; }
49  void setRect(const QRectF& r) { _rect = r; }
50  bool visible() const { return _visible; }
51  void setVisible(bool val) { _visible = val; }
52  QColor color() const { return _color; }
53  void setColor(const QColor& c) { _color = c; }
54  Fraction tick() const { return _tick; }
55  void setTick(const Fraction& val) { _tick = val; }
56 
57  void update(QWidget*);
58  void move(const Fraction& tick);
59  void paint(QPainter*);
60  QRectF bbox() const;
61  };
62 
63 }
64 
65 #endif
66 
67 
68 
QRectF rect() const
Definition: textcursor.h:48
Definition: textcursor.h:36
Definition: scoreview.h:90
Fraction tick() const
Definition: textcursor.h:54
PositionCursor(ScoreView *sv)
Definition: textcursor.h:45
void setVisible(bool val)
Definition: textcursor.h:51
CursorType
Definition: textcursor.h:26
ScoreView * _sv
Definition: textcursor.h:37
void setTick(const Fraction &val)
Definition: textcursor.h:55
Definition: aeolus.cpp:26
bool visible() const
Definition: textcursor.h:50
void setRect(const QRectF &r)
Definition: textcursor.h:49
Definition: fraction.h:46
POS
Definition: score.h:100
QColor _color
Definition: textcursor.h:40
QRectF _rect
Definition: textcursor.h:38
QColor color() const
Definition: textcursor.h:52
void setColor(const QColor &c)
Definition: textcursor.h:53