<div dir="ltr"><div>What do you mean? Should I import this module in the python context? I tried adding this line wihtout any effect:</div><div>`PyRun_SimpleString("import PyQt5.QtCore")`</div><div><br></div><div>If we're speaking about some cpp header to include, I can't see which one it is.</div><div>Thanks<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 27 août 2019 à 10:25, Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 27/08/2019 08:29, Alexis Barbot wrote:<br>
> Thanks for these replies,<br>
> <br>
> First of all, I had a look at PythonQt which indeed looked promising in <br>
> my<br>
> case. However I had toubles to build it, so I skipped that solution. <br>
> Now I<br>
> understand that this was probably caused by the compilation attempt <br>
> with<br>
> mingw while using a binary python installer, obviously compiled using <br>
> msvc.<br>
> Furthermore, I got some success with PyQt: after preparing all paths <br>
> and<br>
> adding several flags to the configure command, I could perform the <br>
> complete<br>
> build wihtout errors. I so tried to write a small piece of code to <br>
> validate<br>
> my usage. It builds correctly, but it suddenly stop while running <br>
> without<br>
> any error message. Here is the code:<br>
> <br>
> ```<br>
> #include <QDebug><br>
> #include <Python.h><br>
> #include <QDateTime><br>
> #include <sipAPIQtCore.h><br>
> #include <memory><br>
> <br>
> int main(int argc, char* argv[])<br>
> {<br>
> qDebug() << "start";<br>
> Py_Initialize();<br>
> auto d = PyDict_New();<br>
> auto test = std::make_unique<QDateTime>();<br>
> auto pyTest = sipConvertFromType(test.get(), sipType_QDateTime,<br>
> nullptr);<br>
> qDebug() << "end";<br>
> Py_FinalizeEx();<br>
> return 0;<br>
> }<br>
> ```<br>
> <br>
> It sounds like everything is installed but I'm missing some <br>
> initialization<br>
> step. Is that possible? Or maybe there's something else I should <br>
> check/try?<br>
> Many thanks for your help.<br>
<br>
You haven't imported PyQt5.QtCore.<br>
<br>
Phil<br>
</blockquote></div>