Changeset - 9e25c4ca0dd6
[Not reviewed]
default
0 2 0
Hasan Yavuz ÖZDERYA - 9 years ago 2016-08-12 17:03:08
hy@ozderya.net
added tooltip
2 files changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/portcontrol.cpp
Show inline comments
 
@@ -25,48 +25,49 @@
 
#include <QLabel>
 
#include <QtDebug>
 
#include "utils.h"
 

	
 
#define TBPORTLIST_MINWIDTH (200)
 

	
 
PortControl::PortControl(QSerialPort* port, QWidget* parent) :
 
    QWidget(parent),
 
    ui(new Ui::PortControl),
 
    portToolBar("Port Toolbar"),
 
    openAction("Open", this),
 
    loadPortListAction("↺", this)
 
{
 
    ui->setupUi(this);
 

	
 
    serialPort = port;
 

	
 
    // setup actions
 
    openAction.setCheckable(true);
 
    openAction.setShortcut(QKeySequence("F12"));
 
    openAction.setToolTip("Open Port");
 
    QObject::connect(&openAction, &QAction::triggered,
 
                     this, &PortControl::openActionTriggered);
 

	
 
    loadPortListAction.setToolTip("Reload port list");
 
    QObject::connect(&loadPortListAction, &QAction::triggered,
 
                     [this](bool checked){loadPortList();});
 

	
 
    // setup toolbar
 
    portToolBar.addWidget(&tbPortList);
 
    portToolBar.addAction(&loadPortListAction);
 
    portToolBar.addAction(&openAction);
 

	
 
    // setup port selection widgets
 
    tbPortList.setMinimumWidth(TBPORTLIST_MINWIDTH);
 
    tbPortList.setModel(&portList);
 
    ui->cbPortList->setModel(&portList);
 
    QObject::connect(ui->cbPortList,
 
                     SELECT<int>::OVERLOAD_OF(&QComboBox::activated),
 
                     this, &PortControl::onCbPortListActivated);
 
    QObject::connect(&tbPortList,
 
                     SELECT<int>::OVERLOAD_OF(&QComboBox::activated),
 
                     this, &PortControl::onTbPortListActivated);
 
    QObject::connect(ui->cbPortList,
 
                     SELECT<const QString&>::OVERLOAD_OF(&QComboBox::activated),
 
                     this, &PortControl::selectPort);
 
    QObject::connect(&tbPortList,
 
                     SELECT<const QString&>::OVERLOAD_OF(&QComboBox::activated),
 
                     this, &PortControl::selectPort);
src/portcontrol.ui
Show inline comments
 
@@ -49,49 +49,49 @@
 
        </widget>
 
       </item>
 
       <item row="1" column="0">
 
        <widget class="QLabel" name="label_2">
 
         <property name="text">
 
          <string>Baud Rate:</string>
 
         </property>
 
        </widget>
 
       </item>
 
       <item row="0" column="2">
 
        <widget class="QToolButton" name="pbReloadPorts">
 
         <property name="sizePolicy">
 
          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
 
           <horstretch>0</horstretch>
 
           <verstretch>0</verstretch>
 
          </sizepolicy>
 
         </property>
 
         <property name="maximumSize">
 
          <size>
 
           <width>30</width>
 
           <height>16777215</height>
 
          </size>
 
         </property>
 
         <property name="toolTip">
 
          <string>Reload port list</string>
 
          <string/>
 
         </property>
 
         <property name="text">
 
          <string>↺</string>
 
         </property>
 
        </widget>
 
       </item>
 
      </layout>
 
     </item>
 
     <item>
 
      <layout class="QHBoxLayout" name="horizontalLayout_2">
 
       <item>
 
        <widget class="QFrame" name="frame">
 
         <property name="frameShape">
 
          <enum>QFrame::NoFrame</enum>
 
         </property>
 
         <layout class="QVBoxLayout" name="verticalLayout_5">
 
          <item>
 
           <widget class="QRadioButton" name="rbNoParity">
 
            <property name="text">
 
             <string>No Parity</string>
 
            </property>
 
            <property name="checked">
 
             <bool>true</bool>
 
            </property>
0 comments (0 inline, 0 general)