Hi,
I want to poll continuously some hardware functions like ..
main(int argc, char *argv[])
{
Widget w; // Widget Class
while (1)
{
//functions to poll continuously
}
w.show();
a.exec();
}
main(int argc, char *argv[])
{
Widget w; // Widget Class
QApplication a(argc, argv);
while (1)
{
//functions to poll continuously
}
w.show();
a.exec();
}
To copy to clipboard, switch view to plain text mode
If i execute above code it doesn't show widget on the display, I understand that a.exec() should execute to enter in to the event loop.
But if i write like this...
main(int argc, char *argv[])
{
Widget w; // Widget Class
w.show();
while (1)
{
//functions to poll continuously
a.exec();
}
}
main(int argc, char *argv[])
{
Widget w; // Widget Class
QApplication a(argc, argv);
w.show();
while (1)
{
//functions to poll continuously
a.exec();
}
}
To copy to clipboard, switch view to plain text mode
in while loop only execute once, and then a.exec() wait for the event.
How can I run while loop continuously to poll some function.
Is it mean that I need to start QTimer and need timer event every time?
Or is there any other way that can use while loop?
With Regards,
Nirav
Bookmarks