Answer the question
In order to leave comments, you need to log in
How to make it so that in PyQt5, when displaying information in textBrowser, the line does not replace the previous one?
I wrote the code, but when sending information from textEdit to textBrowser, the next line replaces the previous one, how can I make the next lines print below the previous ones?
Help me please.
import sys
# Импортируем наш интерфейс из файла
from bot import *
from PyQt5 import QtCore, QtGui, QtWidgets
class MyWin(QtWidgets.QMainWindow):
def __init__(self, parent=None):
QtWidgets.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
# Событие нажатия на кнопку
self.ui.pushButton.clicked.connect(self.MyFunction)
# Функция которая выполняется при нажатии на кнопку
def MyFunction(self):
dannie = self.ui.textEdit.toPlainText()
self.ui.textBrowser.setText(dannie)
if __name__=="__main__":
app = QtWidgets.QApplication(sys.argv)
myapp = MyWin()
myapp.show()
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