MuseScore  3.4
Music composition and notation
posedit.h
Go to the documentation of this file.
1 //=============================================================================
2 // Awl
3 // Audio Widget Library
4 //
5 // Copyright (C) 2002-2006 by 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 __POSEDIT_H__
21 #define __POSEDIT_H__
22 
23 #include "libmscore/pos.h"
24 
25 namespace Awl {
26 
27 //---------------------------------------------------------
28 // PosEdit
29 //---------------------------------------------------------
30 
31 class PosEdit : public QAbstractSpinBox
32  {
33  Q_OBJECT
34  Q_PROPERTY(bool smpte READ smpte WRITE setSmpte)
35 
36  bool _smpte;
39 
40  virtual void paintEvent(QPaintEvent* event);
41  virtual void stepBy(int steps);
42  virtual StepEnabled stepEnabled() const;
43  virtual void fixup(QString& input) const;
44  virtual QValidator::State validate(QString&, int&) const;
45  void updateValue();
46  int curSegment() const;
47  virtual bool event(QEvent*);
48 
49  signals:
50  void valueChanged(const Pos&);
51 
52  public slots:
53  void setValue(const Pos& time);
54  void setValue(int t);
55  void setValue(const QString& s);
56 
57  public:
58  PosEdit(QWidget* parent = 0);
59  ~PosEdit();
60  QSize sizeHint() const;
61 
62  Pos pos() const { return _pos; }
63  void setSmpte(bool);
64  bool smpte() const { return _smpte; }
65  void* operator new(size_t);
66  };
67 }
68 
69 #endif
virtual StepEnabled stepEnabled() const
Definition: posedit.cpp:201
QSize sizeHint() const
Definition: posedit.cpp:50
int curSegment() const
Definition: posedit.cpp:292
Pos _pos
Definition: posedit.h:37
Pos pos() const
Definition: posedit.h:62
void setValue(const Pos &time)
Definition: posedit.cpp:158
void setSmpte(bool)
Definition: posedit.cpp:144
bool _smpte
Definition: posedit.h:36
virtual bool event(QEvent *)
Definition: posedit.cpp:68
virtual void paintEvent(QPaintEvent *event)
Definition: posedit.cpp:430
bool initialized
Definition: posedit.h:38
void valueChanged(const Pos &)
virtual void stepBy(int steps)
Definition: posedit.cpp:325
Definition: aslider.cpp:23
void updateValue()
Definition: posedit.cpp:180
virtual void fixup(QString &input) const
Definition: posedit.cpp:272
bool smpte() const
Definition: posedit.h:64
Definition: posedit.h:31
Definition: pos.h:42
virtual QValidator::State validate(QString &, int &) const
Definition: posedit.cpp:281