forked from M-Labs/artiq
1
0
Fork 0

dndwidgets: change splitter to use signal

This commit is contained in:
Simon Renblad 2024-01-24 10:37:54 +08:00 committed by Sébastien Bourdeauducq
parent 6c9f1cbf7c
commit 3861d58749
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,8 @@ from PyQt5 import QtCore, QtWidgets
class VDragDropSplitter(QtWidgets.QSplitter):
dropped = QtCore.pyqtSignal(int, int)
def __init__(self, parent):
QtWidgets.QSplitter.__init__(self, parent=parent)
self.setAcceptDrops(True)
@ -50,7 +52,7 @@ class VDragDropSplitter(QtWidgets.QSplitter):
for n in range(self.count()):
w = self.widget(n)
if pos.y() < w.y() + w.size().height():
self.insertWidget(n, src)
self.dropped.emit(src_i, n)
break
e.accept()