sc/uiconfig/scalc/ui/selectrange.ui | 65 +++++++++++++++++------------------- vcl/qt5/QtBuilder.cxx | 2 - vcl/qt5/QtInstanceBuilder.cxx | 1 vcl/qt5/QtInstanceDrawingArea.cxx | 2 - vcl/qt5/QtInstanceIconView.cxx | 4 +- vcl/qt5/QtInstanceTreeView.cxx | 4 +- vcl/qt5/QtInstanceWidget.cxx | 9 +++- 7 files changed, 44 insertions(+), 43 deletions(-)
New commits: commit af6fa1dd6cbdf76f7bcca591e6444c8b7bdce1b8 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Oct 14 17:25:48 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Wed Oct 15 16:39:34 2025 +0200 tdf#130857 qt weld: Support Calc "Select Range" dialog This means that native Qt widgets are used for that dialog now when using the qt5 or qt6 VCL plugin and starting LO with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. This dialog can be triggered using "Data" -> "Select Range" in Calc. Change-Id: I41a4e8e82f99ad4659dbcb65c4a92abd53c42765 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192401 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index fe6b77fe4395..f84f3e4057ab 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -137,6 +137,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile, const weld::W u"modules/scalc/ui/insertcells.ui"_ustr, u"modules/scalc/ui/movecopysheet.ui"_ustr, u"modules/scalc/ui/optdlg.ui"_ustr, + u"modules/scalc/ui/selectrange.ui"_ustr, u"modules/scalc/ui/selectsource.ui"_ustr, u"modules/scalc/ui/showsheetdialog.ui"_ustr, u"modules/scalc/ui/sortdialog.ui"_ustr, commit ded1a3aa43f514afc9d0f648f0a1a5e23b14c548 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Oct 14 17:25:15 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Wed Oct 15 16:39:28 2025 +0200 sc: Resave selectrange.ui with glade 3.40 This dialog can be triggered using "Data" -> "Select Range" in Calc. Change-Id: I9603f091fa8546abede913e8b2ecf3b86896353c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192400 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/sc/uiconfig/scalc/ui/selectrange.ui b/sc/uiconfig/scalc/ui/selectrange.ui index 69375185693a..7d6a76ce9dea 100644 --- a/sc/uiconfig/scalc/ui/selectrange.ui +++ b/sc/uiconfig/scalc/ui/selectrange.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.36.0 --> +<!-- Generated with glade 3.40.0 --> <interface domain="sc"> <requires lib="gtk+" version="3.20"/> <object class="GtkTreeStore" id="liststore1"> @@ -11,30 +11,30 @@ </columns> </object> <object class="GtkDialog" id="SelectRangeDialog"> - <property name="can_focus">False</property> - <property name="border_width">6</property> + <property name="can-focus">False</property> + <property name="border-width">6</property> <property name="title" translatable="yes" context="selectrange|SelectRangeDialog">Select Database Range</property> <property name="modal">True</property> - <property name="default_width">0</property> - <property name="default_height">0</property> - <property name="type_hint">dialog</property> + <property name="default-width">0</property> + <property name="default-height">0</property> + <property name="type-hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="SelectRange"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">12</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> + <property name="can-focus">False</property> + <property name="layout-style">end</property> <child> <object class="GtkButton" id="ok"> <property name="label" translatable="yes" context="stock">_OK</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -47,8 +47,8 @@ <object class="GtkButton" id="cancel"> <property name="label" translatable="yes" context="stock">_Cancel</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -61,8 +61,8 @@ <object class="GtkButton" id="help"> <property name="label" translatable="yes" context="stock">_Help</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -76,38 +76,38 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="pack_type">end</property> + <property name="pack-type">end</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkFrame" id="frame1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="shadow_type">in</property> + <property name="can-focus">True</property> <property name="margin-start">12</property> <property name="margin-top">6</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="shadow-type">in</property> <child> <object class="GtkTreeView" id="treeview"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="model">liststore1</property> - <property name="headers_visible">False</property> - <property name="headers_clickable">False</property> - <property name="search_column">0</property> - <property name="show_expanders">False</property> + <property name="headers-visible">False</property> + <property name="headers-clickable">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="treeview-selection1"/> </child> @@ -133,7 +133,7 @@ <child type="label"> <object class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="selectrange|label1">Ranges</property> <attributes> <attribute name="weight" value="bold"/> @@ -154,9 +154,6 @@ <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> - <child type="titlebar"> - <placeholder/> - </child> <child internal-child="accessible"> <object class="AtkObject" id="SelectRangeDialog-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="selectrange|extended_tip|SelectRangeDialog">Selects a database range that you defined under Data - Define Range.</property> commit 1d1470c798fc4d3ce2d7198aafc0a160cc73b828 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Oct 14 16:42:48 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Wed Oct 15 16:39:22 2025 +0200 tdf#130857 qt weld: Use HTML for tooltip texts Instead of setting the plain text tooltip as is, use HTML formatting. This ensures that the tooltip text wraps. This basically applies the same solution as introduced for the non-weld case in commit fa89130d4980662642cb81a05ec044dbe21fd5d0 Date: Fri Aug 2 19:30:18 2024 +0200 tdf#162297 Wrap tooltips in Qt5 Acoording to the Qt documentation, in order to wrap the tooltip a rich-text style needs to be set. for the case of native Qt widgets as well and e.g. makes the extended tip as described in tdf#162297 wrap for the SAL_VCL_QT_USE_WELDED_WIDGETS=1 case as well. In the same way, the tooltip mentioned for Calc's "Sort" dialog case in [1] also wraps with this commit in place when using the qt6 VCL plugin with SAL_VCL_QT_USE_WELDED_WIDGETS=1 after support for that dialog was declared in Change-Id: Ica500005020169de0faf2dada052e5d8f5665ce9 Author: Michael Weghorn <[email protected]> Date: Tue Oct 14 14:10:00 2025 +0200 tdf#130857 qt weld: Support Calc "Sort" dialog Also adjust QtInstanceWidget::get_tooltip_text to do the reverse conversion from HTML to plain text again, using QTextDocumentFragment that is mentioned as a potential solution for such a task in [2]. [1] https://lists.freedesktop.org/archives/libreoffice/2025-October/093867.html [2] https://stackoverflow.com/questions/2799379/is-there-an-easy-way-to-strip-html-from-a-qstring-in-qt#comment73105365_9546425 Change-Id: Ie57d59e482103b25a94de8377c0f5562ff294b46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192399 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx index 5fe12226a242..3b485f4542d2 100644 --- a/vcl/qt5/QtBuilder.cxx +++ b/vcl/qt5/QtBuilder.cxx @@ -507,7 +507,7 @@ QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, std: QtInstanceWidget::setHelpId(*pWidget, getHelpRoot() + rId); - pWidget->setToolTip(toQString(extractTooltipText(rMap))); + pWidget->setToolTip(toRichTextTooltip(extractTooltipText(rMap))); pWidget->setVisible(extractVisible(rMap)); #if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0) diff --git a/vcl/qt5/QtInstanceDrawingArea.cxx b/vcl/qt5/QtInstanceDrawingArea.cxx index a9dfb67d1980..7c92d33b0847 100644 --- a/vcl/qt5/QtInstanceDrawingArea.cxx +++ b/vcl/qt5/QtInstanceDrawingArea.cxx @@ -178,7 +178,7 @@ bool QtInstanceDrawingArea::handleToolTipEvent(const QHelpEvent& rHelpEvent) return QtInstanceWidget::handleToolTipEvent(rHelpEvent); const QPoint aPos = getQWidget()->mapToGlobal(toQRect(aHelpArea).topLeft()); - QToolTip::showText(aPos, toQString(sToolTipText), getQWidget()); + QToolTip::showText(aPos, toRichTextTooltip(sToolTipText), getQWidget()); return true; } diff --git a/vcl/qt5/QtInstanceIconView.cxx b/vcl/qt5/QtInstanceIconView.cxx index 87cd486f1753..1092e1b6f160 100644 --- a/vcl/qt5/QtInstanceIconView.cxx +++ b/vcl/qt5/QtInstanceIconView.cxx @@ -330,11 +330,11 @@ bool QtInstanceIconView::handleToolTipEvent(const QHelpEvent& rHelpEvent) SolarMutexGuard g; const QtInstanceTreeIter aIter(aIndex); - const QString sToolTip = toQString(signal_query_tooltip(aIter)); + const OUString sToolTip = signal_query_tooltip(aIter); if (sToolTip.isEmpty()) return QtInstanceWidget::handleToolTipEvent(rHelpEvent); - QToolTip::showText(rHelpEvent.globalPos(), sToolTip, m_pListView, + QToolTip::showText(rHelpEvent.globalPos(), toRichTextTooltip(sToolTip), m_pListView, m_pListView->visualRect(aIndex)); return true; } diff --git a/vcl/qt5/QtInstanceTreeView.cxx b/vcl/qt5/QtInstanceTreeView.cxx index 458ef5828bd2..4be1be3bcc1e 100644 --- a/vcl/qt5/QtInstanceTreeView.cxx +++ b/vcl/qt5/QtInstanceTreeView.cxx @@ -1182,11 +1182,11 @@ bool QtInstanceTreeView::handleViewPortToolTipEvent(const QHelpEvent& rHelpEvent SolarMutexGuard g; const QtInstanceTreeIter aIter(aIndex); - const QString sToolTip = toQString(signal_query_tooltip(aIter)); + const OUString sToolTip = signal_query_tooltip(aIter); if (sToolTip.isEmpty()) return false; - QToolTip::showText(rHelpEvent.globalPos(), sToolTip, m_pTreeView, + QToolTip::showText(rHelpEvent.globalPos(), toRichTextTooltip(sToolTip), m_pTreeView, m_pTreeView->visualRect(aIndex)); return true; } diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx index a01df56ace46..4f0dfcd0073b 100644 --- a/vcl/qt5/QtInstanceWidget.cxx +++ b/vcl/qt5/QtInstanceWidget.cxx @@ -17,6 +17,7 @@ #include <vcl/qt/QtUtils.hxx> #include <QtGui/QMouseEvent> +#include <QtGui/QTextDocumentFragment> #include <QtWidgets/QTabWidget> #include <QtWidgets/QToolTip> @@ -582,7 +583,7 @@ void QtInstanceWidget::set_tooltip_text(const OUString& rTip) return; } - getQWidget()->setToolTip(toQString(rTip)); + getQWidget()->setToolTip(toRichTextTooltip(rTip)); } OUString QtInstanceWidget::get_tooltip_text() const @@ -596,7 +597,8 @@ OUString QtInstanceWidget::get_tooltip_text() const return sToolTipText; } - return toOUString(getQWidget()->toolTip()); + // convert HTML tooltip to plain text + return toOUString(QTextDocumentFragment::fromHtml(getQWidget()->toolTip()).toPlainText()); } void QtInstanceWidget::set_cursor_data(void*) { assert(false && "Not implemented yet"); } @@ -832,7 +834,8 @@ bool QtInstanceWidget::handleToolTipEvent(const QHelpEvent& rHelpEvent) if (sExtendedTip.isEmpty()) return false; - QToolTip::showText(rHelpEvent.globalPos(), sExtendedTip, getQWidget()); + QToolTip::showText(rHelpEvent.globalPos(), toRichTextTooltip(toOUString(sExtendedTip)), + getQWidget()); return true; }
