PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 1041 - QAbstractItemModel has wrong ownership policy for selectionModel()
: QAbstractItemModel has wrong ownership policy for selectionModel()
Status: RESOLVED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: All All
: P2 normal
Assigned To: Paulo Alcantara
:
:
:
  Show dependency treegraph
 
Reported: 2011-10-31 23:44 EET by Hugo Parente Lima
Modified: 2012-01-11 22:47 EET (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hugo Parente Lima 2011-10-31 23:44:58 EET
The following code causes a weird error maybe on type discover code.

#!/usr/bin/env python

from PySide import QtGui, QtCore
import sys

class TreeWidget(QtGui.QWidget):
    def __init__(self, parent=None):
        super(TreeWidget, self).__init__(parent)
        self.view = QtGui.QTreeView(self)
        self.count = 0
        self.make_view()

    def make_view(self):
        self._model = QtGui.QStandardItemModel()
        self.view.setModel(self._model)
        smodel = self.view.selectionModel()
        self.count += 1
        print(self.count)
        if self.count > 100:
            QApplication.instance.quit()

    def event(self, event):
        return super(TreeWidget, self).event(event)

app = QtGui.QApplication(sys.argv)

w = TreeWidget()
w.show()

t = QtCore.QTimer()
t.timeout.connect(w.make_view)
t.start(10)

app.exec_()

Part of the fix includes the following change on typesystem (on
QAbstractItemView):

    <modify-function signature="selectionModel()">
      <modify-argument index="return">
        <!-- Defining ownership as "default" avoids the object to be
automatically
             set as parent of the returned pointer. -->
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>
Comment 1 Lauro Moura 2011-11-18 19:26:42 EET
What kind of error? Paulo found something related to QWarnings from QTimers
being deleted twice (see [1]).

[1] https://bugreports.qt.nokia.com/browse/QTBUG-16175
Comment 2 Nathan 2011-11-18 22:42:54 EET
Without the type system change for QAbstractItemView, QItemSelectionModel
instances begin to be delivered to the TreeWidget.event method rather than
instances of QEvent.  My hypothesis was that the following chain of events was
occurring:

1. A QItemSelectionModel object was deleted in C++ but its wrapper was not
removed from the Python object map.
2. A new object (QEvent in this case) was created who's memory address just so
happens to land on the deleted QItemSelectionModel address.  This fooled
PySide/Shiboken into thinking that the old QItemSelectionModel wrapper object
was a wrapper for the new QEvent object, and so delivered the
QItemSelectionModel wrapper to the Python TreeWidget.event method.

The type system code included in the original bug post changes the ownership of
the QItemSelectionModel instance returned from
QAbstractItemView.selectionModel() to match that of the ownership on the
QAbstractItemModel returned from QAbstractItemView.model().

This error occurs without the QTimer, but it relies on chance and thus doesn't
always occur.  The QTimer was added to the code to make it show up
*eventually*.

The first error is:

Traceback (most recent call last):
  File "test.py", line 22, in event
    return super(TreeWidget, self).event(event)
TypeError: 'PySide.QtGui.QWidget.event' called with wrong argument types:
  PySide.QtGui.QWidget.event(PySide.QtGui.QItemSelectionModel)
Supported signatures:
  PySide.QtGui.QWidget.event(PySide.QtCore.QEvent)


Followed by:

Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelAboutToBeReset()
Comment 3 Stefan Champailler 2012-01-06 09:47:36 EET
Hello, I came across something similar :

My best explanation is that the selection model is not
created by PySide but inside Qt. Therefore, somehow, PySide
can't get a hold of it and can't handle its destruction
properly, leaving to leaks...

I use : 
- python 2.7.2
- PySide-1.0.5qt473-py2.7
- Windows XP

Thank you,

Stefan


----------------------------------- logs follows



import sys
from PySide.QtGui import *
from PySide.QtCore import *

class BugWindow(QMainWindow):
    def __init__(self):
        super(BugWindow,self).__init__()

        # First (not so important) question : who has ownership
        # on the table here ? Python or Qt ? Qt doc says
        # that QMainWindow takes ownership of the table but since
        # we're in a subclass then, who has ownership ? The
        # subclass (and thus Python) or the parent class ?

        self.setCentralWidget(QTableView())

        # We're going to call test_bug() often and until death
        # It's just one way of doing this

        self.timer = QTimer(self)
        self.timer.timeout.connect(self.test_bug)

        # Adapt this to the performance of your system if needed
        # to make sure you exit test_bug() before it is called
        # again.

        self.timer.start(20) 

    @Slot()
    def test_bug(self):

        # First, create a new model ----------------------------------------

        # If there was a model in self.m before, it is now
        # ready for garbage collection => if something
        # happens now on the table that requires access
        # to the model, we're in for a possible bug 

        # parent is None => ownership by Python (and then
        # destruction when leaving this method) ?

        self.m = QStandardItemModel(1,1,None) 


        # Set the table's model --------------------------------------------

        table = self.centralWidget()

        # A new selection model is associated by Qt to the model, cf Qt. doc
        # Question is : what happened to the previous selection model ?

        table.setModel(self.m) # model's ownership is left unchanged, cf. Qt
doc.

        # Here, I expect the old model to be definitely
        # lost (it is not in self.m anymore and it is
        # not referenced by the table anymore). Therefore
        # the model can be garbage collected by Python.

        # But for some reason, adding this line makes the
        # program crash after a few calls to test_bug()

        table.selectionModel()

        # Interestingly, the following line doesn't crash
        # However, it sounds normal. By setting the parent
        # to None, I guess the ownership is transferred
        # from Qt (which created the selection model) to
        # Python (question is : is my guess right ?)

        # table.selectionModel().setParent(None)

        print "go !"


app = QApplication(sys.argv)
window = BugWindow()
window.show()
app.exec_()






C:\PORT-STC\pl\ECLIPS~1\PL\src>python bug.py
go !
go !
go !
go !
go !
go !
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Error calling slot "test_bug"
Traceback (most recent call last):
  File "bug.py", line 71, in test_bug
    table.setModel(self.m) # model's ownership is left unchanged, cf. Qt doc.
AttributeError: 'PySide.QtGui.QItemSelectionModel' object has no attribute
'rowCount'
Object::disconnect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::disconnect: No such signal
QItemSelectionModel::layoutAboutToBeChanged()
Object::disconnect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::disconnect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::disconnect: No such signal QItemSelectionModel::modelReset()
Object::disconnect: No such signal QItemSelectionModel::layoutChanged()
Object::disconnect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::disconnect: No such signal
QItemSelectionModel::layoutAboutToBeChanged()
Object::disconnect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::disconnect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::disconnect: No such signal QItemSelectionModel::modelReset()
Object::disconnect: No such signal QItemSelectionModel::layoutChanged()
Object::disconnect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::disconnect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::disconnect: No such signal QItemSelectionModel::modelReset()
Object::disconnect: No such signal QItemSelectionModel::layoutChanged()
go !
go !
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Error calling slot "test_bug"
Traceback (most recent call last):
  File "bug.py", line 71, in test_bug
    table.setModel(self.m) # model's ownership is left unchanged, cf. Qt doc.
AttributeError: 'PySide.QtGui.QItemSelectionModel' object has no attribute
'rowCount'
Object::disconnect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::disconnect: No such signal
QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::disconnect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::disconnect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::disconnect: No such signal QItemSelectionModel::modelReset()
Object::disconnect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::disconnect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::disconnect: No such signal
QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::disconnect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::disconnect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::disconnect: No such signal QItemSelectionModel::modelReset()
Object::disconnect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::disconnect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::disconnect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::disconnect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::disconnect: No such signal QItemSelectionModel::modelReset()
Object::disconnect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::dataChanged(QModelIndex,QModelIndex)
Object::connect: No such signal
QItemSelectionModel::headerDataChanged(Qt::Orientation,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::modelReset()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeRemoved(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::rowsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal
QItemSelectionModel::columnsAboutToBeInserted(QModelIndex,int,int)
Object::connect: No such signal QItemSelectionModel::layoutAboutToBeChanged()
Object::connect: No such signal QItemSelectionModel::layoutChanged()
Error calling slot "test_bug"
Traceback (most recent call last):
  File "bug.py", line 71, in test_bug
    table.setModel(self.m) # model's ownership is left unchanged, cf. Qt doc.
AttributeError: 'PySide.QtGui.QItemSelectionModel' object has no attribute
'rowCount'
^C
C:\PORT-STC\pl\ECLIPS~1\PL\src>
Comment 4 Nathan 2012-01-06 23:17:31 EET
I was able to reproduce Stefan's bug with PySide 1.0.8 and 1.0.9.  Both
Stefan's bug and mine are also reproducable with the latest version of code on
github (as of 2011-01-06).
Comment 5 Hugo Parente Lima 2012-01-09 18:02:07 EET
Changing the status to NEW, the Qt bug was fixed so it it really blocked
something is doesn't block anymore
Comment 6 Nathan 2012-01-09 22:16:23 EET
I am running Qt 4.7.4 (one of the two versions that received the QTimer bug
fix) and PySide latest (as of 2011-01-06) and can confirm that this bug still
exists.
Comment 7 Paulo Alcantara 2012-01-11 22:47:48 EET
Hi,

Thanks for the report and tests!

Fixed on PySide commit a50e42645e01662db3875e5872e84ca80ed84464.