Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>since your QTableView inherits QWidget, you can call the following on it:</p> <pre><code>setUpdatesEnabled(false); changeAllYourData(); setUpdatesEnabled(true); </code></pre> <p>When setUpdatesEnabled is false, any paint() or update() call on it has no effect. So, you could stop it from updating, change all your data and then reenable it, possibly by manually calling paint() or update() manually on it, I'm not sure about this part.</p> <p>Here is the doc for the setUpdatesEnabled method.</p> <p><a href="http://doc.trolltech.com/4.6/qwidget.html#updatesEnabled-prop" rel="nofollow noreferrer">QWidget updatesEnabled</a></p> <p>Hope this helps.</p> <p><strong>EDIT after comment from user:</strong></p> <p>You could implement your own setUpdatesEnabled(bool) for your QItemDelegate subclass (since it does not inherit QWidget and does not have one) by testing a flag before executing your original paint() or update(). After that, you could specify for every cell (or row or column) of your QTableView if they must be updated or repainted. </p> <p>By doing this, you could stop your other cells (delegates) from repainting, unless you change the setUpdatesEnabled flag you created manually, but keep the updates on your cells containing a graph.</p> <p>I must say I never tested this or anything like this, so I hope it works the way I think it does.</p> <p>Best of luck</p> <p><strong>EDIT after edit from user:</strong></p> <p>Following my previous comment, instead of setting a flag for every cell (I thought your graph was in a separate cell), you could set a flag for every delegate to paint only your graph or the whole image.</p> <p>Hope this helps,</p> <p><strong>EDIT:</strong></p> <p>I stumbled upon a new feature in Qt 4.7 (I do not know if it's possible for you to use it, but it could solve some of your problems.) The feature is QStaticText. It is a class that allows you to cache text (font and effects) and paint them faster. See the link <a href="http://doc.qt.nokia.com/4.7-snapshot/qstatictext.html" rel="nofollow noreferrer">here</a>.</p> <p>Hope it could solve your problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload