forked from M-Labs/artiq
dndwidgets: change splitter to use signal
This commit is contained in:
parent
6c9f1cbf7c
commit
3861d58749
|
@ -2,6 +2,8 @@ from PyQt5 import QtCore, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
class VDragDropSplitter(QtWidgets.QSplitter):
|
class VDragDropSplitter(QtWidgets.QSplitter):
|
||||||
|
dropped = QtCore.pyqtSignal(int, int)
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
QtWidgets.QSplitter.__init__(self, parent=parent)
|
QtWidgets.QSplitter.__init__(self, parent=parent)
|
||||||
self.setAcceptDrops(True)
|
self.setAcceptDrops(True)
|
||||||
|
@ -50,7 +52,7 @@ class VDragDropSplitter(QtWidgets.QSplitter):
|
||||||
for n in range(self.count()):
|
for n in range(self.count()):
|
||||||
w = self.widget(n)
|
w = self.widget(n)
|
||||||
if pos.y() < w.y() + w.size().height():
|
if pos.y() < w.y() + w.size().height():
|
||||||
self.insertWidget(n, src)
|
self.dropped.emit(src_i, n)
|
||||||
break
|
break
|
||||||
e.accept()
|
e.accept()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue