I have custom QWidget
that contains custom QWindow
. QWindow
with OpenGL is used as a "connector" between render framework and Qt application.
Mouse and keyboard events are handled with overriding QWindow
methods.
Pseudo-code:
class MyWindow : public QWindow
{
public:
MyWindow : QWindow() { /* GL stuff init*/ }
protected:
// mouse/keyboard event handling
// expose event handling
// resize event handling
// ...
};
class MyWidget : public QWidget
{
public:
MyWidget : QWidget()
{
auto window = new MyWindow();
auto container = createWindowContainer(window);
layout()->addWidget( container );
setAcceptDrops( true );
}
protected:
// overriding drop event, but is doesn't work
};
Question: how to handle drop events (it doesn't matter where)?
Problems:
QWindow
doesn't provide virtual methods for drag-n-drop support.QWidget::dragEnterEvent
,QWidget::dropEvent
(and similar) are not called.QWindow
still accept mouse events, evensetMouseGrabEnabled( false );
is set.
Note: I found that call of setMouseGrabEnabled( false );
doesn't blocks mouse events handling in QWindow
.