Hi,

I am building a QT application (QT4.8), where it has two ui forms, two threads one is main/GUI thread and other is worker thread with timer running.

It has one Base class derived from QObject, and two other classes for ui screens derived from QMainWindow. Base class contains the pointers for ui classes.


What is required is when application loads it should display the first screen , QMainWindow form , for that I am using show() function with CTOR of base class (shown below).

Now when timer in the thread goes off it calls the SIGNAL function in the base class and at that time it should switch to second ui or replace with second screen.

Issue:
First screen is shown properly but when it tries to switch to second screen within SIGNAL function, display becomes blank i.e. it goes off.

Any kind of help/suggestion is appreciated,

Thank you,


Code:
//CTOR
Base::Base()
{
qDebug() << "Base CTOR called\n";

//Show the first screen, loading raptor status
this->lrsGUI = new RaptorLrsGUI;
this->lrsGUI->setlabel(QString("Loading Status..."));
this->lrsGUI->showMaximized();
this->lrsGUI->show();

this->coreGUI = new RaptorCoreGUI;
}

/*SIGNAL function*/
void Base::rcvInitData()
{
qDebug()<< "Main Thread (CALLBACK): Swtch screen\n";

this->lrsGUI->hide();
this->coreGUI->setlabel(QString("Second Screen..."));
this->coreGUI->showMaximized();
this->coreGUI->show();
bootInitData = 1;

qDebug()<< "Main Thread (CALLBACK): EXiting Display initial screen\n";
}