Use context object in QHttpServer::route


Use a context object and QtPrivate:makeCallableObject instead
of std::function when adding routes.

The rvalue was exchanged with a reference in the callback signature
because QMetaObject::invokeMethod is not prepared to handle rvalues.

The context object is used for two purposes, to ensure that a
rule does not outlive the context object, and also it is posssible
to use it as an object to call a member function on.

Pick-to: 6.8
Change-Id: Ibc5478f2dab77f4aa4891819b1c7743c9767849e
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
commit945a3c209c98926aae053465ac46f9c988234d19
parent86f73fed47dd8f7391c5822d482e54d56aeab23b
authorMatthias Rauter <matthias.rauter@qt.io>
committerMatthias Rauter <matthias.rauter@qt.io>
commit timeTue, 3 Sep 2024 18:21:17 +0200