0

How to remove the outer blue border ? thank you!

class MainWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)


        self.lineEdit = QLineEdit(self)
        self.lineEdit.setGeometry(QRect(20, 20, 100, 30))
        self.lineEdit.setStyleSheet("QLineEdit:focus { border-radius: 5px; border:1px solid  #c6255e;}"); 

        layout = QHBoxLayout()
        layout.addWidget(self.lineEdit)

        self.setLayout(layout)

        self.resize(200, 200)


if __name__ == "__main__":
    app = QApplication([])

    mainWindow = MainWindow()
    mainWindow.show()

    sys.exit(app.exec_())

enter image description here

S. Nick
  • 12,879
  • 8
  • 25
  • 33
Chans
  • 23
  • 1
  • 5

1 Answers1

0

You can call lineEdit.setAttribute(Qt.WA_MacShowFocusRect, 0).

Tim Körner
  • 385
  • 2
  • 9
  • 1
    Can you expand on your answer, explaining why it addresses the original question? That will help anybody else who searches for this particular problem and wants to learn more. – Bob Dalgleish Jan 14 '20 at 19:31