代码拉取完成,页面将自动刷新
import sys, time
from PyQt5.QtWidgets import QApplication, QDialog, QHBoxLayout, QPushButton
from PyQt5 import QtGui
from QxdmDlg import CQxdmTranslatorDlg
from SerialDlg import CSerialMonitorDlg
import Ui.sys_rc
main_window = None
main_icon = None
def show_serial_monitor():
serial_monitor = CSerialMonitorDlg()
serial_monitor.setWindowIcon(main_icon)
main_window.hide()
if serial_monitor.exec_() == 0:
time.sleep(0.1)
main_window.show()
def show_qxdm_translator():
qxdm_translator = CQxdmTranslatorDlg()
qxdm_translator.setWindowIcon(main_icon)
main_window.hide()
if qxdm_translator.exec_() == 0:
time.sleep(0.1)
main_window.show()
if __name__ == "__main__":
app = QApplication([])
window = QDialog()
main_window = window
icon = QtGui.QIcon()
main_icon = icon
icon.addPixmap(QtGui.QPixmap(":/img/5g"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
window.setWindowIcon(icon)
# app.setStyleSheet(open("./Ui/style.qss").read())
window.setWindowTitle('Commands Translator v0.13')
hBox = QHBoxLayout(window)
window.setMinimumSize(500, 100)
serial_push_button = QPushButton('Serial Monitor')
serial_push_button.setMinimumHeight(40)
serial_push_button.clicked.connect(show_serial_monitor)
qxdm_push_button = QPushButton('QXDM Translator')
qxdm_push_button.setMinimumHeight(40)
qxdm_push_button.clicked.connect(show_qxdm_translator)
hBox.addWidget(serial_push_button)
hBox.addWidget(qxdm_push_button)
window.show()
sys.exit(app.exec_())
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。