vcl/inc/qt5/QtInstanceTextView.hxx |    1 
 vcl/qt5/QtInstanceBuilder.cxx      |    2 +
 vcl/qt5/QtInstanceTextView.cxx     |   54 ++++++++++++++++++++++++++++++++-----
 3 files changed, 50 insertions(+), 7 deletions(-)

New commits:
commit 1f2caf50dc675b822d40a8dde8e6912823adfa76
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Aug 1 14:16:43 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Aug 2 09:16:01 2025 +0200

    tdf#130857 qt weld: Implement TextView scroll API
    
    Implement weld::TextView API related to scrolling
    in the Qt implementation, QtInstanceTextView.
    
    For the license dialog newly supported since
    
        Change-Id: I1441119bd334a36dd260d491347575093cd98aa0
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Fri Aug 1 12:34:22 2025 +0200
    
            tdf#130857 qt weld: Support extension license dialog
    
    , this causes the "Scroll Down" button to be greyed
    out as expected when using the scrollbar to move
    down to the end of the license document.
    
    Clicking the "Scroll Down" button moves the license
    text down by one page as expected according to the
    implementation in LicenseDialogImpl::PageDown and
    what is seen with the gtk3 and gen VCL plugins.
    
    Change-Id: I803d1f0f9108fc20836eab3ffea164e39be2d3fb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188769
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/inc/qt5/QtInstanceTextView.hxx 
b/vcl/inc/qt5/QtInstanceTextView.hxx
index a1aceca839c3..93f527b97836 100644
--- a/vcl/inc/qt5/QtInstanceTextView.hxx
+++ b/vcl/inc/qt5/QtInstanceTextView.hxx
@@ -52,6 +52,7 @@ public:
 private Q_SLOTS:
     void handleCursorPositionChanged();
     void handleTextChanged();
+    void handleVerticalScrollValueChanged();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/qt5/QtInstanceTextView.cxx b/vcl/qt5/QtInstanceTextView.cxx
index 86483375b857..0846d2deaed4 100644
--- a/vcl/qt5/QtInstanceTextView.cxx
+++ b/vcl/qt5/QtInstanceTextView.cxx
@@ -13,6 +13,7 @@
 #include <vcl/qt/QtUtils.hxx>
 
 #include <QtGui/QTextCursor>
+#include <QtWidgets/QScrollBar>
 
 QtInstanceTextView::QtInstanceTextView(QPlainTextEdit* pTextEdit)
     : QtInstanceWidget(pTextEdit)
@@ -24,6 +25,10 @@ QtInstanceTextView::QtInstanceTextView(QPlainTextEdit* 
pTextEdit)
             &QtInstanceTextView::handleCursorPositionChanged);
     connect(m_pTextEdit, &QPlainTextEdit::textChanged, this,
             &QtInstanceTextView::handleTextChanged);
+
+    if (QScrollBar* pVerticalScrollBar = m_pTextEdit->verticalScrollBar())
+        connect(pVerticalScrollBar, &QScrollBar::valueChanged, this,
+                &QtInstanceTextView::handleVerticalScrollValueChanged);
 }
 
 void QtInstanceTextView::set_text(const OUString& rText)
