Changeset - 2f041070d306
[Not reviewed]
default
2 4 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-09-02 00:25:30
hy@ozderya.net
use QToolButton and QAction instead of CustomCheckableButton for Open port button
6 files changed with 8 insertions and 85 deletions:
0 comments (0 inline, 0 general)
CMakeLists.txt
Show inline comments
 
@@ -58,7 +58,6 @@ add_executable(${PROGRAM_NAME} WIN32
 
  main.cpp
 
  mainwindow.cpp
 
  portcontrol.cpp
 
  customcheckablebutton.cpp
 
  plot.cpp
 
  zoomer.cpp
 
  hidabletabwidget.cpp
customcheckablebutton.cpp
Show inline comments
 
deleted file
customcheckablebutton.h
Show inline comments
 
deleted file
portcontrol.cpp
Show inline comments
 
@@ -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());
 
}
 

	
portcontrol.ui
Show inline comments
 
@@ -276,7 +276,13 @@
 
   <item>
 
    <layout class="QVBoxLayout" name="verticalLayout_4">
 
     <item>
 
      <widget class="CustomCheckableButton" name="pbOpenPort">
 
      <widget class="QToolButton" name="pbOpenPort">
 
       <property name="sizePolicy">
 
        <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
 
         <horstretch>0</horstretch>
 
         <verstretch>0</verstretch>
 
        </sizepolicy>
 
       </property>
 
       <property name="minimumSize">
 
        <size>
 
         <width>0</width>
 
@@ -321,13 +327,6 @@
 
   </item>
 
  </layout>
 
 </widget>
 
 <customwidgets>
 
  <customwidget>
 
   <class>CustomCheckableButton</class>
 
   <extends>QPushButton</extends>
 
   <header>customcheckablebutton.h</header>
 
  </customwidget>
 
 </customwidgets>
 
 <resources/>
 
 <connections/>
 
</ui>
serialplot.pro
Show inline comments
 
@@ -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 \
0 comments (0 inline, 0 general)