<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div><div>Using version 5.1.1 of PyQt and 4.15.3 of sip. Qt 5.1<br></div><div><br></div>When passing an enum as an argument to a method, the following assert fails: <br><br>
siplib.c:8356: sip_api_can_convert_to_type: Assertion `(((td)->td_flags & 0x0007) == 0x0000) || (((td)->td_flags & 0x0007) == 0x0002)' failed.<br><br><br></div><div>With PyQt 5.0.1 we did not have this problem. Is there something special to do with enums with PyQt 5.1.1 ? <br>
</div><div><br></div><div>Here is a small example to reproduce the problem:<br></div><div><br><br></div><div>Header:<br></div>class QDockWorkspace<br>: public QWidget<br>{ Q_OBJECT<br> public :<br> QDockWorkspace(QWidget* parent,Qt::DockWidgetAreas allowedAreas);<br>
virtual ~QDockWorkspace();<br><br> private :<br> Qt::DockWidgetAreas m_allowedAreas;<br>};<br><br>cc file:<br>QDockWorkspace::QDockWorkspace(QWidget* parent,Qt::DockWidgetAreas allowedAreas)<br>: QWidget(parent)<br>
, m_allowedAreas(allowedAreas)<br>{}<br><br>QDockWorkspace::~QDockWorkspace()<br>{}<br><br></div>Sip:<br>class QDockWorkspace : QWidget<br>{<br>%TypeHeaderCode<br>#include "qdockworkspace.hh"<br>%End<br> public :<br>
QDockWorkspace(QWidget* parent /TransferThis/ );//, Qt::DockWidgetAreas allowedAreas );<br> virtual ~QDockWorkspace();<br>};<br><br></div><div>The python part:<br>import PyQt5.Qt as qt<br>application = qt.QApplication([])<br>
import myModule<br>myModule.QDockWorkspace2(None,0)<br></div><div><br></div>Cheers,<br><br></div>Julien<br></div>