Re: Advices on embedding python in Qt/C++ application

Alexis Barbot <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <CAFXj0vqgTKqnHR5OXymtvL7Sc_P+u3ZEiY44fc0F-wNYdMANbQ@mail.gmail.com>
What do you mean? Should I import this module in the python context? I
tried adding this line wihtout any effect:
`PyRun_SimpleString("import PyQt5.QtCore")`

If we're speaking about some cpp header to include, I can't see which one
it is.
Thanks

Le mar. 27 août 2019 à 10:25, Phil Thompson <[email protected]> a
écrit :

> On 27/08/2019 08:29, Alexis Barbot wrote:
> > Thanks for these replies,
> >
> > First of all, I had a look at PythonQt which indeed looked promising in
> > my
> > case. However I had toubles to build it, so I skipped that solution.
> > Now I
> > understand that this was probably caused by the compilation attempt
> > with
> > mingw while using a binary python installer, obviously compiled using
> > msvc.
> > Furthermore, I got some success with PyQt: after preparing all paths
> > and
> > adding several flags to the configure command, I could perform the
> > complete
> > build wihtout errors. I so tried to write a small piece of code to
> > validate
> > my usage. It builds correctly, but it suddenly stop while running
> > without
> > any error message. Here is the code:
> >
> > ```
> > #include <QDebug>
> > #include <Python.h>
> > #include <QDateTime>
> > #include <sipAPIQtCore.h>
> > #include <memory>
> >
> > int main(int argc, char* argv[])
> > {
> >     qDebug() << "start";
> >     Py_Initialize();
> >     auto d = PyDict_New();
> >     auto test = std::make_unique<QDateTime>();
> >     auto pyTest = sipConvertFromType(test.get(), sipType_QDateTime,
> > nullptr);
> >     qDebug() << "end";
> >     Py_FinalizeEx();
> >     return 0;
> > }
> > ```
> >
> > It sounds like everything is installed but I'm missing some
> > initialization
> > step. Is that possible? Or maybe there's something else I should
> > check/try?
> > Many thanks for your help.
>
> You haven't imported PyQt5.QtCore.
>
> Phil
>

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.