miqt: remove QTimer::singleShot that does not seem to be needed

This commit is contained in:
mappu 2025-01-06 18:34:52 +13:00
parent 89f34d8621
commit bc2216a9f8

16
main.go
View File

@ -524,9 +524,7 @@ func (self *DockerGUI) refresh_containers() {
self.filter_tree(self.containers_tree, self.containers_searchbar.Text())
self.restore_selection(self.containers_tree, selected_items)
qt.QTimer_SingleShot(0, func() {
self.containers_tree.VerticalScrollBar().SetValue(scroll_position)
})
self.containers_tree.VerticalScrollBar().SetValue(scroll_position)
}
func (self *DockerGUI) refresh_images() {
@ -554,9 +552,7 @@ func (self *DockerGUI) refresh_images() {
self.filter_tree(self.images_tree, self.images_searchbar.Text())
self.restore_selection(self.images_tree, selected_items)
qt.QTimer_SingleShot(0, func() {
self.images_tree.VerticalScrollBar().SetValue(scroll_position)
})
self.images_tree.VerticalScrollBar().SetValue(scroll_position)
}
func (self *DockerGUI) refresh_networks() {
@ -582,9 +578,7 @@ func (self *DockerGUI) refresh_networks() {
self.filter_tree(self.networks_tree, self.networks_searchbar.Text())
self.restore_selection(self.networks_tree, selected_items)
qt.QTimer_SingleShot(0, func() {
self.networks_tree.VerticalScrollBar().SetValue(scroll_position)
})
self.networks_tree.VerticalScrollBar().SetValue(scroll_position)
}
func (self *DockerGUI) refresh_volumes() {
@ -610,9 +604,7 @@ func (self *DockerGUI) refresh_volumes() {
self.filter_tree(self.volumes_tree, self.volumes_searchbar.Text())
self.restore_selection(self.volumes_tree, selected_items)
qt.QTimer_SingleShot(0, func() {
self.volumes_tree.VerticalScrollBar().SetValue(scroll_position)
})
self.volumes_tree.VerticalScrollBar().SetValue(scroll_position)
}
func (self *DockerGUI) get_selected_items(tree *qt.QTreeWidget) []string {