score
Home
Classes
Namespaces
Files
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
13
class
QStackedLayout;
14
class
QLineEdit;
15
class
QVBoxLayout;
16
class
QFormLayout;
17
class
QSpinBox;
18
class
QWidget;
19
class
QLabel;
20
class
QScrollArea;
21
22
namespace
Protocols
23
{
24
class
BitfocusProtocolSettingsWidget
final :
public
Device::ProtocolSettingsWidget
25
{
26
public
:
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
34
private
:
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
}
Device::ProtocolSettingsWidget
Definition
ProtocolSettingsWidget.hpp:22
Protocols::BitfocusProtocolSettingsWidget
Definition
BitfocusProtocolSettingsWidget.hpp:25
Device::DeviceSettings
Definition
DeviceSettings.hpp:20
Protocols::BitfocusSpecificSettings
Definition
BitfocusSpecificSettings.hpp:18