[PyQt] PyQt4 question

Giovanni Bajo rasky at develer.com
Sun May 27 13:48:10 BST 2007


On 27/05/2007 13.37, Detlev Offenbach wrote:

>>> -------------------------------------------------------------------------
>>> -- - class QDesignerFormEditorPluginInterface
>>> {
>>>
>>> %TypeHeaderCode
>>> #include <abstractformeditorplugin.h>
>>> %End
>>>
>>> public:
>>>     virtual ~QDesignerFormEditorPluginInterface();
>>>
>>>     virtual bool isInitialized() const = 0;
>>>     virtual void initialize(QDesignerFormEditorInterface *core) = 0;
>>>     virtual QAction *action() const = 0;
>>>
>>>     virtual QDesignerFormEditorInterface *core() const = 0;
>>> };
>>> -------------------------------------------------------------------------
>>> --
>> What RTTI is available for the code to determine what the class really is?
>> I can't see anything that is obviously suitable - in which case you are
>> stuck.
>>
> 
> In a C++ program one would do it with this statement
> 
> qobject_cast<QDesignerFormEditorPluginInterface*>(object)
> 
> where object is a pointer to a QObject. If the conversion code would be in 
> QObject.sip, one could probably use the inherits() method of QObject.

Uh? Does QDesignerFormEditorPluginInterface inherit from QObject? Otherwise, I 
can't see how the qobject_cast can work.
-- 
Giovanni Bajo



More information about the PyQt mailing list