vcl/inc/qt5/QtBuilder.hxx | 1 + vcl/qt5/QtBuilder.cxx | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
New commits: commit 92f232af9e7fcc5ae37916d117d0c4cfc1a3a4ed Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Jul 29 12:02:21 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Jul 29 18:28:18 2025 +0200 tdf#130857 qt weld: Apply entry text set in .ui file Evaluate the GtkEntry::text property for "GtkEntry" objects in .ui files. This makes the entries in the widget test dialog supported since commit 59f363f705583529af17fc43d314a7e47bbe2657 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Sat Jul 26 09:54:39 2025 +0200 tdf#130857 qt weld: Support widget test dialog show their "Editable Entry" and "Disabled Entry" when using the qt6 VCL plugin with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. Change-Id: I22624b2eee9a5c6c7b83e5c76eeba79a7a03ec29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188526 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx index dccf9738f314..e4872ae33abc 100644 --- a/vcl/qt5/QtBuilder.cxx +++ b/vcl/qt5/QtBuilder.cxx @@ -920,6 +920,10 @@ void QtBuilder::setEntryProperties(QLineEdit& rLineEdit, stringmap& rProps) if (aIt != rProps.end()) rLineEdit.setPlaceholderText(toQString(aIt->second)); + aIt = rProps.find(u"text"_ustr); + if (aIt != rProps.end()) + rLineEdit.setText(toQString(aIt->second)); + aIt = rProps.find(u"visibility"_ustr); if (aIt != rProps.end() && !toBool(aIt->second)) rLineEdit.setEchoMode(QLineEdit::Password); commit bc36d0726ea29344e0544bd4d2ba15f38676fb8c Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Jul 29 11:56:25 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Jul 29 18:28:13 2025 +0200 tdf#130857 qt weld: Apply "sensitive" property Evaluate the GtkWidget::sensitive property for widgets. This causes the second entry widget in the widget test dialog supported since commit 59f363f705583529af17fc43d314a7e47bbe2657 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Sat Jul 26 09:54:39 2025 +0200 tdf#130857 qt weld: Support widget test dialog to be shown as disabled as expected when using the qt6 VCL plugin with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. Change-Id: I3fc1936c84daf9763bef9da62f34afe57138242d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188525 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/inc/qt5/QtBuilder.hxx b/vcl/inc/qt5/QtBuilder.hxx index 4d296693b133..fbd6ec17a9c4 100644 --- a/vcl/inc/qt5/QtBuilder.hxx +++ b/vcl/inc/qt5/QtBuilder.hxx @@ -98,6 +98,7 @@ private: void setScaleProperties(QSlider& rSlider, stringmap& rProps); void setSpinButtonProperties(QDoubleSpinBox& rSpinBox, stringmap& rProps); static void setTextViewProperties(QPlainTextEdit& rTextEdit, stringmap& rProps); + static void setWidgetProperties(QWidget& rWidget, stringmap& rProps); static QWidget* windowForObject(QObject* pObject); static void applyGridPackingProperties(QWidget* pCurrentChild, QGridLayout& rGrid, diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx index d954fadba25a..dccf9738f314 100644 --- a/vcl/qt5/QtBuilder.cxx +++ b/vcl/qt5/QtBuilder.cxx @@ -434,7 +434,9 @@ QObject* QtBuilder::makeObject(QObject* pParent, std::u16string_view sName, std: } QWidget* pWidget = qobject_cast<QWidget*>(pObject); - if (!pWidget) + if (pWidget) + setWidgetProperties(*pWidget, rMap); + else pWidget = pLayoutParentWidget; if (QSplitter* pSplitterParent = qobject_cast<QSplitter*>(pParentWidget)) @@ -1045,6 +1047,13 @@ void QtBuilder::setTextViewProperties(QPlainTextEdit& rTextEdit, stringmap& rPro } } +void QtBuilder::setWidgetProperties(QWidget& rWidget, stringmap& rProps) +{ + auto aSensitiveIt = rProps.find(u"sensitive"_ustr); + if (aSensitiveIt != rProps.end()) + rWidget.setEnabled(toBool(aSensitiveIt->second)); +} + QWidget* QtBuilder::windowForObject(QObject* pObject) { if (QWidget* pWidget = qobject_cast<QWidget*>(pObject))