예제 #1
0
def set_app_icon(app):
    from ezdxf.addons.xqt import QtGui, QtCore

    app_icon = QtGui.QIcon()
    p = resources_path()
    app_icon.addFile(str(p / "16x16.png"), QtCore.QSize(16, 16))
    app_icon.addFile(str(p / "24x24.png"), QtCore.QSize(24, 24))
    app_icon.addFile(str(p / "32x32.png"), QtCore.QSize(32, 32))
    app_icon.addFile(str(p / "48x48.png"), QtCore.QSize(48, 48))
    app_icon.addFile(str(p / "64x64.png"), QtCore.QSize(64, 64))
    app_icon.addFile(str(p / "256x256.png"), QtCore.QSize(256, 256))
    app.setWindowIcon(app_icon)
예제 #2
0
 def make_action(
     self,
     name,
     slot,
     *,
     shortcut: str = "",
     icon_name: str = "",
     tip: str = "",
 ) -> QAction:
     action = QAction(name, self)
     if shortcut:
         action.setShortcut(shortcut)
     if icon_name:
         icon = QtGui.QIcon(str(self.resource_path / icon_name))
         action.setIcon(icon)
     if tip:
         action.setToolTip(tip)
     action.triggered.connect(slot)
     return action