vcl/qt5/QtBuilder.cxx             |    2 +-
 vcl/qt5/QtInstanceComboBox.cxx    |    9 ++++++---
 vcl/qt5/QtInstanceDrawingArea.cxx |    9 ++++++++-
 3 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 6231f5dfdd2dc446b925b2b780052fe10461f74a
Author:     Michael Weghorn <[email protected]>
AuthorDate: Wed Jan 8 17:59:29 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Jan 9 09:35:47 2025 +0100

    tdf#130857 qt weld: Set combobox entry icons
    
    Handle the `pImageSurface` and `pIconName` params
    that can be used to set icons for combobox entries.
    
    This gets used e.g. in the spell check dialog (that's
    not supported by QtInstanceBuilder yet).
    
    Change-Id: I88a39826280aedbd7a8054366c30d263090cdd96
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179965
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtInstanceComboBox.cxx b/vcl/qt5/QtInstanceComboBox.cxx
index b573edad0126..087073c3558d 100644
--- a/vcl/qt5/QtInstanceComboBox.cxx
+++ b/vcl/qt5/QtInstanceComboBox.cxx
@@ -33,9 +33,6 @@ QtInstanceComboBox::QtInstanceComboBox(QComboBox* pComboBox)
 void QtInstanceComboBox::insert(int nPos, const OUString& rStr, const 
OUString* pId,
                                 const OUString* pIconName, VirtualDevice* 
pImageSurface)
 {
-    if (pIconName || pImageSurface)
-        assert(false && "Handling for these not implemented yet");
-
     SolarMutexGuard g;
     GetQtInstance().RunInMainThread([&] {
         QVariant aUserData;
@@ -43,6 +40,12 @@ void QtInstanceComboBox::insert(int nPos, const OUString& 
rStr, const OUString*
             aUserData = QVariant::fromValue(toQString(*pId));
 
         m_pComboBox->insertItem(nPos, toQString(rStr), aUserData);
+
+        if (pIconName)
+            m_pComboBox->setItemIcon(nPos, loadQPixmapIcon(*pIconName));
+        else if (pImageSurface)
+            m_pComboBox->setItemIcon(nPos, toQPixmap(*pImageSurface));
+
         if (m_bSorted)
             sortItems();
     });
commit ad29aebd689c158ab59f2c2d4f8253b0e5146a32
Author:     Michael Weghorn <[email protected]>
AuthorDate: Wed Jan 8 17:57:28 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Jan 9 09:35:40 2025 +0100

    tdf#130857 qt weld: Handle "GtkComboBox" objects
    
    Handle it the same as "GtkComboBoxText" and create
    a QComboBox widget for it.
    
    This gets used e.g. in the spellcheck dialog that's
    not supported by QtInstanceBuilder yet.
    
    Change-Id: I959ecd2736a171eb44849df4405f1b4a42b5c69c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179964
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx
index 44835875cba8..c3b283a9c1e8 100644
--- a/vcl/qt5/QtBuilder.cxx
+++ b/vcl/qt5/QtBuilder.cxx
@@ -201,7 +201,7 @@ QObject* QtBuilder::makeObject(QObject* pParent, 
std::u16string_view sName, std:
     {
         pObject = new QCheckBox(pParentWidget);
     }
-    else if (sName == u"GtkComboBoxText")
+    else if (sName == u"GtkComboBox" || sName == u"GtkComboBoxText")
     {
         QComboBox* pComboBox = new QComboBox(pParentWidget);
         pComboBox->setEditable(extractEntry(rMap));
commit 41498a8ae8075b17e4df4c580c7d1ed9ff071fdc
Author:     Michael Weghorn <[email protected]>
AuthorDate: Wed Jan 8 17:42:42 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Jan 9 09:35:34 2025 +0100

    tdf#130857 qt weld: Implement QtInstanceDrawingArea::set_cursor
    
    See also QtFrame::SetPointer.
    
    Change-Id: I446abcd28e0066b936724228472d466a405ce1b0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179963
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtInstanceDrawingArea.cxx 
b/vcl/qt5/QtInstanceDrawingArea.cxx
index 9a6368d35024..a68d2b906d53 100644
--- a/vcl/qt5/QtInstanceDrawingArea.cxx
+++ b/vcl/qt5/QtInstanceDrawingArea.cxx
@@ -10,6 +10,8 @@
 #include <QtInstanceDrawingArea.hxx>
 #include <QtInstanceDrawingArea.moc>
 
+#include <QtData.hxx>
+
 #include <vcl/qt/QtUtils.hxx>
 
 QtInstanceDrawingArea::QtInstanceDrawingArea(QLabel* pLabel)
@@ -39,7 +41,12 @@ void 
QtInstanceDrawingArea::enable_drag_source(rtl::Reference<TransferDataContai
     assert(false && "Not implemented yet");
 }
 
-void QtInstanceDrawingArea::set_cursor(PointerStyle) { assert(false && "Not 
implemented yet"); }
+void QtInstanceDrawingArea::set_cursor(PointerStyle ePointerStyle)
+{
+    SolarMutexGuard g;
+    GetQtInstance().RunInMainThread(
+        [&] { getQWidget()->setCursor(GetQtData()->getCursor(ePointerStyle)); 
});
+}
 
 Point QtInstanceDrawingArea::get_pointer_position() const
 {

Reply via email to