[Libreoffice-commits] core.git: vcl/CustomTarget_qt5_moc.mk vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5 vcl/unx

2021-09-29 Thread Michael Weghorn (via logerrit)
 vcl/CustomTarget_qt5_moc.mk   |   22 +-
 vcl/Library_vclplug_qt5.mk|   62 +++---
 vcl/inc/qt5/QtAccessibleEventListener.hxx |2 
 vcl/inc/qt5/QtFont.hxx|2 
 vcl/inc/qt5/QtFrame.hxx   |2 
 vcl/inc/qt5/QtGraphics.hxx|2 
 vcl/inc/qt5/QtInstance.hxx|2 
 vcl/inc/qt5/QtMainWindow.hxx  |2 
 vcl/inc/qt5/QtPainter.hxx |4 -
 vcl/inc/qt5/QtSvpGraphics.hxx |2 
 vcl/qt5/QtAccessibleEventListener.cxx |2 
 vcl/qt5/QtAccessibleWidget.cxx|   14 +++---
 vcl/qt5/QtBitmap.cxx  |6 +-
 vcl/qt5/QtClipboard.cxx   |   10 ++--
 vcl/qt5/QtData.cxx|2 
 vcl/qt5/QtDragAndDrop.cxx |8 +--
 vcl/qt5/QtFilePicker.cxx  |   12 ++---
 vcl/qt5/QtFont.cxx|4 -
 vcl/qt5/QtFontFace.cxx|6 +-
 vcl/qt5/QtFrame.cxx   |   28 ++---
 vcl/qt5/QtGraphics.cxx|   12 ++---
 vcl/qt5/QtGraphics_Controls.cxx   |6 +-
 vcl/qt5/QtGraphics_GDI.cxx|6 +-
 vcl/qt5/QtGraphics_Text.cxx   |8 +--
 vcl/qt5/QtInstance.cxx|   30 +++---
 vcl/qt5/QtInstance_Print.cxx  |4 -
 vcl/qt5/QtMainWindow.cxx  |6 +-
 vcl/qt5/QtMenu.cxx|   10 ++--
 vcl/qt5/QtObject.cxx  |8 +--
 vcl/qt5/QtOpenGLContext.cxx   |4 -
 vcl/qt5/QtPainter.cxx |2 
 vcl/qt5/QtPrinter.cxx |2 
 vcl/qt5/QtSvpGraphics.cxx |   12 ++---
 vcl/qt5/QtSvpSurface.cxx  |4 -
 vcl/qt5/QtSvpVirtualDevice.hxx|2 
 vcl/qt5/QtSystem.cxx  |4 -
 vcl/qt5/QtTimer.cxx   |4 -
 vcl/qt5/QtTools.cxx   |2 
 vcl/qt5/QtTransferable.cxx|6 +-
 vcl/qt5/QtVirtualDevice.cxx   |6 +-
 vcl/qt5/QtWidget.cxx  |   18 
 vcl/qt5/QtXAccessible.cxx |   10 ++--
 vcl/unx/kf5/KF5FilePicker.cxx |2 
 vcl/unx/kf5/KF5FilePicker.hxx |2 
 vcl/unx/kf5/KF5SalFrame.cxx   |2 
 vcl/unx/kf5/KF5SalFrame.hxx   |4 -
 vcl/unx/kf5/KF5SalInstance.cxx|2 
 vcl/unx/kf5/KF5SalInstance.hxx|2 
 48 files changed, 187 insertions(+), 187 deletions(-)

New commits:
commit b9cd02937b358ae035ed554a28037237a6c8434c
Author: Michael Weghorn 
AuthorDate: Tue Sep 28 15:55:43 2021 +0200
Commit: Michael Weghorn 
CommitDate: Wed Sep 29 13:50:28 2021 +0200

qt5: Rename sources + headers according to new class names

This renames the source and header files according to the
new class names without a "5" in them, as mentioned in
Change-Id: Idf422f82ca9dafbb70e9a64de9c8cfc4cc8c0909
(qt5: Remove "5" from class names in qt5 VCL plugin):

