A
A
adel3212020-07-03 14:27:49
Python
adel321, 2020-07-03 14:27:49

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

1 answer(s)
S
soremix, 2020-07-03
@adel321

It's not clear where, but it's possible
ui.label_2.setText(ui.textEdit)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question