forked from smirgol/LinVAM
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
A window at the bottom of the Mainwindow showing the console output instead of or in addition too the sys.stdout
May be as simple as adding:
ui_mainwind.py
self.consoleTextEdit = QtWidgets.QTextEdit(parent=MainWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushToListenHotkey.sizePolicy().hasHeightForWidth())
self.textEditConsole.setSizePolicy(sizePolicy)
self.textEditConsole.setMinimumSize(QtCore.QSize(180, 0))
self.textEditConsole.setMaximumSize(QtCore.QSize(200, 16777215))
self.textEditConsole.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.textEditConsole.setReadOnly(True)
self.textEditConsole.setPlainText(True)
self.textEditConsole.setObjectName("consoleTextEdit")
self.textEditConsole = QtWidgets.QTextEdit()
self.horizontalLayout_5.addWidget(self.textEditConsole)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.gridLayout_2.addLayout(self.horizontalLayout_5, 5, 0, -1, -1)
and then in the correct location define a function like:
consoleOutput(console_str):
self.textEditConsole.append(str(console_str))
return console_str
Then replace all of the print(str(ex)) with
print(consoleOutput(str(ex)))
Please double check everything first , this is my first attempt at actual widget programming in Python.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels