[PyQt] PyQt4 question

Detlev Offenbach detlev at die-offenbachs.de
Sun May 27 13:53:08 BST 2007


On Sonntag, 27. Mai 2007, Giovanni Bajo wrote:
> 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.

I have no idea. I had a look into edyuk, and they do it that way and it works 
there (unless there is some magic somewhere else in their code).

Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the PyQt mailing list