<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Brett,</p>
<p>Many thanks for the Test file link. That is really an interesting
source of information. I looked in examples but not in tests.<br>
</p>
<p>My lone problem was I didn't know the optional
Q_RETURN_ARG(QRemoteObjectPendingCall, call) required when wanted
return value, and i didn't find information about a return value
in the metamethod (RO seems to remove the ReturnValueType)<br>
</p>
<p>At my knowledge, this information is missing in documentation.</p>
<p>I have now everything working in C++ but how is exposed this
QRemoteObjectPendingCall in QML ? with a PendingReply ?</p>
<p>Is there an example of that also (calling a slot with pending
value on a dynamic replica from qml) ? <br>
</p>
<p>Cordially.</p>
<p>Daes<br>
</p>
<br>
<div class="moz-cite-prefix">Le 08/08/2019 à 21:37, Stottlemyer,
Brett (B.S.) a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:%3C74cad6ca572744089d93c4a6103c0d70@ford.com%3E">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
code
{mso-style-priority:99;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle21
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">The
constructor is private because you aren’t intended to create
the dynamic replica directly, you must get it from a node.
The object won’t be valid until it receives an initial state
from a source in another node, so the nodes must be
connected together.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">See:
</span><a
href="https://code.woboq.org/qt5/qtremoteobjects/src/remoteobjects/qremoteobjectnode.h.html#_ZN17QRemoteObjectNode14acquireDynamicERK7QString"
moz-do-not-send="true">https://code.woboq.org/qt5/qtremoteobjects/src/remoteobjects/qremoteobjectnode.h.html#_ZN17QRemoteObjectNode14acquireDynamicERK7QString</a><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Once
the node is initialized, you can use Qt’s introspection
methods to understand the properties, signals and slots
available.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">A
usage example can be found in the tests, here:<o:p></o:p></span></p>
<p class="MsoNormal"><a
href="https://code.woboq.org/qt5/qtremoteobjects/tests/auto/integration/tst_integration.cpp.html#_ZN15tst_Integration22slotTestDynamicReplicaEv"
moz-do-not-send="true">https://code.woboq.org/qt5/qtremoteobjects/tests/auto/integration/tst_integration.cpp.html#_ZN15tst_Integration22slotTestDynamicReplicaEv</a><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Using
dynamica replicas is available, but is generally much more
difficult than using repc. So repc is certainly recommended
for most use-cases.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Brett<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">
Interest <a class="moz-txt-link-rfc2396E" href="mailto:interest-bounces@qt-project.org"><interest-bounces@qt-project.org></a>
<b>On Behalf Of </b>Daesdemon<br>
<b>Sent:</b> Thursday, August 8, 2019 3:03 PM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:interest@qt-project.org">interest@qt-project.org</a><br>
<b>Subject:</b> [Interest] QRemoteObjectDynamicReplica:
How get a slot return value?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi Qt people,<o:p></o:p></p>
<p>I have been advised to post this kind of question on the
maillist instead of forum. If it is the wrong place, please,
forgive me.<o:p></o:p></p>
<p>After digging in REPC generated code and RO sources, i found
there is some "kind of magic" in the REPC code:<o:p></o:p></p>
<p> - The call of returning value slot in REPC generated
object use the protected
<code><span style="font-size:10.0pt">sendWithReply</span></code>
function of QRemoteObjectReplica (async call, returning a kind
of future object:
<code><span style="font-size:10.0pt">QRemoteObjectPendingReply<T>
with T of the ReturnType of the slot)</span></code><o:p></o:p></p>
<p>The problem is that the QRemoteObjectDynamicReplica have no
public constructor, so no way to use this function even by
derivation.<o:p></o:p></p>
<p>The slot signature in the dynamic replica metaobject also has
no functor parameter to get the return value async. In fact
the signature even loose the ReturnValue Type.<o:p></o:p></p>
<p>So how could we get a slot return value from a dynamic
Replica ?<o:p></o:p></p>
<p>If there is no way (without re-coding a large part) to do
this, I find this lack of feature really troublesome in my
case, where the main spec is to have no use of REPC.<o:p></o:p></p>
<p>A subsidiary question could be : Why is the <code><span
style="font-size:10.0pt">QRemoteObjectDynamicReplica(QRemoteObjectNode
*node, const QString &name)</span></code> constructor
private ?<o:p></o:p></p>
<p>If public, it would allow to overload acquireDynamic in
QRemoteObjectNode and extend QRemoteObjectDynamicReplica by
derivation, for, in this case, expose internally the
sendAndReply function.<o:p></o:p></p>
<p>However the lack of the return value type would still be a
problem. <o:p></o:p></p>
<p>I understand principle of encapsulation but i am in dead-end
there.<o:p></o:p></p>
<p>If someone had a clue, i'll take it gratefully.<o:p></o:p></p>
</div>
</blockquote>
</body>
</html>