[Development] QMetaType and non-const references

Thiago Macieira thiago.macieira at intel.com
Wed Jul 20 16:45:07 CEST 2022

On Tuesday, 19 July 2022 23:03:15 PDT Ulf Hermann wrote:
> We don't only use signals and slots in QML. We can also invoke methods
> directly using QMetaObject::invokeMethod() and friends. And we call
> property write accessors. Being able to encode references and rvalue
> references in QMetaType could be useful for such a case. It doesn't have
> to be exposed in public API yet, but it should be possible to add it later.

I see. 

In https://codereview.qt-project.org/c/qt/qtbase/+/422210, I added a test to 
tst_qmetaobject to prove that this works -- because it was already in use in 
Qt (tst_qdbusinterface). So with Q_ARG you can already do it.

But if you scroll to the end of the series[1][2], it became ugly again. That's 
why I am asking what people may want to use this for, so I can decide how to 

[1] https://codereview.qt-project.org/c/qt/qtbase/+/422745/1/tests/auto/
[2] https://codereview.qt-project.org/c/qt/qtbase/+/422746/1/src/corelib/

Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering

More information about the Development mailing list