diff --git a/examples/scriptableapplication/main.cpp b/examples/scriptableapplication/main.cpp
index d7cb4b6d..ce986c43 100644
--- a/examples/scriptableapplication/main.cpp
+++ b/examples/scriptableapplication/main.cpp
@@ -55,7 +55,7 @@
 
 int main(int argc, char *argv[])
 {
-    QApplication a(argc, argv);
+    MyApplication a(argc, argv);
     MainWindow mainWindow;
     const QRect availableGeometry =  a.desktop()->availableGeometry(&mainWindow);
     mainWindow.resize(availableGeometry.width() / 2, availableGeometry.height() / 2);
diff --git a/examples/scriptableapplication/mainwindow.cpp b/examples/scriptableapplication/mainwindow.cpp
index 15504cb6..0764419e 100644
--- a/examples/scriptableapplication/mainwindow.cpp
+++ b/examples/scriptableapplication/mainwindow.cpp
@@ -66,10 +66,24 @@
 #include <QtCore/QDebug>
 #include <QtCore/QTextStream>
 
-static const char defaultScript[] = R"(
+static const char defaultScript[] = R"P(
+from PySide2 import QtWidgets
+
 print("Hello, world")
-mainWindow.testFunction1()
-)";
+print('file menu', mainWindow.fileMenu())
+print('help menu', mainWindow.helpMenu())
+
+# ISSUE1: Derived class from QApplication does not fallback to QApplication
+app = QtWidgets.QApplication.instance()
+print("%s is a (%s)" % (str(app), app.metaObject().className()))
+
+app.__class__ = QtWidgets.QApplication
+
+# ISSUE2: Derived class from QMenu does not fallback to QMenu
+widgets = app.topLevelWidgets()
+for w in widgets:
+    print("%s is a (%s)" % (str(w), w.metaObject().className()))
+)P";
 
 MainWindow::MainWindow()
     : m_scriptEdit(new QPlainTextEdit(QString::fromLatin1(defaultScript).trimmed(), this))
@@ -77,6 +91,7 @@ MainWindow::MainWindow()
     setWindowTitle(tr("Scriptable Application"));
 
     QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+    m_fileMenu = fileMenu;
     const QIcon runIcon = QIcon::fromTheme(QStringLiteral("system-run"));
     QAction *runAction = fileMenu->addAction(runIcon, tr("&Run..."), this, &MainWindow::slotRunScript);
     runAction->setShortcut(Qt::CTRL + Qt::Key_R);
@@ -91,7 +106,10 @@ MainWindow::MainWindow()
     const QIcon clearIcon = QIcon::fromTheme(QStringLiteral("edit-clear"));
     QAction *clearAction = editMenu->addAction(clearIcon, tr("&Clear"), m_scriptEdit, &QPlainTextEdit::clear);
 
-    QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+    MyMenu* helpMenu = new MyMenu(tr("&Help"));
+    m_helpMenu  = helpMenu;
+    helpMenu->setObjectName("helpMenu(MyMenu!)");
+    menuBar()->addMenu(helpMenu);
     const QIcon aboutIcon = QIcon::fromTheme(QStringLiteral("help-about"));
     QAction *aboutAction = helpMenu->addAction(aboutIcon, tr("&About Qt"), qApp, &QApplication::aboutQt);
 
@@ -140,3 +158,14 @@ void MainWindow::testFunction1()
     qDebug().noquote() << message;
     statusBar()->showMessage(message);
 }
+
+QWidget *MainWindow::fileMenu() const
+{
+    return m_fileMenu;
+}
+
+QWidget *MainWindow::helpMenu() const
+{
+    return m_helpMenu;
+}
+
diff --git a/examples/scriptableapplication/mainwindow.h b/examples/scriptableapplication/mainwindow.h
index ce613833..254f22b1 100644
--- a/examples/scriptableapplication/mainwindow.h
+++ b/examples/scriptableapplication/mainwindow.h
@@ -51,10 +51,28 @@
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
 
+#include <QtWidgets/QApplication>
 #include <QtWidgets/QMainWindow>
+#include <QtWidgets/QMenu>
 
 class QPlainTextEdit;
 
+class MyApplication : public QApplication
+{
+    Q_OBJECT
+public:
+    MyApplication(int& argc, char** argv) :
+        QApplication(argc, argv) {}
+};
+
+class MyMenu : public QMenu
+{
+    Q_OBJECT
+public:
+    MyMenu(const QString& title, QWidget* parent = nullptr) :
+        QMenu(title, parent) {}
+};
+
 class MainWindow : public QMainWindow
 {
     Q_OBJECT
@@ -62,6 +80,8 @@ public:
     MainWindow();
 
     void testFunction1();
+    QWidget *fileMenu() const;
+    QWidget *helpMenu() const;
 
 private Q_SLOTS:
     void slotRunScript();
@@ -71,6 +91,8 @@ private:
     void runScript(const QStringList &);
 
     QPlainTextEdit *m_scriptEdit;
+    QWidget *m_fileMenu;
+    QWidget *m_helpMenu;
 };
 
 #endif // MAINWINDOW_H
