1 Star 0 Fork 308

Elijahxb / PyQt

forked from PyQt5 / PyQt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
SingleApplication.py 788 Bytes
一键复制 编辑 原始数据 按行查看 历史
Irony 提交于 2019-01-01 17:04 . demo
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2017年3月30日
@author: Irony."[讽刺]
@site: https://pyqt5.com , https://github.com/892768447
@email: 892768447@qq.com
@file: TestQSingleApplication
@description:
'''
from PyQt5.QtWidgets import QTextEdit
from Lib.Application import QSingleApplication # @UnresolvedImport
__version__ = "0.0.1"
class Widget(QTextEdit):
def __init__(self, *args, **kwargs):
super(Widget, self).__init__(*args, **kwargs)
if __name__ == "__main__":
import sys
app = QSingleApplication(sys.argv)
if app.isRunning():
app.sendMessage("app is running")
sys.exit(0)
t = Widget()
app.setActivationWindow(t)
app.messageReceived.connect(t.append)
t.show()
sys.exit(app.exec_())
Python
1
https://gitee.com/Elijahxb/PyQt.git
git@gitee.com:Elijahxb/PyQt.git
Elijahxb
PyQt
PyQt
master

搜索帮助