vcl/inc/qt5/QtExpander.hxx     |    3 +++
 vcl/qt5/QtExpander.cxx         |    5 +++++
 vcl/qt5/QtInstanceBuilder.cxx  |    1 +
 vcl/qt5/QtInstanceExpander.cxx |    2 ++
 4 files changed, 11 insertions(+)

New commits:
commit 2f5acb35458d360c7db6b0f072204baf021ea84b
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sun Nov 24 02:13:32 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sun Nov 24 17:05:02 2024 +0100

    tdf#130857 qt weld: Notify about Expander state change
    
    Call weld::Expander::signal_expanded when the
    QtExpander expanded state changes, e.g. when
    its button gets clicked.
    
    In order to do that, introduce a signal in
    QtExpander and connect to that in
    QtInstanceExpander.
    
    With this in place, a breakpoint in
    weld::Expander::signal_expanded now gets
    hit as expected when (un)expanding the
    expander in the "Set Password" dialog triggered in Writer
    using "File" -> "Save As", check "Save with password"
    checkbox and press "Save" when using the qt6 VCL
    plugin with SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.
    
    This implements what was mentioned as still
    missing in earlier commit
    
        Change-Id: I7e3a332c0417b1897ae57d7d4c29609245fb5e19
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Sun Nov 24 01:20:31 2024 +0100
    
            tdf#130857 qt weld: Add QtInstanceExpander
    
    as
    
    > Signal handling still needs to be implemented
    > (calling `weld::Expander::signal_expanded` when
    > the expanded state is toggled).
    
    Change-Id: I9cd1b2cc99018f84ba930d55399953266119bed0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177199
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/inc/qt5/QtExpander.hxx b/vcl/inc/qt5/QtExpander.hxx
index 394712a55a77..d9952c9f914d 100644
--- a/vcl/inc/qt5/QtExpander.hxx
+++ b/vcl/inc/qt5/QtExpander.hxx
@@ -32,6 +32,9 @@ public:
     void setExpanded(bool bExpand);
     bool isExpanded() const;
 
+Q_SIGNALS:
+    void expandedChanged(bool bExpanded);
+
 private:
     void update();
 
diff --git a/vcl/qt5/QtExpander.cxx b/vcl/qt5/QtExpander.cxx
index 433244999905..1b690ecdc888 100644
--- a/vcl/qt5/QtExpander.cxx
+++ b/vcl/qt5/QtExpander.cxx
@@ -45,8 +45,13 @@ QString QtExpander::text() const { return m_pButton->text(); 
}
 
 void QtExpander::setExpanded(bool bExpand)
 {
+    if (m_bExpanded == bExpand)
+        return;
+
     m_bExpanded = bExpand;
     update();
+
+    emit expandedChanged(isExpanded());
 }
 
 bool QtExpander::isExpanded() const { return m_bExpanded; }
diff --git a/vcl/qt5/QtInstanceExpander.cxx b/vcl/qt5/QtInstanceExpander.cxx
index 7594af8f0a26..1c120105e690 100644
--- a/vcl/qt5/QtInstanceExpander.cxx
+++ b/vcl/qt5/QtInstanceExpander.cxx
@@ -17,6 +17,8 @@ QtInstanceExpander::QtInstanceExpander(QtExpander* pExpander)
     , m_pExpander(pExpander)
 {
     assert(m_pExpander);
+
+    connect(m_pExpander, &QtExpander::expandedChanged, this, [&] { 
signal_expanded(); });
 }
 
 void QtInstanceExpander::set_label(const OUString& rText)
commit 5e4aa646356e1d59976e0f1adcfeb9353c65eda0
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sun Nov 24 01:36:29 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sun Nov 24 17:04:54 2024 +0100

    tdf#130857 qt weld: Support "Save with password" dialog
    
    Declare support for the "Set Password" dialog that can
    be triggered in Writer using "File" -> "Save As", check
    "Save with password" checkbox and press "Save" to trigger
    the 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 makes use of QtInstanceExpander added in
    
        Change-Id: I7e3a332c0417b1897ae57d7d4c29609245fb5e19
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Sun Nov 24 01:20:31 2024 +0100
    
            tdf#130857 qt weld: Add QtInstanceExpander
    
    Currently, I see a small rendering issue when
    opening that dialog and expanding the expander:
    The "Enter password to allow editing" and
    "Confirm password" label text is a bit cropped.
    It's shown fine when manually enlarging the dialog a bit,
    however.
    
    Change-Id: I37775fa3a39d621696d2a6aaa49bd11d6cfb9350
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177198
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx
index c0512b5929aa..d232e10b4893 100644
--- a/vcl/qt5/QtInstanceBuilder.cxx
+++ b/vcl/qt5/QtInstanceBuilder.cxx
@@ -51,6 +51,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& 
rUIFile)
         u"cui/ui/aboutdialog.ui"_ustr,
         u"cui/ui/insertrowcolumn.ui"_ustr,
         u"cui/ui/optnewdictionarydialog.ui"_ustr,
+        u"cui/ui/password.ui"_ustr,
         u"cui/ui/querysetinsmodedialog.ui"_ustr,
         u"cui/ui/securityoptionsdialog.ui"_ustr,
         u"cui/ui/tipofthedaydialog.ui"_ustr,

Reply via email to