TagStudio
TagStudio copied to clipboard
[suggestion] drag and drop outside the window
It would be nice if one could find a file in TagStudio and then drag it towards a new destination, such as a file explorer, a website drop area or a chatroom.
i agree with this, hydrus already has this feature and it's super useful for dragging images into chat apps.
You can use event.mimeData().hasUrls() to detect files being dragged.
Here is a mock-up of a drop-target window
import sys
from PySide6.QtWidgets import QApplication, QWidget
from PySide6.QtCore import Qt
class DragDropWindow(QWidget):
def __init__(self):
super().__init__()
self.setAcceptDrops(True)
self.setWindowTitle("Drag and Drop Files")
self.setGeometry(100, 100, 400, 300)
def dragEnterEvent(self, event):
if event.mimeData().hasUrls():
event.accept()
else:
event.ignore()
def dragMoveEvent(self, event):
if event.mimeData().hasUrls():
event.accept()
else:
event.ignore()
def dropEvent(self, event):
for url in event.mimeData().urls():
file_path = url.toLocalFile()
print("Dropped file:", file_path)
if __name__ == "__main__":
app = QApplication(sys.argv)
window = DragDropWindow()
window.show()
sys.exit(app.exec_())
Implemented in #153