vcl/inc/qt5/QtInstanceBuilder.hxx | 4 ++-- vcl/qt5/QtInstanceBuilder.cxx | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-)
New commits: commit bc1437fcf50e0016419c64ee0de534ab4a2802bc Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Oct 11 22:25:34 2024 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat Oct 12 17:19:25 2024 +0200 tdf#130857 qt weld: Implement QtInstanceBuilder::weld_widget This will be needed e.g. by the svtools/uiconfig/ui/restartdialog.ui dialog shown when toggling experimental mode in "Tools" -> "Options" and closing the dialog with the "OK" button. Change-Id: Iad2c88f6ea75b9434fee239aa5016ba35d0cae33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174831 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/inc/qt5/QtInstanceBuilder.hxx b/vcl/inc/qt5/QtInstanceBuilder.hxx index 271797e51ce2..d0332b7601be 100644 --- a/vcl/inc/qt5/QtInstanceBuilder.hxx +++ b/vcl/inc/qt5/QtInstanceBuilder.hxx @@ -33,7 +33,7 @@ public: virtual std::unique_ptr<weld::Dialog> weld_dialog(const OUString& rId) override; virtual std::unique_ptr<weld::Assistant> weld_assistant(const OUString&) override; virtual std::unique_ptr<weld::Window> create_screenshot_window() override; - virtual std::unique_ptr<weld::Widget> weld_widget(const OUString&) override; + virtual std::unique_ptr<weld::Widget> weld_widget(const OUString& rId) override; virtual std::unique_ptr<weld::Container> weld_container(const OUString&) override; virtual std::unique_ptr<weld::Box> weld_box(const OUString&) override; virtual std::unique_ptr<weld::Paned> weld_paned(const OUString&) override; diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index 62720bfd341f..c4918c13e8e4 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -73,10 +73,12 @@ std::unique_ptr<weld::Window> QtInstanceBuilder::create_screenshot_window() return nullptr; } -std::unique_ptr<weld::Widget> QtInstanceBuilder::weld_widget(const OUString&) +std::unique_ptr<weld::Widget> QtInstanceBuilder::weld_widget(const OUString& rId) { - assert(false && "Not implemented yet"); - return nullptr; + QWidget* pWidget = m_xBuilder->get<QWidget>(rId); + std::unique_ptr<weld::Widget> xRet(pWidget ? std::make_unique<QtInstanceWidget>(pWidget) + : nullptr); + return xRet; } std::unique_ptr<weld::Container> QtInstanceBuilder::weld_container(const OUString&) commit ff66941536720f14711d0bb14b6514ea37a6c0eb Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Oct 11 22:20:45 2024 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat Oct 12 17:19:16 2024 +0200 tdf#130857 qt weld: Implement QtInstanceBuilder::weld_button This will be needed e.g. by the svtools/uiconfig/ui/restartdialog.ui dialog shown when toggling experimental mode in "Tools" -> "Options" and closing the dialog with the "OK" button. Change-Id: I7d7af45c0905c79ecc9dc2927dc6b91fade1684d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174830 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/inc/qt5/QtInstanceBuilder.hxx b/vcl/inc/qt5/QtInstanceBuilder.hxx index 3b2bde087507..271797e51ce2 100644 --- a/vcl/inc/qt5/QtInstanceBuilder.hxx +++ b/vcl/inc/qt5/QtInstanceBuilder.hxx @@ -41,7 +41,7 @@ public: virtual std::unique_ptr<weld::ScrolledWindow> weld_scrolled_window(const OUString&, bool bUserManagedScrolling = false) override; virtual std::unique_ptr<weld::Notebook> weld_notebook(const OUString&) override; - virtual std::unique_ptr<weld::Button> weld_button(const OUString&) override; + virtual std::unique_ptr<weld::Button> weld_button(const OUString& rId) override; virtual std::unique_ptr<weld::MenuButton> weld_menu_button(const OUString&) override; virtual std::unique_ptr<weld::MenuToggleButton> weld_menu_toggle_button(const OUString&) override; diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index 0f9f1872ed07..62720bfd341f 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -115,10 +115,12 @@ std::unique_ptr<weld::Notebook> QtInstanceBuilder::weld_notebook(const OUString& return nullptr; } -std::unique_ptr<weld::Button> QtInstanceBuilder::weld_button(const OUString&) +std::unique_ptr<weld::Button> QtInstanceBuilder::weld_button(const OUString& rId) { - assert(false && "Not implemented yet"); - return nullptr; + QPushButton* pButton = m_xBuilder->get<QPushButton>(rId); + std::unique_ptr<weld::Button> xRet(pButton ? std::make_unique<QtInstanceButton>(pButton) + : nullptr); + return xRet; } std::unique_ptr<weld::MenuButton> QtInstanceBuilder::weld_menu_button(const OUString&)