Hello Phil,
i have detected other problem with clases inheriting from a abstract qt subclass and a python subclass. Here you have sample code. it gives me this error when i click the button.

TypeError: QAbstractItemModel.rowCount() is abstract and cannot be called as an unbound method

---- CODE ----

# -*- coding: utf-8 -*-
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *

class TestPythonClass(object):
    def __init__(self):
        pass

    def rowCount(self):
        return 1

class TestSubClass(QAbstractTableModel, TestPythonClass):
    def __init__(self, parent):
        super(TestSubClass, self).__init__()
        TestPythonClass.__init__(self)

class TestWidget(QWidget):
    def __init__(self, parent):
        super(TestWidget, self).__init__()
        self.model = TestSubClass(self)

        self.button = QPushButton("test")
        self.connect(self.button, SIGNAL("clicked()"), self.model.rowCount)

        layout = QVBoxLayout()
        layout.addWidget(self.button)
        self.setLayout(layout)


def main():
    app = QApplication(sys.argv)

    widget = TestWidget(None)
    widget.show()
    return app.exec_()

if __name__ == "__main__":
    main()

---- CODE ----
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to