gui: change timer creation
This commit is contained in:
parent
5e0a23903e
commit
1191dfc68e
5
gui.py
5
gui.py
|
@ -10,6 +10,8 @@ class SelectionObserver:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._attached = False
|
self._attached = False
|
||||||
self.timer = QtCore.QTimer()
|
self.timer = QtCore.QTimer()
|
||||||
|
self.timer.setSingleShot(True)
|
||||||
|
self.timer.timeout.connect(self.onTimer)
|
||||||
self.cmds = []
|
self.cmds = []
|
||||||
self.elements = dict()
|
self.elements = dict()
|
||||||
self.attach()
|
self.attach()
|
||||||
|
@ -83,9 +85,6 @@ class SelectionObserver:
|
||||||
for cmd in self.cmds:
|
for cmd in self.cmds:
|
||||||
cmd.onSelectionChange(False)
|
cmd.onSelectionChange(False)
|
||||||
return
|
return
|
||||||
if not self.timer.isSingleShot():
|
|
||||||
self.timer.setSingleShot(True)
|
|
||||||
self.timer.timeout.connect(self.onTimer)
|
|
||||||
self.timer.start(50)
|
self.timer.start(50)
|
||||||
|
|
||||||
def onTimer(self):
|
def onTimer(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user