[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Pyqt 5.1.1, problem when passing enum as parameter (assetion fails)
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2013-10-25 16:31:36
Message-ID: a5d1f4bd3eefc9dfb8570290cf28873f () localhost
[Download RAW message or body]
On Mon, 21 Oct 2013 15:14:23 +0200, Julien Pauty <julien.pauty@gmail.com>
wrote:
> Hi,
>
> Using version 5.1.1 of PyQt and 4.15.3 of sip. Qt 5.1
>
> When passing an enum as an argument to a method, the following assert
> fails:
>
> siplib.c:8356: sip_api_can_convert_to_type: Assertion `(((td)->td_flags
&
> 0x0007) == 0x0000) || (((td)->td_flags & 0x0007) == 0x0002)' failed.
>
>
> With PyQt 5.0.1 we did not have this problem. Is there something special
to
> do with enums with PyQt 5.1.1 ?
No.
> Here is a small example to reproduce the problem:
>
>
> Header:
> class QDockWorkspace
> : public QWidget
> { Q_OBJECT
> public :
> QDockWorkspace(QWidget* parent,Qt::DockWidgetAreas
allowedAreas);
> virtual ~QDockWorkspace();
>
> private :
> Qt::DockWidgetAreas m_allowedAreas;
> };
>
> cc file:
> QDockWorkspace::QDockWorkspace(QWidget* parent,Qt::DockWidgetAreas
> allowedAreas)
> : QWidget(parent)
> , m_allowedAreas(allowedAreas)
> {}
>
> QDockWorkspace::~QDockWorkspace()
> {}
>
> Sip:
> class QDockWorkspace : QWidget
> {
> %TypeHeaderCode
> #include "qdockworkspace.hh"
> %End
> public :
> QDockWorkspace(QWidget* parent /TransferThis/ );//,
> Qt::DockWidgetAreas allowedAreas );
> virtual ~QDockWorkspace();
> };
>
> The python part:
> import PyQt5.Qt as qt
> application = qt.QApplication([])
> import myModule
> myModule.QDockWorkspace2(None,0)
One obvious problem is your .sip doesn't match your .cc file. Maybe you
have code from previous attempts getting mixed up.
Phil
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic