[poppler] qt4/src

Pino Toscano pino at kemper.freedesktop.org
Mon Feb 11 02:58:54 PST 2008


 qt4/src/poppler-form.cc |   14 ++++++++++++++
 qt4/src/poppler-form.h  |    8 ++++++++
 2 files changed, 22 insertions(+)

New commits:
commit 7499764d382366823519aa13a38e1e44781c78af
Author: Pino Toscano <pino at kde.org>
Date:   Mon Feb 11 11:57:50 2008 +0100

    Add FormFieldButton::siblings().
    
    This is needed for grouping together the radio buttons.

diff --git a/qt4/src/poppler-form.cc b/qt4/src/poppler-form.cc
index 74dd0a4..c1942ef 100644
--- a/qt4/src/poppler-form.cc
+++ b/qt4/src/poppler-form.cc
@@ -180,6 +180,20 @@ void FormFieldButton::setState( bool state )
   fwb->setState((GBool)state);
 }
 
+QList<int> FormFieldButton::siblings() const
+{
+  FormWidgetButton* fwb = static_cast<FormWidgetButton*>(m_formData->fm);
+  if (fwb->getButtonType() != formButtonRadio)
+    return QList<int>();
+
+  QList<int> ret;
+  unsigned *sibls = fwb->getSiblingsID();
+  for (int i = 0; i < fwb->getNumSiblingsID(); ++i)
+    ret.append(sibls[i]);
+
+  return ret;
+}
+
 
 FormFieldText::FormFieldText(DocumentData *doc, ::Page *p, ::FormWidgetText *w)
   : FormField(*new FormFieldData(doc, p, w))
diff --git a/qt4/src/poppler-form.h b/qt4/src/poppler-form.h
index c89840c..fa3317d 100644
--- a/qt4/src/poppler-form.h
+++ b/qt4/src/poppler-form.h
@@ -142,6 +142,14 @@ namespace Poppler {
 	 */
 	void setState( bool state );
 
+	/**
+	  The list with the IDs of siblings (ie, buttons belonging to the same
+	  group as the current one.
+
+	  Valid only for \ref Radio buttons, an empty list otherwise.
+	 */
+	QList<int> siblings() const;
+
     private:
 	Q_DISABLE_COPY(FormFieldButton)
     };


More information about the poppler mailing list