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

signal and slot can not connect

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 554 Views
  • 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.
  • E Offline
    E Offline
    EricWilson
    wrote on 14 Oct 2015, 01:50 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);
    };

    E 1 Reply Last reply 14 Oct 2015, 02:19
    0
    • E EricWilson
      14 Oct 2015, 01:50

      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);
      };

      E Offline
      E Offline
      EricWilson
      wrote on 14 Oct 2015, 02:19 last edited by
      #2

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

      1 Reply Last reply
      0

      1/2

      14 Oct 2015, 01:50

      • Login

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