mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Sim test
ID to label
This commit is contained in:
@@ -80,3 +80,16 @@ void Test_Sim::setup_dials(void)
|
||||
create_dial_needle(dial);
|
||||
}
|
||||
}
|
||||
|
||||
QLabel* Test_Sim::id_to_label(size_t id)
|
||||
{
|
||||
QWidget* widget = ui_lookup.at(id);
|
||||
if (widget == ui->slider)
|
||||
return ui->slider_label;
|
||||
if (widget == ui->thermo)
|
||||
return ui->thermo_label;
|
||||
if (widget == ui->dial)
|
||||
return ui->dial_label;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ class Test_Sim : public SimulatorBase {
|
||||
void setup_comboboxes(void);
|
||||
void setup_dials(void);
|
||||
|
||||
QLabel* id_to_label(size_t name) override;
|
||||
|
||||
private:
|
||||
Ui::Test_Sim* ui;
|
||||
};
|
||||
|
||||
+61
-29
@@ -15,53 +15,85 @@
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="led">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="button">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="combobox"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QwtDial" name="dial">
|
||||
<property name="lineWidth">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="minScaleArc">
|
||||
<double>20.000000000000000</double>
|
||||
</property>
|
||||
<property name="maxScaleArc">
|
||||
<double>340.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="led">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item row="4" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="slider_label">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QwtSlider" name="slider"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="dial_label">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QwtDial" name="dial">
|
||||
<property name="lineWidth">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="minScaleArc">
|
||||
<double>20.000000000000000</double>
|
||||
</property>
|
||||
<property name="maxScaleArc">
|
||||
<double>340.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="thermo_label">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QwtThermo" name="thermo"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QComboBox" name="combobox"/>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
|
||||
Reference in New Issue
Block a user