[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [atelier] src/widgets: Add signals to RatesControlWidget
From:       Lays Rodrigues <null () kde ! org>
Date:       2017-03-31 16:40:11
Message-ID: E1ctzat-0004Gy-LC () code ! kde ! org
[Download RAW message or body]

Git commit 7c505a6f3e107b2059460ac9a46918a1aeaa6689 by Lays Rodrigues.
Committed on 29/03/2017 at 14:01.
Pushed by laysrodrigues into branch 'master'.

Add signals to RatesControlWidget

Add signals when the value of the widgets changed
emit a signal with the new value.

Signed-off-by: Lays Rodrigues <laysrodriguessilva@gmail.com>

M  +10   -0    src/widgets/ratescontrolwidget.cpp
M  +4    -0    src/widgets/ratescontrolwidget.h

https://commits.kde.org/atelier/7c505a6f3e107b2059460ac9a46918a1aeaa6689

diff --git a/src/widgets/ratescontrolwidget.cpp b/src/widgets/ratescontrolwidget.cpp
index 82d1ced..0e62011 100644
--- a/src/widgets/ratescontrolwidget.cpp
+++ b/src/widgets/ratescontrolwidget.cpp
@@ -6,6 +6,16 @@ RatesControlWidget::RatesControlWidget(QWidget *parent) :
     ui(new Ui::RatesControlWidget)
 {
     ui->setupUi(this);
+    connect(ui->flowRateSB, static_cast<void \
(QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), [ = ](float value){ +        emit \
flowRateChanged(value); +    });
+    connect(ui->fanSpeedSB, static_cast<void \
(QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), [ = ](float value){ +        emit \
fanSpeedChanged(value); +    });
+    connect(ui->printSpeedSB, static_cast<void \
(QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), [ = ](float value){ +       emit \
printSpeedChanged(value); +    });
+
 }
 
 RatesControlWidget::~RatesControlWidget()
diff --git a/src/widgets/ratescontrolwidget.h b/src/widgets/ratescontrolwidget.h
index 9c73a26..561f151 100644
--- a/src/widgets/ratescontrolwidget.h
+++ b/src/widgets/ratescontrolwidget.h
@@ -13,6 +13,10 @@ class RatesControlWidget : public QWidget
 public:
     explicit RatesControlWidget(QWidget *parent = nullptr);
     ~RatesControlWidget();
+signals:
+    void flowRateChanged(int value);
+    void printSpeedChanged(int value);
+    void fanSpeedChanged(int value, uint fan = 0);
 
 private:
     Ui::RatesControlWidget *ui;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic