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. Output complaining about signals and slots that DO exist
Forum Updated to NodeBB v4.3 + New Features

Output complaining about signals and slots that DO exist

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.1k 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.
  • P Offline
    P Offline
    primem0ver
    wrote on last edited by
    #1

    I am getting errors in my output that make no sense. Such as:
    QObject::connect: No such signal AppCore::LoginServer::incomingSignal(NetEventInfo* requestEvent) in ServerEngine.cpp:104

    Here is the line (104) from ServerEngine:
    @
    connect(mLoginServer, SIGNAL(incomingSignal(NetEventInfo* requestEvent)), this, SLOT(loginRequest(NetEventInfo* requestEvent)));
    @

    Here is the header for the class it is referring too (LoginServer)
    @
    class LoginServer : public QTcpServer
    {
    Q_OBJECT

    public:
    explicit LoginServer(IServerEngine* engine, QObject* parent = 0);
    bool start();

    signals:
    void incomingSignal(NetEventInfo* requestEvent);

    protected:
    void incomingConnection(qintptr socketDescriptor);

    private slots:
    void processLogin(const QByteArray& data);
    //void threadFinished(int threadID);

    private:
    IServerEngine* mEngine;
    };
    @

    Why does it report the signal doesn't exist when it clearly does?

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi,
      Did you register your NewEventInfo class/variable as a Meta Object?

      Greetz, Jeroen

      1 Reply Last reply
      0
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        Hi,

        Your connect() statement should only contain the type name, not the variable name.

        @
        connect(mLoginServer, SIGNAL(incomingSignal(NetEventInfo*)), this, SLOT(loginRequest(NetEventInfo*)));
        @

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • P Offline
          P Offline
          primem0ver
          wrote on last edited by
          #4

          Thanks. I did two things that helped solve this problem. First I removed the variables from the code as suggested by JKSH. For a later slot I also changed a qintptr to an int because it said that qintptr was not a MetaObject. If I had needed to continue using a qintptr for whatever reasons, how would I make it a MetaObject?

          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