> Renaming the headers and source files will be done
> in a separate commit to make tracking git history easier.

Change-Id: If955e77c8ba508d0a2e01e3a9df1be6dc04c4e4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122806
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk
index 87caee8d918e..14360ae3ae26 100644
--- a/vcl/CustomTarget_qt5_moc.mk
+++ b/vcl/CustomTarget_qt5_moc.mk
@@ -10,17 +10,17 @@
 $(eval $(call gb_CustomTarget_CustomTarget,vcl/qt5))
 
 $(call gb_CustomTarget_get_target,vcl/qt5) : \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5AccessibleWidget.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Clipboard.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5FilePicker.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Frame.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Instance.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5MainWindow.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Menu.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Object.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Timer.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Widget.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5XAccessible.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/QtAccessibleWidget.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/QtClipboard.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/QtFilePicker.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/QtFrame.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/QtInstance.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/QtMainWindow.moc \
+   $(call 

[Libreoffice-commits] core.git: vcl/CustomTarget_qt5_moc.mk vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5

2018-10-01 Thread Libreoffice Gerrit user
 vcl/CustomTarget_qt5_moc.mk |2 
 vcl/Library_vclplug_qt5.mk  |2 
 vcl/inc/qt5/Qt5AccessibleWidget.hxx |8 -
 vcl/inc/qt5/Qt5XAccessible.hxx  |   11 +-
 vcl/qt5/Qt5AccessibleWidget.cxx |  162 ++--
 vcl/qt5/Qt5XAccessible.cxx  |   11 +-
 6 files changed, 65 insertions(+), 131 deletions(-)

New commits:
commit 7384e53bbc5163534ae898b7295b4efe51c8acde
Author: Samuel Mehrbrodt 
AuthorDate: Fri Sep 28 17:00:12 2018 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Oct 1 08:49:24 2018 +0200

qt5 a11y: Use UNO Api instead of vcl::Window methods

This gets us into the document itself, not only the widgets.

Change-Id: Id0cf1294817309c889729d01242cae69d2391130
Reviewed-on: https://gerrit.libreoffice.org/61094
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk
index ab8deea2e950..55e9dcee9cd3 100644
--- a/vcl/CustomTarget_qt5_moc.mk
+++ b/vcl/CustomTarget_qt5_moc.mk
@@ -17,8 +17,8 @@ $(call gb_CustomTarget_get_target,vcl/qt5) : \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5MainWindow.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Menu.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Timer.moc \
-   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5VclWindow.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Widget.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5XAccessible.moc \
 
 $(call gb_CustomTarget_get_workdir,vcl/qt5)/%.moc : \
$(SRCDIR)/vcl/inc/qt5/%.hxx \
diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index 3d350afe6a36..eda2e104d941 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -102,8 +102,8 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
 vcl/qt5/Qt5Timer \
 vcl/qt5/Qt5Tools \
 vcl/qt5/Qt5VirtualDevice \
-vcl/qt5/Qt5VclWindow \
 vcl/qt5/Qt5Widget \
+vcl/qt5/Qt5XAccessible \
 ))
 
 ifeq ($(OS),LINUX)
diff --git a/vcl/inc/qt5/Qt5AccessibleWidget.hxx 
b/vcl/inc/qt5/Qt5AccessibleWidget.hxx
index df6862567dd0..c77104931eb6 100644
--- a/vcl/inc/qt5/Qt5AccessibleWidget.hxx
+++ b/vcl/inc/qt5/Qt5AccessibleWidget.hxx
@@ -22,7 +22,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 class Qt5Frame;
 class Qt5Widget;
@@ -33,8 +33,7 @@ class VCLPLUG_QT5_PUBLIC Qt5AccessibleWidget : public 
QObject, public QAccessibl
 Q_OBJECT
 
 public:
