<?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[New signall slot syntax]]></title><description><![CDATA[<p dir="auto">Hi I just try to use new yntax and for testing that i wrote this simple code :<br />
@<br />
#include "mainwindow.h"<br />
#include &lt;QApplication&gt;<br />
#include&lt;QLabel&gt;<br />
#include&lt;QTimer&gt;</p>
<p dir="auto">int main(int argc, char <em>argv[])<br />
{<br />
QApplication a(argc, argv);<br />
QLabel</em> lbl=new QLabel;<br />
lbl-&gt;setNum(0);<br />
QTimer *timer=new QTimer;<br />
timer-&gt;setInterval(1000);<br />
int x=0;<br />
QObject::connect(timer,&amp;QTimer::timeout,<a>&amp;</a>{lbl-&gt;setNum(x++);});<br />
//QObject::connect(timer,&amp;QTimer::timeout,lbl,&amp;QLabel::setNum(int));<br />
timer-&gt;start();<br />
lbl-&gt;show();<br />
return a.exec();<br />
}<br />
@<br />
but when i build the code i get the following error<br />
@<br />
/home/mohsen/qt_projects/qt_android/main.cpp:15: error: expected expression<br />
QObject::connect(timer,&amp;QTimer::timeout,<a>&amp;</a>{lbl-&gt;setNum(x++);});</p>
<p dir="auto">@<br />
any suggestions?</p>
]]></description><link>https://forum.qt.io/topic/35796/new-signall-slot-syntax</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 10:12:42 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/35796.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 22 Dec 2013 07:49:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to New signall slot syntax on Sun, 22 Dec 2013 09:31:52 GMT]]></title><description><![CDATA[<p dir="auto">thanks it solved</p>
]]></description><link>https://forum.qt.io/post/208279</link><guid isPermaLink="true">https://forum.qt.io/post/208279</guid><dc:creator><![CDATA[pumper]]></dc:creator><pubDate>Sun, 22 Dec 2013 09:31:52 GMT</pubDate></item><item><title><![CDATA[Reply to New signall slot syntax on Sun, 22 Dec 2013 08:14:26 GMT]]></title><description><![CDATA[<p dir="auto">The syntax looks correct, one thing that can cause the error is that you didn't enabled the C++11 for your C++ compiler (the android ndk seems to use gcc 4.8), so you need to add this line into your <em>.pro</em> file:  @QMAKE_CXXFLAGS += -std=c++11@</p>
<p dir="auto">And if you build the same project with a visual c++ that doesn't need (or know) that flag, you can use this:<br />
@gcc : QMAKE_CXXFLAGS += -std=c++11@<br />
to add the flag only for gcc.</p>
]]></description><link>https://forum.qt.io/post/208272</link><guid isPermaLink="true">https://forum.qt.io/post/208272</guid><dc:creator><![CDATA[Zlatomir]]></dc:creator><pubDate>Sun, 22 Dec 2013 08:14:26 GMT</pubDate></item></channel></rss>