Remove dotted border around combo box items
-
Hello All,
Can someone guide me on how to remove border around text on hover.
Here is style:-
@
QComboBox QAbstractItemView::item{padding: 10px;background-color:transparent;outline:none; border-bottom:1px solid #c6c6c6;}
QComboBox QAbstractItemView::item:selected {color:#65b0a5;outline:none;}
QComboBox QAbstractItemView::item:hover{background-color:#b5b5b5; color:#323232;outline:none;}
@EDIT: please use @-tags around code, changed here - Gerolf
-
Is there a way we can remove Focus from the items?
-
Not sure I understand exactly what you want, but you request a border by "border-bottom:1px solid #c6c6c6", no?
Could you try something like
@QComboBox::item { border: 0px solid black }@
on your style sheet?
-
Here is the problem when i mouse over the combo box item.
Please see the attached image.
I wan to remove the border that is coming around the text.
-
If you see i want to remove the boder which comes on mouse over on the Hit State text.
-
so perhaps you could use :
@QComboBox::selected:item { border: 0px solid black }@
or
@QAbstractScrollArea::selected:item { border: 0px solid black }@
-
how do apply the above style on QComboBox QAbstractItemView?
-
For a first try, create a file named "my_style.qss", put the previous line inside, then simply launch your application with:
@myApplication -stylesheet my_style.qss@
NB : QAbstractItemView is an QAbstractScrollArea.
-
Is there a way i can apply the style directly in style file?
-
you can do that via q QStyle implementation, but I think, the focus rectangle (which is in fact the problem here) can't be modified via style sheet.
-
Is there some way through or something else so i can the border invisible or hide it so it does not show?
-
AFAIK not ...
-
Maybe topicstarter already has resolved this problem, but I found solution:
QComboBox QAbstractItemView {
outline: 0px;
}this stylesheet deletes dotted border.
Maybe it helps someone. -
It worked for me, thank you very much arybnikov.
-
Thank you "arybnikov" this worked for me as well :)