From 9470dc27cad6f527d753abf6dce47cc1634244cc Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 16 Jan 2014 01:04:22 +0100 Subject: [PATCH] #98 Changed back signal/slot connection to old style The described problem is one of the disadvantages of the new style, when it comes to default values or different signatures Also using a minimum value and adjusting the slider to any set value. --- samples/blackgui/mainwindow.cpp | 2 ++ samples/blackgui/mainwindow_init.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/blackgui/mainwindow.cpp b/samples/blackgui/mainwindow.cpp index a8a44b979..349c0da56 100644 --- a/samples/blackgui/mainwindow.cpp +++ b/samples/blackgui/mainwindow.cpp @@ -391,7 +391,9 @@ void MainWindow::changeWindowOpacity(int opacity) return; } qreal o = opacity / 100.0; + o = o < 0.3 ? 0.3 : o; QWidget::setWindowOpacity(o); + this->ui->hs_SettingsGuiOpacity->setValue(o * 100.0); } /* diff --git a/samples/blackgui/mainwindow_init.cpp b/samples/blackgui/mainwindow_init.cpp index 119695f50..0878f8ad8 100644 --- a/samples/blackgui/mainwindow_init.cpp +++ b/samples/blackgui/mainwindow_init.cpp @@ -184,8 +184,10 @@ void MainWindow::initGuiSignals() Q_ASSERT(connected); connected = this->connect(this->ui->pb_MainWeather, SIGNAL(released()), this, SLOT(setMainPage())); Q_ASSERT(connected); - this->connect(this->ui->pb_MainKeypadOpacity050, &QPushButton::clicked, this, &MainWindow::changeWindowOpacity); - this->connect(this->ui->pb_MainKeypadOpacity100, &QPushButton::clicked, this, &MainWindow::changeWindowOpacity); + connected = this->connect(this->ui->pb_MainKeypadOpacity050, SIGNAL(clicked()), this, SLOT(changeWindowOpacity())); + Q_ASSERT(connected); + connected = this->connect(this->ui->pb_MainKeypadOpacity100, SIGNAL(clicked()), this, SLOT(changeWindowOpacity())); + Q_ASSERT(connected); // Sound buttons this->connect(this->ui->pb_SoundMute, &QPushButton::clicked, this, &MainWindow::audioVolumes);