Loading...
Searching...
No Matches
BitfocusProtocolSettingsWidget.hpp
1#pragma once
2#include <Device/Protocol/DeviceSettings.hpp>
3#include <Device/Protocol/ProtocolSettingsWidget.hpp>
4
5#include <Protocols/Bitfocus/BitfocusSpecificSettings.hpp>
6
7#include <QJSEngine>
8#include <QVariant>
9
10#include <functional>
11#include <verdigris>
12
13class QStackedLayout;
14class QLineEdit;
15class QVBoxLayout;
16class QFormLayout;
17class QSpinBox;
18class QWidget;
19class QLabel;
20class QScrollArea;
21
22namespace Protocols
23{
25{
26public:
27 explicit BitfocusProtocolSettingsWidget(QWidget* parent = nullptr);
28
29 Device::DeviceSettings getSettings() const override;
30 void setSettings(const Device::DeviceSettings& settings) override;
31
32 using Device::ProtocolSettingsWidget::checkForChanges;
33
34private:
35 void updateFields();
36 void resizeEvent(QResizeEvent*) override;
37 BitfocusSpecificSettings m_settings;
38
39 QFormLayout* m_rootLayout{};
40 QLineEdit* m_deviceNameEdit{};
41 QScrollArea* m_scroll{};
42 QWidget* m_subWidget{};
43 QVBoxLayout* m_subForm{};
44
45 // Get the configuration for each widget
46 struct widget
47 {
48 QLabel* label{};
49 QWidget* widg{};
50 std::function<ossia::value()> getValue;
51 std::function<void(ossia::value)> setValue;
52 };
53
54 std::map<QString, widget> m_widgets;
55 QJSEngine m_uiEngine;
56 bool m_hasInitLabel{};
57};
58}
Definition ProtocolSettingsWidget.hpp:22
Definition BitfocusProtocolSettingsWidget.hpp:25
Definition DeviceSettings.hpp:20
Definition BitfocusSpecificSettings.hpp:18