Reputation: 2017
I am porting my console app to a QT gui. The app get data from a website and prints the rsult line by line in the console ( I use spyder). Each line are a few strings. Now I want to add a gui to the app so others can use the app as well. With QT designer I designed a nice gui. In a Main module I call the UI. Now I am trying to 'connect' my app to the gui. Since I am new to Qt (with PySide) I would like to build step by step and learn. Now I would like to show ('print' line by line) the results in a widget (e.g. QListView). Can you show me a example where ["this is line 1", "This is line two"] are show in two rows in a QT Widget. Thanks
Upvotes: 1
Views: 1010
Reputation: 273796
I usually use QTextBrowser
for a "logging" widget.
QTextBrowser
widget in your main window (i.e. self.log_widget = QTextBrowser()
)self.log_widget.append('Hello')
)QTextBrowser
is a powerful widget that can also accept HTML for formatted output.
Upvotes: 1