代码拉取完成,页面将自动刷新
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'F:\prog-tmp\PyQt5-code\MDI_code_compV0.32\compileSetting.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class Ui_complierDialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(566, 240)
Dialog.setSizeGripEnabled(True)
self.layoutWidget = QtWidgets.QWidget(Dialog)
self.layoutWidget.setGeometry(QtCore.QRect(460, 170, 87, 61))
self.layoutWidget.setObjectName("layoutWidget")
self.vboxlayout = QtWidgets.QVBoxLayout(self.layoutWidget)
self.vboxlayout.setContentsMargins(0, 0, 0, 0)
self.vboxlayout.setSpacing(6)
self.vboxlayout.setObjectName("vboxlayout")
self.okButton = QtWidgets.QPushButton(self.layoutWidget)
self.okButton.setObjectName("okButton")
self.vboxlayout.addWidget(self.okButton)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.vboxlayout.addItem(spacerItem)
self.cancelButton = QtWidgets.QPushButton(self.layoutWidget)
self.cancelButton.setObjectName("cancelButton")
self.vboxlayout.addWidget(self.cancelButton)
self.groupBox = QtWidgets.QGroupBox(Dialog)
self.groupBox.setGeometry(QtCore.QRect(10, 10, 541, 71))
self.groupBox.setObjectName("groupBox")
self.rdb_pathDefault = QtWidgets.QRadioButton(self.groupBox)
self.rdb_pathDefault.setGeometry(QtCore.QRect(20, 20, 211, 16))
self.rdb_pathDefault.setFocusPolicy(QtCore.Qt.WheelFocus)
self.rdb_pathDefault.setObjectName("rdb_pathDefault")
self.rdb_pathSelect = QtWidgets.QRadioButton(self.groupBox)
self.rdb_pathSelect.setGeometry(QtCore.QRect(20, 40, 81, 16))
self.rdb_pathSelect.setObjectName("rdb_pathSelect")
self.lineEdit_path = QtWidgets.QLineEdit(self.groupBox)
self.lineEdit_path.setEnabled(True)
self.lineEdit_path.setGeometry(QtCore.QRect(110, 40, 391, 20))
self.lineEdit_path.setMaxLength(1024)
self.lineEdit_path.setReadOnly(True)
self.lineEdit_path.setObjectName("lineEdit_path")
self.pushButton_path = QtWidgets.QPushButton(self.groupBox)
self.pushButton_path.setGeometry(QtCore.QRect(508, 39, 31, 23))
self.pushButton_path.setObjectName("pushButton_path")
self.groupBox_2 = QtWidgets.QGroupBox(Dialog)
self.groupBox_2.setGeometry(QtCore.QRect(10, 90, 511, 71))
self.groupBox_2.setObjectName("groupBox_2")
self.rdb_xdataDefault = QtWidgets.QRadioButton(self.groupBox_2)
self.rdb_xdataDefault.setGeometry(QtCore.QRect(20, 20, 171, 16))
self.rdb_xdataDefault.setObjectName("rdb_xdataDefault")
self.radioButton = QtWidgets.QRadioButton(self.groupBox_2)
self.radioButton.setGeometry(QtCore.QRect(20, 40, 89, 16))
self.radioButton.setObjectName("radioButton")
self.lineEdit_xdata = QtWidgets.QLineEdit(self.groupBox_2)
self.lineEdit_xdata.setGeometry(QtCore.QRect(100, 40, 71, 20))
self.lineEdit_xdata.setMaximumSize(QtCore.QSize(16777215, 16777213))
self.lineEdit_xdata.setMaxLength(8)
self.lineEdit_xdata.setFrame(True)
self.lineEdit_xdata.setEchoMode(QtWidgets.QLineEdit.Normal)
self.lineEdit_xdata.setObjectName("lineEdit_xdata")
self.retranslateUi(Dialog)
self.okButton.clicked.connect(Dialog.accept)
self.cancelButton.clicked.connect(Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "complier 编译器选项"))
self.okButton.setText(_translate("Dialog", "&OK"))
self.cancelButton.setText(_translate("Dialog", "&Cancel"))
self.groupBox.setTitle(_translate("Dialog", "编译器路径选择"))
self.rdb_pathDefault.setText(_translate("Dialog", "默认在本软件所在目录"))
self.rdb_pathSelect.setText(_translate("Dialog", "手动选择"))
self.pushButton_path.setText(_translate("Dialog", "..."))
self.groupBox_2.setTitle(_translate("Dialog", "外部RAM/xdata 设置"))
self.rdb_xdataDefault.setText(_translate("Dialog", "xdata设置为8192"))
self.radioButton.setText(_translate("Dialog", "手动输入:"))
class complierSetting(QDialog, Ui_complierDialog):
"""
Class documentation goes here.
"""
def __init__(self, parent=None):
"""
Constructor
@param parent reference to the parent widget
@type QWidget
"""
super(complierSetting, self).__init__(parent)
self.setupUi(self)
self.parent = parent
self.pushButton_path.clicked.connect(self.SelectExistDirect)
self.rdb_xdataDefault.toggled.connect(self.SetXdata8192)
#self.radioButton.toggled.connect(self.SetXdataInput)
def SelectExistDirect(self):
dir=QFileDialog.getExistingDirectory(self, "选择文件夹", self.parent.compilePath)
if dir == None:
return
self.lineEdit_path.setText(dir)
def SetXdata8192(self):
if self.rdb_xdataDefault.isChecked():
self.lineEdit_xdata.setText('8192')
self.lineEdit_xdata.setEnabled(False)
else:
self.lineEdit_xdata.setEnabled(True)
'''
def SetXdataInput(self):
if self.radioButton.isChecked():
self.lineEdit_xdata.setEnabled(True)
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
'''
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。