Message Board -  Archive

[ Login ] [ Create Account ]
[ Board List ] [ View Board ] [ Post Reply ]
  Author  Subject: Event Handling w/ QT
Archive  

Posted on 09-25-2001 05:47 p.m. ET  reply

Original Poster: David Bojdak

Here is some code to help present my problem:

class A
{
public:

bool keepRunning;

void longFunction()
{
while(keepRunning){


}
};

void stopRunning()
{
keepRunning = false;
}
}

class SomeQtGuiImpl : public SomeQtGui
{
public:

A instanceOfA;

Public Slots:

Virtual Void runFunc()
{
instanceOfA.keepRunning = true;
instanceOfA.longFunction();
};

virtual void stopFunc()
{
instanceOfA.stopRunning();
};
}

What I want to be able to do is occasionally check to see if any signals
are called from my instance of SomeQtGuiImpl while I am in the
instanceOfA.longFunction() while-loop.

Is this possible?

Is there some command that could halt instanceOfA.longFunction() , check the
event Queue and run all of the necessary slots, finally returning back to
instanceOfA.longFunction() ?

Will I need to resort to Qthreads?

Any help is appreciated...

Thank You,

David Bojdak

< Previous 1 Next >

Site Contents