css - 后面没有方框的圆形QComboBox

标签 css qt stylesheet qcombobox

我正在 Qt 中设计 QComboBox 的样式。如图所示,它是四舍五入的。问题是在圆形边框后面显示了一个奇怪的方框。

有人能告诉我这个盒子是什么以及如何让它不可见吗?

顺便说一句,我也想把阴影带走。

enter image description here

这是我当前的代码:

QComboBox {
    border: 1px solid gray;
    border-radius: 10px;
    min-width: 6em;
}

QComboBox:on {
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0px;
}

QComboBox QAbstractItemView {
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
    background: white;
    border: 1px solid gray;
    box-shadow: transparent;
}

QComboBox::drop-down {
    border-color: transparent;
}

有人可以帮忙吗??谢谢!

最佳答案

你可以像这样在后面添加代码,

(your qcombobox)->view()->window()->setWindowFlags(Qt::Popup | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint);

我试过了,没问题

关于css - 后面没有方框的圆形QComboBox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27962162/

相关文章:

html - Div 标签之间的交替背景颜色

html - 具有 flex 相邻div的居中灵活div

c++ - 如何共享 OpenGL 上下文或数据?

c++ - Qt4 与 Qt3 有何不同?

css - 仅加载 ipad 的 css 文件

html - CSS 冲突样式表

jquery - 如果图像 src 不存在,则显示图像而不是 Alt 文本

css - 父级 :before pseudoelement with child alt attribute as content

c++ - QTableWidget::itemAt() 返回看似随机的项目

css - 将图像对齐到 h3 的右侧