mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Source trigger patch file drop (#1236)
* Add Signal if File dropped * Check if Index is valid Send Signal and return if Index is invalid and File was dropped * Connect Dropsignal to fileopen
This commit is contained in:
committed by
Martin Kleusberg
parent
09e170f75d
commit
0a995423fa
@@ -543,6 +543,14 @@ void ExtendedTableWidget::dragMoveEvent(QDragMoveEvent* event)
|
||||
void ExtendedTableWidget::dropEvent(QDropEvent* event)
|
||||
{
|
||||
QModelIndex index = indexAt(event->pos());
|
||||
|
||||
if (!index.isValid())
|
||||
{
|
||||
if (event->mimeData()->hasUrls() && event->mimeData()->urls().first().isLocalFile())
|
||||
emit openFileFromDropEvent(event->mimeData()->urls().first().toLocalFile());
|
||||
return;
|
||||
}
|
||||
|
||||
model()->dropMimeData(event->mimeData(), Qt::CopyAction, index.row(), index.column(), QModelIndex());
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user