| 123456789101112131415161718192021222324252627 | 
							- #ifndef CUSTOMCOMBOBOX_H
 
- #define CUSTOMCOMBOBOX_H
 
- #include <QComboBox>
 
- /**
 
-  * @brief 1、使用此类绘制下拉框阴影需要在样式表中设置QAbstractItemView {margin: LISTVIEW_MARGIN;}
 
-  *          否则阴影会被遮挡
 
-  *        2、调用函数setViewShadowEffect()设置下拉框阴影
 
-  *        3、调用setViewShadowEffect()前,需要先设置样式表
 
-  */
 
- class CustomComboBox : public QComboBox
 
- {
 
- public:
 
-     explicit CustomComboBox(QWidget *parent = nullptr);
 
-     ~CustomComboBox();
 
-     /* 设置下拉框阴影,需要先设置样式表,再调用此函数 */
 
-     void setViewShadowEffect();
 
-     //重写下拉框弹出位置
 
-     void showPopup() override;
 
- private:
 
-     const int LISTVIEW_MARGIN = 12; // QAbstractItemView边距(阴影宽度)
 
- };
 
- #endif // CUSTOMCOMBOBOX_H
 
 
  |