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. [SOLVED]Object not receiving some signals
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Object not receiving some signals

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.4k 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.
  • J Offline
    J Offline
    Jake007
    wrote on last edited by
    #1

    Hi!

    I have the following problem.

    All the signals that are emited in my derived QDockWidget class, do not get to my worker class. But it works for it's parent.

    @connect(programManager(), SIGNAL(delay(int)), this, SLOT(test(int))); // Works
    connect(programManager(), SIGNAL(delay(int)), myWorker, SLOT(onUpdateSleep(int))); // Not working
    @

    @public slots:
    void onUpdateSleep(int sleep) { mySleep = sleep; }
    @

    The problem is just between those two classes.
    In a nested class ( of a program manager), which inherits from QTextEdit, is also connected to worker:
    @ connect(programManager()->console(), SIGNAL(inputReceived(QString)), myWorker, SLOT(setInput(QString)));@

    And works without any problems.
    There are Q_OBJECT macros everywhere.

    Any ideas?

    Thanks in advance.

    Regards,
    Jake


    Code is poetry

    1 Reply Last reply
    0
    • G Offline
      G Offline
      guziemic
      wrote on last edited by
      #2

      Hi,

      Could you post header of worker class?

      BR,
      Michal

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jake007
        wrote on last edited by
        #3

        @class LPExecutor : public QObject
        {
        Q_OBJECT
        public:
        explicit LPExecutor(LProgram *progParent, QObject *parent = 0);
        ~LPExecutor();

        public:

        signals:
        void started();
        void finished();
        void error(QString err);
        void varChange(QString, QString,);
        void requestInput();
        void print(QString);

        public slots:
        void onUpdateSleep(int); // moved to .cpp
        void process();
        void setInput(QString);
        void onStop();
        bool execute(QString);
        void onPause(bool pause);
        void onStart(bool);

        private:
        void init();
        void run();

        private:
        // Just a bunch of variables
        };@


        Code is poetry

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jake007
          wrote on last edited by
          #4

          Found the problem.

          Worker class is moved to thread. But the thread wasn't started. Is soon as I started the thread, everything worked OK.

          Regards,
          Jake


          Code is poetry

          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