14 #include <QDomElement>
38 QDomElement elem = node.toElement();
50 QDomElement elem = node.toElement();
51 mGroup = elem.attribute(
"group").toInt();
52 mPlane = string2enum<PLANE_TYPE> (elem.attribute(
"type"));
63 return create(uid, name, 0, 0);
77 mOffScreenRendering(false)
86 mName = mName +
" " + uid;
94 if (!this->
merge(region))
104 if (!this->
merge(region))
121 reportError(
"Attempted to merge a region outside allocated space in LayoutData.");
138 if (iter != this->
end())
144 mView.push_back(current);
169 if (iter == this->
end())
171 if (iter->mRegion.span.row == 1 && iter->mRegion.span.col == 1)
186 mView.push_back(newView);
198 if (mSize.
row == 0 || mSize.
col == 0)
208 if (iter->mRegion.pos.row >= rows || iter->mRegion.pos.col >= cols)
210 iter = mView.erase(iter);
219 for (
int r = 0; r < rows; ++r)
221 for (
int c = 0; c < cols; ++c)
238 return *(this->
find(pos));
245 if (iter->mRegion.contains(pos))
254 QDomDocument doc = node.ownerDocument();
255 QDomElement elem = node.toElement();
257 elem.setAttribute(
"uid", mUid);
258 elem.setAttribute(
"name", mName);
259 elem.setAttribute(
"offScreenRendering", mOffScreenRendering);
261 QDomElement
size = doc.createElement(
"size");
262 size.setAttribute(
"row", mSize.
row);
263 size.setAttribute(
"col", mSize.
col);
264 elem.appendChild(
size);
268 QDomElement view = doc.createElement(
"view");
270 elem.appendChild(view);
279 QDomElement elem = node.toElement();
280 mUid = elem.attribute(
"uid");
281 mName = elem.attribute(
"name");
282 mOffScreenRendering = elem.attribute(
"offScreenRendering").toInt();
284 QDomElement
size = elem.namedItem(
"size").toElement();
285 mSize.
row =
size.attribute(
"row").toInt();
286 mSize.
col =
size.attribute(
"col").toInt();
290 QDomElement currentElem = elem.firstChildElement(
"view");
291 for (; !currentElem.isNull(); currentElem = currentElem.nextSiblingElement(
"view"))
295 mView.push_back(viewData);