When I create a QWidget pointer object using createWindowContainer that has qml scene embedded into a QQuickView instance, i.e.
QWidget* wig = QWidget::createWindowContainer(quickView, 0, Qt::Window);
// this is to support drag and drop
wig->setAcceptDrops(true);
wig->installEventFilter(this);
then adding the following method to myClass to intercept events on wig
bool myclass::eventFilter(QObject *obj, QEvent *event){
}
It seems that the events related to mouse events like drag and drop cannot be intercepted. i.e. QMouseEvent, QDragEnter, QDropEvent...etc.
When only I switch to a normal QWidget instanct i.e.
QWidget* wig = new QWidget;
I am able to track mouse, drag, drop events normally.
I've tested the above scenario on Windows 10 and Ubuntu 16.10 along with Qt 5.7.1 and both of them are working fine, I've been able to track mouse and drag/drop events from a QWidget created by QWidget::createWindowContainer.
The problem happens only on Mac OSX (El Capitan and Sierra)
I've attached a working example that demonstrates the issue, here
Am doing something wrong or is there any work around for this problem.
I am working Mac OSX El Capitan, along with Qt 5.7.1. Thanks.