Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Blocking functions cause buffer to delay output
Forum Updated to NodeBB v4.3 + New Features

Blocking functions cause buffer to delay output

Scheduled Pinned Locked Moved Unsolved Language Bindings
5 Posts 3 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    daegontaven
    wrote on 10 Aug 2017, 21:24 last edited by
    #1

    Hi, I've been having this issue with PyQT for a while now. And I've been trying to solve it for over 2 months. I've had help from #pyqt and stackoverflow to no avail. Any help appreciated.

    StackOverlfow Version

    Github Issue

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Aug 2017, 22:32 last edited by
      #2

      Hi and welcome to devnet,

      Are you editing anything in this QTextEdit ?

      If not then you should consider using a QListView and a model to handle the data especially since you wrote that it's coming in fast.

      You can then for example trigger an update per batch of new data rather than for each line.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply 11 Aug 2017, 05:35
      0
      • S SGaist
        10 Aug 2017, 22:32

        Hi and welcome to devnet,

        Are you editing anything in this QTextEdit ?

        If not then you should consider using a QListView and a model to handle the data especially since you wrote that it's coming in fast.

        You can then for example trigger an update per batch of new data rather than for each line.

        D Offline
        D Offline
        daegontaven
        wrote on 11 Aug 2017, 05:35 last edited by
        #3

        @SGaist Thanks for replying. Yeah. It's like qtconsole. I've tested this with a QPlainTextEdit and I saw very little improvement in performance. I can't sacrifice basic HTML capabilities. I am working om writing a better buffer using Qt. How would I go about checking for a batch of data ? Should I just flush or check the queue ? You may have noticed that right now it just gets something from the queue in intervals. So a lot of appends fast(but delayed). Is this the reason it's very slow ? I need speed since it's an interpreter. I am very sure that it can be done without QListView since Spyder IDE has successfully done it.

        Thanks in advance
        (^_^)

        1 Reply Last reply
        0
        • V Offline
          V Offline
          VRonin
          wrote on 11 Aug 2017, 07:25 last edited by VRonin 8 Nov 2017, 07:26
          #4

          I'm sorry but this does not look like a bug of the system nor of the buffer, you are just blocking the event loop.

          from your stackoverflow code, if you add app.porcessEvents() inside the loop everything will work as you expect

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          D 1 Reply Last reply 11 Aug 2017, 13:15
          1
          • V VRonin
            11 Aug 2017, 07:25

            I'm sorry but this does not look like a bug of the system nor of the buffer, you are just blocking the event loop.

            from your stackoverflow code, if you add app.porcessEvents() inside the loop everything will work as you expect

            D Offline
            D Offline
            daegontaven
            wrote on 11 Aug 2017, 13:15 last edited by
            #5

            @VRonin Oh yeah that was brought up a few times and I'm aware of it. But the stackoverflow version was not a good mvce. I suppose the GitHub version explains the issue better. The loop actually runs in an environment without access to qt UI or its variables. I'm still writing the buffer so will keep this posted unless I can't figure out the buffer flush myself.

            1 Reply Last reply
            0

            1/5

            10 Aug 2017, 21:24

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved