Results 1 to 2 of 2

Thread: How do you display logging output to user in QTextEdit?

  1. #1
    Join Date
    Jun 2018
    Posts
    1
    Qt products
    Qt5
    Platforms
    MacOS X

    Default How do you display logging output to user in QTextEdit?

    I have created a debug print for every user app events (mouse click & API requests) like shown below. How do you display them in QTextEdit, so when the app took longer time to process users don't assume the app is hang or something ?

    Qt Code:
    1. import logging
    2.  
    3. def setupUi(self, MainWindow):
    4. .....
    5. self.textEdit = QtWidgets.QTextEdit(self.centralwidget)
    6. self.textEdit.setGeometry(QtCore.QRect(50, 890, 960, 80))
    7. self.textEdit.setObjectName("textEdit")
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. if DEBUG:
    2. logging.basicConfig(filename='example.log', level=logging.DEBUG)
    3. logging.debug(self.wooconsumerweb.text())
    4. logging.debug(self.wooconsumerinput.text())
    5. logging.debug(self.wooconsumersecret.text())
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How do you display logging output to user in QTextEdit?

    How do you display them in QTextEdit
    Are you asking how to show text in a QTextEdit? because that is what I make out from your question.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Logging Qt User Actions
    By Frank J. Lhota in forum Qt Programming
    Replies: 14
    Last Post: 30th May 2014, 21:36
  2. Replies: 0
    Last Post: 20th July 2013, 03:07
  3. Replies: 2
    Last Post: 22nd September 2012, 01:18
  4. Replies: 3
    Last Post: 19th July 2012, 09:32
  5. Replies: 2
    Last Post: 27th November 2008, 10:16

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.