mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
This fixes the error: clang:optin.cplusplus.VirtualCall When virtual methods are called during construction and destruction the polymorphism is restricted to the class that’s being constructed or destructed because the more derived contexts are either not yet initialized or already destructed.
34 lines
1019 B
C++
34 lines
1019 B
C++
#pragma once
|
|
#include "ui_item.hpp"
|
|
|
|
#define UI_DIAL_TYPE std::string("ui_dial")
|
|
|
|
class UI_dial : public UI_item
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
UI_dial(std::string text, std::string unit, Color fg_color, Color bg_color, double min, double max, double value,
|
|
QObject *parent = nullptr);
|
|
UI_dial(std::string text, std::string unit, double min, double max, double value, QObject *parent = nullptr);
|
|
UI_dial(std::string text, Color fg_color, Color bg_color, double min, double max, double value,
|
|
QObject *parent = nullptr);
|
|
UI_dial(std::string text, double min, double max, double value, QObject *parent = nullptr);
|
|
UI_dial(QObject *parent = nullptr);
|
|
|
|
void set_value(double value) override;
|
|
double value() const;
|
|
|
|
double min() const;
|
|
double max() const;
|
|
std::string unit() const;
|
|
|
|
void from_json(const json &j) override;
|
|
json to_json(size_t id) const override;
|
|
|
|
private:
|
|
double m_min;
|
|
double m_max;
|
|
double m_value;
|
|
std::string m_unit;
|
|
};
|