def __init__(self, argv, key): QtGui.QApplication.__init__(self, argv) self._memory = QtCore.QSharedMemory(self) self._memory.setKey(key) if self._memory.attach(): self._running = True else: self._running = False if not self._memory.create(1): raise RuntimeError(self._memory.errorString())
def __init__(self, argv, key): QtGui.QApplication.__init__(self, argv) self._memory = QtCore.QSharedMemory(self) self._memory.setKey(key) if self._memory.attach(): self._running = True else: self._running = False if not self._memory.create(1): raise RuntimeError(self._memory.errorString()) # Set correct logo base_path = os.path.abspath(os.path.dirname(__file__)) icon_path = os.path.join(base_path, 'images', 'hyperspy.svg') QtGui.QApplication.setWindowIcon(QtGui.QIcon(icon_path))