vcl/inc/qt5/QtInstanceTreeView.hxx |    2 +-
 vcl/qt5/QtInstanceBuilder.cxx      |    3 +++
 vcl/qt5/QtInstanceTreeView.cxx     |    6 +++---
 3 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 26b24e181c7e924a4f0521a875cf38bbc7b70871
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Dec 5 23:59:28 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Dec 6 12:17:33 2024 +0100

    tdf#130857 qt weld: Support printer properties dialog
    
    Declare support for the "Insert Breaks"
    "File" -> Printer Settings" -> "Properties" 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.
    
    Since this dialog contains tab pages, their .ui files
    need to be declared as supported as well.
    
    Change-Id: Ia4360eebf3fed6ab5f78510c866a1703b0db8998
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177923
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx
index 453258b26aa6..03b7d15701fe 100644
--- a/vcl/qt5/QtInstanceBuilder.cxx
+++ b/vcl/qt5/QtInstanceBuilder.cxx
@@ -81,6 +81,9 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& 
rUIFile)
         u"svx/ui/gotopagedialog.ui"_ustr,
         u"svx/ui/safemodedialog.ui"_ustr,
         u"vcl/ui/openlockedquerybox.ui"_ustr,
+        u"vcl/ui/printerdevicepage.ui"_ustr,
+        u"vcl/ui/printerpaperpage.ui"_ustr,
+        u"vcl/ui/printerpropertiesdialog.ui"_ustr,
         u"vcl/ui/printprogressdialog.ui"_ustr,
         u"writerperfect/ui/exportepub.ui"_ustr,
     };
commit 42f8227fdd3a0bb92a5eb50fd580e76d7d35fcb0
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Dec 5 23:46:35 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Dec 6 12:17:26 2024 +0100

    tdf#130857 qt weld: Return selected item when requested in callback
    
    The current item and the selected item(s) are
    not necessarily the same.
    
    Looking into the gtk and VCL implementations,
    weld::TreeView::signal_changed is called
    when the selection (not the current item) changes, so
    connect to the QItemSelectionModel::selectionChanged signal
    instead of the  QItemSelectionModel::currentChanged one
    in the Qt implementation.
    
    At the point in time that the QItemSelectionModel::selectionChanged
    signal gets emitted, QItemSelectionModel::selectedIndexes
    returns the newly selected indices while that was not
    yet the case with QItemSelectionModel::currentChanged.
    
    For the "Device" tab in the "File" -> "Printer Settings" -> "Properties"
    dialog (for which support will be added in an upcoming commit),
    this resulted in the PPD values (in the tree view
    on the right) not being shown for the actually selected PPD
    option/key (in the left tree view), but for the
    one selected previously.
    (See RTSDevicePage::SelectHdl for the logic filling
    the tree view with items, which gets triggered when
    weld::TreeView::signal_changed gets called.)
    
    Change-Id: I31ec5aaaa47cd3d4704f25086b24645fb708be0a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177922
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/inc/qt5/QtInstanceTreeView.hxx 
b/vcl/inc/qt5/QtInstanceTreeView.hxx
index dd252c3e2b47..15fab0ff0792 100644
--- a/vcl/inc/qt5/QtInstanceTreeView.hxx
+++ b/vcl/inc/qt5/QtInstanceTreeView.hxx
@@ -189,7 +189,7 @@ private:
 
 private Q_SLOTS:
     void handleActivated();
-    void handleCurrentChanged();
+    void handleSelectionChanged();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/qt5/QtInstanceTreeView.cxx b/vcl/qt5/QtInstanceTreeView.cxx
index 70bfd40e0ea6..e72826ce8734 100644
--- a/vcl/qt5/QtInstanceTreeView.cxx
+++ b/vcl/qt5/QtInstanceTreeView.cxx
@@ -28,8 +28,8 @@ QtInstanceTreeView::QtInstanceTreeView(QTreeView* pTreeView)
     assert(m_pSelectionModel);
 
     connect(m_pTreeView, &QTreeView::activated, this, 
&QtInstanceTreeView::handleActivated);
-    connect(m_pSelectionModel, &QItemSelectionModel::currentChanged, this,
-            &QtInstanceTreeView::handleCurrentChanged);
+    connect(m_pSelectionModel, &QItemSelectionModel::selectionChanged, this,
+            &QtInstanceTreeView::handleSelectionChanged);
 }
 
 void QtInstanceTreeView::insert(const weld::TreeIter* pParent, int pos, const 
OUString* pStr,
@@ -737,7 +737,7 @@ void QtInstanceTreeView::handleActivated()
     signal_row_activated();
 }
 
-void QtInstanceTreeView::handleCurrentChanged()
+void QtInstanceTreeView::handleSelectionChanged()
 {
     SolarMutexGuard g;
     signal_changed();

Reply via email to