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. QTableView and double buffering?
Qt 6.11 is out! See what's new in the release blog

QTableView and double buffering?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 1.2k Views 3 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.
  • davecotterD Offline
    davecotterD Offline
    davecotter
    wrote on last edited by
    #1

    I was under the impression that QWidgets (ergo QTableView) would use double buffering to avoid having to do expensive redraws.

    but i find it calling paint events when i'm just browsing the menu bar (windows)
    or even just hovering the mouse (there are no mouseover calls, so no bits are changing, yet it is continuously redrawing items in the table)

    how can i make it stop?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      Qwidget::setUpdatesEnabled(bool enable) ?

      1 Reply Last reply
      0
      • davecotterD Offline
        davecotterD Offline
        davecotter
        wrote on last edited by
        #3

        that is unrelated to double buffering

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

          Hi,

          AFAIR no the raster engine does not. Update calls are compressed though.

          [edit: mixed double buffering with a different technique SGaist]

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

          1 Reply Last reply
          0
          • davecotterD Offline
            davecotterD Offline
            davecotter
            wrote on last edited by
            #5

            is there a bit i can flip that says "please doublebuffer this" so redraws (no model changes) can blit from the buffer and not ask all the widgets to do their (very expensive) drawing?

            1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on last edited by
              #6

              The manual says that double-buffering is on by default. I guess standard QTableView could be doing something that defeats the caching: not seen this myself.

              The fact that you have overloaded the view's paintEvent() (or you would not be seeing this) makes it possible there's something odd you are doing. Is your overload accidentally triggering further updates? Are there delegates involved?

              It's also possible the underlying model may be doing something odd, triggering frequent update() calls.
              What is your model doing? Does the behaviour persist if you put a static QStandardItemModel in the view?

              1 Reply Last reply
              1
              • davecotterD Offline
                davecotterD Offline
                davecotter
                wrote on last edited by
                #7

                it's possible further updates are triggered, though it's certainly not supposed to do that. i'll investigate that.
                yes there are item delegates involved.
                not sure what you're asking with "what is your model doing". it's an SQLite table.
                i'm not able to simply replace what i'm doing with a QStandardItemModel, that would take weeks of work.
                thanks for the ideas.

                but doesn't it seem strange that simply BROWSING THE MENU BAR would cause paint events instead of blit-from-double-buffer? also: only when the table has focus. if another view has focus, no paint events are triggered, even when the menus overlap the same areas.

                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