Maxim Popravko
Maxim Popravko

Reputation: 4159

Can't get flat QToolButton with border on hover stylesheet

I need to implement textbox with inplace button (for search or filter purposes). So, I need to get Qtoolbutton, that is flat and rendered as icon, and obtain the border when hovered by mouse or pressed. And maybe I'd add some almost transparent background on hover too.

I tried to set the following stylesheet:

'border: none; hover {border: 1px} pressed {border: 1px}'

, but it seems that only border set. Nothing happens when I hover or click it. I tried to set autoRaise() to True and False, I mean, maybe some intersection occured, but haven't succeed.

Furthermore, when button is placed in QlineEdit, if I set stylesheet to it, whole button vanishes, I cannot no border or icon or anything.

Upvotes: 2

Views: 5121

Answers (1)

Guard
Guard

Reputation: 6955

try putting ':' before 'hover', as well as 'pressed'

Upvotes: 3

Related Questions