Loading...
Searching...
No Matches
StringListEditor.hpp
1#pragma once
2#include <ossia/network/value/value.hpp>
3
4#include <QWidget>
5
6#include <score_lib_process_export.h>
7
8#include <functional>
9
10class QListWidget;
11
12namespace Process
13{
14// Reuses ControlInlet's ordinary LIST value: [[stable id, text], ...].
15// No transient widget state is needed to restore an edit or a preset.
16class SCORE_LIB_PROCESS_EXPORT StringListEditor final : public QWidget
17{
18public:
19 std::function<void(ossia::value)> on_edited;
20
21 explicit StringListEditor(QWidget* parent = nullptr);
22
23 void setValue(const ossia::value& value);
24
25 ossia::value value() const;
26
27private:
28 QListWidget* rows{};
29 void append(int key, const QString& text);
30 void commit();
31 void move(int row, int direction);
32};
33}
Definition StringListEditor.hpp:17
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1115