Aleksandar
Aleksandar

Reputation: 43

How to remove outline on QToolButton

I'm developing Qt application for Mac OS X. Problem is when I create QToolButton it apears with some outline.

https://i.sstatic.net/vqtP9.png

I use next stylesheet

QToolButton {  
    border: 1px solid #575757;
    border-radius: 4px;
}

How to remove the outline?


ANSWER:

I didn't mentioned that I'm adding this item to statusBar().

To remove border around the item I used:

QStatusBar::item {border: 0px;}

Upvotes: 1

Views: 3744

Answers (2)

Mhadhbi issam
Mhadhbi issam

Reputation: 420

use this :

yourWidgetElement->setFocusPolicy(Qt::NoFocus ) ;

Upvotes: 0

ereOn
ereOn

Reputation: 55796

Have you tried this ?

QToolButton {  
    border: 1px solid #575757;
    border-radius: 4px;
    background-color: palette(base);
}

Usually, web best-practices recommand that if you change one color, you have to change them all.

It is likely that you will also have to change the text color as well to avoid potential issues on some computers with non-default window text color.

Upvotes: 1

Related Questions