I created myself simple window for debugging purposes. It's completely separate QMainWindow
, so that I can put it on the other monitor when testing the app. But when there's a dialog in my application, I cannot access the window. Right now, this is exactly the time I WANT to access it.
I tried to override QWidget::event
like so:
DebugWindow.h
#include <QtWidgets/QMainWindow>
QT_BEGIN_NAMESPACE
class QEvent;
QT_END_NAMESPACE
class DebugWindow : public QMainWindow
{
Q_OBJECT
public:
DebugWindow(QWidget *parent = 0);
virtual ~DebugWindow();
protected:
virtual bool event(QEvent*);
};
DebugWindow.cpp
bool TechadminScript::event(QEvent* e)
{
if (e->type() == QEvent::WindowBlocked) {
// accept the event to stop propagation
e->accept();
return true;
}
return false;
}
I have set up breakpoint in the overriden function and it was hit - that means I did something right. But the window is still blocked as it was before.
So I am probably missing something, can somebody help me finish this?