Menu

Replace WIN32 with Q_OS_WIN

Pavel
2015-06-17
2015-06-18
  • Pavel

    Pavel - 2015-06-17

    I tried to use the new Qt signal-slot syntax (lambda):

    QString error;
    QObject::connect (PythonQt::self(), &PythonQt::pythonStdErr, [&error] (const QString & err) {error += err;});

    but connection failed with this run-time error (not compile-time):
    QObject::connect: signal not found in PythonQt

    Meanwhile, old syntax worked fine.

    The problem was inside PythonQtSystem.h. When I replaced WIN32 with Q_OS_WIN, lambda-connections started working as expected.

    I'm using Qt 5.4.1 (MinGW) and newest PythonQt (r399).

     
  • Florian Link

    Florian Link - 2015-06-18

    I think PythonQt has not been used with Mingw a lot...
    Probably WIN32 is not set at all, so other parts of PythonQt might also not work correctly on Mingw. Using the Qt defines is a good idea, I will change that.

     
    • Pavel

      Pavel - 2015-06-18

      I think PythonQt has not been used with Mingw a lot
      Sure. In docs you've written that if someone wants to use PythonQt with MinGW he needs to compile Python from sources.

      Quote: "On Windows, the (non-source) Python Windows installer can be used. Make sure that you use the same compiler as the one that your Python distribution is built with. If you want to use another compiler, you will need to build Python yourself, using your compiler." http://pythonqt.sourceforge.net/Building.html

      But I built PythonQt with MinGW using pre-built Python binaries (compiled with VS2008). In short, I linked PythonQt with Python/libs/libpython27.a. I can elaborate if someone is interested.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.