@@ -129,23 +134,52 @@ void QtInstanceTextView::set_alignment(TxtAlign) { 
assert(false && "Not implemen
 
 int QtInstanceTextView::vadjustment_get_value() const
 {
-    assert(false && "Not implemented yet");
-    return -1;
+    SolarMutexGuard g;
+
+    int nValue = -1;
+    GetQtInstance().RunInMainThread([&] {
+        if (QScrollBar* pVerticalScrollBar = m_pTextEdit->verticalScrollBar())
+            nValue = pVerticalScrollBar->value() - vadjustment_get_page_size();
+    });
+
+    return nValue;
 }
 
 int QtInstanceTextView::vadjustment_get_upper() const
 {
-    assert(false && "Not implemented yet");
-    return -1;
+    SolarMutexGuard g;
+
+    int nUpper = -1;
+    GetQtInstance().RunInMainThread([&] {
+        if (QScrollBar* pVerticalScrollBar = m_pTextEdit->verticalScrollBar())
+            nUpper = pVerticalScrollBar->maximum();
+    });
+
+    return nUpper;
 }
 
 int QtInstanceTextView::vadjustment_get_page_size() const
 {
-    assert(false && "Not implemented yet");
-    return -1;
+    SolarMutexGuard g;
+
+    int nPageSize = 0;
+    GetQtInstance().RunInMainThread([&] {
+        if (QScrollBar* pVerticalScrollBar = m_pTextEdit->verticalScrollBar())
+            nPageSize = pVerticalScrollBar->pageStep();
+    });
+
+    return nPageSize;
 }
 
-void QtInstanceTextView::vadjustment_set_value(int) { assert(false && "Not 
implemented yet"); }
+void QtInstanceTextView::vadjustment_set_value(int nValue)
+{
+    SolarMutexGuard g;
+
+    GetQtInstance().RunInMainThread([&] {
+        if (QScrollBar* pVerticalScrollBar = m_pTextEdit->verticalScrollBar())
+            pVerticalScrollBar->setValue(nValue + vadjustment_get_page_size());
+    });
+}
 
 void QtInstanceTextView::handleCursorPositionChanged()
 {
@@ -159,4 +193,10 @@ void QtInstanceTextView::handleTextChanged()
     signal_changed();
 }
 
+void QtInstanceTextView::handleVerticalScrollValueChanged()
+{
+    SolarMutexGuard aGuard;
+    signal_vadjustment_value_changed();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
commit fb7627eaadd64d966f9d3818669e5f5a36b2020c
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Aug 1 12:34:22 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Aug 2 09:15:54 2025 +0200

    tdf#130857 qt weld: Support extension license 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 as follows:
    
    * start LO
    * "Tools" -> "Extensions"
    * click "Add" button
    * select the .oxt file of a previously downloaded
      extension, e.g. APSO [1] and confirm
    * select "Only for me" in the dialog asking who
      to install the extension for
    
    [1] 
https://extensions.libreoffice.org/en/extensions/show/apso-alternative-script-organizer-for-python
    
    Change-Id: I1441119bd334a36dd260d491347575093cd98aa0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188765
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx
index 6c23ade26d56..75f056f4c14c 100644
--- a/vcl/qt5/QtInstanceBuilder.cxx
+++ b/vcl/qt5/QtInstanceBuilder.cxx
@@ -110,6 +110,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& 
rUIFile, const weld::W
         u"dbaccess/ui/savedialog.ui"_ustr,
         u"dbaccess/ui/tabledesignsavemodifieddialog.ui"_ustr,
         u"desktop/ui/installforalldialog.ui"_ustr,
+        u"desktop/ui/licensedialog.ui"_ustr,
         u"filter/ui/testxmlfilter.ui"_ustr,
         u"filter/ui/xmlfiltertabpagegeneral.ui"_ustr,
         u"filter/ui/xmlfiltertabpagetransformation.ui"_ustr,
commit 358de2c2a91bd33786745a79f2d090a0aeb2cf26
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Aug 1 12:29:27 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Aug 2 09:15:47 2025 +0200

    tdf#130857 qt weld: Support dlg asking who to install extension for
    
    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 as follows:
    
    * start LO
    * "Tools" -> "Extensions"
    * click "Add" button
    * select the .oxt file of a previously downloaded
      extension, e.g. APSO [1] and confirm
    
    [1] 
https://extensions.libreoffice.org/en/extensions/show/apso-alternative-script-organizer-for-python
    
    Change-Id: Ieb6cd075666ecc12f45bf485bdd72f89b7a47103
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188764
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx
index c86f61d66bbf..6c23ade26d56 100644
--- a/vcl/qt5/QtInstanceBuilder.cxx
+++ b/vcl/qt5/QtInstanceBuilder.cxx
@@ -109,6 +109,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& 
rUIFile, const weld::W
         u"cui/ui/zoomdialog.ui"_ustr,
         u"dbaccess/ui/savedialog.ui"_ustr,
         u"dbaccess/ui/tabledesignsavemodifieddialog.ui"_ustr,
+        u"desktop/ui/installforalldialog.ui"_ustr,
         u"filter/ui/testxmlfilter.ui"_ustr,
         u"filter/ui/xmlfiltertabpagegeneral.ui"_ustr,
         u"filter/ui/xmlfiltertabpagetransformation.ui"_ustr,

Reply via email to