示例#1
0
 def autoConnectSignals(self):
     widgets, members = super(Form, self).__dict__, Form.__dict__
     for i in widgets:
         for m in [j for j in members if j.startswith(i+"_")]:
             signal = getattr(widgets[i], m[len(i)+1:], None)
             if signal: signal.connect(bind(members[m], self))
             else: print("Signal '%s' of '%s' not found" % (m[len(i)+1:], i))
示例#2
0
def slot_disconnected(signal, slot):
    try:
        signal.disconnect(slot)
    except Exception:
        pass
    yield
    signal.connect(slot)
示例#3
0
 def _init_signal_handler(self, callback):
     import signal as sig
     from signal import signal as connect
     for target_signal in self.catch_signals:
         connect(
             getattr(sig, target_signal),
             callback
         )
示例#4
0
 def autoConnectSignals(self):
     widgets, members = super(Form, self).__dict__, Form.__dict__
     for i in widgets:
         for m in [j for j in members if j.startswith(i + "_")]:
             signal = getattr(widgets[i], m[len(i) + 1:], None)
             if signal: signal.connect(bind(members[m], self))
             else:
                 print("Signal '%s' of '%s' not found" %
                       (m[len(i) + 1:], i))
示例#5
0
	def reconnect(self, signal, new, prev):
		signal.disconnect(prev)
		signal.connect(new)
		self.prev_slot_sr = new
示例#6
0
 def wait(self, signal, ms):
     signal.connect(self.onsignal)
     self.timer.start(ms)
     self.loop.exec_()
     return self.waited