开发者

pyqt icon overlap with word

开发者 https://www.devze.com 2023-01-26 09:21 出处:网络
This is what happens: code here: self.connectAction = createAction( self, \"设备连接(&C)\", self.setupDevice,

This is what happens:

pyqt icon overlap with word

code here:

self.connectAction = createAction(
    self, "设备连接(&C)", self.setupDevice, 
    icon_id = QStyle.SP_DialogNoButton)

and this the createAction:

def createAction(parent,
                 text,
                 slot=None,
                 shortcut=None,
                 icon=None,
                 tip=None,
                 checkable=False,
                 signal="triggered()",
                 whatis=None,
                 icon_id=None):
    action = QAction(text, parent)
    if icon:
        if isinstance(icon, QIcon):
            action.setIcon(icon)
        else:
            action.setIcon(QIcon(":/%s.png" % icon))
    if icon_id:
        action.se开发者_如何学GotIcon(app.style().standardIcon(icon_id))
    if slot:
        connect(action, signal, slot)
    return action


OK, I found my problem, I set qt stylesheet, and it cause this problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消