<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Slot function pointer with arguments]]></title><description><![CDATA[<p dir="auto">I'm trying to use setText() in a slot on connect <strong>without</strong> using a lambda. Here's what I have:</p>
<pre><code>MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui-&gt;setupUi(this);

    QApplication::connect(timeThread, &amp;QThread::started, timer, &amp;CustomTimer::start);
    QApplication::connect(timeThread, &amp;QThread::finished, ui-&gt;timeLabel, &amp;QLabel::setText("Done"));
}
</code></pre>
<p dir="auto">I'm just unsure how to call the function if it has an argument. Any guidance is appreciated.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.qt.io/topic/129458/slot-function-pointer-with-arguments</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 09:38:08 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/129458.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Aug 2021 23:48:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Slot function pointer with arguments on Tue, 17 Aug 2021 00:00:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/eyllanesc">@<bdi>eyllanesc</bdi></a></p>
<p dir="auto">Yeah, I didn't know if I needed to create a class to inherit from QLabel for that. Need to promote a label in designer but I wanted to make sure that was the simplest way.</p>
<p dir="auto">Thanks for the quick response!</p>
]]></description><link>https://forum.qt.io/post/676080</link><guid isPermaLink="true">https://forum.qt.io/post/676080</guid><dc:creator><![CDATA[TheLumbee]]></dc:creator><pubDate>Tue, 17 Aug 2021 00:00:23 GMT</pubDate></item><item><title><![CDATA[Reply to Slot function pointer with arguments on Mon, 16 Aug 2021 23:54:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/thelumbee">@<bdi>TheLumbee</bdi></a> So create a slot:</p>
<p dir="auto">*<strong>.h</strong></p>
<pre><code class="language-cpp">private slots:
    void handle_finished();
</code></pre>
<p dir="auto">*<strong>.cpp</strong></p>
<pre><code class="language-cpp">void MainWindow::handle_finished(){
    ui-&gt;timeLabel-&gt;setText("Done");
}
</code></pre>
<p dir="auto">and the connection:</p>
<pre><code class="language-cpp">connect(timeThread, &amp;QThread::finished, this, &amp;MainWindow::handle_finished);
</code></pre>
]]></description><link>https://forum.qt.io/post/676079</link><guid isPermaLink="true">https://forum.qt.io/post/676079</guid><dc:creator><![CDATA[eyllanesc]]></dc:creator><pubDate>Mon, 16 Aug 2021 23:54:13 GMT</pubDate></item></channel></rss>