[PyKDE] tableview and model

David Boddie david at boddie.org.uk
Sun Feb 26 14:26:18 GMT 2006


On Sat, 25 Feb 2006 17:12:58, Olivier Fournier wrote:

> It's what I 've write in first but it's doen't work
> model is a locale  variable for my __init__ classe.

This class works for me:

from PyQt4.QtCore import QObject
from PyQt4.QtGui import QStandardItemModel, QTableView

class A(QObject):
  def __init__(self):
    QObject.__init__(self)
    self.tableView = QTableView()
    model = QStandardItemModel(3, 3, self)
    self.tableView.setModel(model)
    self.tableView.show()

Note that the A class is a subclass of QObject and that I call the
QObject's __init__ method from my __init__ method.

Hope this helps,

David




More information about the PyQt mailing list