Continue on CDB watchmodel.

This commit is contained in:
Friedemann Kleint
2009-04-01 08:55:57 +02:00
parent 0120008a06
commit 8d54b23311
3 changed files with 214 additions and 71 deletions

View File

@@ -195,18 +195,22 @@ QString WatchData::toString() const
const char *doubleQuoteComma = "\",";
QString res;
QTextStream str(&res);
str <<"{state=\"0x" << QString::number(state, 16) << doubleQuoteComma
<< "level=\"" << level << doubleQuoteComma
<< "parent=\"" << parentIndex << doubleQuoteComma
<< "row=\"" << row << doubleQuoteComma
<< "child=\"";
const int childCount = childIndex.size();
for (int i = 0; i < childCount; i++) {
if (i)
str << ',';
str << childIndex.at(i);
str <<"{state=\"0x" << QString::number(state, 16) << doubleQuoteComma;
if (level != -1)
str << "level=\"" << level << doubleQuoteComma;
if (parentIndex != -1)
str << "parent=\"" << parentIndex << doubleQuoteComma;
if (row != -1)
str << "row=\"" << row << doubleQuoteComma;
if (const int childCount = childIndex.size()) {
str << "child=\"";
for (int i = 0; i < childCount; i++) {
if (i)
str << ',';
str << childIndex.at(i);
}
str << doubleQuoteComma;
}
str << doubleQuoteComma;
if (!iname.isEmpty())
str << "iname=\"" << iname << doubleQuoteComma;