马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import sys
from PyQt5.QtWidgets import QApplication, QDialog
from ui_Dialog import Ui_Dialog
class QmyDialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
self.ui = Ui_Dialog()
self.ui.setupUi(self)
def on_btnClear_clicked(self):
self.ui.textEdit.clear()
def on_chkBoxBold_toggled(self, checked):
font = self.ui.textEdit.font()
font.setBold(checked)
self.ui.textEdit.setFont(font)
def on_chkBoxUnder_clicked(self):
checked = self.ui.chkBoxUnder.isChecked()
font = self.ui.textEdit.font()
font.setUnderline(checked)
self.ui.textEdit.setFont(font)
@pyqtSlot(bool)
def on_chkBoxItalic_clicked(self, checked):
font = self.ui.textEdit.font()
font.setItalic(checked)
self.ui.textEdit.setFont(font)
这个是myDialog.py
import sys
from PyQt5.QtWidgets import QApplication
from myDialog import QmyDialog
app = QApplication(sys.argv)
mainform = QmyDialog()
mainform.show()
sys.exit(app.exec_())
appMain.py
运行提示pyqtSlot未定义,求大神指点 |