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. signal and slot can not connect
Forum Updated to NodeBB v4.3 + New Features

signal and slot can not connect

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 564 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.
  • EricWilsonE Offline
    EricWilsonE Offline
    EricWilson
    wrote on last edited by
    #1

    I have two widgets, one of which have a signal 'void subMarket(string)', the other have a public slot 'void subMarket(string)'. I connect them and there is no compile error or run time warning, but when i emit the signal 'subMarket(string)', the slot function is not invoked, and there is not any warning. could anyone help me fix this problem?
    attach snapshot of two class:

    class mdwidget :public QWidget{
    Q_OBJECT
    public:
    mdwidget(MessageHub*_hub = 0);
    signals:
    void subMarket(string ins);
    public slots:
    };

    class MessageHub :public QObject{
    Q_OBJECT
    public:
    MessageHub(){}
    public slots :
    void subMarket(string ins);
    };

    EricWilsonE 1 Reply Last reply
    0
    • EricWilsonE EricWilson

      I have two widgets, one of which have a signal 'void subMarket(string)', the other have a public slot 'void subMarket(string)'. I connect them and there is no compile error or run time warning, but when i emit the signal 'subMarket(string)', the slot function is not invoked, and there is not any warning. could anyone help me fix this problem?
      attach snapshot of two class:

      class mdwidget :public QWidget{
      Q_OBJECT
      public:
      mdwidget(MessageHub*_hub = 0);
      signals:
      void subMarket(string ins);
      public slots:
      };

      class MessageHub :public QObject{
      Q_OBJECT
      public:
      MessageHub(){}
      public slots :
      void subMarket(string ins);
      };

      EricWilsonE Offline
      EricWilsonE Offline
      EricWilson
      wrote on last edited by
      #2

      @EricWilson
      ok, this bug turn out to be my mistake signal senders..

      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