- cleanup.. The drag&drop focus solution only works for the 1st drag&drop... Why?

This commit is contained in:
Olli Suutari 2016-09-30 05:36:32 +03:00
parent 337edf039f
commit 8dbd79dba0

View File

@ -44,7 +44,6 @@ class TreeWidgetWithDnD(QtWidgets.QTreeWidget):
self.default_indentation = self.indentation()
self.setIndentation(0)
self.setAnimated(True)
window_flags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | QtCore.Qt.WindowStaysOnTopHint
def activateDnD(self):
"""
@ -113,7 +112,6 @@ class TreeWidgetWithDnD(QtWidgets.QTreeWidget):
# the folder stays on top of the group creation box. This piece of code fixes this issue.
if is_win():
self.setWindowState(self.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
QtWidgets.QWidget().raise_()
if event.mimeData().hasUrls():
event.setDropAction(QtCore.Qt.CopyAction)
event.accept()
@ -131,18 +129,8 @@ class TreeWidgetWithDnD(QtWidgets.QTreeWidget):
event.setDropAction(QtCore.Qt.CopyAction)
event.accept()
Registry().execute('%s_dnd_internal' % self.mime_data_text, self.itemAt(event.pos()))
#QtWidgets.QWidget.activateWindow(self)
#QtWidgets.QWidget().raise_()
#QtWidgets.QApplication.setActiveWindow()
#self.setWindowState(self.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
# this will activate the window
#self.activateWindow()
# this will activate the window
else:
event.ignore()
# Convenience methods for emulating a QListWidget. This helps keeping MediaManagerItem simple.
def addItem(self, item):