• 大小: 378KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-05
  • 语言: 其他
  • 标签: QCombobox  Qt  自定义  

资源简介

实现了自定义的Combobox,通过QPushButton,QListWidget和自定义的ListWidgetItem实现,效果是下拉列表的每一项都有一个Logo+文字

资源截图

代码片段和文件信息

#include “comboboxbutton.h“

ComboBoxButton::ComboBoxButton(QWidget *parent) :
    QPushButton(parent)
{
    setstyleSheet(“\
      QPushButton{\
          min-width:164px;\
          max-width:164px;\
          min-height:24px;\
          max-height:24px;\
          background-color: qlineargradient(spread:pad x1:1 y1:0 x2:1 y2:1 stop:0 #494949 stop:1 #2b2b2c);\
          padding: 0 5 0 5;\
          image: url(:/ComboBoxButton/Image/ComboBoxButton/down_arrow.png);\
          image-position: top right;\
          border: 1px solid rgba(81 81 82 179);\
          font: 14px ‘微软雅黑‘;\
          color:#eee9e9;\
      }\
      “);
}

ComboBoxButton::~ComboBoxButton()
{
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-11-04 16:25  CustomComboBox\
     文件         610  2015-04-16 13:08  CustomComboBox\CustomComboBox.pro
     文件       18297  2015-11-04 16:25  CustomComboBox\CustomComboBox.pro.user
     目录           0  2015-04-16 15:54  CustomComboBox\Image\
     目录           0  2015-04-17 09:51  CustomComboBox\Image\ComboBoxButton\
     文件        2580  2015-04-16 11:56  CustomComboBox\Image\ComboBoxButton\background.png
     文件        1097  2015-04-16 11:23  CustomComboBox\Image\ComboBoxButton\down_arrow.png
     目录           0  2015-04-16 13:30  CustomComboBox\Image\RemoteControlDeviceLogo\
     文件        1502  2015-04-13 16:49  CustomComboBox\Image\RemoteControlDeviceLogo\logo_CD.png
     文件        1114  2015-04-13 16:50  CustomComboBox\Image\RemoteControlDeviceLogo\logo_TV.png
     文件        1247  2015-04-13 16:49  CustomComboBox\Image\RemoteControlDeviceLogo\logo_air-condition.png
     目录           0  2015-04-16 13:29  CustomComboBox\Image\ScrollBar\
     文件        2841  2015-04-04 15:23  CustomComboBox\Image\ScrollBar\backgroundHorizontal.png
     文件        1063  2015-03-25 10:43  CustomComboBox\Image\ScrollBar\backgroundVertical.png
     文件        1140  2015-03-26 16:00  CustomComboBox\Image\ScrollBar\down-arrow.png
     文件        2846  2015-04-11 14:09  CustomComboBox\Image\ScrollBar\handleHorizontal.png
     文件        1053  2015-04-11 13:41  CustomComboBox\Image\ScrollBar\handleVertical.png
     文件        2950  2015-04-04 15:22  CustomComboBox\Image\ScrollBar\left-arrow.png
     文件        2914  2015-04-04 15:20  CustomComboBox\Image\ScrollBar\right-arrow.png
     文件        1125  2015-03-26 16:00  CustomComboBox\Image\ScrollBar\up-arrow.png
     目录           0  2015-04-16 15:54  CustomComboBox\Image\titlebarButton\
     文件        3245  2015-03-23 15:39  CustomComboBox\Image\titlebarButton\closeHover.png
     文件        1207  2015-03-21 17:28  CustomComboBox\Image\titlebarButton\closeNormal.png
     文件        3247  2015-03-23 15:39  CustomComboBox\Image\titlebarButton\closePressed.png
     文件        2822  2015-03-23 15:32  CustomComboBox\Image\titlebarButton\minimizeHover.png
     文件        1012  2015-03-21 17:28  CustomComboBox\Image\titlebarButton\minimizeNormal.png
     文件        2822  2015-03-23 15:32  CustomComboBox\Image\titlebarButton\minimizePressed.png
     文件      335024  2015-03-21 16:18  CustomComboBox\Image\background.png
     文件        1481  2015-04-17 09:52  CustomComboBox\Image.qrc
     文件         717  2015-04-17 10:27  CustomComboBox\comboboxbutton.cpp
     文件         272  2015-04-16 13:08  CustomComboBox\comboboxbutton.h
............此处省略9个文件信息

评论

共有 条评论