<?xml version="1.0" encoding="UTF-8"?>
<db:article xmlns:db="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.2" xml:lang="en">
<db:info>
<db:title>TestClass Class</db:title>
<db:productname>OverloadedSignalsSlots</db:productname>
<db:titleabbrev>Test for overloaded signals and slots documentation</db:titleabbrev>
<db:abstract>
<db:para>Test class for overloaded signals and slots.</db:para>
</db:abstract>
</db:info>
<db:variablelist>
<db:varlistentry>
<db:term>Header</db:term>
<db:listitem>
<db:para>TestClass</db:para>
</db:listitem>
</db:varlistentry>
<db:varlistentry>
<db:term>Inherits</db:term>
<db:listitem>
<db:para/>
</db:listitem>
</db:varlistentry>
</db:variablelist>
<db:section xml:id="details">
<db:title>Detailed Description</db:title>
<db:para>This class tests QDoc's generation of connection snippets for overloaded signals and slots.</db:para>
</db:section>
<db:section xml:id="member-function-documentation">
<db:title>Member Function Documentation</db:title>
<db:section xml:id="TestClass">
<db:title>[explicit] TestClass::TestClass(QObject *<db:emphasis>parent</db:emphasis> = nullptr)</db:title>
<db:para>Constructs a <db:link xlink:href="testclass.xml">TestClass</db:link> with the given <db:code role="parameter">parent</db:code>.</db:para>
</db:section>
<db:section xml:id="dataChanged">
<db:title>[signal] void TestClass::dataChanged(const QString &amp;<db:emphasis>value</db:emphasis>)</db:title>
<db:para>This signal is emitted when a string <db:code role="parameter">value</db:code> changes.</db:para>
<db:note>
<db:para>This signal is overloaded. To connect to this signal:</db:para>
<db:programlisting>// Connect using qOverload:
connect(testClass, qOverload&lt;const QString &amp;&gt;(&amp;TestClass::dataChanged),
        receiver, &amp;ReceiverClass::slot);

// Or using a lambda:
connect(testClass, qOverload&lt;const QString &amp;&gt;(&amp;TestClass::dataChanged),
        this, [](const QString &amp;value) { /* handle dataChanged */ });</db:programlisting>
<db:para>For more examples and approaches, see <db:link db:linkend="https://example.org/connecting-overloaded-signals">connecting to overloaded signals</db:link>.</db:para>
</db:note>
</db:section>
<db:section xml:id="dataChanged-1">
<db:title>[signal] void TestClass::dataChanged(int <db:emphasis>value</db:emphasis>)</db:title>
<db:para>This signal is emitted when an integer <db:code role="parameter">value</db:code> changes.</db:para>
<db:note>
<db:para>This signal is overloaded. To connect to this signal:</db:para>
<db:programlisting>// Connect using qOverload:
connect(testClass, qOverload&lt;int&gt;(&amp;TestClass::dataChanged),
        receiver, &amp;ReceiverClass::slot);

// Or using a lambda:
connect(testClass, qOverload&lt;int&gt;(&amp;TestClass::dataChanged),
        this, [](int value) { /* handle dataChanged */ });</db:programlisting>
<db:para>For more examples and approaches, see <db:link db:linkend="https://example.org/connecting-overloaded-signals">connecting to overloaded signals</db:link>.</db:para>
</db:note>
</db:section>
<db:section xml:id="process">
<db:title>[slot] void TestClass::process(const QString &amp;<db:emphasis>value</db:emphasis>)</db:title>
<db:para>Processes a string <db:code role="parameter">value</db:code>.</db:para>
<db:note>
<db:para>This slot is overloaded. To connect to this slot:</db:para>
<db:programlisting>// Connect using qOverload:
connect(sender, &amp;SenderClass::signal,
        testClass, qOverload&lt;const QString &amp;&gt;(&amp;TestClass::process));

// Or using a lambda as wrapper:
connect(sender, &amp;SenderClass::signal,
        testClass, [receiver = testClass](const QString &amp;value) { receiver-&gt;process(value); });</db:programlisting>
<db:para>For more examples and approaches, see <db:link db:linkend="https://example.org/connecting-overloaded-slots">connecting to overloaded slots</db:link>.</db:para>
</db:note>
</db:section>
<db:section xml:id="process-1">
<db:title>[slot] void TestClass::process(int <db:emphasis>value</db:emphasis>)</db:title>
<db:para>Processes an integer <db:code role="parameter">value</db:code>.</db:para>
<db:note>
<db:para>This slot is overloaded. To connect to this slot:</db:para>
<db:programlisting>// Connect using qOverload:
connect(sender, &amp;SenderClass::signal,
        testClass, qOverload&lt;int&gt;(&amp;TestClass::process));

// Or using a lambda as wrapper:
connect(sender, &amp;SenderClass::signal,
        testClass, [receiver = testClass](int value) { receiver-&gt;process(value); });</db:programlisting>
<db:para>For more examples and approaches, see <db:link db:linkend="https://example.org/connecting-overloaded-slots">connecting to overloaded slots</db:link>.</db:para>
</db:note>
</db:section>
</db:section>
</db:article>
