vcl/inc/qt5/QtTools.hxx | 4 ++-- vcl/qt5/QtFrame.cxx | 4 ++-- vcl/qt5/QtInstanceBuilder.cxx | 2 ++ vcl/qt5/QtInstanceComboBox.cxx | 3 +++ vcl/qt5/QtTools.cxx | 4 ++-- vcl/qt5/QtWidget.cxx | 10 +++++----- 6 files changed, 16 insertions(+), 11 deletions(-)
New commits: commit 00ce53015d314fbb6bc4a5832b53578cee166918 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Apr 11 15:22:26 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 11 19:44:49 2025 +0200 qt: Rename Get{Key,Mouse}ModCode helpers .. to match the "toVcl..." naming scheme used for other helper functions to convert between Qt and VCL types. Change-Id: I33a79b476427dd779ff3e717200c84bd5c358ceb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184046 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/inc/qt5/QtTools.hxx b/vcl/inc/qt5/QtTools.hxx index 9284cc8826b1..863356d66246 100644 --- a/vcl/inc/qt5/QtTools.hxx +++ b/vcl/inc/qt5/QtTools.hxx @@ -148,8 +148,8 @@ struct CairoDeleter typedef std::unique_ptr<cairo_surface_t, CairoDeleter> UniqueCairoSurface; -sal_uInt16 GetKeyModCode(Qt::KeyboardModifiers eKeyModifiers); -sal_uInt16 GetMouseModCode(Qt::MouseButtons eButtons); +sal_uInt16 toVclKeyboardModifiers(Qt::KeyboardModifiers eKeyModifiers); +sal_uInt16 toVclMouseButtons(Qt::MouseButtons eButtons); QImage toQImage(const Image& rImage); diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx index 4511ca814814..1d0414ef3782 100644 --- a/vcl/qt5/QtFrame.cxx +++ b/vcl/qt5/QtFrame.cxx @@ -1261,8 +1261,8 @@ SalFrame::SalPointerState QtFrame::GetPointerState() aState.maPos = toPoint(QCursor::pos() * devicePixelRatioF()); SalFrameGeometry aGeometry = GetUnmirroredGeometry(); aState.maPos.Move(-aGeometry.x(), -aGeometry.y()); - aState.mnState = GetMouseModCode(QGuiApplication::mouseButtons()) - | GetKeyModCode(QGuiApplication::keyboardModifiers()); + aState.mnState = toVclMouseButtons(QGuiApplication::mouseButtons()) + | toVclKeyboardModifiers(QGuiApplication::keyboardModifiers()); return aState; } diff --git a/vcl/qt5/QtTools.cxx b/vcl/qt5/QtTools.cxx index c642e7706522..dc7c3d69b8c7 100644 --- a/vcl/qt5/QtTools.cxx +++ b/vcl/qt5/QtTools.cxx @@ -33,7 +33,7 @@ void CairoDeleter::operator()(cairo_surface_t* pSurface) const { cairo_surface_destroy(pSurface); } -sal_uInt16 GetKeyModCode(Qt::KeyboardModifiers eKeyModifiers) +sal_uInt16 toVclKeyboardModifiers(Qt::KeyboardModifiers eKeyModifiers) { sal_uInt16 nCode = 0; if (eKeyModifiers & Qt::ShiftModifier) @@ -47,7 +47,7 @@ sal_uInt16 GetKeyModCode(Qt::KeyboardModifiers eKeyModifiers) return nCode; } -sal_uInt16 GetMouseModCode(Qt::MouseButtons eButtons) +sal_uInt16 toVclMouseButtons(Qt::MouseButtons eButtons) { sal_uInt16 nCode = 0; if (eButtons & Qt::LeftButton) diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx index 26276abd3e73..f3543a14d0e5 100644 --- a/vcl/qt5/QtWidget.cxx +++ b/vcl/qt5/QtWidget.cxx @@ -83,7 +83,7 @@ void QtWidget::fillSalAbstractMouseEvent(const QtFrame& rFrame, const QInputEven aSalEvent.mnX = QGuiApplication::isLeftToRight() ? aPos.X() : round(nWidth * fRatio) - aPos.X(); aSalEvent.mnY = aPos.Y(); aSalEvent.mnTime = pQEvent->timestamp(); - aSalEvent.mnCode = GetKeyModCode(pQEvent->modifiers()) | GetMouseModCode(eButtons); + aSalEvent.mnCode = toVclKeyboardModifiers(pQEvent->modifiers()) | toVclMouseButtons(eButtons); } #define FILL_SAME(rFrame, nWidth) \ @@ -150,8 +150,8 @@ void QtWidget::handleMouseEnterLeaveEvents(const QtFrame& rFrame, QEvent* pQEven aEvent.mnY = aPos.Y(); aEvent.mnTime = 0; aEvent.mnButton = 0; - aEvent.mnCode = GetKeyModCode(QGuiApplication::keyboardModifiers()) - | GetMouseModCode(QGuiApplication::mouseButtons()); + aEvent.mnCode = toVclKeyboardModifiers(QGuiApplication::keyboardModifiers()) + | toVclMouseButtons(QGuiApplication::mouseButtons()); SalEvent nEventType; if (pQEvent->type() == QEvent::Enter) @@ -520,7 +520,7 @@ bool QtWidget::handleKeyEvent(QtFrame& rFrame, const QWidget& rWidget, QKeyEvent if (nCode == 0 && pEvent->text().isEmpty()) { - sal_uInt16 nModCode = GetKeyModCode(pEvent->modifiers()); + sal_uInt16 nModCode = toVclKeyboardModifiers(pEvent->modifiers()); SalKeyModEvent aModEvt; aModEvt.mbDown = bIsKeyPressed; aModEvt.mnModKeyCode = ModKeyFlags::NONE; @@ -605,7 +605,7 @@ bool QtWidget::handleKeyEvent(QtFrame& rFrame, const QWidget& rWidget, QKeyEvent aEvent.mnCharCode = (pEvent->text().isEmpty() ? 0 : pEvent->text().at(0).unicode()); aEvent.mnRepeat = 0; aEvent.mnCode = nCode; - aEvent.mnCode |= GetKeyModCode(pEvent->modifiers()); + aEvent.mnCode |= toVclKeyboardModifiers(pEvent->modifiers()); bool bStopProcessingKey; if (bIsKeyPressed) commit fc2eee6c3ed912f21850d106fb3094b80774c19e Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Apr 11 13:57:28 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 11 19:44:41 2025 +0200 tdf#130857 qt weld: Support "Font Features" 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. The dialog can e.g. be triggered from Writer using "Format" -> "Character", then clicking the "Features" button in the "Character" dialog. Change-Id: I8440692adf3956f318cccee68717860ef10a67bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184040 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index 187f1070dea9..0adbc7682a5f 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -65,6 +65,8 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile) static std::unordered_set<OUString> aSupportedUIFiles = { u"cui/ui/aboutdialog.ui"_ustr, u"cui/ui/breaknumberoption.ui"_ustr, + u"cui/ui/fontfeaturesdialog.ui"_ustr, + u"cui/ui/fontfragment.ui"_ustr, u"cui/ui/insertrowcolumn.ui"_ustr, u"cui/ui/javastartparametersdialog.ui"_ustr, u"cui/ui/namedialog.ui"_ustr, commit 70db1c2de93f34eee8a9c411f4f0db21502347db Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Apr 11 13:51:15 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 11 19:44:34 2025 +0200 tdf#130857 qt weld: Handle special combobox insert pos -1 weld::ComboBox::append calls weld::ComboBox::insert with a special insert position of -1, so handle that in QtInstanceComboBox::insert. Passing -1 as is to QComboBox::insertItem results in the new entry to be inserted at position 0 instead, i.e. as the first instead of as the last entry. (Seen in a WIP branch adding support for the "Font Features" dialog.) Change-Id: Ia0c88449ed938d9ccb25bfefabd7f5aa742eed28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184039 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/qt5/QtInstanceComboBox.cxx b/vcl/qt5/QtInstanceComboBox.cxx index 087073c3558d..05154e18b525 100644 --- a/vcl/qt5/QtInstanceComboBox.cxx +++ b/vcl/qt5/QtInstanceComboBox.cxx @@ -35,6 +35,9 @@ void QtInstanceComboBox::insert(int nPos, const OUString& rStr, const OUString* { SolarMutexGuard g; GetQtInstance().RunInMainThread([&] { + if (nPos == -1) + nPos = m_pComboBox->count(); + QVariant aUserData; if (pId) aUserData = QVariant::fromValue(toQString(*pId));