-Qt5AccessibleWidget(Qt5Widget* pFrame, vcl::Window* pWindow);
-Qt5AccessibleWidget(vcl::Window* pWindow);
+Qt5AccessibleWidget(const 
css::uno::Reference xAccessible);
 QWindow* window() const override;
 int childCount() const override;
 int indexOfChild(const QAccessibleInterface* child) const override;
@@ -70,8 +69,7 @@ public:
 static QAccessibleInterface* customFactory(const QString& classname, 
QObject* object);
 
 private:
-Qt5Widget* m_pFrame;
-VclPtr m_pWindow;
+css::uno::Reference m_xAccessible;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5VclWindow.hxx b/vcl/inc/qt5/Qt5XAccessible.hxx
similarity index 59%
rename from vcl/inc/qt5/Qt5VclWindow.hxx
rename to vcl/inc/qt5/Qt5XAccessible.hxx
index f7883aa67c4d..66b3901f0b85 100644
--- a/vcl/inc/qt5/Qt5VclWindow.hxx
+++ b/vcl/inc/qt5/Qt5XAccessible.hxx
@@ -13,19 +13,22 @@
 
 #include 
 
+#include 
+
 #include 
 
 class Qt5Frame;
 class Qt5Widget;
 
-// Wrapper class to hold a vcl::Window while being able to pass it as a QObject
-class VCLPLUG_QT5_PUBLIC Qt5VclWindow : public QObject
+// Wrapper class to hold a css::accessibility::XAccessible object
+// while being able to pass it as a QObject
+class VCLPLUG_QT5_PUBLIC Qt5XAccessible : public QObject
 {
 Q_OBJECT
 
 public:
-Qt5VclWindow(vcl::Window* pWindow);
-VclPtr m_pWindow;
+Qt5XAccessible(css::uno::Reference 
xAccessible);
+css::uno::Reference m_xAccessible;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx
index b07182fbee8f..3fecb9a28155 100644
--- a/vcl/qt5/Qt5AccessibleWidget.cxx
+++ b/vcl/qt5/Qt5AccessibleWidget.cxx
@@ -24,28 +24,24 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
 #include 
 
+using namespace css;
 using namespace css::accessibility;
 using namespace css::uno;
 
-Qt5AccessibleWidget::Qt5AccessibleWidget(Qt5Widget* pFrame, vcl::Window* 
pWindow)
-: m_pFrame(pFrame)
-, m_pWindow(pWindow)
-{
-}
-
-Qt5AccessibleWidget::Qt5AccessibleWidget(vcl::Window* pWindow)
-: m_pWindow(pWindow)
+Qt5AccessibleWidget::Qt5AccessibleWidget(const Reference 
xAccessible)
+: m_xAccessible(xAccessible)
 {
 }
 
@@ -53,10 +49,7 @@ QWindow* Qt5AccessibleWidget::window() const { return 
nullptr; }
 
 int Qt5AccessibleWidget::childCount() const
 {
-  

[Libreoffice-commits] core.git: vcl/CustomTarget_qt5_moc.mk vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5

2018-09-27 Thread Libreoffice Gerrit user
 vcl/CustomTarget_qt5_moc.mk |2 
 vcl/Library_vclplug_qt5.mk  |2 
 vcl/inc/qt5/Qt5AccessibleWidget.hxx |   77 +
 vcl/inc/qt5/Qt5VclWindow.hxx|   31 ++
 vcl/inc/qt5/Qt5Widget.hxx   |3 
 vcl/qt5/Qt5AccessibleWidget.cxx |  511 
 vcl/qt5/Qt5MainWindow.cxx   |3 
 vcl/qt5/Qt5VclWindow.cxx|   26 +
 8 files changed, 653 insertions(+), 2 deletions(-)

New commits:
commit 4d382636b0b1c555af2b98f2f41b4776fd7b5ffb
Author: Samuel Mehrbrodt 
AuthorDate: Fri Sep 21 10:20:09 2018 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Thu Sep 27 17:05:02 2018 +0200

qt5: Add basic a11y support

Widget tree is displayed and basic role mapping is available.
Still needs quite some work (positions, actions, texts, etc.)

Change-Id: I9d26a762f1d9684f33bbb80a384cf2a0b8a905c0
Reviewed-on: https://gerrit.libreoffice.org/60853
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk
index 1ef8b89f9f48..ab8deea2e950 100644
--- a/vcl/CustomTarget_qt5_moc.mk
+++ b/vcl/CustomTarget_qt5_moc.mk
@@ -10,12 +10,14 @@
 $(eval $(call gb_CustomTarget_CustomTarget,vcl/qt5))
 
 $(call gb_CustomTarget_get_target,vcl/qt5) : \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5AccessibleWidget.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5FilePicker.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Frame.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Instance.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5MainWindow.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Menu.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Timer.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5VclWindow.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Widget.moc \
 
 $(call gb_CustomTarget_get_workdir,vcl/qt5)/%.moc : \
diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index d66a82319ed2..3d350afe6a36 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_add_libs,vclplug_qt5,\
 endif
 
 $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
+vcl/qt5/Qt5AccessibleWidget \
 vcl/qt5/Qt5Bitmap \
 vcl/qt5/Qt5Data \
 vcl/qt5/Qt5FilePicker \
@@ -101,6 +102,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
 vcl/qt5/Qt5Timer \
 vcl/qt5/Qt5Tools \
 vcl/qt5/Qt5VirtualDevice \
+vcl/qt5/Qt5VclWindow \
 vcl/qt5/Qt5Widget \
 ))
 
