Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
摆脱Qt';QListView项目上的虚线轮廓_Qt_Pyqt4_Qtstylesheets - Fatal编程技术网

摆脱Qt';QListView项目上的虚线轮廓

摆脱Qt';QListView项目上的虚线轮廓,qt,pyqt4,qtstylesheets,Qt,Pyqt4,Qtstylesheets,我正在尝试使用样式表删除此QListView::item中文本的虚线边框: 我尝试了QListView上的border:0和show-decoration-selected:0、QListView::item和QListView::item::text的变体,但没有效果 我使用PyQt,但我相信样式表规则与C++库中的规则相同。 在经过更多的测试之后,我发现下面的样式表工作: QListView { outline: 0; } 在样式表中设置“outline:0;”对我来说已经不起作

我正在尝试使用样式表删除此
QListView::item
中文本的虚线边框:

我尝试了
QListView
上的
border:0
show-decoration-selected:0
QListView::item
QListView::item::text
的变体,但没有效果


我使用PyQt,但我相信样式表规则与C++库中的规则相同。

在经过更多的测试之后,我发现下面的样式表工作:

QListView {
    outline: 0;
}
在样式表中设置“outline:0;”对我来说已经不起作用了(现在?)。
我能找到的唯一解决方案是将ListView的FocusPolicy设置为“Qt::NoFocus”,这有明显的缺点。

将边框设置为none似乎对我起到了作用

QListView::item { 
    border: none;
}

绝对的救命稻草,谢谢!