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
@@ -36,15 +36,9 @@ GridView {
onVisibleChanged: {
if (visible) {
// Start polling when this view is shown
ComputerManager.startPolling()
appModel.computerLost.connect(computerLost)
}
else {
// Stop polling when this view is not on top
ComputerManager.stopPollingAsync()
appModel.computerLost.disconnect(computerLost)
}
}