On Thursday 20 December 2007, Noam Raphael wrote: > Hello, > > I created a simple program which uses QAbstractTableModel to display a > table with 1000x1000 cells. It works, but if I enlarge the window and > scroll a little bit the memory consumption of the program jumps to the > skies (If I weren't careful, my system would have stuck.) > > Here's the program. I'm using PyQt 4.3-2ubuntu7 on Ubuntu 7.10. > > ========================== > #!/usr/bin/env python > > import sys > from PyQt4 import QtCore, QtGui > from PyQt4.QtCore import Qt > > class TableModel(QtCore.QAbstractTableModel): > def rowCount(self, index): > return 1000 > > def columnCount(self, index): > return 1000 > > def data(self, index, role): > return QtCore.QVariant(str((index.row(), index.column()))) > > def headerData(self, col, orientation, role): > if orientation == Qt.Horizontal and role == Qt.DisplayRole: > return QtCore.QVariant(str(col)) > if orientation == Qt.Vertical and role == Qt.DisplayRole: > return QtCore.QVariant(str(col)) > return QtCore.QVariant() > > > def main(): > app = QtGui.QApplication(sys.argv) > > model = TableModel() > tableView = QtGui.QTableView() > tableView.setModel(model) > > tableView.show() > sys.exit(app.exec_()) > > if __name__ == '__main__': > main() > ========================== > > Is there some way I can solve this?
Works fine for me with current versions. Phil _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt