The reason is that the QBitmap arg__1 argument actually should be QBitmap&& other, but the generator currently doesn't handle rvalue references.
I have added support for rvalue references in the generator based on commits (f7fb80ae, 80fef170 and 454b2eef) by Friedemann Kleint in the pyside-shiboken project (took me all summer...). The changes are found in handle-rvalue-refs.diff. With this patch applied the generated code looks fine, but compiling still fails:
I haven't managed to understand what's the problem here, but probably the wrapping made by PythonQt is not working out really, so for now my suggestion is to simply skip functions with rvalue reference arguments, see ignore-functions-with-rvalue-ref-args.diff. Applying this patch in addition to the first one makes the compilation work for me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh, that's unfortunate. I'll have a look at it, trying to come up with something. I guess long-term it would be nice to use some more recent version of the generator that's used by other projects and easier to maintain?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think PySide considers moving to a clang based parser/generator since it is really hard to maintain a cpp parser. So in the long run, we might switch to a different generator. Right now, the licencing is in the way...
I think all rvalues are inside of
Q_COMPILER_RVALUE_REFS
and I ask myself why the generator makes the Qt headers think that is supports rvalues.
I'm not sure how Q_COMPILER_RVALUE_REFS is meant to be used. Not all rvalue references in the headers are checked for that. This is an excerpt from the definition of the class QRegion in QtGui/qregion.h:
I have now made a new implementation that's focused on skipping functions with rvalue reference arguments as early as possible. The filtering is now made while building the abstract syntax tree. The code is written by me, but for example in the parser, it's difficult not to make it similar to other's implementations, because there are not so many ways to do certain things.
When building for Debian stable which has Qt 5.7 (running the generator myself), I get errors like this:
The reason is that the
QBitmap arg__1
argument actually should beQBitmap&& other
, but the generator currently doesn't handle rvalue references.I have added support for rvalue references in the generator based on commits (f7fb80ae, 80fef170 and 454b2eef) by Friedemann Kleint in the pyside-shiboken project (took me all summer...). The changes are found in
handle-rvalue-refs.diff
. With this patch applied the generated code looks fine, but compiling still fails:I haven't managed to understand what's the problem here, but probably the wrapping made by PythonQt is not working out really, so for now my suggestion is to simply skip functions with rvalue reference arguments, see
ignore-functions-with-rvalue-ref-args.diff
. Applying this patch in addition to the first one makes the compilation work for me.Here are the patches (the ones ending with "unix" have unix line endings, the other ones have Windows line endings.
I will have a look, it might take a while. I guess rvalues don't make sense together with qmake slots.
Rvalue references seem to be used for move assignment operators etc., like here for QBitmap: http://doc.qt.io/qt-5/qbitmap.html#operator-eq-1
Right, but they don't make sense from Python wrappers, so it's fine to ignore the,.
I am sorry, I can't take that patch because it is taken from PySide and thus copyrighted by the LGPL v3 while PythonQt is LGPL v2.1.
I think rvalue references don't need wrapping, so the best approach will be to remove the functions containing rvalue refs as early as possible.
Oh, that's unfortunate. I'll have a look at it, trying to come up with something. I guess long-term it would be nice to use some more recent version of the generator that's used by other projects and easier to maintain?
I think PySide considers moving to a clang based parser/generator since it is really hard to maintain a cpp parser. So in the long run, we might switch to a different generator. Right now, the licencing is in the way...
I think all rvalues are inside of
Q_COMPILER_RVALUE_REFS
and I ask myself why the generator makes the Qt headers think that is supports rvalues.
If we manage to undefine Q_COMPILER_RVALUE_REFS or to trick
http://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/global/qcompilerdetection.h
into thinking that the generator does not support rvalues, then they should be gone.
I did not have these problems with 5.7 on Windows, maybe unsetting the INCLUDE env variable helps?
I'm not sure how Q_COMPILER_RVALUE_REFS is meant to be used. Not all rvalue references in the headers are checked for that. This is an excerpt from the definition of the class QRegion in
QtGui/qregion.h
:The other places causing problems (none of them within Q_COMPILER_RVALUE_REFS ifdefs):
I see, so the define is no option.
I have now made a new implementation that's focused on skipping functions with rvalue reference arguments as early as possible. The filtering is now made while building the abstract syntax tree. The code is written by me, but for example in the parser, it's difficult not to make it similar to other's implementations, because there are not so many ways to do certain things.
Thanks, I will have a look on Monday.
Thanks for your effort, I integrated the patch into svn trunk.
Great, thanks! This was an important step towards a build that works for the folks at Debian. :)