cmd info in a Qt window
-
I'm creating a code and everything is working fine, but I'm running it in a cmd screen, how would I put it in a specific Qt window? I tried the OpenGl widget , Plain text Edit , Dock Widget , widget , Frame option but I couldn't (I don't know if I was directing it wrong because I'm new in the area) the image shows the cmd with the information I'm trying to put in Qt, this window that is in Qt is Plain Text Edit
I want to put this data that is appearing in the CMD in the Qt window -
Hi and welcome to devnet,
What exactly are you running ?
Without knowing that, it's impossible to help you. -
I'm creating a code and everything is working fine, but I'm running it in a cmd screen, how would I put it in a specific Qt window? I tried the OpenGl widget , Plain text Edit , Dock Widget , widget , Frame option but I couldn't (I don't know if I was directing it wrong because I'm new in the area) the image shows the cmd with the information I'm trying to put in Qt, this window that is in Qt is Plain Text Edit
I want to put this data that is appearing in the CMD in the Qt window -
Hi and welcome to devnet,
What exactly are you running ?
Without knowing that, it's impossible to help you. -
@Satil
If it is your own source code which is e.g. outputting to cout/stdout, change it to emit signals and in a slot append it to theQPlianTextEdit. If it is another application useQProcessto run it and grab its output. -
@JonB I'm new to programming, so I don't know what the code to call in PlainTextEdit would look like, could you give an example of how it would look?How would you call the def monitor in PlainTextEdit?

@Satil
Please paste text, not screenshots, so people can copy.self.ui.plainTextEdit.setPlainText(self.monitor()) def monitor(self): return "oi"Or
def monitor(self): self.ui.plainTextEdit.appendPlainText("ABC") self.ui.plainTextEdit.appendPlainText("DEF") ...Or raise signals from
monitor()with the text as parameter and attach slot to append to plain text edit.You cannot easily just cause Python
print()statements to appear in aQPlainTextEdit. So depends whether you are in charge of theprint()statements. -
@Satil
Please paste text, not screenshots, so people can copy.self.ui.plainTextEdit.setPlainText(self.monitor()) def monitor(self): return "oi"Or
def monitor(self): self.ui.plainTextEdit.appendPlainText("ABC") self.ui.plainTextEdit.appendPlainText("DEF") ...Or raise signals from
monitor()with the text as parameter and attach slot to append to plain text edit.You cannot easily just cause Python
print()statements to appear in aQPlainTextEdit. So depends whether you are in charge of theprint()statements.
