[PyQt] causes self to be owned by Qt instead of PyQt ???

Phil Thompson phil at riverbankcomputing.com
Thu Apr 2 18:33:55 BST 2015


On 02/04/2015 5:38 pm, Baz Walter wrote:
> On 02/04/15 17:18, Andreas Pakulat wrote:
>> On Thu, Apr 2, 2015 at 3:18 PM, redstone-cold <redstone-cold at 163.com> 
>> wrote:
>>> 
>>> Ok, this is the example
>>> https://bpaste.net/show/a5b2b50e5052
>>> 
>>> BTW,if you comment print(model.parent()),then console show
>>> QObject::startTimer: QTimer can only be used with threads started 
>>> with
>>> QThread
>>> 
>>> what's wrong in the code ?
>> 
>> QAbstractItemModel.parent() require an argument, so calling it without 
>> an
>> argument is a bug.
>> 
>> And the message is printed regardless of wether the print is there or 
>> not,
>> thats likely an internal issue in Qt.
> 
> QAbstractItemModel.parent(QModelIndex) overloads QObject.parent(), so
> it is a bug in PyQt4/5 that it doesn't support the latter.

Eh? The QAbstractItemModel parent() hides the QObject parent().

Phil


More information about the PyQt mailing list