include/vcl/weld/IconView.hxx  |    3 ---
 include/vcl/weld/ItemView.hxx  |    3 +++
 include/vcl/weld/TreeView.hxx  |    2 --
 vcl/qt5/QtInstanceIconView.cxx |   11 ++++++++---
 4 files changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 518959c61a672651fe594ed6715336b59f3c9a93
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat Dec 20 16:27:54 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Dec 20 22:31:47 2025 +0100

    weld: Move selected_foreach to weld::ItemView
    
    Both, weld::TreeView and weld::IconView have such a purely virtual method.
    Move it to the common base class, which will also allow deduplicating
    implementations.
    
    Change-Id: Ie16cb3222e78f53159deff74d146588429f232d6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196010
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/include/vcl/weld/IconView.hxx b/include/vcl/weld/IconView.hxx
index c368ed85aa7d..606282ecfdfb 100644
--- a/include/vcl/weld/IconView.hxx
+++ b/include/vcl/weld/IconView.hxx
@@ -133,9 +133,6 @@ public:
         do_scroll_to_item(rIter);
         enable_notify_events();
     }
-
-    // call func on each selected element until func returns true or we run 
out of elements
-    virtual void selected_foreach(const std::function<bool(TreeIter&)>& func) 
= 0;
 };
 }
 
diff --git a/include/vcl/weld/ItemView.hxx b/include/vcl/weld/ItemView.hxx
index e19af46cb030..6edc2216d0c6 100644
--- a/include/vcl/weld/ItemView.hxx
+++ b/include/vcl/weld/ItemView.hxx
@@ -74,6 +74,9 @@ public:
 
     void clear();
 
+    // call func on each selected element until func returns true or we run 
out of elements
+    virtual void selected_foreach(const std::function<bool(TreeIter&)>& func) 
= 0;
+
     void save_value() { m_sSavedValue = get_selected_text(); }
     OUString const& get_saved_value() const { return m_sSavedValue; }
     bool get_value_changed_from_saved() const { return m_sSavedValue != 
get_selected_text(); }
diff --git a/include/vcl/weld/TreeView.hxx b/include/vcl/weld/TreeView.hxx
index 6c36487926d0..7fe7dfc24ee9 100644
--- a/include/vcl/weld/TreeView.hxx
+++ b/include/vcl/weld/TreeView.hxx
@@ -369,8 +369,6 @@ public:
 
     // call func on each element until func returns true or we run out of 
elements
     virtual void all_foreach(const std::function<bool(TreeIter&)>& func) = 0;
-    // call func on each selected element until func returns true or we run 
out of elements
-    virtual void selected_foreach(const std::function<bool(TreeIter&)>& func) 
= 0;
     // call func on each visible element until func returns true or we run out 
of elements
     virtual void visible_foreach(const std::function<bool(TreeIter&)>& func) = 
0;
     // clear the children of pParent (whole tree if nullptr),
commit 5602a94b22b0ec387fd5a9c15a6e9fbdcd947593
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat Dec 20 16:21:31 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Dec 20 22:31:39 2025 +0100

    tdf#130857 tdf#168594 qt weld: Implement QtInstanceIconView::get_rect
    
    Change-Id: I32c17ee87bb3bd118661fbb65c89a637ae3b33ce
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196009
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtInstanceIconView.cxx b/vcl/qt5/QtInstanceIconView.cxx
index bd41cea25b86..9a35ff3741c4 100644
--- a/vcl/qt5/QtInstanceIconView.cxx
+++ b/vcl/qt5/QtInstanceIconView.cxx
@@ -149,10 +149,15 @@ void QtInstanceIconView::set_item_tooltip_text(int nPos, 
const OUString& rToolTi
     });
 }
 
-tools::Rectangle QtInstanceIconView::get_rect(const weld::TreeIter&) const
+tools::Rectangle QtInstanceIconView::get_rect(const weld::TreeIter& rIter) 
const
 {
-    assert(false && "Not implemented yet");
-    return tools::Rectangle();
+    SolarMutexGuard g;
+
+    tools::Rectangle aRect;
+    GetQtInstance().RunInMainThread(
+        [&] { aRect = toRectangle(m_pListView->visualRect(modelIndex(rIter))); 
});
+
+    return aRect;
 }
 
 OUString QtInstanceIconView::get_text(const weld::TreeIter& rIter) const

Reply via email to