MuseScore  3.4
Music composition and notation
importmidi_delegate.h
Go to the documentation of this file.
1 #ifndef IMPORTMIDI_DELEGATE_H
2 #define IMPORTMIDI_DELEGATE_H
3 
4 #include "importmidi_view.h"
5 
6 
7 namespace Ms {
8 
9 class TimeSigEditor : public QWidget
10  {
11  Q_OBJECT
12 
13  public:
14  TimeSigEditor(const QStringList &values, QWidget *parent = nullptr);
15 
16  QStringList data() const;
17 
18  signals:
19  void okClicked();
20 
21  private:
22  QComboBox *_comboBoxNumerator;
24  };
25 
26 class SizedListWidget : public QListWidget
27  {
28  Q_OBJECT
29 
30  public:
31  SizedListWidget(QWidget *parent = nullptr);
32 
33  virtual QSize sizeHint () const;
34  };
35 
36 // class for multiple value representation
37 // each value is a button that can be checked or unchecked
38 
39 class MultiValueEditor : public QWidget
40  {
41  Q_OBJECT
42 
43  public:
44  MultiValueEditor(const QStringList &values, QWidget *parent = nullptr);
45 
46  QStringList data() const;
47 
48  signals:
49  void okClicked();
50 
51  private slots:
52  void checkBoxClicked(QListWidgetItem *);
53  void itemClicked(QListWidgetItem *);
54 
55  private:
56  void setAllCheckBox();
57  void updateStates();
58  void connectCheckBoxes();
59  void disconnectCheckBoxes();
60 
62  std::vector<Qt::CheckState> _states;
63  };
64 
65 
67  {
68  Q_OBJECT
69 
70  public:
71  explicit OperationsDelegate(QWidget *appWindow, bool rightArrowAlign);
72 
73  void paint(QPainter *painter,
74  const QStyleOptionViewItem &option,
75  const QModelIndex &index) const;
76 
77  QWidget* createEditor(QWidget *parent,
78  const QStyleOptionViewItem &option,
79  const QModelIndex &index) const;
80 
81  void setEditorData(QWidget *editor, const QModelIndex &index) const;
82  void setModelData(QWidget *editor, QAbstractItemModel *model,
83  const QModelIndex &index) const;
84 
85  private slots:
86  void commitAndCloseEditor();
87 
88  private:
89  void drawArrow(QPainter *painter,
90  const QStyleOptionViewItem &option,
91  const QModelIndex &index) const;
92 
93  QWidget *appWindow;
94  const bool rightArrowAlign;
95  };
96 
97 } // namespace Ms
98 
99 
100 #endif // IMPORTMIDI_DELEGATE_H
Definition: importmidi_delegate.h:9
std::vector< Qt::CheckState > _states
Definition: importmidi_delegate.h:62
QWidget * appWindow
Definition: importmidi_delegate.h:93
SizedListWidget * _listWidget
Definition: importmidi_delegate.h:61
QComboBox * _comboBoxDenominator
Definition: importmidi_delegate.h:23
Definition: aeolus.cpp:26
Definition: importmidi_delegate.h:26
TimeSigEditor(const QStringList &values, QWidget *parent=nullptr)
Definition: importmidi_delegate.cpp:5
Definition: importmidi_view.h:7
QStringList data() const
Definition: importmidi_delegate.cpp:78
const bool rightArrowAlign
Definition: importmidi_delegate.h:94
QComboBox * _comboBoxNumerator
Definition: importmidi_delegate.h:22
Definition: importmidi_delegate.h:39
Definition: importmidi_delegate.h:66