Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Compiler says that emit keyword is undeclared

Compiler says that emit keyword is undeclared

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 358 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Simmania
    wrote on last edited by
    #1

    I have a class that inherits from QAbstractTableModel, like this:

    MessagesModel::MessagesModel(LogData* logData, QObject* parent)
        : QAbstractTableModel(parent)
    {
    
    }
    

    Somewhere in this class I need to emit the dataChanged signal, but the compiler does not understand the emit !
    I have no clue what I am doing wrong. The .h file starts with the correct includes etc:

    #include <QAbstractTableModel>
    
    class MessagesModel : public QAbstractTableModel
    {
    	Q_OBJECT
    

    b7e4b1d6-e70f-4b92-9750-9dd878ba8ea1-afbeelding.png

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you disable the Qt keywords in your .pro file ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Simmania
        wrote on last edited by
        #3

        No, I didn't.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Does it happen only in that class ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Simmania
            wrote on last edited by
            #5

            This problem suddenly dissapeared, and I could not reproduce it anymore.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved