diff --git a/tests/manual/containertest/containertest.pro b/tests/manual/containertest/containertest.pro
index 55cfe12..975b3e2 100644
--- a/tests/manual/containertest/containertest.pro
+++ b/tests/manual/containertest/containertest.pro
@@ -1,5 +1,11 @@
 QT += core gui widgets axcontainer
 
+DIAGLIB =
+exists($$(QTDIR)):DIAGLIB = $$(QTDIR)/tests/manual/diaglib
+# Building against Qt4 or QTDIR not set:
+!exists($$DIAGLIB):DIAGLIB=d:/dev/5-vs13-stable-dbg/qt-stable-dbg/qtbase/tests/manual/diaglib
+exists($$DIAGLIB):include($$DIAGLIB/diaglib.pri)
+
 TARGET = containertest
 TEMPLATE = app
 
@@ -7,3 +13,4 @@ SOURCES += main.cpp \
     mainwindow.cpp
 
 HEADERS += mainwindow.h
+CONFIG+=console
diff --git a/tests/manual/containertest/main.cpp b/tests/manual/containertest/main.cpp
index 4e7358f..cbe099e 100644
--- a/tests/manual/containertest/main.cpp
+++ b/tests/manual/containertest/main.cpp
@@ -36,6 +36,10 @@
 #include <QCommandLineParser>
 #include <QCommandLineOption>
 
+#ifdef QT_DIAG_LIB
+#  include <eventfilter.h>
+#endif
+
 // A stripped-down version of testcon for comparing QAxWidget, QAxWindow.
 
 int main(int argc, char *argv[])
@@ -48,7 +52,13 @@ int main(int argc, char *argv[])
     parser.addVersionOption();
     QCommandLineOption extendedOption("extended", "Add 2nd row of controls");
     parser.addOption(extendedOption);
-    parser.process(a);
+    QStringList args = QCoreApplication::arguments();
+#ifdef QT_DIAG_LIB
+    if (!args.removeAll("-e")) {
+        a.installEventFilter(new QtDiag::EventFilter(&a));
+    }
+#endif
+    parser.process(args);
 
     MainWindow w;
     w.createPanels(parser.isSet(extendedOption));
diff --git a/tests/manual/containertest/mainwindow.cpp b/tests/manual/containertest/mainwindow.cpp
index e73c24f..a719f7f 100644
--- a/tests/manual/containertest/mainwindow.cpp
+++ b/tests/manual/containertest/mainwindow.cpp
@@ -50,6 +50,13 @@
 #include <ActiveQt/QAxSelect>
 #include <ActiveQt/QAxWidget>
 #include <ActiveQt/QAxWindow>
+#include <QDebug>
+
+#ifdef QT_DIAG_LIB
+#  include <qwidgetdump.h>
+#  include <qwindowdump.h>
+#  include <nativewindowdump.h>
+#endif
 
 static const char clsIdWebBrowser[] = "{8856F961-340A-11D0-A96B-00C04FD705A2}";
 
@@ -145,7 +152,9 @@ void QAxControlPanel::setControl()
     const QString clsid = selectDialog.clsid();
     if (clsid.isEmpty())
         return;
+    qDebug() << __FUNCTION__ << m_control << clsid << '>';
     m_control->setControl(clsid);
+    qDebug() << __FUNCTION__ << m_control << clsid << '<';
 }
 
 void QAxControlPanel::setInternetExplorerControl()
@@ -156,8 +165,10 @@ void QAxControlPanel::setInternetExplorerControl()
 
 void QAxControlPanel::setKnownControl()
 {
-    if (QAction *a = qobject_cast<QAction *>(sender()))
+    if (QAction *a = qobject_cast<QAction *>(sender())) {
+        qDebug() << __FUNCTION__ << m_control << a->data();
        m_control->setControl(a->data().toString());
+    }
 }
 
 void QAxControlPanel::displayInfo()
@@ -220,6 +231,10 @@ MainWindow::MainWindow(QWidget *parent)
     exitAction->setStatusTip(tr("Exit the application"));
     connect(exitAction, &QAction::triggered, this, &QWidget::close);
 
+    QAction *da = fileMenu->addAction(tr("Dump"));
+    da->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D));
+    connect(da, &QAction::triggered, this, &MainWindow::dumpWins);
+
     QMenu *aboutMenu = mBar->addMenu(tr("&About"));
     QAction *aboutAction = aboutMenu->addAction(tr("&About Qt"));
     connect(aboutAction, &QAction::triggered, qApp, &QApplication::aboutQt);
@@ -240,4 +255,18 @@ void MainWindow::createPanels(bool extended)
     setCentralWidget(centralWidget);
 }
 
+void MainWindow::dumpWins()
+{
+    qDebug() << __FUNCTION__ << '>';
+#ifdef QT_DIAG_LIB
+    QtDiag::dumpAllWidgets();
+    QtDiag::dumpAllWindows();
+    QtDiag::dumpNativeWindows();
+
+#else
+    qDebug("NOT A");
+#endif
+    qDebug() << __FUNCTION__ << '<';
+}
+
 #include "mainwindow.moc"
diff --git a/tests/manual/containertest/mainwindow.h b/tests/manual/containertest/mainwindow.h
index 977e51d..6db14b7 100644
--- a/tests/manual/containertest/mainwindow.h
+++ b/tests/manual/containertest/mainwindow.h
@@ -47,6 +47,9 @@ public:
     explicit MainWindow(QWidget *parent = 0);
     void createPanels(bool extended);
 
+public slots:
+    void dumpWins();
+
 private:
     QAxWidget *m_axWidget;
     QAxWindow *m_axWindow;
