<?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[Compiler says that emit keyword is undeclared]]></title><description><![CDATA[<p dir="auto">I have a class that inherits from QAbstractTableModel, like this:</p>
<pre><code>MessagesModel::MessagesModel(LogData* logData, QObject* parent)
    : QAbstractTableModel(parent)
{

}
</code></pre>
<p dir="auto">Somewhere in this class I need to emit the dataChanged signal, but the compiler does not understand the emit !<br />
I have no clue what I am doing wrong. The .h file starts with the correct includes etc:</p>
<pre><code>#include &lt;QAbstractTableModel&gt;

class MessagesModel : public QAbstractTableModel
{
	Q_OBJECT
</code></pre>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/0b3bb25d-d91b-4a6f-9b9e-42761bebb2dd.png" alt="b7e4b1d6-e70f-4b92-9750-9dd878ba8ea1-afbeelding.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/135161/compiler-says-that-emit-keyword-is-undeclared</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 04:34:25 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/135161.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 Mar 2022 18:52:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Compiler says that emit keyword is undeclared on Fri, 01 Apr 2022 15:19:13 GMT]]></title><description><![CDATA[<p dir="auto">This problem suddenly dissapeared, and I could not reproduce it anymore.</p>
]]></description><link>https://forum.qt.io/post/708588</link><guid isPermaLink="true">https://forum.qt.io/post/708588</guid><dc:creator><![CDATA[Simmania]]></dc:creator><pubDate>Fri, 01 Apr 2022 15:19:13 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler says that emit keyword is undeclared on Fri, 18 Mar 2022 20:09:26 GMT]]></title><description><![CDATA[<p dir="auto">Does it happen only in that class ?</p>
]]></description><link>https://forum.qt.io/post/706920</link><guid isPermaLink="true">https://forum.qt.io/post/706920</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 18 Mar 2022 20:09:26 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler says that emit keyword is undeclared on Fri, 18 Mar 2022 20:07:04 GMT]]></title><description><![CDATA[<p dir="auto">No, I didn't.</p>
]]></description><link>https://forum.qt.io/post/706918</link><guid isPermaLink="true">https://forum.qt.io/post/706918</guid><dc:creator><![CDATA[Simmania]]></dc:creator><pubDate>Fri, 18 Mar 2022 20:07:04 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler says that emit keyword is undeclared on Fri, 18 Mar 2022 19:26:41 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Did you disable the Qt keywords in your .pro file ?</p>
]]></description><link>https://forum.qt.io/post/706908</link><guid isPermaLink="true">https://forum.qt.io/post/706908</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 18 Mar 2022 19:26:41 GMT</pubDate></item></channel></rss>