qt5/src/poppler-form.cc |   11 +++++++++++
 qt5/src/poppler-form.h  |    6 ++++++
 2 files changed, 17 insertions(+)

New commits:
commit 3e0408966ccdd713de7795ce7992888b3896b49c
Author: Andre Heinecke <aheine...@intevation.de>
Date:   Thu Mar 22 14:53:19 2018 +0100

    Qt5: Allow setting of visibility
    
    Extends Qt5 API to allow setting visibility flags

diff --git a/qt5/src/poppler-form.cc b/qt5/src/poppler-form.cc
index ff737bdc..7396b596 100644
--- a/qt5/src/poppler-form.cc
+++ b/qt5/src/poppler-form.cc
@@ -163,6 +163,17 @@ bool FormField::isVisible() const
   return !(m_formData->fm->getWidgetAnnotation()->getFlags() & 
Annot::flagHidden);
 }
 
+void FormField::setVisible(bool value)
+{
+  Guint flags = m_formData->fm->getWidgetAnnotation()->getFlags();
+  if (value) {
+    flags &= ~Annot::flagHidden;
+  } else {
+    flags |= Annot::flagHidden;
+  }
+  m_formData->fm->getWidgetAnnotation()->setFlags(flags);
+}
+
 Link* FormField::activationAction() const
 {
   Link* action = nullptr;
diff --git a/qt5/src/poppler-form.h b/qt5/src/poppler-form.h
index d52f7e4b..e83deca3 100644
--- a/qt5/src/poppler-form.h
+++ b/qt5/src/poppler-form.h
@@ -122,6 +122,12 @@ namespace Poppler {
        bool isVisible() const;
 
        /**
+         Set whether this form field is visible.
+         \since 0.64
+        */
+       void setVisible(bool value);
+
+       /**
          The activation action of this form field.
 
          \note It may be null.
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to