Home > Mobile >  QT how to loop through a program?
QT how to loop through a program?

Time:09-27

Just learning qt, now there is a situation, have a function to detect whether there is connected to the equipment, if there is a device to connect, disconnect or equipment is change some of the data interface,
All but I to the present study is mostly in the constructor of the widget to write code, or use a trough this kind of signal, I checked the qt is circular perform some events? Such as signal channel, mouse, keyboard events, that how to let him go to cycle through a testing equipment code?

CodePudding user response:

1. Open a thread, QThread or pthread
2. The timer, QTImer, set up interval, groove function is the loop body

CodePudding user response:

The timer QTimer is ok
  •  Tags:  
  • Qt
  • Related