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. Signals in visual is not showing up

Signals in visual is not showing up

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

    Hi,
    I work with Qt5.2.1 on VS. I have two classes.
    classa.h:
    @
    class classA: public QObject
    {
    Q_Object

    public:
    explicit classA();
    signals:
    void doWorkRequest();
    }
    @

    classb.h

    @
    #include "classa.h"

    class classB: public QObject
    {
    Q_Object

    public:
    explicit classB();
    private slots:
    void doWork();
    private:
    classA* pointA;
    }
    @

    classb.cpp

    @
    #include "classb.h"

    classB::classB()
    {
    pointA = new classA();
    //here I want to add signal-slot connection,
    //but I can't because Visual is not finding
    //signal doWorkRequest();

    // connect(pointA, SIGNAL(doWorkRequest()),
    // this, SLOT(doWork()));
    }
    @

    I have tried to write it on my own, but slot doWork() is not working.
    If anyone have an idea where problem is?

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

      Hi,

      It's not because your IDE doesn't find something that it's not there.

      Once connected (also look at the console output to see if you have an error message related to that), do you ever emit doWorkRequest ?

      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
      • N Offline
        N Offline
        never_ever
        wrote on last edited by
        #3

        Yes, I emit that signal from other function from classA, here I only omitted it.
        No, I don''t have any error messages related to it.

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

          So, how do you know it's not working ?

          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
          • N Offline
            N Offline
            never_ever
            wrote on last edited by
            #5

            Ok, I don't know why, but now it works (I have just close visual and open it again). After that connect() works, but I should write it on my own (program doesn't suggest any existing signal from beyond the classB).

            EDIT: I put the breakpoint in slot that should be invoked, and earlier it was not invoked.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              Zarkon
              wrote on last edited by
              #6

              Maybe you should make it a public slot instead of a private slot.

              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