Removing dotted border without setting NoFocus in Windows PyQt

前端 未结 5 1747
猫巷女王i
猫巷女王i 2021-02-04 02:18

There are a few questions on SO about this, all of which seem to say that the only way to remove the dotted border is to set the focusPolicy on widget/item in question to NoFocu

5条回答
  •  南旧
    南旧 (楼主)
    2021-02-04 02:42

    On OSX you can do QWidget.setAttribute(QtCore.Qt.WA_MacShowFocusRect, False). Not sure about Win or Linux. You might have to do it through stylesheets.

提交回复
热议问题