|
@@ -3,6 +3,7 @@
|
|
#include <QGraphicsDropShadowEffect>
|
|
#include <QGraphicsDropShadowEffect>
|
|
#include <QListView>
|
|
#include <QListView>
|
|
#include <QDebug>
|
|
#include <QDebug>
|
|
|
|
+#include <QStyleFactory>
|
|
|
|
|
|
CustomComboBox::CustomComboBox(QWidget *parent)
|
|
CustomComboBox::CustomComboBox(QWidget *parent)
|
|
: QComboBox(parent)
|
|
: QComboBox(parent)
|
|
@@ -16,6 +17,8 @@ CustomComboBox::~CustomComboBox()
|
|
/* 设置下拉框阴影 */
|
|
/* 设置下拉框阴影 */
|
|
void CustomComboBox::setViewShadowEffect()
|
|
void CustomComboBox::setViewShadowEffect()
|
|
{
|
|
{
|
|
|
|
+ /* 设置这个在Linux下,下拉框才会背景透明 */
|
|
|
|
+ setStyle(QStyleFactory::create("Windows"));
|
|
setView(new QListView());
|
|
setView(new QListView());
|
|
if (nullptr != view() && nullptr != view()->window())
|
|
if (nullptr != view() && nullptr != view()->window())
|
|
{
|
|
{
|