diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-02-14 10:32:11 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-02-15 08:07:33 +0100 |
commit | 092bcd7133c30c0614056928a16baea44704735e (patch) | |
tree | 06437b187d8d6a962da98c0b862351aed8908afe /vcl | |
parent | 43d962c27b6efb04d22b05ad8dec08f6056078a0 (diff) |
tdf#130857 qt weld: Move QWidget* member to QtInstanceWidget
Move the `m_pWidget` member from `QtInstanceWindow`
to the base class `QtInstanceWidget` and add a getter
for it.
This allows to get the `QWidget` directly from the
base class, which will be used in an upcoming commit.
Change-Id: I9c41b48936e5a6051afb9721dae2fac5add22e4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163360
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar <omkaracharekar12@gmail.com>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/qt5/QtInstanceContainer.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/qt5/QtInstanceWidget.hxx | 6 | ||||
-rw-r--r-- | vcl/inc/qt5/QtInstanceWindow.hxx | 2 | ||||
-rw-r--r-- | vcl/qt5/QtInstanceContainer.cxx | 5 | ||||
-rw-r--r-- | vcl/qt5/QtInstanceWidget.cxx | 6 | ||||
-rw-r--r-- | vcl/qt5/QtInstanceWindow.cxx | 7 |
6 files changed, 22 insertions, 6 deletions
diff --git a/vcl/inc/qt5/QtInstanceContainer.hxx b/vcl/inc/qt5/QtInstanceContainer.hxx index 87a89c48bd46..a0cd31869dc6 100644 --- a/vcl/inc/qt5/QtInstanceContainer.hxx +++ b/vcl/inc/qt5/QtInstanceContainer.hxx @@ -14,6 +14,8 @@ class QtInstanceContainer : public QtInstanceWidget, public virtual weld::Container { public: + QtInstanceContainer(QWidget* pWidget); + virtual void move(weld::Widget*, weld::Container*) override; virtual css::uno::Reference<css::awt::XWindow> CreateChildFrame() override; diff --git a/vcl/inc/qt5/QtInstanceWidget.hxx b/vcl/inc/qt5/QtInstanceWidget.hxx index ee0c5b8c451d..f5038ee5ad66 100644 --- a/vcl/inc/qt5/QtInstanceWidget.hxx +++ b/vcl/inc/qt5/QtInstanceWidget.hxx @@ -21,7 +21,13 @@ class QtInstanceWidget : public virtual weld::Widget { + QWidget* m_pWidget; + public: + QtInstanceWidget(QWidget* pWidget); + + QWidget* getQWidget() const { return m_pWidget; } + virtual void set_sensitive(bool) override; virtual bool get_sensitive() const override; diff --git a/vcl/inc/qt5/QtInstanceWindow.hxx b/vcl/inc/qt5/QtInstanceWindow.hxx index c29863da4f67..db80a6e71458 100644 --- a/vcl/inc/qt5/QtInstanceWindow.hxx +++ b/vcl/inc/qt5/QtInstanceWindow.hxx @@ -13,8 +13,6 @@ class QtInstanceWindow : public QtInstanceContainer, public virtual weld::Window { - QWidget* m_pWidget; - public: QtInstanceWindow(QWidget* pWidget); diff --git a/vcl/qt5/QtInstanceContainer.cxx b/vcl/qt5/QtInstanceContainer.cxx index e22b1afb2a55..35f0a4bbaa69 100644 --- a/vcl/qt5/QtInstanceContainer.cxx +++ b/vcl/qt5/QtInstanceContainer.cxx @@ -9,6 +9,11 @@ #include <QtInstanceContainer.hxx> +QtInstanceContainer::QtInstanceContainer(QWidget* pWidget) + : QtInstanceWidget(pWidget) +{ +} + void QtInstanceContainer::move(weld::Widget*, weld::Container*) {} css::uno::Reference<css::awt::XWindow> QtInstanceContainer::CreateChildFrame() diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx index cbccac8799db..9c17ebe6cb1d 100644 --- a/vcl/qt5/QtInstanceWidget.cxx +++ b/vcl/qt5/QtInstanceWidget.cxx @@ -9,6 +9,12 @@ #include <QtInstanceWidget.hxx> +QtInstanceWidget::QtInstanceWidget(QWidget* pWidget) + : m_pWidget(pWidget) +{ + assert(pWidget); +} + void QtInstanceWidget::set_sensitive(bool) {} bool QtInstanceWidget::get_sensitive() const { return true; } diff --git a/vcl/qt5/QtInstanceWindow.cxx b/vcl/qt5/QtInstanceWindow.cxx index 0e74c8d6f873..05dfec57a973 100644 --- a/vcl/qt5/QtInstanceWindow.cxx +++ b/vcl/qt5/QtInstanceWindow.cxx @@ -10,17 +10,16 @@ #include <QtInstanceWindow.hxx> QtInstanceWindow::QtInstanceWindow(QWidget* pWidget) - : m_pWidget(pWidget) + : QtInstanceContainer(pWidget) { - assert(m_pWidget); } void QtInstanceWindow::set_title(const OUString& rTitle) { - m_pWidget->setWindowTitle(toQString(rTitle)); + getQWidget()->setWindowTitle(toQString(rTitle)); } -OUString QtInstanceWindow::get_title() const { return toOUString(m_pWidget->windowTitle()); } +OUString QtInstanceWindow::get_title() const { return toOUString(getQWidget()->windowTitle()); } void QtInstanceWindow::window_move(int, int) {} |