Good day.
I have created a GUI that uses its buttons to change different states of a system. I want to be able to run a unending loop that reads data over the PCI bus inside of each event of a button. I have the buttons and I have the functions that run the unending loop that reads the PCI bus.
However, when the loop is running inside the event of the button I loose functionality of the gui.
So I basicly want to learn how to run a unending loop in the event of a button and still be able to control the GUI
I will try to explain with code:
void Controller::standby()
{
powerDownButton->setEnabled(true);
standbyButton->setEnabled(false);
int val = 1;
while (val == 1)
{
read_data();
//here I nead something to exit the loop when a button is pressed;
//something that I can use to change val to another value and exit the loop
}
void Controller::standby()
{
powerDownButton->setEnabled(true);
standbyButton->setEnabled(false);
int val = 1;
while (val == 1)
{
read_data();
//here I nead something to exit the loop when a button is pressed;
//something that I can use to change val to another value and exit the loop
}
To copy to clipboard, switch view to plain text mode
Hope this post makes sense.
Thanks to anyone that can help!
Bookmarks