Avoid polling if the Qt window is minimized

This commit is contained in:
Cameron Gutman
2018-08-13 19:47:42 -07:00
parent 860d317330
commit f3309087ab
4 changed files with 23 additions and 29 deletions
-6
View File
@@ -44,16 +44,10 @@ Item {
if (visible) {
// Connect the quit completion signal
ComputerManager.quitAppCompleted.connect(quitAppCompleted)
// We must be polling or we won't get the quitAppCompleted() callback
ComputerManager.startPolling()
}
else {
// Disconnect the signal
ComputerManager.quitAppCompleted.disconnect(quitAppCompleted)
// Stop polling when this view is not on top
ComputerManager.stopPollingAsync()
}
}