[SOLVED] Slot not receiving Signal
-
In MainWindow class.
@this->petStage = new PetStage();
//Initialize Preferences.
this->preferences = new Preferences(this);//Initialize Interpreter.
this->interpreter = new Interpreter(petStage, ai, &Window);//Initialize AI.
this->ai = new AI(petStage, &Window);
this->ai->moveToThread(interpreter);//Initialize AI connections.
connect(this->preferences, SIGNAL(LoadPreferences()), this->ai, SLOT(LoadPreferences()));@Now Preferences is a QDialog, when I click "OK" it emits the signal LoadPreferences which SHOULD reach the AI class by having the MainWindow handle the connection. Unfortunately it is not being reached. If I move the Slot to the MainWindow it works. But even, then I cannot seem to have AI's Slot be reached even if I create a connection between MainWindow and AI.
@class AI :
public QObject
{
Q_OBJECTpublic:
AI(PetStage*, Robot::Window*);
~AI(void);public slots:
void LoadPreferences();
void Run();
}@ -
You are correct. Though Interpreter is to be called later when the button is pressed. The idea is to allow changing preferences before it starts. I guess I could get the preferences as it starts if there is no alternative.
In short, the idea was to update without starting that thread.