diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,6 @@ add_executable(${PROGRAM_NAME} WIN32 main.cpp mainwindow.cpp portcontrol.cpp - customcheckablebutton.cpp plot.cpp zoomer.cpp hidabletabwidget.cpp diff --git a/customcheckablebutton.cpp b/customcheckablebutton.cpp deleted file mode 100644 --- a/customcheckablebutton.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright © 2015 Hasan Yavuz Özderya - - This file is part of serialplot. - - serialplot is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - serialplot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with serialplot. If not, see . -*/ - -#include "customcheckablebutton.h" - -CustomCheckableButton::CustomCheckableButton(QWidget *parent) : - QPushButton(parent) -{ - this->setCheckable(true); -} - -void CustomCheckableButton::nextCheckState() -{ - /* Do nothing! Check state will be altered by parent. */ -} diff --git a/customcheckablebutton.h b/customcheckablebutton.h deleted file mode 100644 --- a/customcheckablebutton.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright © 2015 Hasan Yavuz Özderya - - This file is part of serialplot. - - serialplot is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - serialplot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with serialplot. If not, see . -*/ - -#ifndef CUSTOMCHECKABLEBUTTON_H -#define CUSTOMCHECKABLEBUTTON_H - -#include - -class CustomCheckableButton : public QPushButton -{ - Q_OBJECT -public: - explicit CustomCheckableButton(QWidget *parent = 0); - -signals: - -public slots: - -private: - void nextCheckState(); - -}; - -#endif // CUSTOMCHECKABLEBUTTON_H diff --git a/portcontrol.cpp b/portcontrol.cpp --- a/portcontrol.cpp +++ b/portcontrol.cpp @@ -44,8 +44,7 @@ PortControl::PortControl(QSerialPort* po QObject::connect(ui->pbReloadPorts, &QPushButton::clicked, this, &PortControl::loadPortList); - QObject::connect(ui->pbOpenPort, &QPushButton::clicked, - this, &PortControl::togglePort); + ui->pbOpenPort->setDefaultAction(&openAction); // TODO: port name coming from combobox is dirty, create a separate layer of signals // that will sanitize this information @@ -248,7 +247,6 @@ void PortControl::togglePort() emit portToggled(true); } } - ui->pbOpenPort->setChecked(serialPort->isOpen()); openAction.setChecked(serialPort->isOpen()); } diff --git a/portcontrol.ui b/portcontrol.ui --- a/portcontrol.ui +++ b/portcontrol.ui @@ -276,7 +276,13 @@ - + + + + 0 + 0 + + 0 @@ -321,13 +327,6 @@ - - - CustomCheckableButton - QPushButton -
customcheckablebutton.h
-
-
diff --git a/serialplot.pro b/serialplot.pro --- a/serialplot.pro +++ b/serialplot.pro @@ -35,7 +35,6 @@ CONFIG += qwt SOURCES += main.cpp\ mainwindow.cpp \ - customcheckablebutton.cpp \ portcontrol.cpp \ plot.cpp \ zoomer.cpp \ @@ -44,7 +43,6 @@ SOURCES += main.cpp\ HEADERS += mainwindow.h \ utils.h \ - customcheckablebutton.h \ portcontrol.h \ floatswap.h \ plot.h \