mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Lint
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
#include "ui_plot.hpp"
|
#include "ui_plot.hpp"
|
||||||
#include "ui_slider.hpp"
|
#include "ui_slider.hpp"
|
||||||
#include "ui_spinbox.hpp"
|
#include "ui_spinbox.hpp"
|
||||||
#include "ui_table.hpp"
|
|
||||||
#include "ui_tab_widget.hpp"
|
#include "ui_tab_widget.hpp"
|
||||||
|
#include "ui_table.hpp"
|
||||||
#include "ui_textbox.hpp"
|
#include "ui_textbox.hpp"
|
||||||
#include "ui_thermo.hpp"
|
#include "ui_thermo.hpp"
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
#include "ui_tab_widget.hpp"
|
#include "ui_tab_widget.hpp"
|
||||||
|
|
||||||
UI_tab_widget::UI_tab_widget(QObject *parent)
|
UI_tab_widget::UI_tab_widget(QObject *parent) : UI_item(UI_TAB_WIDGET_TYPE, parent)
|
||||||
: UI_item(UI_TAB_WIDGET_TYPE, parent)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
UI_tab_widget::UI_tab_widget(std::vector<std::string> tab_names, size_t selected,
|
UI_tab_widget::UI_tab_widget(std::vector<std::string> tab_names, size_t selected, QObject *parent)
|
||||||
QObject *parent)
|
|
||||||
: UI_item(UI_TAB_WIDGET_TYPE, parent), m_selected_tab(selected), m_tab_names(tab_names)
|
: UI_item(UI_TAB_WIDGET_TYPE, parent), m_selected_tab(selected), m_tab_names(tab_names)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_tab_widget::set_selected(size_t selected)
|
void UI_tab_widget::set_selected(size_t selected)
|
||||||
@@ -25,7 +22,8 @@ size_t UI_tab_widget::selected() const
|
|||||||
|
|
||||||
void UI_tab_widget::set_visible(size_t index, bool visible)
|
void UI_tab_widget::set_visible(size_t index, bool visible)
|
||||||
{
|
{
|
||||||
if (index >= m_tab_visible.size()) {
|
if (index >= m_tab_visible.size())
|
||||||
|
{
|
||||||
m_tab_visible.resize(index + 1);
|
m_tab_visible.resize(index + 1);
|
||||||
}
|
}
|
||||||
m_tab_visible.at(index) = visible;
|
m_tab_visible.at(index) = visible;
|
||||||
@@ -38,7 +36,8 @@ bool UI_tab_widget::visible(size_t index) const
|
|||||||
|
|
||||||
void UI_tab_widget::set_tab_name(size_t index, std::string name)
|
void UI_tab_widget::set_tab_name(size_t index, std::string name)
|
||||||
{
|
{
|
||||||
if (index >= m_tab_names.size()) {
|
if (index >= m_tab_names.size())
|
||||||
|
{
|
||||||
m_tab_names.resize(index + 1);
|
m_tab_names.resize(index + 1);
|
||||||
}
|
}
|
||||||
m_tab_names.at(index) = name;
|
m_tab_names.at(index) = name;
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ class UI_tab_widget : public UI_item
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit UI_tab_widget(QObject *parent = nullptr);
|
explicit UI_tab_widget(QObject *parent = nullptr);
|
||||||
UI_tab_widget(std::vector<std::string> tab_names, size_t selected = 0,
|
UI_tab_widget(std::vector<std::string> tab_names, size_t selected = 0, QObject *parent = nullptr);
|
||||||
QObject *parent = nullptr);
|
|
||||||
|
|
||||||
void set_selected(size_t selected) override;
|
void set_selected(size_t selected) override;
|
||||||
size_t selected() const;
|
size_t selected() const;
|
||||||
@@ -26,6 +25,7 @@ class UI_tab_widget : public UI_item
|
|||||||
json to_json(size_t id) const override;
|
json to_json(size_t id) const override;
|
||||||
signals:
|
signals:
|
||||||
void selected(size_t index);
|
void selected(size_t index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t m_selected_tab;
|
size_t m_selected_tab;
|
||||||
std::vector<std::string> m_tab_names;
|
std::vector<std::string> m_tab_names;
|
||||||
|
|||||||
@@ -614,8 +614,6 @@ void Simulator_base::process_ui_tab_widget(json &ui_item, QWidget *widget)
|
|||||||
SPDLOG_WARN("widget is not of type QTabWidget");
|
SPDLOG_WARN("widget is not of type QTabWidget");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Simulator_base::process_ui_plot(json &ui_item, QWidget *widget)
|
void Simulator_base::process_ui_plot(json &ui_item, QWidget *widget)
|
||||||
|
|||||||
Reference in New Issue
Block a user