MuseScore  3.4
Music composition and notation
magbox.h
Go to the documentation of this file.
1 //=============================================================================
2 // MusE Score
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2008-2009 Werner Schweer and 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 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __MAGBOX_H__
21 #define __MAGBOX_H__
22 
23 namespace Ms {
24 
25 class ScoreView;
26 
27 //---------------------------------------------------------
28 // magTable
29 // list of strings shown in QComboBox "MagBox"
30 //---------------------------------------------------------
31 
32 enum class MagIdx : char {
35  MAG_FREE
36  };
37 
38 //---------------------------------------------------------
39 // MagValidator
40 //---------------------------------------------------------
41 
42 class MagValidator : public QValidator {
43  Q_OBJECT
44 
45  virtual State validate(QString&, int&) const;
46 
47  public:
48  MagValidator(QObject* parent = 0);
49  };
50 
51 //---------------------------------------------------------
52 // MagBox
53 //---------------------------------------------------------
54 
55 class MagBox : public QComboBox {
56  Q_OBJECT
57 
58  double freeMag;
59 
60  private slots:
61  void indexChanged(int);
62  void textChanged();
63 
64  signals:
65  void magChanged(MagIdx);
66 
67  public:
68  MagBox(QWidget* parent = 0);
69  void setMag(double);
70  void setMagIdx(MagIdx);
71  double getMag(ScoreView*) const;
72  double getLMag(ScoreView*) const;
73  void setEnabled(bool val) { QComboBox::setEnabled(val); }
74  QString currentText() const { return QComboBox::currentText(); }
75  int count() const { return QComboBox::count(); }
76  void removeItem(int i) { QComboBox::removeItem(i); }
77  };
78 
79 
80 } // namespace Ms
81 
82 Q_DECLARE_METATYPE(Ms::MagIdx);
83 
84 #endif
85 
86 
87 
Definition: magbox.h:55
Definition: scoreview.h:90
int count() const
Definition: magbox.h:75
void removeItem(int i)
Definition: magbox.h:76
void setEnabled(bool val)
Definition: magbox.h:73
QString currentText() const
Definition: magbox.h:74
MagIdx
Definition: magbox.h:32
Definition: aeolus.cpp:26
Definition: magbox.h:42
double freeMag
Definition: magbox.h:58