StringValueWidget.hpp
1 #pragma once
2 #include "ValueWidget.hpp"
3 
4 #include <State/Value.hpp>
5 
6 #include <ossia/network/domain/domain.hpp>
7 
8 #include <QDialog>
9 
10 class QLineEdit;
11 class QWidget;
12 
13 namespace State
14 {
15 class SCORE_LIB_STATE_EXPORT StringValueWidget final : public ValueWidget
16 {
17 public:
18  StringValueWidget(const std::string& value, QWidget* parent = nullptr);
19 
20  ossia::value value() const override;
21 
22 private:
23  QLineEdit* m_value{};
24 };
25 
26 class SCORE_LIB_STATE_EXPORT StringValueSetDialog final : public QDialog
27 {
28 public:
29  using set_type = std::vector<std::string>;
30  StringValueSetDialog(QWidget* parent);
31 
32  set_type values();
33 
34  void setValues(const set_type& t);
35 
36 private:
37  void addRow(const std::string& c);
38 
39  void removeRow(std::size_t i);
40 
41  QVBoxLayout* m_lay{};
42  std::vector<QWidget*> m_rows;
43  std::vector<StringValueWidget*> m_widgs;
44 };
45 }
Definition: StringValueWidget.hpp:27
Definition: StringValueWidget.hpp:16
The ValueWidget class.
Definition: ValueWidget.hpp:25
Utilities for OSSIA data structures.
Definition: DeviceInterface.hpp:33