void KReportDesignerSectionScene::raiseSelected() { QGraphicsItemList list = selectedItems(); for (QGraphicsItemList::iterator it = list.begin(); it != list.end(); ++it) { (*it)->setZValue(highestZValue() + 1); } }
qreal KReportDesignerSectionScene::highestZValue() { qreal z; qreal zz; z = 0; QGraphicsItemList list = items(); for (QGraphicsItemList::iterator it = list.begin(); it != list.end(); ++it) { zz = (*it)->zValue(); if (zz > z) { z = zz; } } return z; }
void ReportSection::buildXML(QDomDocument & doc, QDomElement & section) { int dpiY = KoGlobal::dpiY(); qreal f = INCH_TO_POINT(m_scene->height() / dpiY); //f = ( ( f - ( int ) f ) > .5 ? f : f + 1 ); QDomElement height = doc.createElement("height"); height.appendChild(doc.createTextNode(QString::number(f))); section.appendChild(height); QDomElement bgcolor = doc.createElement("bgcolor"); bgcolor.appendChild(doc.createTextNode(m_sectionData->bgColor().name())); section.appendChild(bgcolor); // now get a list of all the QCanvasItems on this scene and output them. QGraphicsItemList list = m_scene->items(); for (QGraphicsItemList::iterator it = list.begin(); it != list.end(); it++) { ReportEntity::buildXML((*it), doc, section); } }
QGraphicsItemList KReportDesignerSectionScene::itemsOrdered() const { QGraphicsItemList r; QGraphicsItemList list = items(); for (QGraphicsItemList::iterator it = list.begin(); it != list.end(); ++it) { for (QGraphicsItemList::iterator rit = r.begin(); rit != r.end(); ++rit) { } } return r; }