c++ - Qt : Setting a border bottom on QtableView disables selection-background-color

标签 c++ qt qtstylesheets

我目前在我的 QtableView 样式表中有类似的东西

QTableView::item 
{
     selection-background-color: rgb(85, 85, 127);
     border-bottom: 1px double #8f8f91;
 }

现在的问题是 selection-background-color: rgb(85, 85, 127); 只有在 border-bottom: 1px double #8f8f91; 时才会生效被禁用。有什么建议吗??

最佳答案

如果你想进行糟糕的定制,你应该指定任何边框属性。不特定于 QSS:

border: 0px solid transparent; // Or any other border

关于c++ - Qt : Setting a border bottom on QtableView disables selection-background-color,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22292915/

相关文章:

c++ - cpp 在 std::list 的该位置之后移动一些元素

c++ - 使用 QJSEngine 从 JavaScript 访问 Qt API

python - 在 QT 样式表中使用相对 url

qt - 如何在 QTableView 中为当前项设置样式表

C++ std::async 在主线程上运行

c++ - 在类中声明类型别名的替代方法

c++ - 使用 C++(希望是 WMI?)提取 GPU 信息

c++ - 通过逻辑层中的类转发 QProgressBar 更新的正确方法是什么?

c++ - 将 QProcess 与包含执行文件路径的字符串一起使用

c++ - Qt::如何降低 QSpinBox 中的文本