Skip to content

Commit

Permalink
working on thermometer component
Browse files Browse the repository at this point in the history
  • Loading branch information
tGiech22 committed Oct 12, 2023
1 parent f67bbbb commit 6a5f85e
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NERO.pro
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ HEADERS += \
models/raspberry_model.h \
modes/debug_mode/debug_utils.h \
views/thermometerview.h

DISTFILES += \
ThermometerComponent.qml
25 changes: 25 additions & 0 deletions ThermometerComponent.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import QtQuick

Item {
id: itm

height: 100
width: 100

Rectangle{
id: rct

color: "white"
height: itm.height
width: itm.width
}

Rectangle{
id: circle

color: "green"
height: itm.height
width: itm.width
radius: itm.width
}
}
11 changes: 11 additions & 0 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,21 @@ Window {
visible: true
title: qsTr("Hello World")

/*
Button {
id: button
anchors.centerIn: parent
text: "Click me"
onClicked: homeController.callMe()
}*/

Item{
anchors.centerIn: parent
height: 200
width: 100

ThermometerComponent{
id: thermometerComponent
}
}
}
25 changes: 25 additions & 0 deletions views/thermometerview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,30 @@ thermometerview::thermometerview(QObject *parent)
, m_maxValue(0.0)
, m_minValue(0.0)
{
}

float thermometerview::maxValue() const
{
return m_maxValue;
}

void thermometerview::setMaxValue(float maxValue)
{
if (maxValue != m_maxValue) {
m_maxValue = maxValue;
emit maxValueChanged(maxValue);
}
}

float thermometerview::minValue() const
{
return m_minValue;
}

void thermometerview::setMinValue(float minValue)
{
if (minValue != m_minValue) {
m_minValue = minValue;
emit minValueChanged(minValue);
}
}

0 comments on commit 6a5f85e

Please sign in to comment.