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. How to draw and correctly animate progress bar in QTableView?
Forum Updated to NodeBB v4.3 + New Features

How to draw and correctly animate progress bar in QTableView?

Scheduled Pinned Locked Moved General and Desktop
qtableviewqprogressbarprogress bar
23 Posts 4 Posters 19.6k 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.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by mrjj
    #21

    @hamov said:

    Also found out the same effect can happen by simply call
    m_model->reset() from main window.
    But that is bad for a tree since it resets all open states etc.

    I think one is to use the

    void	dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles = QVector<int> ())
    

    From (inside?) the model for optimized redrawing.

    I agree with you.
    Repaint should still repaint even if model is not dirty. Also it redraws on mousemove even
    model is not changed so a bit odd that it then ignores direct repaints .

    You are right.
    I guess we can add to the conclusion
    that if you have no data/very static , the Item-based ListWidget might work better (?)

    update:
    ListWidget suffer the same. update/repaint does nothing.
    So not sure how one would go about asking it to redraw.

    H 1 Reply Last reply
    0
    • mrjjM mrjj

      @hamov said:

      Also found out the same effect can happen by simply call
      m_model->reset() from main window.
      But that is bad for a tree since it resets all open states etc.

      I think one is to use the

      void	dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles = QVector<int> ())
      

      From (inside?) the model for optimized redrawing.

      I agree with you.
      Repaint should still repaint even if model is not dirty. Also it redraws on mousemove even
      model is not changed so a bit odd that it then ignores direct repaints .

      You are right.
      I guess we can add to the conclusion
      that if you have no data/very static , the Item-based ListWidget might work better (?)

      update:
      ListWidget suffer the same. update/repaint does nothing.
      So not sure how one would go about asking it to redraw.

      H Offline
      H Offline
      hamov
      wrote on last edited by
      #22

      @mrjj
      I have tested that signal for treeview and all works fine. :-)
      Seems update()/repaint() didn't work for any widget/view. Is it a Qt bug?...or such behavior of redraw was planned by developers?!

      mrjjM 1 Reply Last reply
      0
      • H hamov

        @mrjj
        I have tested that signal for treeview and all works fine. :-)
        Seems update()/repaint() didn't work for any widget/view. Is it a Qt bug?...or such behavior of redraw was planned by developers?!

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #23

        @hamov

        well digging around, I also found
        m_list->viewport()->repaint();

        which works for WidgetList. Did not test with model/view yet.

        I think it is by design as it does redraw when data changes but we are not alone finding
        it strange working if one google it

        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