[SOLVED]Object not receiving some signals



  • 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



  • Hi,

    Could you post header of worker class?

    BR,
    Michal



  • @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
    };@



  • 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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.