summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2025-01-22 21:54:37 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2025-01-23 08:29:22 +0100
commitd7fd4f2f84aba449dcd03b20ae4f295172164131 (patch)
treeb1cb68023a92cf4ca8e36f60ec31fb625dab8f5a /vcl/inc
parent18df81e1568f4944a8fd79fd81e85d263dc0325b (diff)
tdf#130857 qt weld: Introduce QtInstanceBox
Introduce QtInstanceBox as the weld::Box implementation using native Qt widgets. weld::Box is used e.g. in the (not yet supported by QtInstanceBuilder) macro security dialog, which however doesn't make use of any weld::Box-specific API (only uses the weld::Container API), so leave implementing the logic for those for later. Change-Id: I6d3948e1282dd6178a3762c235bd8fc97c6e9e34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180609 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/qt5/QtInstanceBox.hxx25
-rw-r--r--vcl/inc/qt5/QtInstanceBuilder.hxx2
-rw-r--r--vcl/inc/qt6/QtInstanceBox.hxx12
3 files changed, 38 insertions, 1 deletions
diff --git a/vcl/inc/qt5/QtInstanceBox.hxx b/vcl/inc/qt5/QtInstanceBox.hxx
new file mode 100644
index 000000000000..68ac5f22807b
--- /dev/null
+++ b/vcl/inc/qt5/QtInstanceBox.hxx
@@ -0,0 +1,25 @@
+/* -*- 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 "QtInstanceContainer.hxx"
+
+class QtInstanceBox : public QtInstanceContainer, public virtual weld::Box
+{
+ Q_OBJECT
+
+public:
+ QtInstanceBox(QWidget* pWidget);
+
+ virtual void reorder_child(weld::Widget* pWidget, int nPosition) override;
+ virtual void sort_native_button_order() override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/inc/qt5/QtInstanceBuilder.hxx b/vcl/inc/qt5/QtInstanceBuilder.hxx
index 340d332a86e0..8b1051a4a3f0 100644
--- a/vcl/inc/qt5/QtInstanceBuilder.hxx
+++ b/vcl/inc/qt5/QtInstanceBuilder.hxx
@@ -35,7 +35,7 @@ public:
virtual std::unique_ptr<weld::Window> create_screenshot_window() override;
virtual std::unique_ptr<weld::Widget> weld_widget(const OUString& rId) override;
virtual std::unique_ptr<weld::Container> weld_container(const OUString& rId) override;
- virtual std::unique_ptr<weld::Box> weld_box(const OUString&) 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::Frame> weld_frame(const OUString& rId) override;
diff --git a/vcl/inc/qt6/QtInstanceBox.hxx b/vcl/inc/qt6/QtInstanceBox.hxx
new file mode 100644
index 000000000000..3917bce997e8
--- /dev/null
+++ b/vcl/inc/qt6/QtInstanceBox.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/QtInstanceBox.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */