dbaccess/source/ui/app/AppDetailView.hxx | 1 dbaccess/source/ui/inc/TableDesignView.hxx | 1 include/sfx2/devtools/ObjectInspectorWidgets.hxx | 1 include/vcl/weld/Paned.hxx | 27 +++++++++++++++++++++ include/vcl/weld/weld.hxx | 9 ------- sfx2/source/appl/newhelp.hxx | 1 vcl/CustomTarget_qt5_moc.mk | 1 vcl/CustomTarget_qt6_moc.mk | 1 vcl/Library_vclplug_qt5.mk | 1 vcl/Library_vclplug_qt6.mk | 1 vcl/inc/qt5/QtInstanceBuilder.hxx | 3 +- vcl/inc/qt5/QtInstancePaned.hxx | 29 +++++++++++++++++++++++ vcl/inc/qt5/QtInstanceWindow.hxx | 2 - vcl/inc/qt6/QtInstancePaned.hxx | 12 +++++++++ vcl/qt5/QtInstanceBuilder.cxx | 13 +++++++--- vcl/qt5/QtInstancePaned.cxx | 26 ++++++++++++++++++++ vcl/qt5/QtInstanceWindow.cxx | 7 ++++- vcl/qt6/QtInstancePaned.cxx | 12 +++++++++ vcl/source/app/salvtables.cxx | 1 vcl/unx/gtk3/gtkinst.cxx | 1 20 files changed, 135 insertions(+), 15 deletions(-)
New commits: commit 711d389c0c2d1b19b35ce8694cbc2261e8fbf1e5 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Jan 9 01:05:42 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Jan 10 23:19:46 2026 +0100 tdf#130857 qt weld: Introduce QtInstancePaned Introduce QtInstancePaned as weld::Paned implementation using a native QSplitter and return an instance in QtInstanceBuilder::weld_paned. Creating a QSplitter for a "GtkPaned" object in a .ui file was already implemented in previous commit commit 78a27033548ad931932dbc91f2be5637337135d8 Author: Michael Weghorn <[email protected]> Date: Thu Dec 19 23:35:40 2024 +0100 tdf#130857 qt weld: Create QSplitter for "GtkPaned" Implementing the actual logic for QtInstancePaned::{g,s}et_position is left for a future commit. Change-Id: Iff4b24368aa4ac5006adf4944d6ea2db0a70c7ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196897 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk index c55ac794504b..ba043a0e036e 100644 --- a/vcl/CustomTarget_qt5_moc.mk +++ b/vcl/CustomTarget_qt5_moc.mk @@ -43,6 +43,7 @@ $(call gb_CustomTarget_get_target,vcl/qt5) : \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceMenuButton.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceMessageDialog.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceNotebook.moc \ + $(gb_CustomTarget_workdir)/vcl/qt5/QtInstancePaned.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstancePopover.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceProgressBar.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceRadioButton.moc \ diff --git a/vcl/CustomTarget_qt6_moc.mk b/vcl/CustomTarget_qt6_moc.mk index 2f4eb8264c4c..be3f11dad86d 100644 --- a/vcl/CustomTarget_qt6_moc.mk +++ b/vcl/CustomTarget_qt6_moc.mk @@ -43,6 +43,7 @@ $(call gb_CustomTarget_get_target,vcl/qt6) : \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceMenuButton.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceMessageDialog.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceNotebook.moc \ + $(gb_CustomTarget_workdir)/vcl/qt6/QtInstancePaned.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstancePopover.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceProgressBar.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceRadioButton.moc \ diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index d3deabaa9476..61eb1f2683e5 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -126,6 +126,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/QtInstanceMenuButton \ vcl/qt5/QtInstanceMessageDialog \ vcl/qt5/QtInstanceNotebook \ + vcl/qt5/QtInstancePaned \ vcl/qt5/QtInstancePopover \ vcl/qt5/QtInstanceProgressBar \ vcl/qt5/QtInstanceRadioButton \ diff --git a/vcl/Library_vclplug_qt6.mk b/vcl/Library_vclplug_qt6.mk index cb42295ab379..b1aa8edcace3 100644 --- a/vcl/Library_vclplug_qt6.mk +++ b/vcl/Library_vclplug_qt6.mk @@ -125,6 +125,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt6,\ vcl/qt6/QtInstanceMenuButton \ vcl/qt6/QtInstanceMessageDialog \ vcl/qt6/QtInstanceNotebook \ + vcl/qt6/QtInstancePaned \ vcl/qt6/QtInstancePopover \ vcl/qt6/QtInstanceProgressBar \ vcl/qt6/QtInstanceRadioButton \ diff --git a/vcl/inc/qt5/QtInstanceBuilder.hxx b/vcl/inc/qt5/QtInstanceBuilder.hxx index d6caffa040a2..e63e96c8f5a6 100644 --- a/vcl/inc/qt5/QtInstanceBuilder.hxx +++ b/vcl/inc/qt5/QtInstanceBuilder.hxx @@ -48,7 +48,7 @@ public: virtual std::unique_ptr<weld::Container> weld_container(const OUString& rId) override; virtual std::unique_ptr<weld::Box> weld_box(const OUString& rId) override; virtual std::unique_ptr<weld::Grid> weld_grid(const OUString& rId) override; - virtual std::unique_ptr<weld::Paned> weld_paned(const OUString&) override; + virtual std::unique_ptr<weld::Paned> weld_paned(const OUString& rId) override; virtual std::unique_ptr<weld::Frame> weld_frame(const OUString& rId) override; virtual std::unique_ptr<weld::ScrolledWindow> weld_scrolled_window(const OUString& rId, bool bUserManagedScrolling = false) override; diff --git a/vcl/inc/qt5/QtInstancePaned.hxx b/vcl/inc/qt5/QtInstancePaned.hxx new file mode 100644 index 000000000000..1bbe9795bb88 --- /dev/null +++ b/vcl/inc/qt5/QtInstancePaned.hxx @@ -0,0 +1,29 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 "QtInstanceWidget.hxx" + +#include <vcl/weld/Paned.hxx> + +#include <QtWidgets/QSplitter> + +class QtInstancePaned : public QtInstanceWidget, public virtual weld::Paned +{ + Q_OBJECT + +public: + QtInstancePaned(QSplitter* pSplitter); + + virtual void set_position(int nPos) override; + virtual int get_position() const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/inc/qt6/QtInstancePaned.hxx b/vcl/inc/qt6/QtInstancePaned.hxx new file mode 100644 index 000000000000..ec5416034447 --- /dev/null +++ b/vcl/inc/qt6/QtInstancePaned.hxx @@ -0,0 +1,12 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#include "../qt5/QtInstancePaned.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index bf454f670b77..577d9923d267 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -33,6 +33,7 @@ #include <QtInstanceMenuButton.hxx> #include <QtInstanceMessageDialog.hxx> #include <QtInstanceNotebook.hxx> +#include <QtInstancePaned.hxx> #include <QtInstancePopover.hxx> #include <QtInstanceProgressBar.hxx> #include <QtInstanceRadioButton.hxx> @@ -403,10 +404,16 @@ std::unique_ptr<weld::Grid> QtInstanceBuilder::weld_grid(const OUString& rId) return xRet; } -std::unique_ptr<weld::Paned> QtInstanceBuilder::weld_paned(const OUString&) +std::unique_ptr<weld::Paned> QtInstanceBuilder::weld_paned(const OUString& rId) { - assert(false && "Not implemented yet"); - return nullptr; + SolarMutexGuard g; + + std::unique_ptr<weld::Paned> xRet; + GetQtInstance().RunInMainThread([&] { + if (QSplitter* pSplitter = m_xBuilder->get<QSplitter>(rId)) + xRet = std::make_unique<QtInstancePaned>(pSplitter); + }); + return xRet; } std::unique_ptr<weld::Frame> QtInstanceBuilder::weld_frame(const OUString& rId) diff --git a/vcl/qt5/QtInstancePaned.cxx b/vcl/qt5/QtInstancePaned.cxx new file mode 100644 index 000000000000..65e7db7a2d64 --- /dev/null +++ b/vcl/qt5/QtInstancePaned.cxx @@ -0,0 +1,26 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#include <QtInstancePaned.hxx> +#include <QtInstancePaned.moc> + +QtInstancePaned::QtInstancePaned(QSplitter* pSplitter) + : QtInstanceWidget(pSplitter) +{ +} + +void QtInstancePaned::set_position(int) { assert(false && "Not implemented yet"); } + +int QtInstancePaned::get_position() const +{ + assert(false && "Not implemented yet"); + return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/qt6/QtInstancePaned.cxx b/vcl/qt6/QtInstancePaned.cxx new file mode 100644 index 000000000000..851b88824e3b --- /dev/null +++ b/vcl/qt6/QtInstancePaned.cxx @@ -0,0 +1,12 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#include "../qt5/QtInstancePaned.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ commit 6f837567882925e79c75caf86664e627deb472f4 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Jan 9 00:47:34 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Jan 10 23:19:39 2026 +0100 weld: Move weld::Paned to own header Move the class out of weld.hxx into its own header, in order to make it easier to keep an overview and to avoid having to recompile ~all UI code when the class is modified. Change-Id: I8b24cd3566f44be24d28c202f523d3a74bc17de1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196896 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index 117cc9eb79f4..ad3a9351b74f 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/sdb/application/NamedDatabaseObject.hpp> #include <vcl/mnemonic.hxx> +#include <vcl/weld/Paned.hxx> #include <vcl/weld/TextView.hxx> #include <IClipBoardTest.hxx> #include "AppTitleWindow.hxx" diff --git a/dbaccess/source/ui/inc/TableDesignView.hxx b/dbaccess/source/ui/inc/TableDesignView.hxx index 2dec087df0c2..d00f20221b0a 100644 --- a/dbaccess/source/ui/inc/TableDesignView.hxx +++ b/dbaccess/source/ui/inc/TableDesignView.hxx @@ -21,6 +21,7 @@ #include <dbaccess/dataview.hxx> #include <com/sun/star/lang/Locale.hpp> #include <vcl/InterimItemWindow.hxx> +#include <vcl/weld/Paned.hxx> #include <vcl/weld/weld.hxx> #include "IClipBoardTest.hxx" diff --git a/include/sfx2/devtools/ObjectInspectorWidgets.hxx b/include/sfx2/devtools/ObjectInspectorWidgets.hxx index 56d31a8c43a2..68590acf3b4d 100644 --- a/include/sfx2/devtools/ObjectInspectorWidgets.hxx +++ b/include/sfx2/devtools/ObjectInspectorWidgets.hxx @@ -12,6 +12,7 @@ #include <sfx2/dllapi.h> #include <vcl/weld/Builder.hxx> +#include <vcl/weld/Paned.hxx> #include <vcl/weld/TextView.hxx> #include <vcl/weld/TreeView.hxx> #include <vcl/weld/weld.hxx> diff --git a/include/vcl/weld/Paned.hxx b/include/vcl/weld/Paned.hxx new file mode 100644 index 000000000000..ca49dbc961d9 --- /dev/null +++ b/include/vcl/weld/Paned.hxx @@ -0,0 +1,27 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 <vcl/dllapi.h> +#include <vcl/weld/weld.hxx> + +namespace weld +{ +class VCL_DLLPUBLIC Paned : virtual public Widget +{ +public: + // set pixel position of divider + virtual void set_position(int nPos) = 0; + // get pixel position of divider + virtual int get_position() const = 0; +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/vcl/weld/weld.hxx b/include/vcl/weld/weld.hxx index 1e5499819664..addb210c9ac6 100644 --- a/include/vcl/weld/weld.hxx +++ b/include/vcl/weld/weld.hxx @@ -436,15 +436,6 @@ public: virtual int get_child_top_attach(weld::Widget& rWidget) const = 0; }; -class VCL_DLLPUBLIC Paned : virtual public Widget -{ -public: - // set pixel position of divider - virtual void set_position(int nPos) = 0; - // get pixel position of divider - virtual int get_position() const = 0; -}; - class VCL_DLLPUBLIC Frame : virtual public Container { public: diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index a083781cfadd..d629305d0826 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -31,6 +31,7 @@ #include <vcl/weld/ComboBox.hxx> #include <vcl/weld/DialogController.hxx> #include <vcl/weld/Entry.hxx> +#include <vcl/weld/Paned.hxx> #include <vcl/weld/TreeView.hxx> #include <vcl/weld/weld.hxx> #include <vcl/window.hxx> diff --git a/vcl/inc/qt5/QtInstanceBuilder.hxx b/vcl/inc/qt5/QtInstanceBuilder.hxx index 81ff045fbfd9..d6caffa040a2 100644 --- a/vcl/inc/qt5/QtInstanceBuilder.hxx +++ b/vcl/inc/qt5/QtInstanceBuilder.hxx @@ -23,6 +23,7 @@ #include <vcl/weld/EntryTreeView.hxx> #include <vcl/weld/FormattedSpinButton.hxx> #include <vcl/weld/MetricSpinButton.hxx> +#include <vcl/weld/Paned.hxx> #include <vcl/weld/SpinButton.hxx> #include <vcl/weld/TextView.hxx> #include <vcl/weld/TreeView.hxx> diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 580a98a34198..10b3e9ec4044 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -71,6 +71,7 @@ #include <vcl/toolkit/treelistentry.hxx> #include <vcl/toolkit/throbber.hxx> #include <vcl/toolkit/unowrap.hxx> +#include <vcl/weld/Paned.hxx> #include <vcl/weld/weld.hxx> #include <vcl/weld/weldutils.hxx> #include <vcl/toolkit/vclmedit.hxx> diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 137a0259d4f7..c9fa85e2b9f1 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -38,6 +38,7 @@ #include <vcl/toolkit/floatwin.hxx> #include <vcl/weld/FormattedSpinButton.hxx> #include <vcl/weld/MetricSpinButton.hxx> +#include <vcl/weld/Paned.hxx> #include <vcl/weld/ScrolledWindow.hxx> #include <vcl/weld/SpinButton.hxx> #include <vcl/weld/TextView.hxx> commit cbbeb51c3f522507fee5205fb3d7bcca20fa6907 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Jan 8 23:43:22 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Jan 10 23:19:33 2026 +0100 tdf#130857 weld: Implement QtInstanceWindow::window_move Note that while there is QWidget API for moving a widget/window, this doesn't change anything about the fact that this isn't supported on Wayland, see also [1]: > Note: Not all windowing systems support setting or querying top level > window positions. On such a system, programmatically moving windows may > not have any effect, and artificial values may be returned for the > current positions, such as QPoint(0, 0). [1] https://doc.qt.io/qt-6/qwidget.html#pos-prop Change-Id: I0eb562e488c36ee74e100897346f0df194b5f7af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196894 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/inc/qt5/QtInstanceWindow.hxx b/vcl/inc/qt5/QtInstanceWindow.hxx index 895fb92925d0..5ae39260838a 100644 --- a/vcl/inc/qt5/QtInstanceWindow.hxx +++ b/vcl/inc/qt5/QtInstanceWindow.hxx @@ -24,7 +24,7 @@ public: virtual void set_title(const OUString& rTitle) override; virtual OUString get_title() const override; - virtual void window_move(int, int) override; + virtual void window_move(int x, int y) override; virtual bool get_resizable() const override; virtual Size get_size() const override; virtual Point get_position() const override; diff --git a/vcl/qt5/QtInstanceWindow.cxx b/vcl/qt5/QtInstanceWindow.cxx index 43cdb02b761f..2999133c5691 100644 --- a/vcl/qt5/QtInstanceWindow.cxx +++ b/vcl/qt5/QtInstanceWindow.cxx @@ -54,7 +54,12 @@ OUString QtInstanceWindow::get_title() const return toOUString(getQWidget()->windowTitle()); } -void QtInstanceWindow::window_move(int, int) { assert(false && "Not implemented yet"); } +void QtInstanceWindow::window_move(int x, int y) +{ + SolarMutexGuard g; + + GetQtInstance().RunInMainThread([&] { getQWidget()->move(x, y); }); +} bool QtInstanceWindow::get_resizable() const {
