Changeset - b4d71a5e7825
[Not reviewed]
portlist
0 2 2
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-09-05 12:40:29
hy@ozderya.net
added usb icon for usb devices
4 files changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
CMakeLists.txt
Show inline comments
 
@@ -48,25 +48,27 @@ else (QWT_USE_STATIC)
 
  find_package(Qwt 6.1 REQUIRED)
 
endif (QWT_USE_STATIC)
 

	
 
# includes
 
include_directories(${QWT_INCLUDE_DIR})
 

	
 
# wrap UI files
 
# wrap UI and resource files
 
qt5_wrap_ui(UI_FILES mainwindow.ui portcontrol.ui about_dialog.ui)
 
qt5_add_resources(RES_FILES misc/icons.qrc)
 

	
 
add_executable(${PROGRAM_NAME} WIN32
 
  main.cpp
 
  mainwindow.cpp
 
  portcontrol.cpp
 
  plot.cpp
 
  zoomer.cpp
 
  hidabletabwidget.cpp
 
  framebuffer.cpp
 
  portlist.cpp
 
  ${UI_FILES}
 
  ${RES_FILES}
 
  misc/windows_icon.rc
 
  )
 

	
 
# Use the Widgets module from Qt 5.
 
target_link_libraries(${PROGRAM_NAME} ${QWT_LIBRARY})
 
qt5_use_modules(${PROGRAM_NAME} Widgets SerialPort Svg)
misc/icons.qrc
Show inline comments
 
new file 100644
 
<RCC>
 
    <qresource prefix="/">
 
        <file>usb_icon.png</file>
 
    </qresource>
 
</RCC>
misc/usb_icon.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
portlist.cpp
Show inline comments
 
@@ -15,12 +15,13 @@
 

	
 
  You should have received a copy of the GNU General Public License
 
  along with serialplot.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
#include <QVariant>
 
#include <QIcon>
 
#include <QtDebug>
 

	
 
#include "portlist.h"
 

	
 
PortListItem::PortListItem(QString name, QString description, quint16 vid, quint16 pid)
 
{
 
@@ -50,12 +51,13 @@ void PortListItem::construct(QString nam
 
        text += QString(" ") + description;
 
    }
 
    if (vid && pid)
 
    {
 
        text += QString("[%1:").arg(vid, 4, 16, QChar('0'));
 
        text += QString("%1]").arg(pid, 4, 16, QChar('0'));
 
        setIcon(QIcon(":/usb_icon.png"));
 
    }
 
    setText(text);
 
    setData(name, PortNameRole);
 
}
 

	
 
QString PortListItem::portName()
0 comments (0 inline, 0 general)