forked from openlp/openlp
only allow drag if an item is selected
This commit is contained in:
parent
4778bfd781
commit
4e870ed705
@ -49,6 +49,9 @@ class ListWidgetWithDnD(QtGui.QListWidget):
|
|||||||
if event.buttons() != QtCore.Qt.LeftButton:
|
if event.buttons() != QtCore.Qt.LeftButton:
|
||||||
event.ignore()
|
event.ignore()
|
||||||
return
|
return
|
||||||
|
if not self.selectedItems():
|
||||||
|
event.ignore()
|
||||||
|
return
|
||||||
drag = QtGui.QDrag(self)
|
drag = QtGui.QDrag(self)
|
||||||
mimeData = QtCore.QMimeData()
|
mimeData = QtCore.QMimeData()
|
||||||
drag.setMimeData(mimeData)
|
drag.setMimeData(mimeData)
|
||||||
|
@ -73,6 +73,9 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
|||||||
if event.buttons() != QtCore.Qt.LeftButton:
|
if event.buttons() != QtCore.Qt.LeftButton:
|
||||||
event.ignore()
|
event.ignore()
|
||||||
return
|
return
|
||||||
|
if not self.selectedItems():
|
||||||
|
event.ignore()
|
||||||
|
return
|
||||||
drag = QtGui.QDrag(self)
|
drag = QtGui.QDrag(self)
|
||||||
mimeData = QtCore.QMimeData()
|
mimeData = QtCore.QMimeData()
|
||||||
drag.setMimeData(mimeData)
|
drag.setMimeData(mimeData)
|
||||||
|
Loading…
Reference in New Issue
Block a user