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
You can do this with PyQt5:
class Style(QProxyStyle): def drawPrimitive(self, element, option, painter, widget): if element == QStyle.PE_FrameFocusRect: return super().drawPrimitive(element, option, painter, widget) app.setStyle(Style())