2014-11-19 3 views
3

Когда я добавить QPushButton на моей форме, я получаю это:Снимает выделение вокруг текста QPushButton

enter image description here

Вы можете увидеть уродливое выделение текста (в кнопку). Как я могу удалить его?
Вот мой CSS этой кнопки:

enterButton->setStyleSheet("QPushButton { \ 
            padding: 6px; \ 
            background: #369; \ 
            color: white; \ 
            font-size: 13px;\ 
            border: 0; \ 
            border-radius: 3px; \ 
           }\ 
           QPushButton:hover { \ 
            background: #47a; \ 
           }\ 
           QPushButton:pressed { \ 
            background: #58b; \ 
           }"); 

Спасибо!

ответ

5

Я не Ubuntu установлен прямо сейчас, но я думаю, что outline: 0px должно работать:

enterButton->setStyleSheet("QPushButton { \ 
           padding: 6px; \ 
           background: #369; \ 
           color: white; \ 
           font-size: 13px;\ 
           border: 0; \ 
           border-radius: 3px; \ 
           outline: 0px; \ 
          }\ 
          QPushButton:hover { \ 
           background: #47a; \ 
          }\ 
          QPushButton:pressed { \ 
           background: #58b; \ 
          }"); 

Попробуйте и вернуться с обратной связью.

+3

QPushButton: focus { border: none; схема: нет; } говорит http://www.qtcentre.org/threads/27656-Can-I-remove-hide-the-border-when-QPushButton-is-highlighted-focus-active – stupidstudent

+0

Большое спасибо, это работает! :) – Efog

+1

@Efog Добро пожаловать, я рад, что это сработало! :) – Iuliu