tdf#126020 Qt5 delete orphan Qt5ObjectWindows

The Qt5ObjectWindow is "adopted" by Qt5Frame's QWidget, which
is needed for the correct display. But since the Qt5Object is
itself a child of the Qt5Frame, it'll be deleted before the
Qt5Frame, which keeps the Qt5ObjectWindows alive.
But the Qt5ObjectWindows child relies on the Qt5Object parent,
so reap it, when the real parent is destructed.

And just in case the Qt5Frame will delete the QWidget with the
child while the Qt5Object is still alive, update the pointer to
the child on its destruction.

Change-Id: I563ddc2294b7b1651f56abdde75319c7455dd9b7
Reviewed-on: https://gerrit.libreoffice.org/74482
Tested-by: Jenkins
Reviewed-by: Aleksei Nikiforov <darktemplar@basealt.ru>
(cherry picked from commit f0c9b93e5bc7976dea5de4a49be87cc9892941a7)
Reviewed-on: https://gerrit.libreoffice.org/74496
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
diff --git a/vcl/inc/qt5/Qt5Object.hxx b/vcl/inc/qt5/Qt5Object.hxx
index 6bfdd81..c6dce6e 100644
--- a/vcl/inc/qt5/Qt5Object.hxx
+++ b/vcl/inc/qt5/Qt5Object.hxx
@@ -33,8 +33,6 @@
{
    Q_OBJECT

    friend class Qt5OpenGLContext;

    SystemEnvData m_aSystemData;
    Qt5Frame* m_pParent;
    QWidget* m_pQWidget; // main widget, container
@@ -43,6 +41,7 @@

public:
    Qt5Object(Qt5Frame* pParent, bool bShow);
    ~Qt5Object() override;

    Qt5Frame* frame() const { return m_pParent; }
    QWidget* widget() const { return m_pQWidget; }
diff --git a/vcl/qt5/Qt5Object.cxx b/vcl/qt5/Qt5Object.cxx
index cf0bd05..a0afe81 100644
--- a/vcl/qt5/Qt5Object.cxx
+++ b/vcl/qt5/Qt5Object.cxx
@@ -36,6 +36,7 @@
    m_pQWindow = new Qt5ObjectWindow(*this);
    m_pQWidget = QWidget::createWindowContainer(m_pQWindow, pParent->GetQWidget());
    m_pQWidget->setAttribute(Qt::WA_NoSystemBackground);
    connect(m_pQWidget, &QObject::destroyed, this, [this]() { m_pQWidget = nullptr; });

    if (bShow)
        m_pQWidget->show();
@@ -65,6 +66,15 @@
    }
}

Qt5Object::~Qt5Object()
{
    if (m_pQWidget)
    {
        m_pQWidget->setParent(nullptr);
        delete m_pQWidget;
    }
}

void Qt5Object::ResetClipRegion()
{
    if (m_pQWidget)