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

void MReportEngine::setLabelAttributes ( MLabelObject label,
QDomNamedNodeMap *  attr 
) [protected]

Sets a label's layout attributes

Definition at line 834 of file mreportengine.cpp.

References MReportObject::setBackgroundColor(), MReportObject::setBorderColor(), MReportObject::setBorderStyle(), MReportObject::setBorderWidth(), MLabelObject::setFont(), MReportObject::setForegroundColor(), MReportObject::setGeometry(), MLabelObject::setHorizontalAlignment(), MLabelObject::setText(), MLabelObject::setVerticalAlignment(), and MLabelObject::setWordWrap().

Referenced by setDetailAttributes(), setFieldAttributes(), setSectionAttributes(), and setSpecialAttributes().

{
  QString tmp;

  label->setText (attr->namedItem ("Text").nodeValue ());
  label->setGeometry (attr->namedItem ("X").nodeValue ().toInt (),
                                attr->namedItem ("Y").nodeValue ().toInt (),
                                attr->namedItem ("Width").nodeValue ().toInt (), attr->namedItem ("Height").nodeValue ().toInt ());

  tmp = attr->namedItem ("BackgroundColor").nodeValue ();
  label->setBackgroundColor (tmp.left (tmp.find (",")).toInt (),
                                           tmp.mid (tmp.find (",") + 1,
                                                        (tmp.findRev (",") - tmp.find (",")) - 1).toInt (), tmp.right (tmp.length () - tmp.findRev (",") - 1).toInt ());

  tmp = attr->namedItem ("ForegroundColor").nodeValue ();
  label->setForegroundColor (tmp.left (tmp.find (",")).toInt (),
                                           tmp.mid (tmp.find (",") + 1,
                                                        (tmp.findRev (",") - tmp.find (",")) - 1).toInt (), tmp.right (tmp.length () - tmp.findRev (",") - 1).toInt ());

  tmp = attr->namedItem ("BorderColor").nodeValue ();
  label->setBorderColor (tmp.left (tmp.find (",")).toInt (),
                                     tmp.mid (tmp.find (",") + 1,
                                                  (tmp.findRev (",") - tmp.find (",")) - 1).toInt (), tmp.right (tmp.length () - tmp.findRev (",") - 1).toInt ());

  label->setBorderWidth (attr->namedItem ("BorderWidth").nodeValue ().toInt ());
  label->setBorderStyle (attr->namedItem ("BorderStyle").nodeValue ().toInt ());
  label->setFont (attr->namedItem ("FontFamily").nodeValue (),
                          attr->namedItem ("FontSize").nodeValue ().toInt (),
                          attr->namedItem ("FontWeight").nodeValue ().toInt (), (attr->namedItem ("FontItalic").nodeValue ().toInt () == 0 ? false : true));
  label->setHorizontalAlignment (attr->namedItem ("HAlignment").nodeValue ().toInt ());
  label->setVerticalAlignment (attr->namedItem ("VAlignment").nodeValue ().toInt ());
  label->setWordWrap (attr->namedItem ("WordWrap").nodeValue ().toInt () == 0 ? false : true);
}


Generated by  Doxygen 1.6.0   Back to index