dlr-gtlab / gtlab-core

GTlab Core Framework
https://www.gtlab.de
Other
7 stars 2 forks source link

Resolve "fix GtEventLoop running indefintely if timeout was set to 0" #1198

Closed mariusalexander closed 6 months ago

mariusalexander commented 6 months ago

Description

Closes #1154

Fixed GtEventLoop not returning if timeout was set to 0.

How Has This Been Tested?

Checklist:

mariusalexander commented 6 months ago

@rainman110 May you have a look? :)

mariusalexander commented 6 months ago
  • What does a timeout of zero even mean?

It should do at least one iteration. The documentation says https://doc.qt.io/qt-6/qtimer.html#interval-prop: (which is exactly what I need/expected)

A QTimer with a timeout interval of 0 will time out as soon as all the events in the window system's event queue have been processed.

Regarding negative values for the timer. I could not find an answer to that in the documentation. But since the eventloop should run idefinetly we do not need a timer for that, therefore I would propose to keep the if-statement as is.