Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.3.2
-
None
Description
Drag and Drop does not work with QVideoWidget. I found the same issue and python workaround here but no bug report: https://stackoverflow.com/questions/70024698/qvideowidget-not-reciving-dropevent-strange-behavior
My quick C++ version of this to make it work:
VideoWidget::VideoWidget(QWidget *parent) : QVideoWidget(parent) { QObject *c = findChild<QWidget*>(); c->installEventFilter(this); } bool VideoWidget::eventFilter(QObject *obj, QEvent *ev) { QObject *c = findChild<QWidget*>(); if(obj == c){ if(ev->type() == QEvent::DragEnter){ qDebug()<<"Drag Enter"; return true; } else if(ev->type() == QEvent::DragMove){ //qDebug()<<"Drag Move"; return true; } else if(ev->type() == QEvent::Drop){ qDebug()<<"Drop"; return true; } } return QVideoWidget::eventFilter(obj, ev); }