Logo Search packages:      
Sourcecode: facturalux version File versions  Download package

void MReportEngine::setDetailAttributes ( QDomNode *  report  )  [protected]

Sets the layout attributes for the detail section

Definition at line 755 of file mreportengine.cpp.

References MReportDetail::addField(), MReportSection::addLabel(), MReportSection::addLine(), MReportSection::addSpecialField(), details, setFieldAttributes(), MReportSection::setHeight(), setLabelAttributes(), MReportSection::setLevel(), setLineAttributes(), and setSpecialAttributes().

Referenced by initTemplate().

{
  // Get the attributes for the detail section
  QDomNamedNodeMap attributes = report->attributes ();

  // Get the report detail attributes
  MReportDetail *detail = new MReportDetail;

  detail->setHeight (attributes.namedItem ("Height").nodeValue ().toInt ());
  detail->setLevel (attributes.namedItem ("Level").nodeValue ().toInt ());

  // Process the report detail labels
  QDomNodeList children = report->childNodes ();
  int childCount = children.length ();

  for (int j = 0; j < childCount; j++)
      {
        QDomNode child = children.item (j);

        if (child.nodeType () == QDomNode::ElementNode)
            {
              if (child.nodeName () == "Line")
                  {
                    QDomNamedNodeMap attributes = child.attributes ();
                    MLineObject *line = new MLineObject ();

                    setLineAttributes (line, &attributes);
                    detail->addLine (line);
                  }
              else if (child.nodeName () == "Label")
                  {
                    QDomNamedNodeMap attributes = child.attributes ();
                    MLabelObject *label = new MLabelObject ();

                    setLabelAttributes (label, &attributes);
                    detail->addLabel (label);
                  }
              else if (child.nodeName () == "Special")
                  {
                    QDomNamedNodeMap attributes = child.attributes ();
                    MSpecialObject *field = new MSpecialObject ();

                    setSpecialAttributes (field, &attributes);
                    detail->addSpecialField (field);
                  }
              else if (child.nodeName () == "Field")
                  {
                    QDomNamedNodeMap attributes = child.attributes ();
                    MFieldObject *field = new MFieldObject ();

                    setFieldAttributes (field, &attributes);
                    detail->addField (field);
                  }
            }
      }
  // Append a newly created detail to the list
  details.append (detail);
}


Generated by  Doxygen 1.6.0   Back to index