Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个需要使用语音模拟拖放动作的应用程序,但是当我尝试发出信号以释放鼠标时,代码会阻塞,直到拖放动作完成。我需要发送一个信号以允许 dropaction 发生。如何在 drag.start 操作期间发送信号或执行命令。提前致谢!
例如,您可以重新实现start发出信号的方法,例如:
start
class MyDrag(QtGui.QDrag): dragStarted = QtCore.pyqtSignal() def __init__(self, dragSource): super(MyDrag, self).__init__(dragSource) def start(self): self.dragStarted.emit() super(MyDrag, self).start()