Answer the question
In order to leave comments, you need to log in
I want to make a program that sorts numbers and letters, but I get the error "setText(self, str):argument 1 has unexpected type "QTextEdit"?
code
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from ui import Ui_Dialog
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
#этот код означает, что я пишу в рамку textEdit, и оно выводится в label_2,
def da():
x = ui.label_2.setText(ui.textEdit)
y = sorted(x)
#переменная "y" сортирует label_2
ui.pushButton.clicked.connect(da)
sys.exit(app.exec_())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question