<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">You have two large culprits here:<div><br class="webkit-block-placeholder"></div><div>tv.resizeColumnsToContents()</div><div><br class="webkit-block-placeholder"></div><div>and</div><div><br class="webkit-block-placeholder"></div><div><div>for row in xrange(nrows):</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tv.setRowHeight(row, 18)</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>Both can take a very long period of time.</div><div><br class="webkit-block-placeholder"></div><div>resizeColumnsToContents is the worst offender as it has to scan every piece of data in your column, determine its size and populate the internal arrays. &nbsp;It is better to have a heuristic for this and set the sizes yourself (look at horizontalHeader() for instance)</div><div><br class="webkit-block-placeholder"></div><div>For row height, see the QTableView::sizeHintForRow()</div><div><br></div><div><br class="webkit-block-placeholder"></div><div><div>On Dec 20, 2007, at 7:20 PM, B Clowers wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I am fairly new to python and programming as a whole and would like to develop a small application capable of plotting simple 2D graphs and also display such data in a table.&nbsp; In my initial assessment of PyQt4 I have been able to load my data into a table but it is terribly slow.&nbsp; I am using a QAbstractTableModel example that I found on the web:<br><br><a href="http://iwiwdsmi.blogspot.com/2007/12/pyqt-43-qtableview-qabstracttable-model.html">http://iwiwdsmi.blogspot.com/2007/12/pyqt-43-qtableview-qabstracttable-model.html</a><br><br>This has been useful but if I load a large numpy array (5 x 250,000) into this example it is insanely slow.&nbsp; It seems as though there was a "bigtable.py" example for PyQt3 but I cannot seem to port this to version 4.&nbsp; The Qt website also discusses the use of large tables when programming C++ but this is out of my league.&nbsp; Does anyone have a simple solution to this problem or perhaps a quick example that I can insert a numpy array into?&nbsp; Again, I'm pretty new to python but am eager to learn.&nbsp; <br><br>Cheers,<br><br>Brian<br><div>        <br class="webkit-block-placeholder"></div><hr size="1">Never miss a thing.  <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a> _______________________________________________<br>PyQt mailing list &nbsp;&nbsp;&nbsp;PyQt@riverbankcomputing.com<br>http://www.riverbankcomputing.com/mailman/listinfo/pyqt</blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">======</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Brian Kelley</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OpenEye Scientific Software Inc.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">American Twine Office Park</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">222 3rd Street Suite 3120</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Cambdridge, MA 02142</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">+1 617 374-8844</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:kelley@eyesopen.com"><span class="Apple-style-span" style="color: rgb(0, 0, 238); -khtml-text-decorations-in-effect: underline; ">kelley@eyesopen.com</span></a></div></div><br class="Apple-interchange-newline"></span> </div><br></div></body></html>