[PyQt] causes self to be owned by Qt instead of PyQt ???
redstone-cold
redstone-cold at 163.com
Fri Apr 3 12:12:26 BST 2015
reported here https://bugreports.qt.io/browse/QTBUG-45393
在2015年04月03 16时19分, "Phil Thompson"<phil at riverbankcomputing.com>写道:
On 02/04/2015 11:54 pm, Baz Walter wrote:
> On 02/04/15 23:01, Andreas Pakulat wrote:
>> Hi Phil,
>>
>> On Thu, Apr 2, 2015 at 11:11 PM, Phil Thompson
>> <phil at riverbankcomputing.com>
>> wrote:
>>>
>>> So the attached C++ code should compile?
>>
>> Not without a fix for qfilesystemmodel.h. qabstractitemmodel.h as well
>> as
>> qstandarditemmodel.h (and probably other qaim subclasses in qt)
>> explicitly
>> 'reuse' QObject::parent using something like:
>>
>> #ifdef Q_NO_USING_KEYWORD
>> inline QObject *parent() const { return QObject::parent(); }
>> #else
>> using QObject::parent;
>> #endif
>>
>> For qfilesystemmodel.h this is missing and hence one cannot call
>> QObject::parent() with a pointer or instance of it.
>
> Huh. So is it a Qt bug, then? Seems a little strange that it has gone
> unnoticed for so long (since at least 4.7). But maybe there's a
> specific reason why QFileSystemModel is be treated differently to all
> the other model classes.
>
> Looks like Q_NO_USING_KEYWORD has been completely removed in Qt-5.5,
> but obviously that didn't touch qfilesystemmodel.h, so parent() is
> still missing there.
...so it's not a PyQt bug :)
Phil
_______________________________________________
PyQt mailing list PyQt at riverbankcomputing.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150403/58525a57/attachment.html>
More information about the PyQt
mailing list