Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I want to improve the paintevent speed of modal window

I want to improve the paintevent speed of modal window

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 523 Views 1 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.
  • L Offline
    L Offline
    LISP
    wrote on last edited by
    #1

    Hi
    I update the screen through paintevent of modal window every 10 seconds.
    If there are many GUI elements in the parent window(Ex. chart data), the modal window updated every 10 seconds is delayed to 100 seconds.
    I want to improve the paintevent speed of modal window
    Does paintevent in modal window also redraw the gui in parent window?
    My modal window has transparency property.
    Thank you for reading my poor English.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4

      For starters: don't update your progress information hundreds of time per second, it adds no valuable information that fast and just burn CPUs.

      The transparency will also require work since the layer underneath is being modified.

      You can also make the update to the widgets below smarter by either handling data per batch rather than continuously, block their updates while the data is being loaded or a mix of both.

      It will also depend on how you are feeding the data to the model.

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

      L 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        Are you doing custom painting ?
        What is happening in that dialog of yours ?
        What happens to the main application while you are showing that dialog ?

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

        L 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Are you doing custom painting ?
          What is happening in that dialog of yours ?
          What happens to the main application while you are showing that dialog ?

          L Offline
          L Offline
          LISP
          wrote on last edited by
          #3

          @SGaist Hi!

          The main application has charts and grids.
          The Modal window does the job of displaying an indeterminate progress bar.

          In my Modal window, QTimer calls update every 10 ms (not 10 sec).
          update automatically calls the overridden paintevent.

          I did the test.

          [Modal window]
          In the paintevent function, there is only one line of code that prints the time.
          QDateTime::currentDateTime().Tostring("mm:ss.zzz")

          [Main window]
          Open the Modal window and add series and data to the chart.
          When data addition is completed, the modal window is closed.

          [1] When there is no or little data in the chart, the time value of paintevent in the modal window is approximately 10ms interval.

          [2] When there are a lot of series and data in the chart, the time value of paintevent in the modal window is approximately 100ms

          What causes the speed difference?
          Is it because the graphic elements of the main window behind the Model window are also redrawn?
          I know that graphic elements can be processed only in the main thread.
          Can't it be split into a different thread?

          In case of [2], progress is slow.
          I always want the progress to run at the same speed.
          Any good ideas?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            For starters: don't update your progress information hundreds of time per second, it adds no valuable information that fast and just burn CPUs.

            The transparency will also require work since the layer underneath is being modified.

            You can also make the update to the widgets below smarter by either handling data per batch rather than continuously, block their updates while the data is being loaded or a mix of both.

            It will also depend on how you are feeding the data to the model.

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

            L 1 Reply Last reply
            0
            • SGaistS SGaist

              For starters: don't update your progress information hundreds of time per second, it adds no valuable information that fast and just burn CPUs.

              The transparency will also require work since the layer underneath is being modified.

              You can also make the update to the widgets below smarter by either handling data per batch rather than continuously, block their updates while the data is being loaded or a mix of both.

              It will also depend on how you are feeding the data to the model.

              L Offline
              L Offline
              LISP
              wrote on last edited by
              #5

              @SGaist Thank you for all your assistance

              1 Reply Last reply
              0

              • Login

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