diff --git a/vcl/inc/qt5/Qt5AccessibleWidget.hxx 
b/vcl/inc/qt5/Qt5AccessibleWidget.hxx
new file mode 100644
index ..df6862567dd0
--- /dev/null
+++ b/vcl/inc/qt5/Qt5AccessibleWidget.hxx
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+class Qt5Frame;
+class Qt5Widget;
+
+class VCLPLUG_QT5_PUBLIC Qt5AccessibleWidget : public QObject, public 
QAccessibleInterface
+//public QAccessibleActionInterface
+{
+Q_OBJECT
+
+public:
+Qt5AccessibleWidget(Qt5Widget* pFrame, vcl::Window* pWindow);
+Qt5AccessibleWidget(vcl::Window* pWindow);
+QWindow* window() const override;
+int childCount() const override;
+int indexOfChild(const QAccessibleInterface* child) const override;
+QVector>
+relations(QAccessible::Relation match = QAccessible::AllRelations) const 
override;
+QAccessibleInterface* focusChild() const override;
+
+QRect rect() const override;
+
+QAccessibleInterface* parent() const override;
+QAccessibleInterface* child(int index) const override;
+
+QString text(QAccessible::Text t) const override;
+QAccessible::Role role() const override;
+QAccessible::State state() const override;
+
+QColor foregroundColor() const override;
+QColor backgroundColor() const override;
+
+bool isValid() const override;
+QObject* object() const override;
+void setText(QAccessible::Text t, const QString& text) override;
+QAccessibleInterface* childAt(int x, int y) const override;
+
+void* interface_cast(QAccessible::InterfaceType t) override;
+
+// QAccessibleActionInterface
+/*  QStringList actionNames() const override;
+void doAction(const QString& actionName) override;
+QStringList keyBindingsForAction(const QString& actionName) const 
override; */
+
+// Factory
+static QAccessibleInterface* customFactory(const QString& classname, 
QObject* object);

[Libreoffice-commits] core.git: vcl/CustomTarget_qt5_moc.mk vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5

2018-08-12 Thread Libreoffice Gerrit user
 vcl/CustomTarget_qt5_moc.mk   |1 
 vcl/Library_vclplug_qt5.mk|1 
 vcl/inc/qt5/Qt5Frame.hxx  |   12 -
 vcl/inc/qt5/Qt5MainWindow.hxx |   41 ++
 vcl/inc/qt5/Qt5Widget.hxx |2 
 vcl/qt5/Qt5Frame.cxx  |   92 +++---
 vcl/qt5/Qt5MainWindow.cxx |   36 
 vcl/qt5/Qt5Menu.cxx   |4 -
 vcl/qt5/Qt5Widget.cxx |   34 +--
 9 files changed, 172 insertions(+), 51 deletions(-)

New commits:
commit 8d791a9d9657f6573ce27947c0289b36c6eba77c
Author: Katarina Behrens 
AuthorDate: Thu Aug 9 17:14:14 2018 +0200
Commit: Thorsten Behrens 
CommitDate: Sun Aug 12 22:25:54 2018 +0200

Set Qt5Widget to be a central widget of QMainWindow

this is meant to solve the problem of native menu bar overlapping
w/ non-native, as well as the inability to place an object or select
text dragging the mouse cursor w/ LMB pressed

Change-Id: I29f590ebf79d1ecc7e17b402125384cf13774bf3
Reviewed-on: https://gerrit.libreoffice.org/58171
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk
index 3962a730d388..afce4d44fd2b 100644
--- a/vcl/CustomTarget_qt5_moc.mk
+++ b/vcl/CustomTarget_qt5_moc.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_CustomTarget_CustomTarget,vcl/qt5))
 $(call gb_CustomTarget_get_target,vcl/qt5) : \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5FilePicker.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Instance.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5MainWindow.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Menu.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Timer.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Widget.moc \
diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index 1ad01555ed3a..d66a82319ed2 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -92,6 +92,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
 vcl/qt5/Qt5Graphics_Text \
 vcl/qt5/Qt5Instance \
 vcl/qt5/Qt5Instance_Print \
+vcl/qt5/Qt5MainWindow \
 vcl/qt5/Qt5Menu \
 vcl/qt5/Qt5Object \
 vcl/qt5/Qt5Painter \
diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index 310298879e52..04ade0b38b2d 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -31,7 +31,9 @@ class Qt5Graphics;
 class Qt5Instance;
 class Qt5Menu;
 class QWidget;
+class Qt5MainWindow;
 class QPaintDevice;
+class QScreen;
 class QImage;
 class SvpSalGraphics;
 
@@ -39,7 +41,8 @@ class VCLPLUG_QT5_PUBLIC Qt5Frame : public SalFrame
 {
 friend class VclQtMixinBase;
 
-std::unique_ptr m_pQWidget;
+QWidget* m_pQWidget;
+Qt5MainWindow* m_pTopLevel;
 
 const bool m_bUseCairo;
 std::unique_ptr m_pQImage;
@@ -76,6 +79,10 @@ class VCLPLUG_QT5_PUBLIC Qt5Frame : public SalFrame
 return bool(m_nStyle & nMask);
 }
 
+bool isWindow();
+QWindow* windowHandle();
+QScreen* screen();
+
 void TriggerPaintEvent();
 void TriggerPaintEvent(QRect aRect);
 
@@ -83,7 +90,8 @@ public:
 Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nSalFrameStyle, bool 
bUseCairo);
 virtual ~Qt5Frame() override;
 
-QWidget* GetQWidget() const { return m_pQWidget.get(); }
+QWidget* GetQWidget() const { return m_pQWidget; }
+Qt5MainWindow* GetTopLevelWindow() const { return m_pTopLevel; }
 
 void Damage(sal_Int32 nExtentsX, sal_Int32 nExtentsY, sal_Int32 
nExtentsWidth,
 sal_Int32 nExtentsHeight) const;
diff --git a/vcl/inc/qt5/Qt5MainWindow.hxx b/vcl/inc/qt5/Qt5MainWindow.hxx
new file mode 100644
index ..caac2299c4bc
--- /dev/null
+++ b/vcl/inc/qt5/Qt5MainWindow.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include "Qt5Frame.hxx"
+
+class Qt5MainWindow : public QMainWindow
+{
+Q_OBJECT
+
+Qt5Frame* m_pFrame;
+
+virtual void closeEvent(QCloseEvent* pEvent) override;
+