summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/findnocoding.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2011-08-01 21:51:34 (GMT)
committerJason R. Coombs <jaraco@jaraco.com>2011-08-01 21:51:34 (GMT)
commitdf9a5f5ecfbbdb5f2e791ee3b470e2a9db609286 (patch)
treed472dd3d0aa90bb8aa5a0a6715b1eb68a28941ee /Tools/scripts/findnocoding.py
parent9aa20affb6603a297f0327da7e990ba2e7e2daeb (diff)
downloadcpython-df9a5f5ecfbbdb5f2e791ee3b470e2a9db609286.zip
cpython-df9a5f5ecfbbdb5f2e791ee3b470e2a9db609286.tar.gz
cpython-df9a5f5ecfbbdb5f2e791ee3b470e2a9db609286.tar.bz2
Issue #12666: Clarifying changes in map for Python 3
Diffstat (limited to 'Tools/scripts/findnocoding.py')
0 files changed, 0 insertions, 0 deletions
else if (atom->string() == ATOM_LIST_LOWERROMAN) - writer.writeAttribute("type","i"); + writer.writeAttribute("outputclass","lowerroman"); else // (atom->string() == ATOM_LIST_NUMERIC) - writer.writeAttribute("type","1"); - if (atom->next() != 0 && atom->next()->string().toInt() != 1) + writer.writeAttribute("outputclass","numeric"); + if (atom->next() != 0 && atom->next()->string().toInt() != 1) { + // I don't think this attribute is supported. writer.writeAttribute("start",atom->next()->string()); + } } break; case Atom::ListItemNumber: @@ -1130,15 +1125,15 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writer.writeStartElement("dt"); } else { // (atom->string() == ATOM_LIST_VALUE) - writer.writeStartElement("tr"); - writer.writeStartElement("td"); + writer.writeStartElement("strow"); + writer.writeStartElement("stentry"); writer.writeAttribute("outputclass","topAlign"); writer.writeStartElement("tt"); writer.writeCharacters(protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(), relative)))); writer.writeEndElement(); // - writer.writeEndElement(); // - writer.writeStartElement("td"); + writer.writeEndElement(); // + writer.writeStartElement("stentry"); writer.writeAttribute("outputclass","topAlign"); QString itemValue; @@ -1167,8 +1162,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } else if (atom->string() == ATOM_LIST_VALUE) { if (threeColumnEnumValueTable) { - writer.writeEndElement(); // - writer.writeStartElement("td"); + writer.writeEndElement(); // + writer.writeStartElement("stentry"); writer.writeAttribute("outputclass","topAlign"); if (matchAhead(atom, Atom::ListItemRight)) writer.writeCharacters(" "); @@ -1185,8 +1180,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writer.writeEndElement(); // } else if (atom->string() == ATOM_LIST_VALUE) { - writer.writeEndElement(); // - writer.writeEndElement(); // + writer.writeEndElement(); // + writer.writeEndElement(); // } else { writer.writeEndElement(); // @@ -1200,7 +1195,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writer.writeEndElement(); // } else if (atom->string() == ATOM_LIST_VALUE) { - writer.writeEndElement(); // + writer.writeEndElement(); // } else { writer.writeEndElement(); // @@ -1264,61 +1259,80 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } break; case Atom::TableLeft: - if (in_para) { - writer.writeEndElement(); //

- in_para = false; + { + if (in_para) { + writer.writeEndElement(); //

+ in_para = false; + } + writer.writeStartElement("table"); + writer.writeAttribute("outputclass","generic"); + numTableRows = 0; + if (tableColumnCount != 0) { + qDebug() << "ERROR: Nested tables!"; + tableColumnCount = 0; + } + const Atom* t = atom->next(); + while ((t->type() != Atom::TableHeaderRight) && + (t->type() != Atom::TableRowRight) && + (t->type() != Atom::TableRight)) { + if (t->type() == Atom::TableItemLeft) + ++tableColumnCount; + t = t->next(); + } + writer.writeStartElement("tgroup"); + writer.writeAttribute("cols",QString::number(tableColumnCount)); } - writer.writeStartElement("table"); - writer.writeAttribute("outputclass","generic"); - numTableRows = 0; break; case Atom::TableRight: + writer.writeEndElement(); // + writer.writeEndElement(); // writer.writeEndElement(); // + tableColumnCount = 0; break; case Atom::TableHeaderLeft: writer.writeStartElement("thead"); - writer.writeStartElement("tr"); + writer.writeStartElement("row"); writer.writeAttribute("outputclass","qt-style topAlign"); inTableHeader = true; + inTableBody = false; break; case Atom::TableHeaderRight: - writer.writeEndElement(); // + writer.writeEndElement(); // if (matchAhead(atom, Atom::TableHeaderLeft)) { skipAhead = 1; - writer.writeStartElement("tr"); + writer.writeStartElement("row"); writer.writeAttribute("outputclass","qt-style topAlign"); } else { writer.writeEndElement(); // inTableHeader = false; + inTableBody = true; + writer.writeStartElement("tbody"); } break; case Atom::TableRowLeft: - writer.writeStartElement("tr"); + if (!inTableHeader && !inTableBody) { + inTableBody = true; + writer.writeStartElement("tbody"); + } + writer.writeStartElement("row"); if (++numTableRows % 2 == 1) writer.writeAttribute("outputclass","odd topAlign"); else writer.writeAttribute("outputclass","even topAlign"); break; case Atom::TableRowRight: - writer.writeEndElement(); // \n"; + writer.writeEndElement(); // \n"; break; case Atom::TableItemLeft: { if (inTableHeader) - writer.writeStartElement("th"); + writer.writeStartElement("entry"); else - writer.writeStartElement("td"); + writer.writeStartElement("entry"); QStringList spans = atom->string().split(","); if (spans.size() == 2) { -#if zzz - - if (spans.at(0) != "1") - out() << " colspan=\"" << spans.at(0) << "\""; - if (spans.at(1) != "1") - out() << " rowspan=\"" << spans.at(1) << "\""; -#endif if (!inTableHeader) writer.writeStartElement("p"); } @@ -1328,10 +1342,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::TableItemRight: if (inTableHeader) - writer.writeEndElement(); // + writer.writeEndElement(); // else { writer.writeEndElement(); //

- writer.writeEndElement(); // + writer.writeEndElement(); // } if (matchAhead(atom, Atom::ParaLeft)) skipAhead = 1; @@ -1384,12 +1398,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writer.writeCharacters(protectEnc(atom->string())); writer.writeEndElement(); // break; -#ifdef QDOC_QML case Atom::QmlText: case Atom::EndQmlText: // don't do anything with these. They are just tags. break; -#endif default: // unknownAtom(atom); break; @@ -1398,7 +1410,9 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } /*! - Generate a reference page for a C++ class. + Generate a element (and all the stuff inside it) + for the C++ class represented by \a innerNode. \a marker is + for marking up the code. I don't know what that means exactly. */ void DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* marker) @@ -1432,7 +1446,9 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writer.writeCharacters(fullTitle); writer.writeEndElement(); // - generateBrief(inner, marker); + generateBrief(inner, marker); // + + // not included: writer.writeStartElement(CXXCLASSDETAIL); writer.writeStartElement(CXXCLASSDEFINITION); @@ -1445,7 +1461,10 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writer.writeAttribute("value","abstract"); writer.writeEndElement(); // } - writeDerivations(cn, marker); + writeDerivations(cn, marker); // + + // not included: + writeLocation(cn); writer.writeEndElement(); // writer.writeStartElement(APIDESC); @@ -1456,12 +1475,18 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writer.writeCharacters("Detailed Description"); writer.writeEndElement(); //

generateBody(inner, marker); - // generateAlsoList(inner, marker); + // generateAlsoList(inner, marker); } writer.writeEndElement(); // + + // not included: ,
, or + writer.writeEndElement(); // + // not included: + // not included: + sections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay); s = sections.begin(); while (s != sections.end()) { @@ -1483,199 +1508,11 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } ++s; } - writer.writeEndElement(); // - } - -#ifdef WRITE_HTML - Text subtitleText; - if (rawTitle != fullTitle) - subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")" - << Atom(Atom::LineBreak); - - QString shortVersion; - shortVersion = project + " " + shortVersion + ": "; - shortVersion = myTree->version(); - if (shortVersion.count(QChar('.')) == 2) - shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); - if (!shortVersion.isEmpty()) { - if (project == "QSA") - shortVersion = "QSA " + shortVersion + ": "; - else - shortVersion = "Qt " + shortVersion + ": "; - } - - out() << " " << shortVersion << protectEnc(title) << "\n"; - -#if 0 - out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - generateBreadCrumbs(title,node,marker); - out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); -#endif - - sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); - generateTableOfContents(inner,marker,§ions); - generateTitle(title, subtitleText, SmallSubTitle, inner, marker); - -#ifdef QDOC_QML - if (cn && !cn->qmlElement().isEmpty()) { - generateInstantiatedBy(cn,marker); - } -#endif - - generateBrief(inner, marker); - generateIncludes(inner, marker); - generateStatus(inner, marker); - if (cn) { - generateInherits(cn, marker); - generateInheritedBy(cn, marker); - } - generateThreadSafeness(inner, marker); - generateSince(inner, marker); - - out() << "
    \n"; - - QString membersLink = generateListOfAllMemberFile(inner, marker); - if (!membersLink.isEmpty()) - out() << "
  • " - << "List of all members, including inherited members
  • \n"; - - QString obsoleteLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Obsolete); - if (!obsoleteLink.isEmpty()) - out() << "
  • " - << "Obsolete members
  • \n"; - - QString compatLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Compat); - if (!compatLink.isEmpty()) - out() << "
  • " - << "Qt 3 support members
  • \n"; - - out() << "
\n"; - - bool needOtherSection = false; - - /* - sections is built above for the call to generateTableOfContents(). - */ - s = sections.begin(); - while (s != sections.end()) { - if (s->members.isEmpty() && s->reimpMembers.isEmpty()) { - if (!s->inherited.isEmpty()) - needOtherSection = true; - } - else { - if (!s->members.isEmpty()) { - out() << "
\n"; - out() << "\n"; - out() << "

" << protectEnc((*s).name) << "

\n"; - generateSection(s->members, inner, marker, CodeMarker::Summary); - } - if (!s->reimpMembers.isEmpty()) { - QString name = QString("Reimplemented ") + (*s).name; - out() << "
\n"; - out() << "\n"; - out() << "

" << protectEnc(name) << "

\n"; - generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); - } - - if (!s->inherited.isEmpty()) { - out() << "
    \n"; - generateSectionInheritedList(*s, inner, marker, true); - out() << "
\n"; - } - } - ++s; - } - - if (needOtherSection) { - out() << "

Additional Inherited Members

\n" - "
    \n"; - - s = sections.begin(); - while (s != sections.end()) { - if (s->members.isEmpty() && !s->inherited.isEmpty()) - generateSectionInheritedList(*s, inner, marker); - ++s; - } - out() << "
\n"; - } - - out() << "\n"; - - if (!inner->doc().isEmpty()) { - out() << "
\n" - << "
\n" // QTBUG-9504 - << "

" << "Detailed Description" << "

\n"; - generateBody(inner, marker); - out() << "
\n"; // QTBUG-9504 - generateAlsoList(inner, marker); - } - - sections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay); - s = sections.begin(); - while (s != sections.end()) { - out() << "
\n"; - if (!(*s).divClass.isEmpty()) - out() << "
\n"; // QTBUG-9504 - out() << "

" << protectEnc((*s).name) << "

\n"; - - NodeList::ConstIterator m = (*s).members.begin(); - while (m != (*s).members.end()) { - if ((*m)->access() != Node::Private) { // ### check necessary? - if ((*m)->type() != Node::Class) - generateDetailedMember(*m, inner, marker); - else { - out() << "

class "; - generateFullName(*m, inner, marker); - out() << "

"; - generateBrief(*m, marker, inner); - } - QStringList names; - names << (*m)->name(); - if ((*m)->type() == Node::Function) { - const FunctionNode *func = reinterpret_cast(*m); - if (func->metaness() == FunctionNode::Ctor || - func->metaness() == FunctionNode::Dtor || - func->overloadNumber() != 1) - names.clear(); - } - else if ((*m)->type() == Node::Property) { - const PropertyNode *prop = reinterpret_cast(*m); - if (!prop->getters().isEmpty() && - !names.contains(prop->getters().first()->name())) - names << prop->getters().first()->name(); - if (!prop->setters().isEmpty()) - names << prop->setters().first()->name(); - if (!prop->resetters().isEmpty()) - names << prop->resetters().first()->name(); - } - else if ((*m)->type() == Node::Enum) { - const EnumNode *enume = reinterpret_cast(*m); - if (enume->flagsType()) - names << enume->flagsType()->name(); + // not included: - foreach (const QString &enumName, - enume->doc().enumItemNames().toSet() - - enume->doc().omitEnumItemNames().toSet()) - names << plainCode(marker->markedUpEnumValue(enumName, - enume)); - } - } - ++m; - } - if (!(*s).divClass.isEmpty()) - out() << "
\n"; // QTBUG-9504 - ++s; + writer.writeEndElement(); // } -#endif } /*! @@ -1684,14 +1521,18 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark */ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) { - return; // zzz - SubTitleSize subTitleSize = LargeSubTitle; QList
sections; QList
::const_iterator s; QString fullTitle = fake->fullTitle(); QString htmlTitle = fullTitle; + /* + NOTE: For now we only handle \page elements. + */ + if (fake->subType() != Node::Page) + return; + if (fake->subType() == Node::File && !fake->subTitle().isEmpty()) { subTitleSize = SmallSubTitle; htmlTitle += " (" + fake->subTitle() + ")"; @@ -1702,7 +1543,30 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker } generateHeader(fake); - + + if (fake->subType() == Node::Page) { + writer.writeStartElement("topic"); + writer.writeAttribute("id",fake->guid()); + writer.writeStartElement("title"); + writer.writeCharacters(fullTitle); + writer.writeEndElement(); // + + generateBrief(fake, marker); // + + if (!fake->doc().isEmpty()) { + writer.writeStartElement("body"); + writer.writeStartElement("p"); + writer.writeAttribute("outputclass","h2"); + writer.writeCharacters("Detailed Description"); + writer.writeEndElement(); //

+ generateBody(fake, marker); + writer.writeEndElement(); // + } + writer.writeEndElement(); // + } +} + +#if 0 /* Generate the TOC for the new doc format. Don't generate a TOC for the home page. @@ -1715,7 +1579,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker subTitleSize, fake, marker); - + if (fake->subType() == Node::Module) { // Generate brief text and status for modules. generateBrief(fake, marker); @@ -1760,7 +1624,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker out() << "\n"; } -#ifdef QDOC_QML else if (fake->subType() == Node::QmlClass) { const QmlClassNode* qml_cn = static_cast(fake); const ClassNode* cn = qml_cn->classNode(); @@ -1800,7 +1663,8 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker return; } #endif - + +#if 0 sections = marker->sections(fake, CodeMarker::Summary, CodeMarker::Okay); s = sections.begin(); while (s != sections.end()) { @@ -1845,7 +1709,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker } ++s; } -} +#endif /*! Returns "xml" for this subclass of Generator. @@ -1943,6 +1807,12 @@ void DitaXmlGenerator::generateBreadCrumbs(const QString& title, } } +/*! + Outputs an XML file header depending on which kind of DITA + file is being generated. + + \note This does not cover all cases yet. + */ void DitaXmlGenerator::generateHeader(const Node* node) { writer.setDevice(out().device()); @@ -1953,18 +1823,28 @@ void DitaXmlGenerator::generateHeader(const Node* node) if (!node) return; - QString docType; + QString doctype; + QString element; QString dtd; + QString base; QString version; if (node->type() == Node::Class) { - docType = "cxxClass"; + element = "cxxClass"; dtd = "dtd/cxxClass.dtd"; version = "0.6.0"; + doctype = ""; + } + else if (node->type() == Node::Fake) { + if (node->subType() == Node::Page) { + element = "topic"; + dtd = "dtd/topic.dtd"; + doctype = ""; + } } - QString doctype = ""; writer.writeDTD(doctype); writer.writeComment(node->doc().location().fileName()); } @@ -1989,7 +1869,7 @@ void DitaXmlGenerator::generateTitle(const QString& title, } /*! - Outputs the brief command as a element. */ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) { @@ -2006,11 +1886,10 @@ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) void DitaXmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) { if (!inner->includes().isEmpty()) { - out() << "
"
-              << trimmedTrailing(highlightedCode(indent(codeIndent,
-                                                        marker->markedUpIncludes(inner->includes())),
-                                                 marker,inner))
-              << "
"; + writer.writeStartElement("pree"); + writer.writeAttribute("outputclass","highlightedcode"); + writeText(marker->markedUpIncludes(inner->includes()), marker, inner); + writer.writeEndElement(); // } } @@ -2532,19 +2411,27 @@ void DitaXmlGenerator::generateCompactList(const Node *relative, Output the alphabet as a row of links. */ if (includeAlphabet) { - out() << "

"; + writer.writeStartElement("p"); + writer.writeAttribute("outputclass","centerAlign functionIndex"); + writer.writeStartElement("b"); for (int i = 0; i < 26; i++) { QChar ch('a' + i); - if (usedParagraphNames.contains(char('a' + i))) - out() << QString("%2 ").arg(ch).arg(ch.toUpper()); + if (usedParagraphNames.contains(char('a' + i))) { + writer.writeStartElement("xref"); + writer.writeAttribute("href",QString("#%1").arg(ch)); + writer.writeCharacters(QString(ch.toUpper())); + writer.writeEndElement(); // + } } - out() << "

\n"; + writer.writeEndElement(); // + writer.writeEndElement(); //

} /* - Output a
element to contain all the
elements. + Output a

element to contain all the

elements. */ - out() << "
\n"; + writer.writeStartElement("p"); + writer.writeAttribute("outputclass","compactlist flowListDiv"); for (int i=0; i. */ if (curParOffset == 0) { - if (i > 0) - out() << "
\n"; + if (i > 0) { + writer.writeEndElement(); // + writer.writeEndElement(); //
+ } + writer.writeStartElement("dl"); if (++numTableRows % 2 == 1) - out() << "
"; + writer.writeAttribute("outputclass","flowList odd"); else - out() << "
"; - out() << "
"; + writer.writeAttribute("outputclass","flowList even"); + writer.writeStartElement("dlentry"); + writer.writeStartElement("dt"); + writer.writeAttribute("outputclass","alphaChar"); if (includeAlphabet) { QChar c = paragraphName[curParNr][0].toLower(); - out() << QString("").arg(c); + writer.writeStartElement("a"); + writer.writeAttribute("name",c); } - out() << "" - << paragraphName[curParNr] - << ""; - out() << "
\n"; + writer.writeStartElement("b"); + writer.writeCharacters(paragraphName[curParNr]); + writer.writeEndElement(); // + writer.writeEndElement(); // } /* Output a
for the current offset in the current paragraph. */ - out() << "
"; + writer.writeStartElement("dd"); if ((curParNr < NumParagraphs) && !paragraphName[curParNr].isEmpty()) { NodeMap::Iterator it; @@ -2589,26 +2482,28 @@ void DitaXmlGenerator::generateCompactList(const Node *relative, Previously, we used generateFullName() for this, but we require some special formatting. */ - out() << ""; + writer.writeStartElement("xref"); + writer.writeAttribute("href",linkForNode(it.value(), relative)); QStringList pieces; if (it.value()->subType() == Node::QmlClass) pieces << it.value()->name(); else pieces = fullName(it.value(), relative, marker).split("::"); - out() << protectEnc(pieces.last()); - out() << ""; + writer.writeCharacters(protectEnc(pieces.last())); + writer.writeEndElement(); // if (pieces.size() > 1) { - out() << " ("; - generateFullName(it.value()->parent(), relative, marker); - out() << ")"; + writer.writeCharacters(" ("); + generateFullName(it.value()->parent(),relative,marker); + writer.writeCharacters(")"); } } - out() << "
\n"; + writer.writeEndElement(); // curParOffset++; } - out() << "
\n"; - out() << "
\n"; + writer.writeEndElement(); // + writer.writeEndElement(); // + writer.writeEndElement(); //

} void DitaXmlGenerator::generateFunctionIndex(const Node *relative, @@ -2624,16 +2519,10 @@ void DitaXmlGenerator::generateFunctionIndex(const Node *relative, char nextLetter = 'a'; char currentLetter; -#if 1 out() << "
    \n"; -#endif QMap::ConstIterator f = funcIndex.begin(); while (f != funcIndex.end()) { -#if 1 out() << "
  • "; -#else - out() << "

    "; -#endif out() << protectEnc(f.key()) << ":"; currentLetter = f.key()[0].unicode(); @@ -2648,17 +2537,11 @@ void DitaXmlGenerator::generateFunctionIndex(const Node *relative, generateFullName((*s)->parent(), relative, marker, *s); ++s; } -#if 1 out() << "

  • "; -#else - out() << "

    "; -#endif out() << "\n"; ++f; } -#if 1 out() << "
\n"; -#endif } void DitaXmlGenerator::generateLegaleseList(const Node *relative, @@ -2680,45 +2563,6 @@ void DitaXmlGenerator::generateLegaleseList(const Node *relative, } } -/*void DitaXmlGenerator::generateSynopsis(const Node *node, - const Node *relative, - CodeMarker *marker, - CodeMarker::SynopsisStyle style) -{ - QString marked = marker->markedUpSynopsis(node, relative, style); - QRegExp templateTag("(<[^@>]*>)"); - if (marked.indexOf(templateTag) != -1) { - QString contents = protectEnc(marked.mid(templateTag.pos(1), - templateTag.cap(1).length())); - marked.replace(templateTag.pos(1), templateTag.cap(1).length(), - contents); - } - marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])"), - "\\1\\2"); - marked.replace("<@param>", ""); - marked.replace("", ""); - - if (style == CodeMarker::Summary) - marked.replace("@name>", "b>"); - - if (style == CodeMarker::SeparateList) { - QRegExp extraRegExp("<@extra>.*"); - extraRegExp.setMinimal(true); - marked.replace(extraRegExp, ""); - } - else { - marked.replace("<@extra>", "  "); - marked.replace("", ""); - } - - if (style != CodeMarker::Detailed) { - marked.replace("<@type>", ""); - marked.replace("", ""); - } - out() << highlightedCode(marked, marker, relative); -}*/ - -#ifdef QDOC_QML void DitaXmlGenerator::generateQmlItem(const Node *node, const Node *relative, CodeMarker *marker, @@ -2747,9 +2591,8 @@ void DitaXmlGenerator::generateQmlItem(const Node *node, marked.replace("<@type>", ""); marked.replace("", ""); } - out() << highlightedCode(marked, marker, relative); + writeText(marked, marker, relative); } -#endif void DitaXmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* marker */) { @@ -2882,13 +2725,24 @@ void DitaXmlGenerator::generateSection(const NodeList& nl, name_alignment = false; } if (name_alignment) { - out() << "\n"; + writer.writeStartElement("table"); + writer.writeAttribute("outputclass","alignedsummary"); + writer.writeStartElement("tgroup"); + writer.writeAttribute("cols","2"); + writer.writeStartElement("tbody"); } else { - if (twoColumn) - out() << "
\n" - << "\n"; - else - out() << "\n"; + QString marked = getMarkedUpSynopsis(*m, relative, marker, style); + writeText(marked, marker, relative, name_alignment); + if (name_alignment) { + writer.writeEndElement(); // + writer.writeEndElement(); // + } + else { + writer.writeEndElement(); // + } i++; ++m; } - if (name_alignment) - out() << "
"; - out() << "
    \n"; + if (twoColumn) { + writer.writeStartElement("table"); + writer.writeAttribute("outputclass","propsummary"); + writer.writeStartElement("tgroup"); + writer.writeAttribute("cols","1"); + writer.writeStartElement("tbody"); + writer.writeStartElement("row"); + writer.writeStartElement("entry"); + writer.writeAttribute("outputclass","topAlign"); + } + writer.writeStartElement("ul"); } int i = 0; @@ -2900,28 +2754,48 @@ void DitaXmlGenerator::generateSection(const NodeList& nl, } if (name_alignment) { - out() << "
"; + writer.writeStartElement("row"); + writer.writeStartElement("entry"); + writer.writeAttribute("outputclass","memItemLeft rightAlign topAlign"); } else { - if (twoColumn && i == (int) (nl.count() + 1) / 2) - out() << "
    \n"; - out() << "
  • "; + if (twoColumn && i == (int) (nl.count() + 1) / 2) { + writer.writeEndElement(); //
+ writer.writeEndElement(); // + writer.writeStartElement("entry"); + writer.writeAttribute("outputclass","topAlign"); + writer.writeStartElement("ul"); + } + writer.writeStartElement("li"); + writer.writeAttribute("outputclass","fn"); } - generateSynopsis(*m, relative, marker, style, name_alignment); - if (name_alignment) - out() << "
\n"; + if (name_alignment) { + writer.writeEndElement(); // + writer.writeEndElement(); // + writer.writeEndElement(); // + } else { - out() << "\n"; - if (twoColumn) - out() << "\n\n"; + writer.writeEndElement(); // + if (twoColumn) { + writer.writeEndElement(); // + writer.writeEndElement(); // + writer.writeEndElement(); // + writer.writeEndElement(); // + writer.writeEndElement(); // + } } } } @@ -2969,7 +2843,8 @@ void DitaXmlGenerator::generateSectionList(const Section& section, out() << "
  • "; } - generateSynopsis(*m, relative, marker, style, name_alignment); + QString marked = getMarkedUpSynopsis(*m, relative, marker, style); + writeText(marked, marker, relative, name_alignment); if (name_alignment) out() << "\n"; else @@ -3019,51 +2894,58 @@ void DitaXmlGenerator::generateSectionInheritedList(const Section& section, } } -void DitaXmlGenerator::generateSynopsis(const Node *node, - const Node *relative, - CodeMarker *marker, - CodeMarker::SynopsisStyle style, - bool nameAlignment) +/*! + Get the synopsis from the \a node using the \a relative + node if needed, and mark up the synopsis using \a marker. + Use the style to decide which kind of sysnopsis to build, + normally \c Summary or \c Detailed. Return the marked up + string. + */ +QString DitaXmlGenerator::getMarkedUpSynopsis(const Node* node, + const Node* relative, + CodeMarker* marker, + CodeMarker::SynopsisStyle style) { QString marked = marker->markedUpSynopsis(node, relative, style); QRegExp templateTag("(<[^@>]*>)"); if (marked.indexOf(templateTag) != -1) { QString contents = protectEnc(marked.mid(templateTag.pos(1), - templateTag.cap(1).length())); - marked.replace(templateTag.pos(1), templateTag.cap(1).length(), - contents); + templateTag.cap(1).length())); + marked.replace(templateTag.pos(1), + templateTag.cap(1).length(), + contents); } marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])"), "\\1\\2"); - marked.replace("<@param>", ""); - marked.replace("", ""); + marked.replace("<@param>",""); + marked.replace("",""); if (style == CodeMarker::Summary) { - marked.replace("<@name>", ""); // was "" - marked.replace("", ""); // was "" + marked.replace("<@name>",""); // was "" + marked.replace("",""); // was "" } if (style == CodeMarker::SeparateList) { QRegExp extraRegExp("<@extra>.*"); extraRegExp.setMinimal(true); - marked.replace(extraRegExp, ""); - } else { - marked.replace("<@extra>", ""); - marked.replace("", ""); + marked.replace(extraRegExp,""); + } + else { + marked.replace("<@extra>",""); + marked.replace("",""); } if (style != CodeMarker::Detailed) { - marked.replace("<@type>", ""); - marked.replace("", ""); + marked.replace("<@type>",""); + marked.replace("",""); } - out() << highlightedCode(marked, marker, relative, style, nameAlignment); + return marked; } -QString DitaXmlGenerator::highlightedCode(const QString& markedCode, - CodeMarker *marker, - const Node *relative, - CodeMarker::SynopsisStyle , - bool nameAlignment) +void DitaXmlGenerator::writeText(const QString& markedCode, + CodeMarker* marker, + const Node* relative, + bool nameAlignment) { QString src = markedCode; QString html; @@ -3079,7 +2961,13 @@ QString DitaXmlGenerator::highlightedCode(const QString& markedCode, for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { if (nameAlignment && !done) {// && (i != 0)) Why was this here? - html += ""; + if (!html.isEmpty()) { + writer.writeCharacters(html); + html.clear(); + } + writer.writeEndElement(); // + writer.writeStartElement("entry"); + writer.writeAttribute("outputclass=","memItemRight bottomAlign"); done = true; } i += 2; @@ -3100,36 +2988,6 @@ QString DitaXmlGenerator::highlightedCode(const QString& markedCode, } } - - if (slow) { - // is this block ever used at all? - // replace all <@func> tags: "(<@func target=\"([^\"]*)\">)(.*)()" - src = html; - html = QString(); - static const QString funcTag("func"); - for (int i = 0, n = src.size(); i < n;) { - if (src.at(i) == charLangle && src.at(i + 1) == charAt) { - i += 2; - if (parseArg(src, funcTag, &i, n, &arg, &par1)) { - QString link = linkForNode( - marker->resolveTarget(par1.toString(), - myTree, - relative), - relative); - addLink(link, arg, &html); - par1 = QStringRef(); - } - else { - html += charLangle; - html += charAt; - } - } - else { - html += src.at(i++); - } - } - } - // replace all "(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)()" tags src = html; html = QString(); @@ -3225,8 +3083,8 @@ QString DitaXmlGenerator::highlightedCode(const QString& markedCode, ++i; } } - - return html; + if (!html.isEmpty()) + writer.writeCharacters(html); } void DitaXmlGenerator::generateLink(const Atom* atom, @@ -3406,29 +3264,6 @@ QString DitaXmlGenerator::fileBase(const Node *node) return result; } -#if 0 -QString DitaXmlGenerator::fileBase(const Node *node, - const SectionIterator& section) -{ - QStringList::ConstIterator s = section.sectionNumber().end(); - QStringList::ConstIterator b = section.baseNameStack().end(); - - QString suffix; - QString base = fileBase(node); - - while (s != section.sectionNumber().begin()) { - --s; - --b; - if (!(*b).isEmpty()) { - base = *b; - break; - } - suffix.prepend("-" + *s); - } - return base + suffix; -} -#endif - QString DitaXmlGenerator::fileName(const Node *node) { if (node->type() == Node::Fake) { @@ -3474,23 +3309,19 @@ QString DitaXmlGenerator::refForNode(const Node *node) ref += "-" + QString::number(func->overloadNumber()); } break; -#ifdef QDOC_QML case Node::Fake: if (node->subType() != Node::QmlPropertyGroup) break; case Node::QmlProperty: -#endif case Node::Property: ref = node->name() + "-prop"; break; -#ifdef QDOC_QML case Node::QmlSignal: ref = node->name() + "-signal"; break; case Node::QmlMethod: ref = node->name() + "-method"; break; -#endif case Node::Variable: ref = node->name() + "-var"; break; @@ -3542,59 +3373,54 @@ QString DitaXmlGenerator::refForAtom(Atom *atom, const Node * /* node */) } } -void DitaXmlGenerator::generateFullName(const Node *apparentNode, - const Node *relative, - CodeMarker *marker, - const Node *actualNode) +void DitaXmlGenerator::generateFullName(const Node* apparentNode, + const Node* relative, + CodeMarker* marker, + const Node* actualNode) { if (actualNode == 0) actualNode = apparentNode; - out() << "status() != actualNode->status()) { switch (actualNode->status()) { case Node::Obsolete: - out() << "\" class=\"obsolete"; + writer.writeAttribute("outputclass","obsolete"); break; case Node::Compat: - out() << "\" class=\"compat"; + writer.writeAttribute("outputclass","compat"); break; default: ; } } - out() << "\">"; - out() << protectEnc(fullName(apparentNode, relative, marker)); - out() << ""; + writer.writeCharacters(protectEnc(fullName(apparentNode, relative, marker))); + writer.writeEndElement(); // } -void DitaXmlGenerator::generateDetailedMember(const Node *node, - const InnerNode *relative, - CodeMarker *marker) +void DitaXmlGenerator::generateDetailedMember(const Node* node, + const InnerNode* relative, + CodeMarker* marker) { - const EnumNode *enume; + QString marked; + const EnumNode* en; -#ifdef GENERATE_MAC_REFS - generateMacRef(node, marker); -#endif - if (node->type() == Node::Enum - && (enume = static_cast(node))->flagsType()) { -#ifdef GENERATE_MAC_REFS - generateMacRef(enume->flagsType(), marker); -#endif + if ((node->type() == Node::Enum) && + (en = static_cast(node))->flagsType()) { out() << "

    "; out() << ""; - generateSynopsis(enume, relative, marker, CodeMarker::Detailed); + marked = getMarkedUpSynopsis(en, relative, marker, CodeMarker::Detailed); + writeText(marked, marker, relative); out() << "
    "; - generateSynopsis(enume->flagsType(), - relative, - marker, - CodeMarker::Detailed); + marked = getMarkedUpSynopsis(en->flagsType(),relative,marker,CodeMarker::Detailed); + writeText(marked,marker,relative); out() << "

    \n"; } else { out() << "

    "; out() << ""; - generateSynopsis(node, relative, marker, CodeMarker::Detailed); + marked = getMarkedUpSynopsis(node,relative,marker,CodeMarker::Detailed); + writeText(marked,marker,relative); out() << "

    \n"; } @@ -3626,14 +3452,14 @@ void DitaXmlGenerator::generateDetailedMember(const Node *node, } } else if (node->type() == Node::Enum) { - const EnumNode *enume = static_cast(node); - if (enume->flagsType()) { - out() << "

    The " << protectEnc(enume->flagsType()->name()) + en = static_cast(node); + if (en->flagsType()) { + out() << "

    The " << protectEnc(en->flagsType()->name()) << " type is a typedef for " << "QFlags<" - << protectEnc(enume->name()) + << protectEnc(en->name()) << ">. It stores an OR combination of " - << protectEnc(enume->name()) + << protectEnc(en->name()) << " values.

    \n"; } } @@ -3694,8 +3520,8 @@ void DitaXmlGenerator::findAllClasses(const InnerNode *node) } /*! - For generating the "New Classes... in 4.6" section on the - What's New in 4.6" page. + For generating the "New Classes... in 4.x" section on the + What's New in 4.x" page. */ void DitaXmlGenerator::findAllSince(const InnerNode *node) { @@ -3757,13 +3583,6 @@ void DitaXmlGenerator::findAllSince(const InnerNode *node) } } -#if 0 - const QRegExp versionSeparator("[\\-\\.]"); - const int minorIndex = version.indexOf(versionSeparator); - const int patchIndex = version.indexOf(versionSeparator, minorIndex+1); - version = version.left(patchIndex); -#endif - void DitaXmlGenerator::findAllFunctions(const InnerNode *node) { NodeList::ConstIterator c = node->childNodes().begin(); @@ -3835,12 +3654,6 @@ int DitaXmlGenerator::hOffset(const Node *node) return 2; case Node::Fake: return 1; -#if 0 - if (node->doc().briefText().isEmpty()) - return 1; - else - return 2; -#endif case Node::Enum: case Node::Typedef: case Node::Function: @@ -3986,14 +3799,6 @@ QString DitaXmlGenerator::getLink(const Atom *atom, << (*node)->name() << "no relative"; } } -#if 0 - else if ((*node)->status() == Node::Deprecated) { - qDebug() << "Link to Deprecated entity"; - } - else if ((*node)->status() == Node::Internal) { - qDebug() << "Link to Internal entity"; - } -#endif } while (!path.isEmpty()) { @@ -4070,21 +3875,6 @@ void DitaXmlGenerator::generateStatus(const Node *node, CodeMarker *marker) } } -#ifdef GENERATE_MAC_REFS -/* - No longer valid. - */ -void DitaXmlGenerator::generateMacRef(const Node *node, CodeMarker *marker) -{ - if (!pleaseGenerateMacRef || marker == 0) - return; - - QStringList macRefs = marker->macRefsForNode(node); - foreach (const QString &macRef, macRefs) - out() << "\n"; -} -#endif - void DitaXmlGenerator::beginLink(const QString &link, const Node *node, const Node *relative, @@ -4143,8 +3933,6 @@ void DitaXmlGenerator::endLink() inObsoleteLink = false; } -#ifdef QDOC_QML - /*! Generates the summary for the \a section. Only used for sections of QML element documentation. @@ -4196,10 +3984,8 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node *node, const InnerNode *relative, CodeMarker *marker) { + QString marked; const QmlPropertyNode* qpn = 0; -#ifdef GENERATE_MAC_REFS - generateMacRef(node, marker); -#endif out() << "
    "; if (node->subType() == Node::QmlPropertyGroup) { const QmlPropGroupNode* qpgn = static_cast(node); @@ -4242,7 +4028,8 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node *node, out() << ""; out() << "

    "; out() << ""; - generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false); + marked = getMarkedUpSynopsis(qsn, relative, marker, CodeMarker::Detailed); + writeText(marked, marker, relative); //generateQmlItem(qsn,relative,marker,false); out() << "

    "; out() << ""; @@ -4259,7 +4046,8 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node *node, out() << ""; out() << "

    "; out() << ""; - generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false); + marked = getMarkedUpSynopsis(qmn, relative, marker, CodeMarker::Detailed); + writeText(marked, marker, relative); out() << "

    "; out() << ""; out() << "
    "; @@ -4510,8 +4298,6 @@ void DitaXmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* ma file.close(); } -#endif - /*! Return the full qualification of the node \a n, but without the name of \a n itself. e.g. A::B::C @@ -4537,6 +4323,26 @@ QString DitaXmlGenerator::fullQualification(const Node* n) return fq; } +/*! + Outputs the element. + \code + + + ... + + ... + + \endcode + + The element is: + + \code + + + Base + + \endcode + */ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker) { QList::ConstIterator r; @@ -4551,17 +4357,31 @@ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker) writer.writeStartElement(CXXCLASSDERIVATIONACCESSSPECIFIER); writer.writeAttribute("value",(*r).accessString()); writer.writeEndElement(); // + + // not included: + writer.writeStartElement(CXXCLASSBASECLASS); writer.writeAttribute("href",(*r).node->ditaXmlHref()); writer.writeCharacters(marker->plainFullName((*r).node)); writer.writeEndElement(); // + + // not included: or + writer.writeEndElement(); // + + // not included: + ++r; } writer.writeEndElement(); // } } +/*! + Writes a element, depending on the + type of the node \a n, which can be a class, function, enum, + typedef, or property. + */ void DitaXmlGenerator::writeLocation(const Node* n) { QString s1, s2, s3; @@ -4601,9 +4421,16 @@ void DitaXmlGenerator::writeLocation(const Node* n) QString lineNr; writer.writeAttribute("value",lineNr.setNum(n->location().lineNo())); writer.writeEndElement(); // DeclarationFileLine> + + // not included: , , + // and + writer.writeEndElement(); // ApiItemLocation> } +/*! + Write the elements. + */ void DitaXmlGenerator::writeFunctions(const Section& s, const ClassNode* cn, CodeMarker* marker) @@ -4615,28 +4442,42 @@ void DitaXmlGenerator::writeFunctions(const Section& s, writer.writeStartElement(CXXFUNCTION); writer.writeAttribute("id",fn->guid()); writer.writeStartElement(APINAME); + if (fn->metaness() == FunctionNode::Signal) + writer.writeAttribute("class","signal"); + else if (fn->metaness() == FunctionNode::Slot) + writer.writeAttribute("class","slot"); writer.writeCharacters(fn->name()); writer.writeEndElement(); // generateBrief(fn,marker); + + // not included: + writer.writeStartElement(CXXFUNCTIONDETAIL); writer.writeStartElement(CXXFUNCTIONDEFINITION); writer.writeStartElement(CXXFUNCTIONACCESSSPECIFIER); writer.writeAttribute("value",fn->accessString()); writer.writeEndElement(); // + // not included: + if (fn->isStatic()) { writer.writeStartElement(CXXFUNCTIONSTORAGECLASSSPECIFIERSTATIC); writer.writeAttribute("name","static"); writer.writeAttribute("value","static"); writer.writeEndElement(); // } - + + // not included: , + if (fn->isConst()) { writer.writeStartElement(CXXFUNCTIONCONST); writer.writeAttribute("name","const"); writer.writeAttribute("value","const"); writer.writeEndElement(); // } + + // not included: + // virtualness() != FunctionNode::NonVirtual) { writer.writeStartElement(CXXFUNCTIONVIRTUAL); @@ -4668,6 +4509,9 @@ void DitaXmlGenerator::writeFunctions(const Section& s, writer.writeCharacters(fn->returnType()); writer.writeEndElement(); // } + + // not included: + QString fq = fullQualification(fn); if (!fq.isEmpty()) { writer.writeStartElement(CXXFUNCTIONSCOPEDNAME); @@ -4707,6 +4551,9 @@ void DitaXmlGenerator::writeFunctions(const Section& s, } writer.writeEndElement(); // + + // not included: ,
    , or + writer.writeEndElement(); // writer.writeEndElement(); // @@ -4719,6 +4566,9 @@ void DitaXmlGenerator::writeFunctions(const Section& s, } } +/*! + This function writes the element. + */ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marker) { const QList& parameters = fn->parameters(); @@ -4735,11 +4585,17 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke writer.writeStartElement(CXXFUNCTIONPARAMETERDECLARATIONNAME); writer.writeCharacters((*p).name()); writer.writeEndElement(); // + + // not included: + if (!(*p).defaultValue().isEmpty()) { writer.writeStartElement(CXXFUNCTIONPARAMETERDEFAULTVALUE); writer.writeCharacters((*p).defaultValue()); writer.writeEndElement(); // } + + // not included: + writer.writeEndElement(); // ++p; } @@ -4747,6 +4603,9 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke } } +/*! + This function writes the enum types. + */ void DitaXmlGenerator::writeEnumerations(const Section& s, const ClassNode* cn, CodeMarker* marker) @@ -4761,6 +4620,9 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, writer.writeCharacters(en->name()); writer.writeEndElement(); // generateBrief(en,marker); + + // not included + writer.writeStartElement(CXXENUMERATIONDETAIL); writer.writeStartElement(CXXENUMERATIONDEFINITION); writer.writeStartElement(CXXENUMERATIONACCESSSPECIFIER); @@ -4797,6 +4659,8 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, writer.writeCharacters(en->parent()->name() + "::" + en->name()); writer.writeEndElement(); // + // not included: + if (!items.isEmpty()) { writer.writeStartElement(CXXENUMERATORS); QList::ConstIterator i = items.begin(); @@ -4824,6 +4688,9 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, writer.writeAttribute("value", (*i).value()); writer.writeEndElement(); // } + + // not included: + if (!(*i).text().isEmpty()) { writer.writeStartElement(APIDESC); generateText((*i).text(), en, marker); @@ -4844,13 +4711,22 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, } writer.writeEndElement(); // + + // not included: ,
    , or + writer.writeEndElement(); // + + // not included: + writer.writeEndElement(); // } ++m; } } +/*! + This function writes the output for the \typedef commands. + */ void DitaXmlGenerator::writeTypedefs(const Section& s, const ClassNode* cn, CodeMarker* marker) @@ -4865,22 +4741,32 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, writer.writeCharacters(tn->name()); writer.writeEndElement(); // generateBrief(tn,marker); + + // not included: + writer.writeStartElement(CXXTYPEDEFDETAIL); writer.writeStartElement(CXXTYPEDEFDEFINITION); writer.writeStartElement(CXXTYPEDEFACCESSSPECIFIER); writer.writeAttribute("value",tn->accessString()); writer.writeEndElement(); // + // not included: + QString fq = fullQualification(tn); if (!fq.isEmpty()) { writer.writeStartElement(CXXTYPEDEFSCOPEDNAME); writer.writeCharacters(fq); writer.writeEndElement(); // } + + // not included: + writer.writeStartElement(CXXTYPEDEFNAMELOOKUP); writer.writeCharacters(tn->parent()->name() + "::" + tn->name()); writer.writeEndElement(); // - + + // not included: + writeLocation(tn); writer.writeEndElement(); // writer.writeStartElement(APIDESC); @@ -4890,13 +4776,23 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, } writer.writeEndElement(); // + + // not included: ,
    , or + writer.writeEndElement(); // + + // not included: + writer.writeEndElement(); // } ++m; } } +/*! + This function writes the output for the \property commands. + This is the Q_PROPERTYs. + */ void DitaXmlGenerator::writeProperties(const Section& s, const ClassNode* cn, CodeMarker* marker) @@ -4911,12 +4807,20 @@ void DitaXmlGenerator::writeProperties(const Section& s, writer.writeCharacters(pn->name()); writer.writeEndElement(); // generateBrief(pn,marker); + + // not included: + writer.writeStartElement(CXXVARIABLEDETAIL); writer.writeStartElement(CXXVARIABLEDEFINITION); writer.writeStartElement(CXXVARIABLEACCESSSPECIFIER); writer.writeAttribute("value",pn->accessString()); writer.writeEndElement(); // + // not included: , + // , + // , + // , + if (!pn->qualifiedDataType().isEmpty()) { writer.writeStartElement(CXXVARIABLEDECLAREDTYPE); writer.writeCharacters(pn->qualifiedDataType()); @@ -4934,10 +4838,10 @@ void DitaXmlGenerator::writeProperties(const Section& s, writer.writeCharacters(pn->qualifiedDataType()); writer.writeCharacters(" "); writer.writeCharacters(pn->name()); - writePropParams("READ",pn->getters()); - writePropParams("WRITE",pn->setters()); - writePropParams("RESET",pn->resetters()); - writePropParams("NOTIFY",pn->notifiers()); + writePropertyParameter("READ",pn->getters()); + writePropertyParameter("WRITE",pn->setters()); + writePropertyParameter("RESET",pn->resetters()); + writePropertyParameter("NOTIFY",pn->notifiers()); if (pn->isDesignable() != pn->designableDefault()) { writer.writeCharacters(" DESIGNABLE "); if (!pn->runtimeDesignabilityFunction().isEmpty()) @@ -4988,13 +4892,22 @@ void DitaXmlGenerator::writeProperties(const Section& s, } writer.writeEndElement(); // + + // not included: ,
    , or + writer.writeEndElement(); // + + // not included: + writer.writeEndElement(); // } ++m; } } +/*! + This function outputs the nodes resulting from \variable commands. + */ void DitaXmlGenerator::writeDataMembers(const Section& s, const ClassNode* cn, CodeMarker* marker) @@ -5009,12 +4922,17 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, writer.writeCharacters(vn->name()); writer.writeEndElement(); // generateBrief(vn,marker); + + // not included: + writer.writeStartElement(CXXVARIABLEDETAIL); writer.writeStartElement(CXXVARIABLEDEFINITION); writer.writeStartElement(CXXVARIABLEACCESSSPECIFIER); writer.writeAttribute("value",vn->accessString()); writer.writeEndElement(); // + // not included: + if (vn->isStatic()) { writer.writeStartElement(CXXVARIABLESTORAGECLASSSPECIFIERSTATIC); writer.writeAttribute("name","static"); @@ -5022,6 +4940,9 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, writer.writeEndElement(); // } + // not included: , + // , + writer.writeStartElement(CXXVARIABLEDECLAREDTYPE); writer.writeCharacters(vn->leftType()); if (!vn->rightType().isEmpty()) @@ -5047,6 +4968,8 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, writer.writeCharacters(vn->parent()->name() + "::" + vn->name()); writer.writeEndElement(); // + // not included: + writeLocation(vn); writer.writeEndElement(); // writer.writeStartElement(APIDESC); @@ -5056,13 +4979,22 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, } writer.writeEndElement(); // + + // not included: ,
    , + writer.writeEndElement(); // + + // not included: + writer.writeEndElement(); // } ++m; } } +/*! + This function writes a \macro as a . + */ void DitaXmlGenerator::writeMacros(const Section& s, const ClassNode* cn, CodeMarker* marker) @@ -5078,6 +5010,9 @@ void DitaXmlGenerator::writeMacros(const Section& s, writer.writeCharacters(fn->name()); writer.writeEndElement(); // generateBrief(fn,marker); + + // not included: + writer.writeStartElement(CXXDEFINEDETAIL); writer.writeStartElement(CXXDEFINEDEFINITION); writer.writeStartElement(CXXDEFINEACCESSSPECIFIER); @@ -5125,6 +5060,9 @@ void DitaXmlGenerator::writeMacros(const Section& s, writer.writeStartElement(CXXDEFINEPARAMETERDECLARATIONNAME); writer.writeCharacters(params[i]); writer.writeEndElement(); // + + // not included: + writer.writeEndElement(); // } writer.writeEndElement(); // @@ -5140,7 +5078,13 @@ void DitaXmlGenerator::writeMacros(const Section& s, } writer.writeEndElement(); // + + // not included: ,
    , or + writer.writeEndElement(); // + + // not included: + writer.writeEndElement(); // } } @@ -5148,7 +5092,12 @@ void DitaXmlGenerator::writeMacros(const Section& s, } } -void DitaXmlGenerator::writePropParams(const QString& tag, const NodeList& nlist) +/*! + This function writes one parameter of a Q_PROPERTY macro. + The property is identified by \a tag ("READ" "WRIE" etc), + and it is found in the 'a nlist. + */ +void DitaXmlGenerator::writePropertyParameter(const QString& tag, const NodeList& nlist) { NodeList::const_iterator n = nlist.begin(); while (n != nlist.end()) { @@ -5161,3 +5110,192 @@ void DitaXmlGenerator::writePropParams(const QString& tag, const NodeList& nlist } QT_END_NAMESPACE + +#ifdef TO_BE_INCLUDED_IN_API_DESC + Text subtitleText; + if (rawTitle != fullTitle) + subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")" + << Atom(Atom::LineBreak); + + QString shortVersion; + shortVersion = project + " " + shortVersion + ": "; + shortVersion = myTree->version(); + if (shortVersion.count(QChar('.')) == 2) + shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); + if (!shortVersion.isEmpty()) { + if (project == "QSA") + shortVersion = "QSA " + shortVersion + ": "; + else + shortVersion = "Qt " + shortVersion + ": "; + } + + out() << " " << shortVersion << protectEnc(title) << "\n"; + +#if 0 + out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + generateBreadCrumbs(title,node,marker); + out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); +#endif + + sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); + generateTableOfContents(inner,marker,§ions); + generateTitle(title, subtitleText, SmallSubTitle, inner, marker); + + if (cn && !cn->qmlElement().isEmpty()) { + generateInstantiatedBy(cn,marker); + } + + generateBrief(inner, marker); + generateIncludes(inner, marker); + generateStatus(inner, marker); + if (cn) { + generateInherits(cn, marker); + generateInheritedBy(cn, marker); + } + generateThreadSafeness(inner, marker); + generateSince(inner, marker); + + out() << "
      \n"; + + QString membersLink = generateListOfAllMemberFile(inner, marker); + if (!membersLink.isEmpty()) + out() << "
    • " + << "List of all members, including inherited members
    • \n"; + + QString obsoleteLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Obsolete); + if (!obsoleteLink.isEmpty()) + out() << "
    • " + << "Obsolete members
    • \n"; + + QString compatLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Compat); + if (!compatLink.isEmpty()) + out() << "
    • " + << "Qt 3 support members
    • \n"; + + out() << "
    \n"; + + bool needOtherSection = false; + + /* + sections is built above for the call to generateTableOfContents(). + */ + s = sections.begin(); + while (s != sections.end()) { + if (s->members.isEmpty() && s->reimpMembers.isEmpty()) { + if (!s->inherited.isEmpty()) + needOtherSection = true; + } + else { + if (!s->members.isEmpty()) { + out() << "
    \n"; + out() << "\n"; + out() << "

    " << protectEnc((*s).name) << "

    \n"; + generateSection(s->members, inner, marker, CodeMarker::Summary); + } + if (!s->reimpMembers.isEmpty()) { + QString name = QString("Reimplemented ") + (*s).name; + out() << "
    \n"; + out() << "\n"; + out() << "

    " << protectEnc(name) << "

    \n"; + generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); + } + + if (!s->inherited.isEmpty()) { + out() << "
      \n"; + generateSectionInheritedList(*s, inner, marker, true); + out() << "
    \n"; + } + } + ++s; + } + + if (needOtherSection) { + out() << "

    Additional Inherited Members

    \n" + "
      \n"; + + s = sections.begin(); + while (s != sections.end()) { + if (s->members.isEmpty() && !s->inherited.isEmpty()) + generateSectionInheritedList(*s, inner, marker); + ++s; + } + out() << "
    \n"; + } + + out() << "\n"; + + if (!inner->doc().isEmpty()) { + out() << "
    \n" + << "
    \n" // QTBUG-9504 + << "

    " << "Detailed Description" << "

    \n"; + generateBody(inner, marker); + out() << "
    \n"; // QTBUG-9504 + generateAlsoList(inner, marker); + } + + sections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay); + s = sections.begin(); + while (s != sections.end()) { + out() << "
    \n"; + if (!(*s).divClass.isEmpty()) + out() << "
    \n"; // QTBUG-9504 + out() << "

    " << protectEnc((*s).name) << "

    \n"; + + NodeList::ConstIterator m = (*s).members.begin(); + while (m != (*s).members.end()) { + if ((*m)->access() != Node::Private) { // ### check necessary? + if ((*m)->type() != Node::Class) + generateDetailedMember(*m, inner, marker); + else { + out() << "

    class "; + generateFullName(*m, inner, marker); + out() << "

    "; + generateBrief(*m, marker, inner); + } + + QStringList names; + names << (*m)->name(); + if ((*m)->type() == Node::Function) { + const FunctionNode *func = reinterpret_cast(*m); + if (func->metaness() == FunctionNode::Ctor || + func->metaness() == FunctionNode::Dtor || + func->overloadNumber() != 1) + names.clear(); + } + else if ((*m)->type() == Node::Property) { + const PropertyNode *prop = reinterpret_cast(*m); + if (!prop->getters().isEmpty() && + !names.contains(prop->getters().first()->name())) + names << prop->getters().first()->name(); + if (!prop->setters().isEmpty()) + names << prop->setters().first()->name(); + if (!prop->resetters().isEmpty()) + names << prop->resetters().first()->name(); + } + else if ((*m)->type() == Node::Enum) { + const EnumNode *enume = reinterpret_cast(*m); + if (enume->flagsType()) + names << enume->flagsType()->name(); + + foreach (const QString &enumName, + enume->doc().enumItemNames().toSet() - + enume->doc().omitEnumItemNames().toSet()) + names << plainCode(marker->markedUpEnumValue(enumName, + enume)); + } + } + ++m; + } + if (!(*s).divClass.isEmpty()) + out() << "
    \n"; // QTBUG-9504 + ++s; + } +#endif // TO_BE_INCLUDED_IN_API_DESC diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 446f735..91d7147 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -133,7 +133,7 @@ class DitaXmlGenerator : public PageGenerator void writeMacros(const Section& s, const ClassNode* cn, CodeMarker* marker); - void writePropParams(const QString& tag, const NodeList& nlist); + void writePropertyParameter(const QString& tag, const NodeList& nlist); private: enum SubTitleSize { SmallSubTitle, LargeSubTitle }; @@ -205,20 +205,18 @@ class DitaXmlGenerator : public PageGenerator const Node *relative, CodeMarker *marker, CodeMarker::SynopsisStyle style); - void generateSynopsis(const Node *node, - const Node *relative, - CodeMarker *marker, - CodeMarker::SynopsisStyle style, - bool nameAlignment = false); + QString getMarkedUpSynopsis(const Node *node, + const Node *relative, + CodeMarker *marker, + CodeMarker::SynopsisStyle style); void generateSectionInheritedList(const Section& section, const Node *relative, CodeMarker *marker, bool nameAlignment = false); - QString highlightedCode(const QString& markedCode, - CodeMarker *marker, - const Node *relative, - CodeMarker::SynopsisStyle style = CodeMarker::Accessors, - bool nameAlignment = false); + void writeText(const QString& markedCode, + CodeMarker *marker, + const Node *relative, + bool nameAlignment = false); void generateFullName(const Node *apparentNode, const Node *relative, @@ -280,6 +278,7 @@ class DitaXmlGenerator : public PageGenerator bool inContents; bool inSectionHeading; bool inTableHeader; + bool inTableBody; int numTableRows; bool threeColumnEnumValueTable; bool offlineDocs; @@ -302,6 +301,7 @@ class DitaXmlGenerator : public PageGenerator bool slow; bool obsoleteLinks; int noLinks; + int tableColumnCount; QMap moduleClassMap; QMap moduleNamespaceMap; NodeMap nonCompatClasses; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 41f90d5..ce53b86 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -1152,8 +1152,8 @@ QString Parameter::reconstruct(bool value) const if (!p.endsWith(QChar('*')) && !p.endsWith(QChar('&')) && !p.endsWith(QChar(' '))) p += " "; p += nam; - if (value) - p += def; + if (value && !def.isEmpty()) + p += " = " + def; return p; } diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index a187c2e..39ee98b 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -273,6 +273,11 @@ QString PageGenerator::outFileName() return QFileInfo(static_cast(out().device())->fileName()).fileName(); } +/*! + Creates the file named \a fileName in the output directory. + Attaches a QTextStream to the created file, which is written + to all over the place using out(). + */ void PageGenerator::beginSubPage(const Location& location, const QString& fileName) { @@ -285,6 +290,11 @@ void PageGenerator::beginSubPage(const Location& location, outStreamStack.push(out); } +/*! + Flush the text stream associated with the subpage, and + then pop it off the text stream stack and delete it. + This terminates output of the subpage. + */ void PageGenerator::endSubPage() { outStreamStack.top()->flush(); -- cgit v0.12 From 7a3273ebbbff161e84c87de01e448047ffa0f2b5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 7 Sep 2010 13:20:26 +0200 Subject: qdoc: Generate correct dita table for the annotated list. --- tools/qdoc3/ditaxmlgenerator.cpp | 47 +++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 3d1c53e..93fd523 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2239,43 +2239,56 @@ void DitaXmlGenerator::generateClassHierarchy(const Node *relative, } } -void DitaXmlGenerator::generateAnnotatedList(const Node *relative, - CodeMarker *marker, - const NodeMap &nodeMap) +void DitaXmlGenerator::generateAnnotatedList(const Node* relative, + CodeMarker* marker, + const NodeMap& nodeMap) { - out() << "\n"; + writer.writeStartElement("table"); + writer.writeAttribute("outputclass","annotated"); + writer.writeStartElement("tgroup"); + writer.writeAttribute("cols","2"); + writer.writeStartElement("tbody"); int row = 0; - foreach (const QString &name, nodeMap.keys()) { - const Node *node = nodeMap[name]; + foreach (const QString& name, nodeMap.keys()) { + const Node* node = nodeMap[name]; if (node->status() == Node::Obsolete) continue; + writer.writeStartElement("row"); if (++row % 2 == 1) - out() << ""; + writer.writeAttribute("outputclass","odd topAlign"); else - out() << ""; - out() << ""; + writer.writeEndElement(); //

    + writer.writeEndElement(); // if (!(node->type() == Node::Fake)) { Text brief = node->doc().trimmedBriefText(name); if (!brief.isEmpty()) { - out() << ""; + writer.writeEndElement(); //

    + writer.writeEndElement(); // } } else { - out() << ""; + writer.writeStartElement("entry"); + writer.writeStartElement("p"); + writer.writeCharacters(protectEnc(node->doc().briefText().toString())); + writer.writeEndElement(); //

    + writer.writeEndElement(); // } - out() << "\n"; + writer.writeEndElement(); // } - out() << "

    "; + writer.writeAttribute("outputclass","even topAlign"); + writer.writeStartElement("entry"); + writer.writeStartElement("p"); generateFullName(node, relative, marker); - out() << "

    "; + writer.writeStartElement("entry"); + writer.writeStartElement("p"); generateText(brief, node, marker); - out() << "

    "; - out() << protectEnc(node->doc().briefText().toString()); - out() << "

    \n"; + writer.writeEndElement(); // + writer.writeEndElement(); // + writer.writeEndElement(); // } /*! -- cgit v0.12 From 12ac485add4a4c7db5996dcd51400e90ea44ef23 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 8 Sep 2010 15:18:09 +0200 Subject: qdoc: Generate xml for more kinds of pages. Not complete. --- tools/qdoc3/atom.cpp | 26 ++++---- tools/qdoc3/ditaxmlgenerator.cpp | 136 ++++++++++++++++++++++++++------------- tools/qdoc3/generator.cpp | 13 ++-- 3 files changed, 114 insertions(+), 61 deletions(-) diff --git a/tools/qdoc3/atom.cpp b/tools/qdoc3/atom.cpp index 88f44ea..6f1602e 100644 --- a/tools/qdoc3/atom.cpp +++ b/tools/qdoc3/atom.cpp @@ -241,25 +241,25 @@ static const struct { { 0, 0 } }; -/*! \fn Atom::Atom( Type type, const QString& string ) +/*! \fn Atom::Atom(Type type, const QString& string) Constructs an atom (\a type, \a string) outside of any atom list. */ -/*! \fn Atom( Atom *prev, Type type, const QString& string ) +/*! \fn Atom(Atom *prev, Type type, const QString& string) Constructs an atom (\a type, \a string) that follows \a prev in \a prev's atom list. */ -/*! \fn void Atom::appendChar( QChar ch ) +/*! \fn void Atom::appendChar(QChar ch) Appends \a ch to the string parameter of this atom. \also string() */ -/*! \fn void Atom::appendString( const QString& string ) +/*! \fn void Atom::appendString(const QString& string) Appends \a string to the string parameter of this atom. @@ -316,18 +316,18 @@ QString Atom::typeString() const { static bool deja = false; - if ( !deja ) { + if (!deja) { int i = 0; - while ( atms[i].english != 0 ) { - if ( atms[i].no != i ) - Location::internalError( tr("atom %1 missing").arg(i) ); + while (atms[i].english != 0) { + if (atms[i].no != i) + Location::internalError(tr("atom %1 missing").arg(i)); i++; } deja = true; } int i = (int) type(); - if ( i < 0 || i > (int) Last ) + if (i < 0 || i > (int) Last) return QLatin1String("Invalid"); return QLatin1String(atms[i].english); } @@ -346,10 +346,10 @@ QString Atom::typeString() const void Atom::dump() const { QString str = string(); - str.replace( "\\", "\\\\" ); - str.replace( "\"", "\\\"" ); - str.replace( "\n", "\\n" ); - str.replace( QRegExp("[^\x20-\x7e]"), "?" ); + str.replace("\\", "\\\\"); + str.replace("\"", "\\\""); + str.replace("\n", "\\n"); + str.replace(QRegExp("[^\x20-\x7e]"), "?"); if (!str.isEmpty()) str = " \"" + str + "\""; fprintf(stderr, diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 93fd523..d2b20a6 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -579,7 +579,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, QString hx; static bool in_para = false; QString guid, hc; - + switch (atom->type()) { case Atom::AbstractLeft: break; @@ -1530,8 +1530,8 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker /* NOTE: For now we only handle \page elements. */ - if (fake->subType() != Node::Page) - return; + //if (fake->subType() != Node::Page) + //return; if (fake->subType() == Node::File && !fake->subTitle().isEmpty()) { subTitleSize = SmallSubTitle; @@ -1542,28 +1542,56 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker htmlTitle = fullTitle; } - generateHeader(fake); - - if (fake->subType() == Node::Page) { - writer.writeStartElement("topic"); - writer.writeAttribute("id",fake->guid()); - writer.writeStartElement("title"); - writer.writeCharacters(fullTitle); - writer.writeEndElement(); // + QString outputclass; + switch (fake->subType()) { + case Node::Page: + outputclass = "page"; + break; + case Node::Group: + outputclass = "group"; + break; + case Node::Example: + outputclass = "example"; + break; + case Node::HeaderFile: + outputclass = "header"; + break; + case Node::File: + outputclass = "file"; + break; + case Node::Image: + outputclass = "image"; + break; + case Node::Module: + outputclass = "module"; + break; + case Node::ExternalPage: + outputclass = "externalpage"; + break; + case Node::QmlClass: + outputclass = "QML"; + break; + default: + return; + } - generateBrief(fake, marker); // + generateHeader(fake); + + writer.writeStartElement("topic"); + writer.writeAttribute("id",fake->guid()); + writer.writeAttribute("outputclass",outputclass); + writer.writeStartElement("title"); + writer.writeCharacters(fullTitle); + writer.writeEndElement(); // + + generateBrief(fake, marker); // - if (!fake->doc().isEmpty()) { - writer.writeStartElement("body"); - writer.writeStartElement("p"); - writer.writeAttribute("outputclass","h2"); - writer.writeCharacters("Detailed Description"); - writer.writeEndElement(); //

    - generateBody(fake, marker); - writer.writeEndElement(); // - } - writer.writeEndElement(); // + if (!fake->doc().isEmpty()) { + writer.writeStartElement("body"); + generateBody(fake, marker); + writer.writeEndElement(); // } + writer.writeEndElement(); // } #if 0 @@ -1837,11 +1865,23 @@ void DitaXmlGenerator::generateHeader(const Node* node) version + "//EN\" \"" + dtd + "\">"; } else if (node->type() == Node::Fake) { - if (node->subType() == Node::Page) { + switch (node->subType()) { + case Node::Page: + case Node::Group: + case Node::Example: + case Node::HeaderFile: + case Node::File: + case Node::Image: + case Node::Module: + case Node::ExternalPage: + case Node::QmlClass: element = "topic"; dtd = "dtd/topic.dtd"; doctype = ""; + break; + default: + break; } } @@ -2300,11 +2340,11 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative, normally you let it figure it out itself by looking at the name of the first and last classes in \a classMap. */ -void DitaXmlGenerator::generateCompactList(const Node *relative, - CodeMarker *marker, - const NodeMap &classMap, - bool includeAlphabet, - QString commonPrefix) +void DitaXmlGenerator::generateCompactList(const Node* relative, + CodeMarker* marker, + const NodeMap& classMap, + bool includeAlphabet, + QString commonPrefix) { const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' @@ -2519,42 +2559,50 @@ void DitaXmlGenerator::generateCompactList(const Node *relative, writer.writeEndElement(); //

    } -void DitaXmlGenerator::generateFunctionIndex(const Node *relative, - CodeMarker *marker) +void DitaXmlGenerator::generateFunctionIndex(const Node* relative, + CodeMarker* marker) { - out() << "

    "; + writer.writeStartElement("p"); + writer.writeAttribute("outputclass","centerAlign functionIndex"); + writer.writeStartElement("b"); for (int i = 0; i < 26; i++) { QChar ch('a' + i); - out() << QString("%2 ").arg(ch).arg(ch.toUpper()); + writer.writeStartElement("xref"); + writer.writeAttribute("href",QString("#%1").arg(ch)); + writer.writeCharacters(QString(ch.toUpper())); + writer.writeEndElement(); // } - out() << "

    \n"; + writer.writeEndElement(); // + writer.writeEndElement(); //

    char nextLetter = 'a'; char currentLetter; - out() << "
      \n"; + writer.writeStartElement("ul"); QMap::ConstIterator f = funcIndex.begin(); while (f != funcIndex.end()) { - out() << "
    • "; - out() << protectEnc(f.key()) << ":"; - + writer.writeStartElement("li"); currentLetter = f.key()[0].unicode(); while (islower(currentLetter) && currentLetter >= nextLetter) { - out() << QString("").arg(nextLetter); + writer.writeStartElement("p"); + writeGuidAttribute(QString(nextLetter)); + writer.writeAttribute("outputclass","target"); + writer.writeCharacters(QString(nextLetter)); + writer.writeEndElement(); //

      nextLetter++; } + writer.writeCharacters(protectEnc(f.key())); + writer.writeCharacters(":"); NodeMap::ConstIterator s = (*f).begin(); while (s != (*f).end()) { - out() << " "; generateFullName((*s)->parent(), relative, marker, *s); ++s; } - out() << "
    • "; - out() << "\n"; + writer.writeEndElement(); // ++f; } - out() << "
    \n"; + writer.writeEndElement(); // } void DitaXmlGenerator::generateLegaleseList(const Node *relative, @@ -3596,7 +3644,7 @@ void DitaXmlGenerator::findAllSince(const InnerNode *node) } } -void DitaXmlGenerator::findAllFunctions(const InnerNode *node) +void DitaXmlGenerator::findAllFunctions(const InnerNode* node) { NodeList::ConstIterator c = node->childNodes().begin(); while (c != node->childNodes().end()) { @@ -3605,7 +3653,7 @@ void DitaXmlGenerator::findAllFunctions(const InnerNode *node) findAllFunctions(static_cast(*c)); } else if ((*c)->type() == Node::Function) { - const FunctionNode *func = static_cast(*c); + const FunctionNode* func = static_cast(*c); if ((func->status() > Node::Obsolete) && (func->metaness() != FunctionNode::Ctor) && (func->metaness() != FunctionNode::Dtor)) { diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 7f39be2..eee998a 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -54,6 +54,7 @@ #include "quoter.h" #include "separator.h" #include "tokenizer.h" +#include "ditaxmlgenerator.h" QT_BEGIN_NAMESPACE @@ -385,16 +386,19 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) } else if (node->type() == Node::Fake) { const FakeNode *fake = static_cast(node); - if (fake->subType() == Node::Example) + if (fake->subType() == Node::Example) { generateExampleFiles(fake, marker); - else if ((fake->subType() == Node::File) || (fake->subType() == Node::Image)) + } + else if ((fake->subType() == Node::File) || (fake->subType() == Node::Image)) { quiet = true; + } } if (node->doc().isEmpty()) { - if (!quiet && !node->isReimp()) // ### might be unnecessary + if (!quiet && !node->isReimp()) { // ### might be unnecessary node->location().warning(tr("No documentation for '%1'") .arg(marker->plainFullName(node))); + } } else { if (node->type() == Node::Function) { @@ -403,9 +407,10 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) generateReimplementedFrom(func, marker); } - if (!generateText(node->doc().body(), node, marker)) + if (!generateText(node->doc().body(), node, marker)) { if (node->isReimp()) return; + } if (node->type() == Node::Enum) { const EnumNode *enume = (const EnumNode *) node; -- cgit v0.12 From 7d5366966e4f29b1ccf112e42bc32a3f64bfb0bb Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 9 Sep 2010 09:58:27 +0200 Subject: qdoc: Generate more xml for module pages. --- tools/qdoc3/ditaxmlgenerator.cpp | 66 +++++++++++++++++++++++++--------------- tools/qdoc3/ditaxmlgenerator.h | 3 ++ 2 files changed, 44 insertions(+), 25 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index d2b20a6..55e873f 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -657,14 +657,14 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::Code: writer.writeStartElement("pre"); writer.writeAttribute("outputclass","highlightedcode"); - writeText(atom->string(), marker, relative); + writeText(trimmedTrailing(atom->string()), marker, relative); writer.writeEndElement(); // break; case Atom::Qml: writer.writeStartElement("pre"); writer.writeAttribute("outputclass","highlightedcode"); - writeText(atom->string(), marker, relative); - writer.writeEndElement(); // pre + writeText(trimmedTrailing(atom->string()), marker, relative); + writer.writeEndElement(); // break; case Atom::CodeNew: writer.writeStartElement("p"); @@ -672,7 +672,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writer.writeEndElement(); //

    writer.writeStartElement("pre"); writer.writeAttribute("outputclass","highlightedcode"); - writeText(atom->string(), marker, relative); + writeText(trimmedTrailing(atom->string()), marker, relative); writer.writeEndElement(); // break; case Atom::CodeOld: @@ -683,7 +683,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::CodeBad: writer.writeStartElement("pre"); writer.writeAttribute("outputclass","highlightedcode"); - writer.writeCharacters(trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string()))))); + writer.writeCharacters(trimmedTrailing(protectEnc(plainCode(atom->string())))); writer.writeEndElement(); // break; case Atom::FootnoteLeft: @@ -1516,6 +1516,25 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } /*! + Write a paragraph for the \a target and a poaragraph for + the \a header. Use the \a attribute for the \a header. + */ +void DitaXmlGenerator::writeTargetAndHeader(const QString& target, + const QString& header, + const QString& attribute) +{ + writer.writeStartElement("p"); + writeGuidAttribute(registerRef(target)); + writer.writeAttribute("outputclass","target"); + writer.writeCharacters(header); + writer.writeEndElement(); //

    + writer.writeStartElement("p"); + writer.writeAttribute("outputclass",attribute); + writer.writeCharacters(header); + writer.writeEndElement(); //

    +} + +/*! Generate the html page for a qdoc file that doesn't map to an underlying c++ file. */ @@ -1585,10 +1604,25 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker writer.writeEndElement(); // generateBrief(fake, marker); // + if (fake->subType() == Node::Module) { + generateStatus(fake, marker); + if (moduleNamespaceMap.contains(fake->name())) { + writeTargetAndHeader("namespaces","Namespaces","h2"); + generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]); + } + if (moduleClassMap.contains(fake->name())) { + writeTargetAndHeader("classes","Classes","h2"); + generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]); + } + } if (!fake->doc().isEmpty()) { writer.writeStartElement("body"); + if (fake->subType() == Node::Module) { + writeTargetAndHeader("details","Detailed Description","h2"); + } generateBody(fake, marker); + generateAlsoList(fake, marker); writer.writeEndElement(); // } writer.writeEndElement(); // @@ -1608,22 +1642,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker fake, marker); - if (fake->subType() == Node::Module) { - // Generate brief text and status for modules. - generateBrief(fake, marker); - generateStatus(fake, marker); - if (moduleNamespaceMap.contains(fake->name())) { - out() << "\n"; - out() << "

    Namespaces

    \n"; - generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]); - } - if (moduleClassMap.contains(fake->name())) { - out() << "\n"; - out() << "

    Classes

    \n"; - generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]); - } - } else if (fake->subType() == Node::HeaderFile) { // Generate brief text and status for modules. generateBrief(fake, marker); @@ -1711,10 +1730,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker else out() << "
    \n"; // QTBUG-9504 - generateBody(fake, marker); - out() << "
    \n"; // QTBUG-9504 - generateAlsoList(fake, marker); - if (!fake->groupMembers().isEmpty()) { NodeMap groupMembersMap; foreach (const Node *node, fake->groupMembers()) { @@ -3248,7 +3263,8 @@ QString DitaXmlGenerator::registerRef(const QString& ref) if (prevRef.isEmpty()) { prevRef = ref; break; - } else if (prevRef == ref) { + } + else if (prevRef == ref) { break; } clean += "x"; diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 91d7147..fe7a434 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -110,6 +110,9 @@ class DitaXmlGenerator : public PageGenerator virtual QString linkForNode(const Node *node, const Node *relative); virtual QString refForAtom(Atom *atom, const Node *node); + void writeTargetAndHeader(const QString& target, + const QString& header, + const QString& attribute); QString fullQualification(const Node* n); void writeDerivations(const ClassNode* cn, CodeMarker* marker); -- cgit v0.12 From d623e2bb039111957efd5edd7da84e3c5a22751e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 9 Sep 2010 10:40:01 +0200 Subject: qdoc: Generate more xml for group pages. --- tools/qdoc3/ditaxmlgenerator.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 55e873f..cd644ec 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1623,6 +1623,16 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker } generateBody(fake, marker); generateAlsoList(fake, marker); + + if (!fake->groupMembers().isEmpty()) { + NodeMap groupMembersMap; + foreach (const Node *node, fake->groupMembers()) { + if (node->type() == Node::Class || node->type() == Node::Namespace) + groupMembersMap[node->name()] = node; + } + generateAnnotatedList(fake, marker, groupMembersMap); + } + writer.writeEndElement(); // } writer.writeEndElement(); // @@ -1730,15 +1740,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker else out() << "
    \n"; // QTBUG-9504 - if (!fake->groupMembers().isEmpty()) { - NodeMap groupMembersMap; - foreach (const Node *node, fake->groupMembers()) { - if (node->type() == Node::Class || node->type() == Node::Namespace) - groupMembersMap[node->name()] = node; - } - generateAnnotatedList(fake, marker, groupMembersMap); - } - sections = marker->sections(fake, CodeMarker::Detailed, CodeMarker::Okay); s = sections.begin(); while (s != sections.end()) { -- cgit v0.12 From 916b610a272f1a1db41ad4177651e34904dd18a0 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 9 Sep 2010 13:45:58 +0200 Subject: qdoc: Generate more xml for group pages. --- tools/qdoc3/ditaxmlgenerator.cpp | 278 +++++++++++++++++++++------------------ tools/qdoc3/ditaxmlgenerator.h | 195 +++++++++++++-------------- tools/qdoc3/generator.cpp | 6 +- 3 files changed, 252 insertions(+), 227 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index cd644ec..1ff9592 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -928,13 +928,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, s = sections.constBegin(); while (s != sections.constEnd()) { if (!(*s).members.isEmpty()) { - - writer.writeStartElement("li"); - writer.writeStartElement("xref"); - writer.writeAttribute("href",QString("#" + Doc::canonicalTitle((*s).name))); - writer.writeCharacters((*s).name); - writer.writeEndElement(); // - writer.writeEndElement(); //
  • + writeXrefListItem(QString("#" + Doc::canonicalTitle((*s).name)), + (*s).name); } ++s; } @@ -1535,6 +1530,19 @@ void DitaXmlGenerator::writeTargetAndHeader(const QString& target, } /*! + Write a list item for a \a link with the given \a text. + */ +void DitaXmlGenerator::writeXrefListItem(const QString& link, const QString& text) +{ + writer.writeStartElement("li"); + writer.writeStartElement("xref"); + writer.writeAttribute("href",link); + writer.writeCharacters(text); + writer.writeEndElement(); // + writer.writeEndElement(); // +} + +/*! Generate the html page for a qdoc file that doesn't map to an underlying c++ file. */ @@ -1615,6 +1623,31 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]); } } + else if (fake->subType() == Node::HeaderFile) { + generateStatus(fake, marker); + writer.writeStartElement("ul"); + + QString membersLink = generateListOfAllMemberFile(fake, marker); + if (!membersLink.isEmpty()) { + writeXrefListItem(membersLink,"List of all members, including inherited members"); + } + + QString obsoleteLink = generateLowStatusMemberFile(fake, + marker, + CodeMarker::Obsolete); + if (!obsoleteLink.isEmpty()) { + writeXrefListItem(obsoleteLink,"Obsolete members"); + } + + QString compatLink = generateLowStatusMemberFile(fake, + marker, + CodeMarker::Compat); + if (!compatLink.isEmpty()) { + writeXrefListItem(compatLink,"Qt 3 support members"); + } + + writer.writeEndElement(); // + } if (!fake->doc().isEmpty()) { writer.writeStartElement("body"); @@ -1631,7 +1664,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker groupMembersMap[node->name()] = node; } generateAnnotatedList(fake, marker, groupMembersMap); - } + } writer.writeEndElement(); // } @@ -1653,34 +1686,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker marker); - else if (fake->subType() == Node::HeaderFile) { - // Generate brief text and status for modules. - generateBrief(fake, marker); - generateStatus(fake, marker); - - out() << "
      \n"; - - QString membersLink = generateListOfAllMemberFile(fake, marker); - if (!membersLink.isEmpty()) - out() << "
    • " - << "List of all members, including inherited members
    • \n"; - - QString obsoleteLink = generateLowStatusMemberFile(fake, - marker, - CodeMarker::Obsolete); - if (!obsoleteLink.isEmpty()) - out() << "
    • " - << "Obsolete members
    • \n"; - - QString compatLink = generateLowStatusMemberFile(fake, - marker, - CodeMarker::Compat); - if (!compatLink.isEmpty()) - out() << "
    • " - << "Qt 3 support members
    • \n"; - - out() << "
    \n"; - } else if (fake->subType() == Node::QmlClass) { const QmlClassNode* qml_cn = static_cast(fake); const ClassNode* cn = qml_cn->classNode(); @@ -2177,8 +2182,8 @@ QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, return fileName; } -QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, - CodeMarker *marker, +QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, + CodeMarker* marker, CodeMarker::Status status) { QList
    sections = marker->sections(inner, @@ -2193,7 +2198,6 @@ QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, return QString(); int i; - QString title; QString fileName; @@ -2640,10 +2644,10 @@ void DitaXmlGenerator::generateLegaleseList(const Node *relative, } } -void DitaXmlGenerator::generateQmlItem(const Node *node, - const Node *relative, - CodeMarker *marker, - bool summary) +void DitaXmlGenerator::generateQmlItem(const Node* node, + const Node* relative, + CodeMarker* marker, + bool summary) { QString marked = marker->markedUpQmlItem(node,summary); QRegExp templateTag("(<[^@>]*>)"); @@ -2671,17 +2675,17 @@ void DitaXmlGenerator::generateQmlItem(const Node *node, writeText(marked, marker, relative); } -void DitaXmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* marker */) +void DitaXmlGenerator::generateOverviewList(const Node* relative, CodeMarker* /* marker */) { - QMap > fakeNodeMap; - QMap groupTitlesMap; - QMap uncategorizedNodeMap; + QMap > fakeNodeMap; + QMap groupTitlesMap; + QMap uncategorizedNodeMap; QRegExp singleDigit("\\b([0-9])\\b"); const NodeList children = myTree->root()->childNodes(); - foreach (Node *child, children) { + foreach (Node* child, children) { if (child->type() == Node::Fake && child != relative) { - FakeNode *fakeNode = static_cast(child); + FakeNode* fakeNode = static_cast(child); // Check whether the page is part of a group or is the group // definition page. @@ -2713,24 +2717,25 @@ void DitaXmlGenerator::generateOverviewList(const Node *relative, CodeMarker * / if (isGroupPage) { // If we encounter a group definition page, we add all // the pages in that group to the list for that group. - foreach (Node *member, fakeNode->groupMembers()) { + foreach (Node* member, fakeNode->groupMembers()) { if (member->type() != Node::Fake) continue; - FakeNode *page = static_cast(member); + FakeNode* page = static_cast(member); if (page) { QString sortKey = page->fullTitle().toLower(); if (sortKey.startsWith("the ")) sortKey.remove(0, 4); sortKey.replace(singleDigit, "0\\1"); - fakeNodeMap[const_cast(fakeNode)].insert(sortKey, page); - groupTitlesMap[fakeNode->fullTitle()] = const_cast(fakeNode); + fakeNodeMap[const_cast(fakeNode)].insert(sortKey, page); + groupTitlesMap[fakeNode->fullTitle()] = const_cast(fakeNode); } } } else if (!isGroupPage) { // If we encounter a page that belongs to a group then // we add that page to the list for that group. - const FakeNode *groupNode = static_cast(myTree->root()->findNode(group, Node::Fake)); + const FakeNode* groupNode = + static_cast(myTree->root()->findNode(group, Node::Fake)); if (groupNode) fakeNodeMap[groupNode].insert(sortKey, fakeNode); //else @@ -2786,9 +2791,9 @@ void DitaXmlGenerator::generateOverviewList(const Node *relative, CodeMarker * / } void DitaXmlGenerator::generateSection(const NodeList& nl, - const Node *relative, - CodeMarker *marker, - CodeMarker::SynopsisStyle style) + const Node* relative, + CodeMarker* marker, + CodeMarker::SynopsisStyle style) { bool name_alignment = true; if (!nl.isEmpty()) { @@ -2878,9 +2883,9 @@ void DitaXmlGenerator::generateSection(const NodeList& nl, } void DitaXmlGenerator::generateSectionList(const Section& section, - const Node *relative, - CodeMarker *marker, - CodeMarker::SynopsisStyle style) + const Node* relative, + CodeMarker* marker, + CodeMarker::SynopsisStyle style) { bool name_alignment = true; if (!section.members.isEmpty()) { @@ -2946,9 +2951,9 @@ void DitaXmlGenerator::generateSectionList(const Section& section, } void DitaXmlGenerator::generateSectionInheritedList(const Section& section, - const Node *relative, - CodeMarker *marker, - bool nameAlignment) + const Node* relative, + CodeMarker* marker, + bool nameAlignment) { QList >::ConstIterator p = section.inherited.begin(); while (p != section.inherited.end()) { @@ -3165,8 +3170,8 @@ void DitaXmlGenerator::writeText(const QString& markedCode, } void DitaXmlGenerator::generateLink(const Atom* atom, - const Node* /* relative */, - CodeMarker* marker) + const Node* /* relative */, + CodeMarker* marker) { static QRegExp camelCase("[A-Z][A-Z][a-z]|[a-z][A-Z0-9]|_"); @@ -3183,7 +3188,8 @@ void DitaXmlGenerator::generateLink(const Atom* atom, } inLink = false; writer.writeCharacters(protectEnc(atom->string().mid(k))); - } else if (marker->recognizeLanguage("Java")) { + } + else if (marker->recognizeLanguage("Java")) { // hack for Java: remove () and use when appropriate bool func = atom->string().endsWith("()"); bool tt = (func || atom->string().contains(camelCase)); @@ -3214,14 +3220,17 @@ QString DitaXmlGenerator::cleanRef(const QString& ref) const uint u = c.unicode(); if ((u >= 'a' && u <= 'z') || - (u >= 'A' && u <= 'Z') || - (u >= '0' && u <= '9')) { + (u >= 'A' && u <= 'Z') || + (u >= '0' && u <= '9')) { clean += c; - } else if (u == '~') { + } + else if (u == '~') { clean += "dtor."; - } else if (u == '_') { + } + else if (u == '_') { clean += "underscore."; - } else { + } + else { clean += "A"; } @@ -3229,25 +3238,33 @@ QString DitaXmlGenerator::cleanRef(const QString& ref) const QChar c = ref[i]; const uint u = c.unicode(); if ((u >= 'a' && u <= 'z') || - (u >= 'A' && u <= 'Z') || - (u >= '0' && u <= '9') || u == '-' || - u == '_' || u == ':' || u == '.') { + (u >= 'A' && u <= 'Z') || + (u >= '0' && u <= '9') || u == '-' || + u == '_' || u == ':' || u == '.') { clean += c; - } else if (c.isSpace()) { + } + else if (c.isSpace()) { clean += "-"; - } else if (u == '!') { + } + else if (u == '!') { clean += "-not"; - } else if (u == '&') { + } + else if (u == '&') { clean += "-and"; - } else if (u == '<') { + } + else if (u == '<') { clean += "-lt"; - } else if (u == '=') { + } + else if (u == '=') { clean += "-eq"; - } else if (u == '>') { + } + else if (u == '>') { clean += "-gt"; - } else if (u == '#') { + } + else if (u == '#') { clean += "#"; - } else { + } + else { clean += "-"; clean += QString::number((int)u, 16); } @@ -3273,12 +3290,12 @@ QString DitaXmlGenerator::registerRef(const QString& ref) return clean; } -QString DitaXmlGenerator::protectEnc(const QString &string) +QString DitaXmlGenerator::protectEnc(const QString& string) { return protect(string, outputEncoding); } -QString DitaXmlGenerator::protect(const QString &string, const QString &outputEncoding) +QString DitaXmlGenerator::protect(const QString& string, const QString& outputEncoding) { #define APPEND(x) \ if (xml.isEmpty()) { \ @@ -3295,20 +3312,25 @@ QString DitaXmlGenerator::protect(const QString &string, const QString &outputEn if (ch == QLatin1Char('&')) { APPEND("&"); - } else if (ch == QLatin1Char('<')) { + } + else if (ch == QLatin1Char('<')) { APPEND("<"); - } else if (ch == QLatin1Char('>')) { + } + else if (ch == QLatin1Char('>')) { APPEND(">"); - } else if (ch == QLatin1Char('"')) { + } + else if (ch == QLatin1Char('"')) { APPEND("""); - } else if ((outputEncoding == "ISO-8859-1" && ch.unicode() > 0x007F) - || (ch == QLatin1Char('*') && i + 1 < n && string.at(i) == QLatin1Char('/')) - || (ch == QLatin1Char('.') && i > 2 && string.at(i - 2) == QLatin1Char('.'))) { + } + else if ((outputEncoding == "ISO-8859-1" && ch.unicode() > 0x007F) || + (ch == QLatin1Char('*') && i + 1 < n && string.at(i) == QLatin1Char('/')) || + (ch == QLatin1Char('.') && i > 2 && string.at(i - 2) == QLatin1Char('.'))) { // we escape '*/' and the last dot in 'e.g.' and 'i.e.' for the Javadoc generator APPEND("&#x"); xml += QString::number(ch.unicode(), 16); xml += QLatin1Char(';'); - } else { + } + else { if (!xml.isEmpty()) xml += ch; } @@ -3321,12 +3343,10 @@ QString DitaXmlGenerator::protect(const QString &string, const QString &outputEn #undef APPEND } -QString DitaXmlGenerator::fileBase(const Node *node) +QString DitaXmlGenerator::fileBase(const Node* node) { QString result; - result = PageGenerator::fileBase(node); - if (!node->isInnerNode()) { switch (node->status()) { case Node::Compat: @@ -3342,21 +3362,21 @@ QString DitaXmlGenerator::fileBase(const Node *node) return result; } -QString DitaXmlGenerator::fileName(const Node *node) +QString DitaXmlGenerator::fileName(const Node* node) { if (node->type() == Node::Fake) { - if (static_cast(node)->subType() == Node::ExternalPage) + if (static_cast(node)->subType() == Node::ExternalPage) return node->name(); - if (static_cast(node)->subType() == Node::Image) + if (static_cast(node)->subType() == Node::Image) return node->name(); } return PageGenerator::fileName(node); } -QString DitaXmlGenerator::refForNode(const Node *node) +QString DitaXmlGenerator::refForNode(const Node* node) { - const FunctionNode *func; - const TypedefNode *typedeffe; + const FunctionNode* func; + const TypedefNode* typedeffe; QString ref; switch (node->type()) { @@ -3409,7 +3429,7 @@ QString DitaXmlGenerator::refForNode(const Node *node) return registerRef(ref); } -QString DitaXmlGenerator::linkForNode(const Node *node, const Node *relative) +QString DitaXmlGenerator::linkForNode(const Node* node, const Node* relative) { QString link; QString fn; @@ -3438,7 +3458,7 @@ QString DitaXmlGenerator::linkForNode(const Node *node, const Node *relative) return link; } -QString DitaXmlGenerator::refForAtom(Atom *atom, const Node * /* node */) +QString DitaXmlGenerator::refForAtom(Atom* atom, const Node* /* node */) { if (atom->type() == Atom::SectionLeft) { return Doc::canonicalTitle(Text::sectionHeading(atom).toString()); @@ -3544,7 +3564,7 @@ void DitaXmlGenerator::generateDetailedMember(const Node* node, generateAlsoList(node, marker); } -void DitaXmlGenerator::findAllClasses(const InnerNode *node) +void DitaXmlGenerator::findAllClasses(const InnerNode* node) { NodeList::const_iterator c = node->childNodes().constBegin(); while (c != node->childNodes().constEnd()) { @@ -3601,7 +3621,7 @@ void DitaXmlGenerator::findAllClasses(const InnerNode *node) For generating the "New Classes... in 4.x" section on the What's New in 4.x" page. */ -void DitaXmlGenerator::findAllSince(const InnerNode *node) +void DitaXmlGenerator::findAllSince(const InnerNode* node) { NodeList::const_iterator child = node->childNodes().constBegin(); while (child != node->childNodes().constEnd()) { @@ -3667,7 +3687,7 @@ void DitaXmlGenerator::findAllFunctions(const InnerNode* node) while (c != node->childNodes().end()) { if ((*c)->access() != Node::Private) { if ((*c)->isInnerNode() && (*c)->url().isEmpty()) { - findAllFunctions(static_cast(*c)); + findAllFunctions(static_cast(*c)); } else if ((*c)->type() == Node::Function) { const FunctionNode* func = static_cast(*c); @@ -3682,7 +3702,7 @@ void DitaXmlGenerator::findAllFunctions(const InnerNode* node) } } -void DitaXmlGenerator::findAllLegaleseTexts(const InnerNode *node) +void DitaXmlGenerator::findAllLegaleseTexts(const InnerNode* node) { NodeList::ConstIterator c = node->childNodes().begin(); while (c != node->childNodes().end()) { @@ -3696,7 +3716,7 @@ void DitaXmlGenerator::findAllLegaleseTexts(const InnerNode *node) } } -void DitaXmlGenerator::findAllNamespaces(const InnerNode *node) +void DitaXmlGenerator::findAllNamespaces(const InnerNode* node) { NodeList::ConstIterator c = node->childNodes().begin(); while (c != node->childNodes().end()) { @@ -3724,7 +3744,7 @@ void DitaXmlGenerator::findAllNamespaces(const InnerNode *node) } } -int DitaXmlGenerator::hOffset(const Node *node) +int DitaXmlGenerator::hOffset(const Node* node) { switch (node->type()) { case Node::Namespace: @@ -3741,7 +3761,7 @@ int DitaXmlGenerator::hOffset(const Node *node) } } -bool DitaXmlGenerator::isThreeColumnEnumValueTable(const Atom *atom) +bool DitaXmlGenerator::isThreeColumnEnumValueTable(const Atom* atom) { while (atom != 0 && !(atom->type() == Atom::ListRight && atom->string() == ATOM_LIST_VALUE)) { if (atom->type() == Atom::ListItemLeft && !matchAhead(atom, Atom::ListItemRight)) @@ -3751,12 +3771,12 @@ bool DitaXmlGenerator::isThreeColumnEnumValueTable(const Atom *atom) return false; } -const Node *DitaXmlGenerator::findNodeForTarget(const QString &target, - const Node *relative, - CodeMarker *marker, - const Atom *atom) +const Node* DitaXmlGenerator::findNodeForTarget(const QString& target, + const Node* relative, + CodeMarker* marker, + const Atom* atom) { - const Node *node = 0; + const Node* node = 0; if (target.isEmpty()) { node = relative; @@ -3780,7 +3800,7 @@ const Node *DitaXmlGenerator::findNodeForTarget(const QString &target, return node; } -const QPair DitaXmlGenerator::anchorForNode(const Node *node) +const QPair DitaXmlGenerator::anchorForNode(const Node* node) { QPair anchorPair; @@ -3793,10 +3813,10 @@ const QPair DitaXmlGenerator::anchorForNode(const Node *node) return anchorPair; } -QString DitaXmlGenerator::getLink(const Atom *atom, - const Node *relative, - CodeMarker *marker, - const Node** node) +QString DitaXmlGenerator::getLink(const Atom* atom, + const Node* relative, + CodeMarker* marker, + const Node** node) { QString link; *node = 0; @@ -3897,14 +3917,14 @@ QString DitaXmlGenerator::getLink(const Atom *atom, return link; } -void DitaXmlGenerator::generateIndex(const QString &fileBase, - const QString &url, - const QString &title) +void DitaXmlGenerator::generateIndex(const QString& fileBase, + const QString& url, + const QString& title) { myTree->generateIndex(outputDir() + "/" + fileBase + ".index", url, title); } -void DitaXmlGenerator::generateStatus(const Node *node, CodeMarker *marker) +void DitaXmlGenerator::generateStatus(const Node* node, CodeMarker* marker) { Text text; @@ -3953,10 +3973,10 @@ void DitaXmlGenerator::generateStatus(const Node *node, CodeMarker *marker) } } -void DitaXmlGenerator::beginLink(const QString &link, - const Node *node, - const Node *relative, - CodeMarker *marker) +void DitaXmlGenerator::beginLink(const QString& link, + const Node* node, + const Node* relative, + CodeMarker* marker) { Q_UNUSED(marker) Q_UNUSED(relative) @@ -4018,8 +4038,8 @@ void DitaXmlGenerator::endLink() Currently handles only the QML property group. */ void DitaXmlGenerator::generateQmlSummary(const Section& section, - const Node *relative, - CodeMarker *marker) + const Node* relative, + CodeMarker* marker) { if (!section.members.isEmpty()) { NodeList::ConstIterator m; diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index fe7a434..dad1c6f 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -91,28 +91,29 @@ class DitaXmlGenerator : public PageGenerator virtual void initializeGenerator(const Config& config); virtual void terminateGenerator(); virtual QString format(); - virtual void generateTree(const Tree *tree, CodeMarker *marker); + virtual void generateTree(const Tree* tree, CodeMarker* marker); - QString protectEnc(const QString &string); - static QString protect(const QString &string, const QString &encoding = "ISO-8859-1"); + QString protectEnc(const QString& string); + static QString protect(const QString& string, const QString& encoding = "ISO-8859-1"); static QString cleanRef(const QString& ref); static QString sinceTitle(int i) { return sinceTitles[i]; } protected: - virtual void startText(const Node *relative, CodeMarker *marker); - virtual int generateAtom(const Atom *atom, - const Node *relative, - CodeMarker *marker); - virtual void generateClassLikeNode(const InnerNode *inner, CodeMarker *marker); - virtual void generateFakeNode(const FakeNode *fake, CodeMarker *marker); - virtual QString fileExtension(const Node *node) const; - virtual QString refForNode(const Node *node); - virtual QString linkForNode(const Node *node, const Node *relative); - virtual QString refForAtom(Atom *atom, const Node *node); + virtual void startText(const Node* relative, CodeMarker* marker); + virtual int generateAtom(const Atom* atom, + const Node* relative, + CodeMarker* marker); + virtual void generateClassLikeNode(const InnerNode* inner, CodeMarker* marker); + virtual void generateFakeNode(const FakeNode* fake, CodeMarker* marker); + virtual QString fileExtension(const Node* node) const; + virtual QString refForNode(const Node* node); + virtual QString linkForNode(const Node* node, const Node* relative); + virtual QString refForAtom(Atom* atom, const Node* node); void writeTargetAndHeader(const QString& target, const QString& header, const QString& attribute); + void writeXrefListItem(const QString& link, const QString& text); QString fullQualification(const Node* n); void writeDerivations(const ClassNode* cn, CodeMarker* marker); @@ -141,63 +142,63 @@ class DitaXmlGenerator : public PageGenerator private: enum SubTitleSize { SmallSubTitle, LargeSubTitle }; - const QPair anchorForNode(const Node *node); - const Node *findNodeForTarget(const QString &target, - const Node *relative, - CodeMarker *marker, - const Atom *atom = 0); + const QPair anchorForNode(const Node* node); + const Node* findNodeForTarget(const QString& target, + const Node* relative, + CodeMarker* marker, + const Atom* atom = 0); void generateBreadCrumbs(const QString& title, - const Node *node, - CodeMarker *marker); + const Node* node, + CodeMarker* marker); void generateHeader(const Node* node); void generateTitle(const QString& title, - const Text &subTitle, + const Text& subTitle, SubTitleSize subTitleSize, - const Node *relative, - CodeMarker *marker); + const Node* relative, + CodeMarker* marker); void generateBrief(const Node* node, CodeMarker* marker); - void generateIncludes(const InnerNode *inner, CodeMarker *marker); - void generateTableOfContents(const Node *node, - CodeMarker *marker, + void generateIncludes(const InnerNode* inner, CodeMarker* marker); + void generateTableOfContents(const Node* node, + CodeMarker* marker, Doc::SectioningUnit sectioningUnit, int numColumns, - const Node *relative = 0); - void generateTableOfContents(const Node *node, - CodeMarker *marker, + const Node* relative = 0); + void generateTableOfContents(const Node* node, + CodeMarker* marker, QList
    * sections = 0); - QString generateListOfAllMemberFile(const InnerNode *inner, CodeMarker *marker); - QString generateLowStatusMemberFile(const InnerNode *inner, - CodeMarker *marker, + QString generateListOfAllMemberFile(const InnerNode* inner, CodeMarker* marker); + QString generateLowStatusMemberFile(const InnerNode* inner, + CodeMarker* marker, CodeMarker::Status status); - void generateClassHierarchy(const Node *relative, - CodeMarker *marker, - const NodeMap &classMap); - void generateAnnotatedList(const Node *relative, - CodeMarker *marker, - const NodeMap &nodeMap); - void generateCompactList(const Node *relative, - CodeMarker *marker, - const NodeMap &classMap, + void generateClassHierarchy(const Node* relative, + CodeMarker* marker, + const NodeMap& classMap); + void generateAnnotatedList(const Node* relative, + CodeMarker* marker, + const NodeMap& nodeMap); + void generateCompactList(const Node* relative, + CodeMarker* marker, + const NodeMap& classMap, bool includeAlphabet, QString commonPrefix = QString()); - void generateFunctionIndex(const Node *relative, CodeMarker *marker); - void generateLegaleseList(const Node *relative, CodeMarker *marker); - void generateOverviewList(const Node *relative, CodeMarker *marker); + void generateFunctionIndex(const Node* relative, CodeMarker* marker); + void generateLegaleseList(const Node* relative, CodeMarker* marker); + void generateOverviewList(const Node* relative, CodeMarker* marker); void generateSectionList(const Section& section, - const Node *relative, - CodeMarker *marker, + const Node* relative, + CodeMarker* marker, CodeMarker::SynopsisStyle style); #ifdef QDOC_QML void generateQmlSummary(const Section& section, - const Node *relative, - CodeMarker *marker); - void generateQmlItem(const Node *node, - const Node *relative, - CodeMarker *marker, + const Node* relative, + CodeMarker* marker); + void generateQmlItem(const Node* node, + const Node* relative, + CodeMarker* marker, bool summary); - void generateDetailedQmlMember(const Node *node, - const InnerNode *relative, - CodeMarker *marker); + void generateDetailedQmlMember(const Node* node, + const InnerNode* relative, + CodeMarker* marker); void generateQmlInherits(const QmlClassNode* cn, CodeMarker* marker); void generateQmlInheritedBy(const QmlClassNode* cn, CodeMarker* marker); void generateQmlInstantiates(const QmlClassNode* qcn, CodeMarker* marker); @@ -205,61 +206,61 @@ class DitaXmlGenerator : public PageGenerator #endif void generateSection(const NodeList& nl, - const Node *relative, - CodeMarker *marker, + const Node* relative, + CodeMarker* marker, CodeMarker::SynopsisStyle style); - QString getMarkedUpSynopsis(const Node *node, - const Node *relative, - CodeMarker *marker, + QString getMarkedUpSynopsis(const Node* node, + const Node* relative, + CodeMarker* marker, CodeMarker::SynopsisStyle style); void generateSectionInheritedList(const Section& section, - const Node *relative, - CodeMarker *marker, + const Node* relative, + CodeMarker* marker, bool nameAlignment = false); void writeText(const QString& markedCode, - CodeMarker *marker, - const Node *relative, + CodeMarker* marker, + const Node* relative, bool nameAlignment = false); - void generateFullName(const Node *apparentNode, - const Node *relative, - CodeMarker *marker, - const Node *actualNode = 0); - void generateDetailedMember(const Node *node, - const InnerNode *relative, - CodeMarker *marker); - void generateLink(const Atom *atom, - const Node *relative, - CodeMarker *marker); - void generateStatus(const Node *node, CodeMarker *marker); + void generateFullName(const Node* apparentNode, + const Node* relative, + CodeMarker* marker, + const Node* actualNode = 0); + void generateDetailedMember(const Node* node, + const InnerNode* relative, + CodeMarker* marker); + void generateLink(const Atom* atom, + const Node* relative, + CodeMarker* marker); + void generateStatus(const Node* node, CodeMarker* marker); QString registerRef(const QString& ref); - QString fileBase(const Node *node); + QString fileBase(const Node* node); #if 0 - QString fileBase(const Node *node, const SectionIterator& section); + QString fileBase(const Node* node, const SectionIterator& section); #endif - QString fileName(const Node *node); - void findAllClasses(const InnerNode *node); - void findAllFunctions(const InnerNode *node); - void findAllLegaleseTexts(const InnerNode *node); - void findAllNamespaces(const InnerNode *node); - void findAllSince(const InnerNode *node); - static int hOffset(const Node *node); - static bool isThreeColumnEnumValueTable(const Atom *atom); - virtual QString getLink(const Atom *atom, - const Node *relative, - CodeMarker *marker, + QString fileName(const Node* node); + void findAllClasses(const InnerNode* node); + void findAllFunctions(const InnerNode* node); + void findAllLegaleseTexts(const InnerNode* node); + void findAllNamespaces(const InnerNode* node); + void findAllSince(const InnerNode* node); + static int hOffset(const Node* node); + static bool isThreeColumnEnumValueTable(const Atom* atom); + virtual QString getLink(const Atom* atom, + const Node* relative, + CodeMarker* marker, const Node** node); - virtual void generateIndex(const QString &fileBase, - const QString &url, - const QString &title); + virtual void generateIndex(const QString& fileBase, + const QString& url, + const QString& title); #ifdef GENERATE_MAC_REFS - void generateMacRef(const Node *node, CodeMarker *marker); + void generateMacRef(const Node* node, CodeMarker* marker); #endif - void beginLink(const QString &link, - const Node *node, - const Node *relative, - CodeMarker *marker); + void beginLink(const QString& link, + const Node* node, + const Node* relative, + CodeMarker* marker); void endLink(); bool generatePageElement(QXmlStreamWriter& writer, const Node* node, @@ -300,7 +301,7 @@ class DitaXmlGenerator : public PageGenerator QString navigationLinks; QStringList stylesheets; QStringList customHeadElements; - const Tree *myTree; + const Tree* myTree; bool slow; bool obsoleteLinks; int noLinks; @@ -317,7 +318,7 @@ class DitaXmlGenerator : public PageGenerator NodeMap qmlClasses; #endif QMap funcIndex; - QMap legaleseTexts; + QMap legaleseTexts; NewSinceMaps newSinceMaps; static QString sinceTitles[]; NewClassMaps newClassMaps; diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index eee998a..5bd5156 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -860,7 +860,11 @@ QMap& Generator::formattingRightMap() return fmtRightMaps[format()]; } -QString Generator::trimmedTrailing(const QString &string) +/* + Trims trailimng whitespace off the \a string and returns + the trimmed string. + */ +QString Generator::trimmedTrailing(const QString& string) { QString trimmed = string; while (trimmed.length() > 0 && trimmed[trimmed.length() - 1].isSpace()) -- cgit v0.12 From 0770668614e8445cb452ccbc50543eede5fed2d1 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 13 Sep 2010 14:43:42 +0200 Subject: qdoc: Implemented stacking of XML stream writers. --- tools/qdoc3/ditaxmlgenerator.cpp | 1893 ++++++++++++++++++-------------------- tools/qdoc3/ditaxmlgenerator.h | 24 +- tools/qdoc3/pagegenerator.h | 18 +- 3 files changed, 886 insertions(+), 1049 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 1ff9592..f572cc7 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -508,7 +508,7 @@ QString DitaXmlGenerator::format() QString DitaXmlGenerator::writeGuidAttribute(QString text) { QString guid = lookupGuid(text); - writer.writeAttribute("id",guid); + xmlWriter().writeAttribute("id",guid); return guid; } @@ -595,11 +595,11 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, endLink(); } else { - writer.writeCharacters(protectEnc(atom->string())); + xmlWriter().writeCharacters(protectEnc(atom->string())); } } else { - writer.writeCharacters(protectEnc(atom->string())); + xmlWriter().writeCharacters(protectEnc(atom->string())); } break; case Atom::BaseName: @@ -609,7 +609,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, skipAhead = skipAtoms(atom, Atom::BriefRight); break; } - writer.writeStartElement(SHORTDESC); + xmlWriter().writeStartElement(SHORTDESC); if (relative->type() == Node::Property || relative->type() == Node::Variable) { QString str; @@ -624,94 +624,94 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, str[0] = str[0].toLower(); if (str.right(1) == ".") str.truncate(str.length() - 1); - writer.writeCharacters("This "); + xmlWriter().writeCharacters("This "); if (relative->type() == Node::Property) - writer.writeCharacters("property"); + xmlWriter().writeCharacters("property"); else - writer.writeCharacters("variable"); + xmlWriter().writeCharacters("variable"); QStringList words = str.split(" "); if (!(words.first() == "contains" || words.first() == "specifies" || words.first() == "describes" || words.first() == "defines" || words.first() == "holds" || words.first() == "determines")) - writer.writeCharacters(" holds "); + xmlWriter().writeCharacters(" holds "); else - writer.writeCharacters(" "); - writer.writeCharacters(str + "."); + xmlWriter().writeCharacters(" "); + xmlWriter().writeCharacters(str + "."); } break; case Atom::BriefRight: if (relative->type() != Node::Fake) { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } break; case Atom::C: - writer.writeStartElement(formattingLeftMap()[ATOM_FORMATTING_TELETYPE]); + xmlWriter().writeStartElement(formattingLeftMap()[ATOM_FORMATTING_TELETYPE]); if (inLink) { - writer.writeCharacters(protectEnc(plainCode(atom->string()))); + xmlWriter().writeCharacters(protectEnc(plainCode(atom->string()))); } else { writeText(atom->string(), marker, relative); } - writer.writeEndElement(); // sse writeStartElement() above + xmlWriter().writeEndElement(); // sse writeStartElement() above break; case Atom::Code: - writer.writeStartElement("pre"); - writer.writeAttribute("outputclass","highlightedcode"); + xmlWriter().writeStartElement("pre"); + xmlWriter().writeAttribute("outputclass","highlightedcode"); writeText(trimmedTrailing(atom->string()), marker, relative); - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // break; case Atom::Qml: - writer.writeStartElement("pre"); - writer.writeAttribute("outputclass","highlightedcode"); + xmlWriter().writeStartElement("pre"); + xmlWriter().writeAttribute("outputclass","highlightedcode"); writeText(trimmedTrailing(atom->string()), marker, relative); - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // break; case Atom::CodeNew: - writer.writeStartElement("p"); - writer.writeCharacters("you can rewrite it as"); - writer.writeEndElement(); //

    - writer.writeStartElement("pre"); - writer.writeAttribute("outputclass","highlightedcode"); + xmlWriter().writeStartElement("p"); + xmlWriter().writeCharacters("you can rewrite it as"); + xmlWriter().writeEndElement(); //

    + xmlWriter().writeStartElement("pre"); + xmlWriter().writeAttribute("outputclass","highlightedcode"); writeText(trimmedTrailing(atom->string()), marker, relative); - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // break; case Atom::CodeOld: - writer.writeStartElement("p"); - writer.writeCharacters("For example, if you have code like"); - writer.writeEndElement(); //

    + xmlWriter().writeStartElement("p"); + xmlWriter().writeCharacters("For example, if you have code like"); + xmlWriter().writeEndElement(); //

    // fallthrough case Atom::CodeBad: - writer.writeStartElement("pre"); - writer.writeAttribute("outputclass","highlightedcode"); - writer.writeCharacters(trimmedTrailing(protectEnc(plainCode(atom->string())))); - writer.writeEndElement(); // + xmlWriter().writeStartElement("pre"); + xmlWriter().writeAttribute("outputclass","highlightedcode"); + xmlWriter().writeCharacters(trimmedTrailing(protectEnc(plainCode(atom->string())))); + xmlWriter().writeEndElement(); // break; case Atom::FootnoteLeft: // ### For now if (in_para) { - writer.writeEndElement(); //

    + xmlWriter().writeEndElement(); //

    in_para = false; } - writer.writeCharacters(""); + xmlWriter().writeCharacters("-->"); break; case Atom::FormatElse: case Atom::FormatEndif: case Atom::FormatIf: break; case Atom::FormattingLeft: - writer.writeStartElement(formattingLeftMap()[atom->string()]); + xmlWriter().writeStartElement(formattingLeftMap()[atom->string()]); if (atom->string() == ATOM_FORMATTING_PARAMETER) { if (atom->next() != 0 && atom->next()->type() == Atom::String) { QRegExp subscriptRegExp("([a-z]+)_([0-9n])"); if (subscriptRegExp.exactMatch(atom->next()->string())) { - writer.writeCharacters(subscriptRegExp.cap(1)); - writer.writeStartElement("sub"); - writer.writeCharacters(subscriptRegExp.cap(2)); - writer.writeEndElement(); // + xmlWriter().writeCharacters(subscriptRegExp.cap(1)); + xmlWriter().writeStartElement("sub"); + xmlWriter().writeCharacters(subscriptRegExp.cap(2)); + xmlWriter().writeEndElement(); // skipAhead = 1; } } @@ -722,7 +722,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, endLink(); } else { - writer.writeEndElement(); // ? + xmlWriter().writeEndElement(); // ? } break; case Atom::AnnotatedList: @@ -924,7 +924,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, /* First generate the table of contents. */ - writer.writeStartElement("ul"); + xmlWriter().writeStartElement("ul"); s = sections.constBegin(); while (s != sections.constEnd()) { if (!(*s).members.isEmpty()) { @@ -933,17 +933,17 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } ++s; } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // int idx = 0; s = sections.constBegin(); while (s != sections.constEnd()) { if (!(*s).members.isEmpty()) { - writer.writeStartElement("p"); + xmlWriter().writeStartElement("p"); writeGuidAttribute(Doc::canonicalTitle((*s).name)); - writer.writeAttribute("outputclass","h3"); - writer.writeCharacters(protectEnc((*s).name)); - writer.writeEndElement(); //

    + xmlWriter().writeAttribute("outputclass","h3"); + xmlWriter().writeCharacters(protectEnc((*s).name)); + xmlWriter().writeEndElement(); //

    if (idx == Class) generateCompactList(0, marker, ncmap.value(), false, QString("Q")); else if (idx == QmlClass) @@ -963,23 +963,24 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, pmap = parentmaps.begin(); while (pmap != parentmaps.end()) { NodeList nlist = pmap->values(); - writer.writeStartElement("p"); - writer.writeCharacters("Class "); - writer.writeStartElement("xref"); - writer.writeAttribute("href",linkForNode(pmap.key(), 0)); + xmlWriter().writeStartElement("p"); + xmlWriter().writeCharacters("Class "); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",linkForNode(pmap.key(), 0)); QStringList pieces = fullName(pmap.key(), 0, marker).split("::"); - writer.writeCharacters(protectEnc(pieces.last())); - writer.writeEndElement(); // - writer.writeCharacters(":"); - writer.writeEndElement(); //

    + xmlWriter().writeCharacters(protectEnc(pieces.last())); + xmlWriter().writeEndElement(); // + xmlWriter().writeCharacters(":"); + xmlWriter().writeEndElement(); //

    generateSection(nlist, 0, marker, CodeMarker::Summary); - writer.writeEmptyElement("br"); + xmlWriter().writeEmptyElement("br"); ++pmap; } } - else + else { generateSection(s->members, 0, marker, CodeMarker::Summary); + } } ++idx; ++s; @@ -995,39 +996,39 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (atom->next() != 0) text = atom->next()->string(); if (atom->type() == Atom::Image) { - writer.writeStartElement("p"); - writer.writeAttribute("outputclass","centerAlign"); + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","centerAlign"); } if (fileName.isEmpty()) { - writer.writeStartElement("font"); - writer.writeAttribute("color","red"); - writer.writeCharacters("[Missing image: "); - writer.writeCharacters(protectEnc(atom->string())); - writer.writeEndElement(); // + xmlWriter().writeStartElement("font"); + xmlWriter().writeAttribute("color","red"); + xmlWriter().writeCharacters("[Missing image: "); + xmlWriter().writeCharacters(protectEnc(atom->string())); + xmlWriter().writeEndElement(); // } else { - writer.writeStartElement("img"); - writer.writeAttribute("src",protectEnc(fileName)); + xmlWriter().writeStartElement("img"); + xmlWriter().writeAttribute("src",protectEnc(fileName)); if (!text.isEmpty()) - writer.writeAttribute("alt",protectEnc(text)); - writer.writeEndElement(); // + xmlWriter().writeAttribute("alt",protectEnc(text)); + xmlWriter().writeEndElement(); // } if (atom->type() == Atom::Image) - writer.writeEndElement(); //

    + xmlWriter().writeEndElement(); //

    } break; case Atom::ImageText: // nothing break; case Atom::LegaleseLeft: - writer.writeStartElement("p"); - writer.writeAttribute("outputclass","legalese"); + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","legalese"); break; case Atom::LegaleseRight: - writer.writeEndElement(); //

    + xmlWriter().writeEndElement(); //

    break; case Atom::LineBreak: - writer.writeEmptyElement("br"); + xmlWriter().writeEmptyElement("br"); break; case Atom::Link: { @@ -1051,64 +1052,64 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::ListLeft: if (in_para) { - writer.writeEndElement(); //

    + xmlWriter().writeEndElement(); //

    in_para = false; } if (atom->string() == ATOM_LIST_BULLET) { - writer.writeStartElement("ul"); + xmlWriter().writeStartElement("ul"); } else if (atom->string() == ATOM_LIST_TAG) { - writer.writeStartElement("dl"); + xmlWriter().writeStartElement("dl"); } else if (atom->string() == ATOM_LIST_VALUE) { threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom); if (threeColumnEnumValueTable) { - writer.writeStartElement("simpletable"); - writer.writeAttribute("outputclass","valuelist"); - writer.writeStartElement("sthead"); + xmlWriter().writeStartElement("simpletable"); + xmlWriter().writeAttribute("outputclass","valuelist"); + xmlWriter().writeStartElement("sthead"); if (++numTableRows % 2 == 1) - writer.writeAttribute("outputclass","odd"); + xmlWriter().writeAttribute("outputclass","odd"); else - writer.writeAttribute("outputclass","even"); - writer.writeStartElement("stentry"); - writer.writeCharacters("Constant"); - writer.writeEndElement(); // - writer.writeStartElement("stentry"); - writer.writeCharacters("Value"); - writer.writeEndElement(); // - writer.writeStartElement("stentry"); - writer.writeCharacters("Description"); - writer.writeEndElement(); // - writer.writeEndElement(); // + xmlWriter().writeAttribute("outputclass","even"); + xmlWriter().writeStartElement("stentry"); + xmlWriter().writeCharacters("Constant"); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement("stentry"); + xmlWriter().writeCharacters("Value"); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement("stentry"); + xmlWriter().writeCharacters("Description"); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } else { - writer.writeStartElement("simpletable"); - writer.writeAttribute("outputclass","valuelist"); - writer.writeStartElement("sthead"); - writer.writeStartElement("stentry"); - writer.writeCharacters("Constant"); - writer.writeEndElement(); // - writer.writeStartElement("stentry"); - writer.writeCharacters("Value"); - writer.writeEndElement(); // - writer.writeEndElement(); // + xmlWriter().writeStartElement("simpletable"); + xmlWriter().writeAttribute("outputclass","valuelist"); + xmlWriter().writeStartElement("sthead"); + xmlWriter().writeStartElement("stentry"); + xmlWriter().writeCharacters("Constant"); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement("stentry"); + xmlWriter().writeCharacters("Value"); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } } else { - writer.writeStartElement("ol"); + xmlWriter().writeStartElement("ol"); if (atom->string() == ATOM_LIST_UPPERALPHA) - writer.writeAttribute("outputclass","upperalpha"); + xmlWriter().writeAttribute("outputclass","upperalpha"); else if (atom->string() == ATOM_LIST_LOWERALPHA) - writer.writeAttribute("outputclass","loweralpha"); + xmlWriter().writeAttribute("outputclass","loweralpha"); else if (atom->string() == ATOM_LIST_UPPERROMAN) - writer.writeAttribute("outputclass","upperroman"); + xmlWriter().writeAttribute("outputclass","upperroman"); else if (atom->string() == ATOM_LIST_LOWERROMAN) - writer.writeAttribute("outputclass","lowerroman"); + xmlWriter().writeAttribute("outputclass","lowerroman"); else // (atom->string() == ATOM_LIST_NUMERIC) - writer.writeAttribute("outputclass","numeric"); + xmlWriter().writeAttribute("outputclass","numeric"); if (atom->next() != 0 && atom->next()->string().toInt() != 1) { // I don't think this attribute is supported. - writer.writeAttribute("start",atom->next()->string()); + xmlWriter().writeAttribute("start",atom->next()->string()); } } break; @@ -1117,19 +1118,19 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::ListTagLeft: if (atom->string() == ATOM_LIST_TAG) { - writer.writeStartElement("dt"); + xmlWriter().writeStartElement("dt"); } else { // (atom->string() == ATOM_LIST_VALUE) - writer.writeStartElement("strow"); - writer.writeStartElement("stentry"); - writer.writeAttribute("outputclass","topAlign"); - writer.writeStartElement("tt"); - writer.writeCharacters(protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(), + xmlWriter().writeStartElement("strow"); + xmlWriter().writeStartElement("stentry"); + xmlWriter().writeAttribute("outputclass","topAlign"); + xmlWriter().writeStartElement("tt"); + xmlWriter().writeCharacters(protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(), relative)))); - writer.writeEndElement(); //
    - writer.writeEndElement(); // - writer.writeStartElement("stentry"); - writer.writeAttribute("outputclass","topAlign"); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement("stentry"); + xmlWriter().writeAttribute("outputclass","topAlign"); QString itemValue; if (relative->type() == Node::Enum) { @@ -1138,105 +1139,105 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } if (itemValue.isEmpty()) - writer.writeCharacters("?"); + xmlWriter().writeCharacters("?"); else { - writer.writeStartElement("tt"); - writer.writeCharacters(protectEnc(itemValue)); - writer.writeEndElement(); // + xmlWriter().writeStartElement("tt"); + xmlWriter().writeCharacters(protectEnc(itemValue)); + xmlWriter().writeEndElement(); // } skipAhead = 1; } break; case Atom::ListTagRight: if (atom->string() == ATOM_LIST_TAG) - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // break; case Atom::ListItemLeft: if (atom->string() == ATOM_LIST_TAG) { - writer.writeStartElement("dd"); + xmlWriter().writeStartElement("dd"); } else if (atom->string() == ATOM_LIST_VALUE) { if (threeColumnEnumValueTable) { - writer.writeEndElement(); // - writer.writeStartElement("stentry"); - writer.writeAttribute("outputclass","topAlign"); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement("stentry"); + xmlWriter().writeAttribute("outputclass","topAlign"); if (matchAhead(atom, Atom::ListItemRight)) - writer.writeCharacters(" "); + xmlWriter().writeCharacters(" "); } } else { - writer.writeStartElement("li"); + xmlWriter().writeStartElement("li"); } if (matchAhead(atom, Atom::ParaLeft)) skipAhead = 1; break; case Atom::ListItemRight: if (atom->string() == ATOM_LIST_TAG) { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } else if (atom->string() == ATOM_LIST_VALUE) { - writer.writeEndElement(); // - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } else { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } break; case Atom::ListRight: if (atom->string() == ATOM_LIST_BULLET) { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } else if (atom->string() == ATOM_LIST_TAG) { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } else if (atom->string() == ATOM_LIST_VALUE) { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } else { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } break; case Atom::Nop: // nothing break; case Atom::ParaLeft: - writer.writeStartElement("p"); + xmlWriter().writeStartElement("p"); in_para = true; break; case Atom::ParaRight: endLink(); if (in_para) { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // break; case Atom::RawString: - writer.writeCharacters(atom->string()); + xmlWriter().writeCharacters(atom->string()); break; case Atom::SectionLeft: - writer.writeStartElement("p"); + xmlWriter().writeStartElement("p"); writeGuidAttribute(Doc::canonicalTitle(Text::sectionHeading(atom).toString())); - writer.writeAttribute("outputclass","target"); - writer.writeCharacters(protectEnc(Text::sectionHeading(atom).toString())); - writer.writeEndElement(); //

    + xmlWriter().writeAttribute("outputclass","target"); + xmlWriter().writeCharacters(protectEnc(Text::sectionHeading(atom).toString())); + xmlWriter().writeEndElement(); //

    break; case Atom::SectionRight: // nothing break; case Atom::SectionHeadingLeft: - writer.writeStartElement("p"); + xmlWriter().writeStartElement("p"); hx = "h" + QString::number(atom->string().toInt() + hOffset(relative)); - writer.writeAttribute("outputclass",hx); + xmlWriter().writeAttribute("outputclass",hx); inSectionHeading = true; break; case Atom::SectionHeadingRight: - writer.writeEndElement(); //

    (see case Atom::SectionHeadingLeft) + xmlWriter().writeEndElement(); //

    (see case Atom::SectionHeadingLeft) inSectionHeading = false; break; case Atom::SidebarLeft: @@ -1250,17 +1251,17 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, generateLink(atom, relative, marker); } else { - writer.writeCharacters(protectEnc(atom->string())); + xmlWriter().writeCharacters(protectEnc(atom->string())); } break; case Atom::TableLeft: { if (in_para) { - writer.writeEndElement(); //

    + xmlWriter().writeEndElement(); //

    in_para = false; } - writer.writeStartElement("table"); - writer.writeAttribute("outputclass","generic"); + xmlWriter().writeStartElement("table"); + xmlWriter().writeAttribute("outputclass","generic"); numTableRows = 0; if (tableColumnCount != 0) { qDebug() << "ERROR: Nested tables!"; @@ -1274,62 +1275,62 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, ++tableColumnCount; t = t->next(); } - writer.writeStartElement("tgroup"); - writer.writeAttribute("cols",QString::number(tableColumnCount)); + xmlWriter().writeStartElement("tgroup"); + xmlWriter().writeAttribute("cols",QString::number(tableColumnCount)); } break; case Atom::TableRight: - writer.writeEndElement(); // - writer.writeEndElement(); // - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // tableColumnCount = 0; break; case Atom::TableHeaderLeft: - writer.writeStartElement("thead"); - writer.writeStartElement("row"); - writer.writeAttribute("outputclass","qt-style topAlign"); + xmlWriter().writeStartElement("thead"); + xmlWriter().writeStartElement("row"); + xmlWriter().writeAttribute("outputclass","qt-style topAlign"); inTableHeader = true; inTableBody = false; break; case Atom::TableHeaderRight: - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // if (matchAhead(atom, Atom::TableHeaderLeft)) { skipAhead = 1; - writer.writeStartElement("row"); - writer.writeAttribute("outputclass","qt-style topAlign"); + xmlWriter().writeStartElement("row"); + xmlWriter().writeAttribute("outputclass","qt-style topAlign"); } else { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // inTableHeader = false; inTableBody = true; - writer.writeStartElement("tbody"); + xmlWriter().writeStartElement("tbody"); } break; case Atom::TableRowLeft: if (!inTableHeader && !inTableBody) { inTableBody = true; - writer.writeStartElement("tbody"); + xmlWriter().writeStartElement("tbody"); } - writer.writeStartElement("row"); + xmlWriter().writeStartElement("row"); if (++numTableRows % 2 == 1) - writer.writeAttribute("outputclass","odd topAlign"); + xmlWriter().writeAttribute("outputclass","odd topAlign"); else - writer.writeAttribute("outputclass","even topAlign"); + xmlWriter().writeAttribute("outputclass","even topAlign"); break; case Atom::TableRowRight: - writer.writeEndElement(); // \n"; + xmlWriter().writeEndElement(); // \n"; break; case Atom::TableItemLeft: { if (inTableHeader) - writer.writeStartElement("entry"); + xmlWriter().writeStartElement("entry"); else - writer.writeStartElement("entry"); + xmlWriter().writeStartElement("entry"); QStringList spans = atom->string().split(","); if (spans.size() == 2) { if (!inTableHeader) - writer.writeStartElement("p"); + xmlWriter().writeStartElement("p"); } if (matchAhead(atom, Atom::ParaLeft)) skipAhead = 1; @@ -1337,10 +1338,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::TableItemRight: if (inTableHeader) - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // else { - writer.writeEndElement(); //

    - writer.writeEndElement(); // + xmlWriter().writeEndElement(); //

    + xmlWriter().writeEndElement(); // } if (matchAhead(atom, Atom::ParaLeft)) skipAhead = 1; @@ -1375,23 +1376,23 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } break; case Atom::Target: - writer.writeStartElement("p"); + xmlWriter().writeStartElement("p"); writeGuidAttribute(Doc::canonicalTitle(atom->string())); - writer.writeAttribute("outputclass","target"); - writer.writeCharacters(protectEnc(atom->string())); - writer.writeEndElement(); //

    + xmlWriter().writeAttribute("outputclass","target"); + xmlWriter().writeCharacters(protectEnc(atom->string())); + xmlWriter().writeEndElement(); //

    break; case Atom::UnhandledFormat: - writer.writeStartElement("b"); - writer.writeAttribute("outputclass","redFont"); - writer.writeCharacters("<Missing DITAXML>"); - writer.writeEndElement(); // + xmlWriter().writeStartElement("b"); + xmlWriter().writeAttribute("outputclass","redFont"); + xmlWriter().writeCharacters("<Missing DITAXML>"); + xmlWriter().writeEndElement(); // break; case Atom::UnknownCommand: - writer.writeStartElement("b"); - writer.writeAttribute("outputclass","redFont code"); - writer.writeCharacters(protectEnc(atom->string())); - writer.writeEndElement(); // + xmlWriter().writeStartElement("b"); + xmlWriter().writeAttribute("outputclass","redFont code"); + xmlWriter().writeCharacters(protectEnc(atom->string())); + xmlWriter().writeEndElement(); // break; case Atom::QmlText: case Atom::EndQmlText: @@ -1433,51 +1434,44 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark fullTitle = marker->plainFullName(inner); title = rawTitle + " Class Reference"; - generateHeader(inner); - - writer.writeStartElement(CXXCLASS); - writer.writeAttribute("id",cn->guid()); - writer.writeStartElement(APINAME); - writer.writeCharacters(fullTitle); - writer.writeEndElement(); // - + generateHeader(inner, fullTitle); generateBrief(inner, marker); // // not included: - writer.writeStartElement(CXXCLASSDETAIL); - writer.writeStartElement(CXXCLASSDEFINITION); - writer.writeStartElement(CXXCLASSACCESSSPECIFIER); - writer.writeAttribute("value",inner->accessString()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXCLASSDETAIL); + xmlWriter().writeStartElement(CXXCLASSDEFINITION); + xmlWriter().writeStartElement(CXXCLASSACCESSSPECIFIER); + xmlWriter().writeAttribute("value",inner->accessString()); + xmlWriter().writeEndElement(); // if (cn->isAbstract()) { - writer.writeStartElement(CXXCLASSABSTRACT); - writer.writeAttribute("name","abstract"); - writer.writeAttribute("value","abstract"); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXCLASSABSTRACT); + xmlWriter().writeAttribute("name","abstract"); + xmlWriter().writeAttribute("value","abstract"); + xmlWriter().writeEndElement(); // } writeDerivations(cn, marker); // // not included: writeLocation(cn); - writer.writeEndElement(); // - writer.writeStartElement(APIDESC); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement(APIDESC); if (!inner->doc().isEmpty()) { - writer.writeStartElement("p"); - writer.writeAttribute("outputclass","h2"); - writer.writeCharacters("Detailed Description"); - writer.writeEndElement(); //

    + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters("Detailed Description"); + xmlWriter().writeEndElement(); //

    generateBody(inner, marker); // generateAlsoList(inner, marker); } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: ,
    , or - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: // not included: @@ -1506,7 +1500,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark // not included: - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } } @@ -1518,15 +1512,15 @@ void DitaXmlGenerator::writeTargetAndHeader(const QString& target, const QString& header, const QString& attribute) { - writer.writeStartElement("p"); + xmlWriter().writeStartElement("p"); writeGuidAttribute(registerRef(target)); - writer.writeAttribute("outputclass","target"); - writer.writeCharacters(header); - writer.writeEndElement(); //

    - writer.writeStartElement("p"); - writer.writeAttribute("outputclass",attribute); - writer.writeCharacters(header); - writer.writeEndElement(); //

    + xmlWriter().writeAttribute("outputclass","target"); + xmlWriter().writeCharacters(header); + xmlWriter().writeEndElement(); //

    + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass",attribute); + xmlWriter().writeCharacters(header); + xmlWriter().writeEndElement(); //

    } /*! @@ -1534,12 +1528,15 @@ void DitaXmlGenerator::writeTargetAndHeader(const QString& target, */ void DitaXmlGenerator::writeXrefListItem(const QString& link, const QString& text) { - writer.writeStartElement("li"); - writer.writeStartElement("xref"); - writer.writeAttribute("href",link); - writer.writeCharacters(text); - writer.writeEndElement(); // - writer.writeEndElement(); // + qDebug() << "WXLI 1" << link; + xmlWriter().writeStartElement("li"); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",link); + qDebug() << "WXLI 2"; + xmlWriter().writeCharacters(text); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + qDebug() << "WXLI 3"; } /*! @@ -1554,12 +1551,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker QString fullTitle = fake->fullTitle(); QString htmlTitle = fullTitle; - /* - NOTE: For now we only handle \page elements. - */ - //if (fake->subType() != Node::Page) - //return; - if (fake->subType() == Node::File && !fake->subTitle().isEmpty()) { subTitleSize = SmallSubTitle; htmlTitle += " (" + fake->subTitle() + ")"; @@ -1569,47 +1560,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker htmlTitle = fullTitle; } - QString outputclass; - switch (fake->subType()) { - case Node::Page: - outputclass = "page"; - break; - case Node::Group: - outputclass = "group"; - break; - case Node::Example: - outputclass = "example"; - break; - case Node::HeaderFile: - outputclass = "header"; - break; - case Node::File: - outputclass = "file"; - break; - case Node::Image: - outputclass = "image"; - break; - case Node::Module: - outputclass = "module"; - break; - case Node::ExternalPage: - outputclass = "externalpage"; - break; - case Node::QmlClass: - outputclass = "QML"; - break; - default: - return; - } - - generateHeader(fake); - - writer.writeStartElement("topic"); - writer.writeAttribute("id",fake->guid()); - writer.writeAttribute("outputclass",outputclass); - writer.writeStartElement("title"); - writer.writeCharacters(fullTitle); - writer.writeEndElement(); // + generateHeader(fake, fullTitle); generateBrief(fake, marker); // if (fake->subType() == Node::Module) { @@ -1625,7 +1576,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker } else if (fake->subType() == Node::HeaderFile) { generateStatus(fake, marker); - writer.writeStartElement("ul"); + xmlWriter().writeStartElement("ul"); QString membersLink = generateListOfAllMemberFile(fake, marker); if (!membersLink.isEmpty()) { @@ -1646,11 +1597,11 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker writeXrefListItem(compatLink,"Qt 3 support members"); } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } if (!fake->doc().isEmpty()) { - writer.writeStartElement("body"); + xmlWriter().writeStartElement("body"); if (fake->subType() == Node::Module) { writeTargetAndHeader("details","Detailed Description","h2"); } @@ -1666,9 +1617,9 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker generateAnnotatedList(fake, marker, groupMembersMap); } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } #if 0 @@ -1732,7 +1683,8 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker while (s != sections.end()) { out() << "\n"; out() << "

    " << protectEnc((*s).name) << "

    \n"; - generateSectionList(*s, fake, marker, CodeMarker::Summary); + generateSection(s->members, fake, marker, CodeMarker::Summary); + generateSectionInheritedList(*s, relative, marker, name_alignment); ++s; } @@ -1862,52 +1814,77 @@ void DitaXmlGenerator::generateBreadCrumbs(const QString& title, \note This does not cover all cases yet. */ -void DitaXmlGenerator::generateHeader(const Node* node) +void DitaXmlGenerator::generateHeader(const Node* node, const QString& name) { - writer.setDevice(out().device()); - writer.setAutoFormatting(true); - writer.setAutoFormattingIndent(4); - writer.writeStartDocument(); - if (!node) return; QString doctype; - QString element; + QString mainElement; + QString nameElement; QString dtd; QString base; QString version; + QString outputclass; + if (node->type() == Node::Class) { - element = "cxxClass"; + mainElement = "cxxClass"; + nameElement = "apiName"; dtd = "dtd/cxxClass.dtd"; version = "0.6.0"; - doctype = ""; } else if (node->type() == Node::Fake) { + mainElement = "topic"; + nameElement = "title"; + dtd = "dtd/topic.dtd"; + doctype = ""; switch (node->subType()) { case Node::Page: + outputclass = "page"; + break; case Node::Group: + outputclass = "group"; + break; case Node::Example: + outputclass = "example"; + break; case Node::HeaderFile: + outputclass = "header"; + break; case Node::File: + outputclass = "file"; + break; case Node::Image: + outputclass = "image"; + break; case Node::Module: + outputclass = "module"; + break; case Node::ExternalPage: + outputclass = "externalpage"; + break; case Node::QmlClass: - element = "topic"; - dtd = "dtd/topic.dtd"; - doctype = ""; + outputclass = "QML"; break; default: - break; + outputclass = "page"; } } - writer.writeDTD(doctype); - writer.writeComment(node->doc().location().fileName()); + xmlWriter().writeDTD(doctype); + xmlWriter().writeComment(node->doc().location().fileName()); + + xmlWriter().writeStartElement(mainElement); + xmlWriter().writeAttribute("id",node->guid()); + if (!outputclass.isEmpty()) + xmlWriter().writeAttribute("outputclass",outputclass); + xmlWriter().writeStartElement(nameElement); + xmlWriter().writeCharacters(name); + xmlWriter().writeEndElement(); // } void DitaXmlGenerator::generateTitle(const QString& title, @@ -1916,16 +1893,22 @@ void DitaXmlGenerator::generateTitle(const QString& title, const Node *relative, CodeMarker *marker) { - if (!title.isEmpty()) - out() << "

    " << protectEnc(title) << "

    \n"; + if (!title.isEmpty()) { + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass", "h1 title"); + xmlWriter().writeCharacters(protectEnc(title)); + xmlWriter().writeEndElement(); //

    + } if (!subTitle.isEmpty()) { - out() << ""; - else - out() << " class=\"subtitle\">"; + xmlWriter().writeStartElement("p"); + if (subTitleSize == SmallSubTitle) { + xmlWriter().writeAttribute("outputclass", "small-subtitle"); + } + else { + xmlWriter().writeAttribute("outputclass", "subtitle"); + } generateText(subTitle, relative, marker); - out() << "\n"; + xmlWriter().writeEndElement(); //

    } } @@ -1937,9 +1920,9 @@ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) Text brief = node->doc().briefText(); if (!brief.isEmpty()) { ++noLinks; - writer.writeStartElement(SHORTDESC); + xmlWriter().writeStartElement(SHORTDESC); generateText(brief, node, marker); - writer.writeEndElement(); // shortdesc + xmlWriter().writeEndElement(); // shortdesc --noLinks; } } @@ -1947,10 +1930,10 @@ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) void DitaXmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) { if (!inner->includes().isEmpty()) { - writer.writeStartElement("pree"); - writer.writeAttribute("outputclass","highlightedcode"); + xmlWriter().writeStartElement("pree"); + xmlWriter().writeAttribute("outputclass","highlightedcode"); writeText(marker->markedUpIncludes(inner->includes()), marker, inner); - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } } @@ -2154,8 +2137,8 @@ void DitaXmlGenerator::generateTableOfContents(const Node *node, inLink = false; } -QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, - CodeMarker *marker) +QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode* inner, + CodeMarker* marker) { QList
    sections; QList
    ::ConstIterator s; @@ -2169,26 +2152,25 @@ QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, QString fileName = fileBase(inner) + "-members." + fileExtension(inner); beginSubPage(inner->location(), fileName); QString title = "List of All Members for " + inner->name(); - generateHeader(inner); + generateHeader(inner, title); + xmlWriter().writeStartElement("body"); generateTitle(title, Text(), SmallSubTitle, inner, marker); out() << "

    This is the complete list of members for "; generateFullName(inner, 0, marker); out() << ", including inherited members.

    \n"; Section section = sections.first(); - generateSectionList(section, 0, marker, CodeMarker::SeparateList); - + generateSection(section.members, 0, marker, CodeMarker::SeparateList); + xmlWriter().writeEndElement(); // endSubPage(); return fileName; } QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, - CodeMarker* marker, - CodeMarker::Status status) + CodeMarker* marker, + CodeMarker::Status status) { - QList
    sections = marker->sections(inner, - CodeMarker::Summary, - status); + QList
    sections = marker->sections(inner,CodeMarker::Summary,status); QMutableListIterator
    j(sections); while (j.hasNext()) { if (j.next().members.size() == 0) @@ -2211,44 +2193,61 @@ QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, } beginSubPage(inner->location(), fileName); - generateHeader(inner); + generateHeader(inner, title); + xmlWriter().writeStartElement("body"); generateTitle(title, Text(), SmallSubTitle, inner, marker); if (status == CodeMarker::Compat) { - out() << "

    The following class members are part of the " - "Qt 3 support layer. " - "They are provided to help you port old code to Qt 4. We advise against " - "using them in new code.

    \n"; + xmlWriter().writeStartElement("p"); + xmlWriter().writeCharacters("

    The following class members are part of the " + "Qt 3 support layer." + " They are provided to help you port old code to Qt 4. " + "We advise against using them in new code."); + xmlWriter().writeEndElement(); //

    } else { - out() << "

    The following class members are obsolete. " - << "They are provided to keep old source code working. " - << "We strongly advise against using them in new code.

    \n"; - } - - out() << "

    • " - << protectEnc(inner->name()) - << " class reference

    \n"; - + xmlWriter().writeStartElement("p"); + xmlWriter().writeCharacters("The following class members are obsolete. " + "They are provided to keep old source code working. " + "We strongly advise against using them in new code."); + xmlWriter().writeEndElement(); //

    + } + xmlWriter().writeStartElement("p"); + xmlWriter().writeStartElement("ul"); + QString text = protectEnc(inner->name()) + " class reference"; + writeXrefListItem(linkForNode(inner,0),text); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); //

    + for (i = 0; i < sections.size(); ++i) { - out() << "

    " << protectEnc(sections.at(i).name) << "

    \n"; - generateSectionList(sections.at(i), inner, marker, CodeMarker::Summary); + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc(sections.at(i).name)); + xmlWriter().writeEndElement(); //

    + generateSection(sections.at(i).members, inner, marker, CodeMarker::Summary); + generateSectionInheritedList(sections.at(i), inner, marker); } sections = marker->sections(inner, CodeMarker::Detailed, status); for (i = 0; i < sections.size(); ++i) { - out() << "
    \n"; - out() << "

    " << protectEnc(sections.at(i).name) << "

    \n"; + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","separator"); + xmlWriter().writeEndElement(); //

    + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc(sections.at(i).name)); + xmlWriter().writeEndElement(); //

    NodeList::ConstIterator m = sections.at(i).members.begin(); while (m != sections.at(i).members.end()) { - if ((*m)->access() != Node::Private) + if ((*m)->access() != Node::Private) { generateDetailedMember(*m, inner, marker); + } ++m; } } - + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // endSubPage(); return fileName; } @@ -2303,11 +2302,11 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeMap& nodeMap) { - writer.writeStartElement("table"); - writer.writeAttribute("outputclass","annotated"); - writer.writeStartElement("tgroup"); - writer.writeAttribute("cols","2"); - writer.writeStartElement("tbody"); + xmlWriter().writeStartElement("table"); + xmlWriter().writeAttribute("outputclass","annotated"); + xmlWriter().writeStartElement("tgroup"); + xmlWriter().writeAttribute("cols","2"); + xmlWriter().writeStartElement("tbody"); int row = 0; foreach (const QString& name, nodeMap.keys()) { @@ -2316,39 +2315,39 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative, if (node->status() == Node::Obsolete) continue; - writer.writeStartElement("row"); + xmlWriter().writeStartElement("row"); if (++row % 2 == 1) - writer.writeAttribute("outputclass","odd topAlign"); + xmlWriter().writeAttribute("outputclass","odd topAlign"); else - writer.writeAttribute("outputclass","even topAlign"); - writer.writeStartElement("entry"); - writer.writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","even topAlign"); + xmlWriter().writeStartElement("entry"); + xmlWriter().writeStartElement("p"); generateFullName(node, relative, marker); - writer.writeEndElement(); //

    - writer.writeEndElement(); // + xmlWriter().writeEndElement(); //

    + xmlWriter().writeEndElement(); // if (!(node->type() == Node::Fake)) { Text brief = node->doc().trimmedBriefText(name); if (!brief.isEmpty()) { - writer.writeStartElement("entry"); - writer.writeStartElement("p"); + xmlWriter().writeStartElement("entry"); + xmlWriter().writeStartElement("p"); generateText(brief, node, marker); - writer.writeEndElement(); //

    - writer.writeEndElement(); // + xmlWriter().writeEndElement(); //

    + xmlWriter().writeEndElement(); // } } else { - writer.writeStartElement("entry"); - writer.writeStartElement("p"); - writer.writeCharacters(protectEnc(node->doc().briefText().toString())); - writer.writeEndElement(); //

    - writer.writeEndElement(); // + xmlWriter().writeStartElement("entry"); + xmlWriter().writeStartElement("p"); + xmlWriter().writeCharacters(protectEnc(node->doc().briefText().toString())); + xmlWriter().writeEndElement(); //

    + xmlWriter().writeEndElement(); // } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } - writer.writeEndElement(); // - writer.writeEndElement(); // - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } /*! @@ -2484,27 +2483,27 @@ void DitaXmlGenerator::generateCompactList(const Node* relative, Output the alphabet as a row of links. */ if (includeAlphabet) { - writer.writeStartElement("p"); - writer.writeAttribute("outputclass","centerAlign functionIndex"); - writer.writeStartElement("b"); + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","centerAlign functionIndex"); + xmlWriter().writeStartElement("b"); for (int i = 0; i < 26; i++) { QChar ch('a' + i); if (usedParagraphNames.contains(char('a' + i))) { - writer.writeStartElement("xref"); - writer.writeAttribute("href",QString("#%1").arg(ch)); - writer.writeCharacters(QString(ch.toUpper())); - writer.writeEndElement(); // + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",QString("#%1").arg(ch)); + xmlWriter().writeCharacters(QString(ch.toUpper())); + xmlWriter().writeEndElement(); // } } - writer.writeEndElement(); // - writer.writeEndElement(); //

    + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); //

    } /* Output a

    element to contain all the

    elements. */ - writer.writeStartElement("p"); - writer.writeAttribute("outputclass","compactlist flowListDiv"); + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","compactlist flowListDiv"); for (int i=0; i 0) { - writer.writeEndElement(); // - writer.writeEndElement(); //
    + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } - writer.writeStartElement("dl"); + xmlWriter().writeStartElement("dl"); if (++numTableRows % 2 == 1) - writer.writeAttribute("outputclass","flowList odd"); + xmlWriter().writeAttribute("outputclass","flowList odd"); else - writer.writeAttribute("outputclass","flowList even"); - writer.writeStartElement("dlentry"); - writer.writeStartElement("dt"); - writer.writeAttribute("outputclass","alphaChar"); + xmlWriter().writeAttribute("outputclass","flowList even"); + xmlWriter().writeStartElement("dlentry"); + xmlWriter().writeStartElement("dt"); + xmlWriter().writeAttribute("outputclass","alphaChar"); if (includeAlphabet) { QChar c = paragraphName[curParNr][0].toLower(); - writer.writeStartElement("a"); - writer.writeAttribute("name",c); + xmlWriter().writeStartElement("a"); + xmlWriter().writeAttribute("name",c); } - writer.writeStartElement("b"); - writer.writeCharacters(paragraphName[curParNr]); - writer.writeEndElement(); // - writer.writeEndElement(); // + xmlWriter().writeStartElement("b"); + xmlWriter().writeCharacters(paragraphName[curParNr]); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } /* Output a
    for the current offset in the current paragraph. */ - writer.writeStartElement("dd"); + xmlWriter().writeStartElement("dd"); if ((curParNr < NumParagraphs) && !paragraphName[curParNr].isEmpty()) { NodeMap::Iterator it; @@ -2555,74 +2554,74 @@ void DitaXmlGenerator::generateCompactList(const Node* relative, Previously, we used generateFullName() for this, but we require some special formatting. */ - writer.writeStartElement("xref"); - writer.writeAttribute("href",linkForNode(it.value(), relative)); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",linkForNode(it.value(), relative)); QStringList pieces; if (it.value()->subType() == Node::QmlClass) pieces << it.value()->name(); else pieces = fullName(it.value(), relative, marker).split("::"); - writer.writeCharacters(protectEnc(pieces.last())); - writer.writeEndElement(); // + xmlWriter().writeCharacters(protectEnc(pieces.last())); + xmlWriter().writeEndElement(); // if (pieces.size() > 1) { - writer.writeCharacters(" ("); + xmlWriter().writeCharacters(" ("); generateFullName(it.value()->parent(),relative,marker); - writer.writeCharacters(")"); + xmlWriter().writeCharacters(")"); } } - writer.writeEndElement(); //
    + xmlWriter().writeEndElement(); // curParOffset++; } - writer.writeEndElement(); // - writer.writeEndElement(); // - writer.writeEndElement(); //

    + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); //

    } void DitaXmlGenerator::generateFunctionIndex(const Node* relative, CodeMarker* marker) { - writer.writeStartElement("p"); - writer.writeAttribute("outputclass","centerAlign functionIndex"); - writer.writeStartElement("b"); + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","centerAlign functionIndex"); + xmlWriter().writeStartElement("b"); for (int i = 0; i < 26; i++) { QChar ch('a' + i); - writer.writeStartElement("xref"); - writer.writeAttribute("href",QString("#%1").arg(ch)); - writer.writeCharacters(QString(ch.toUpper())); - writer.writeEndElement(); // + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",QString("#%1").arg(ch)); + xmlWriter().writeCharacters(QString(ch.toUpper())); + xmlWriter().writeEndElement(); // } - writer.writeEndElement(); // - writer.writeEndElement(); //

    + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); //

    char nextLetter = 'a'; char currentLetter; - writer.writeStartElement("ul"); + xmlWriter().writeStartElement("ul"); QMap::ConstIterator f = funcIndex.begin(); while (f != funcIndex.end()) { - writer.writeStartElement("li"); + xmlWriter().writeStartElement("li"); currentLetter = f.key()[0].unicode(); while (islower(currentLetter) && currentLetter >= nextLetter) { - writer.writeStartElement("p"); + xmlWriter().writeStartElement("p"); writeGuidAttribute(QString(nextLetter)); - writer.writeAttribute("outputclass","target"); - writer.writeCharacters(QString(nextLetter)); - writer.writeEndElement(); //

    + xmlWriter().writeAttribute("outputclass","target"); + xmlWriter().writeCharacters(QString(nextLetter)); + xmlWriter().writeEndElement(); //

    nextLetter++; } - writer.writeCharacters(protectEnc(f.key())); - writer.writeCharacters(":"); + xmlWriter().writeCharacters(protectEnc(f.key())); + xmlWriter().writeCharacters(":"); NodeMap::ConstIterator s = (*f).begin(); while (s != (*f).end()) { generateFullName((*s)->parent(), relative, marker, *s); ++s; } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // ++f; } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } void DitaXmlGenerator::generateLegaleseList(const Node *relative, @@ -2807,24 +2806,24 @@ void DitaXmlGenerator::generateSection(const NodeList& nl, name_alignment = false; } if (name_alignment) { - writer.writeStartElement("table"); - writer.writeAttribute("outputclass","alignedsummary"); - writer.writeStartElement("tgroup"); - writer.writeAttribute("cols","2"); - writer.writeStartElement("tbody"); + xmlWriter().writeStartElement("table"); + xmlWriter().writeAttribute("outputclass","alignedsummary"); + xmlWriter().writeStartElement("tgroup"); + xmlWriter().writeAttribute("cols","2"); + xmlWriter().writeStartElement("tbody"); } else { if (twoColumn) { - writer.writeStartElement("table"); - writer.writeAttribute("outputclass","propsummary"); - writer.writeStartElement("tgroup"); - writer.writeAttribute("cols","1"); - writer.writeStartElement("tbody"); - writer.writeStartElement("row"); - writer.writeStartElement("entry"); - writer.writeAttribute("outputclass","topAlign"); + xmlWriter().writeStartElement("table"); + xmlWriter().writeAttribute("outputclass","propsummary"); + xmlWriter().writeStartElement("tgroup"); + xmlWriter().writeAttribute("cols","1"); + xmlWriter().writeStartElement("tbody"); + xmlWriter().writeStartElement("row"); + xmlWriter().writeStartElement("entry"); + xmlWriter().writeAttribute("outputclass","topAlign"); } - writer.writeStartElement("ul"); + xmlWriter().writeStartElement("ul"); } int i = 0; @@ -2836,144 +2835,78 @@ void DitaXmlGenerator::generateSection(const NodeList& nl, } if (name_alignment) { - writer.writeStartElement("row"); - writer.writeStartElement("entry"); - writer.writeAttribute("outputclass","memItemLeft rightAlign topAlign"); + xmlWriter().writeStartElement("row"); + xmlWriter().writeStartElement("entry"); + xmlWriter().writeAttribute("outputclass","memItemLeft rightAlign topAlign"); } else { if (twoColumn && i == (int) (nl.count() + 1) / 2) { - writer.writeEndElement(); // - writer.writeEndElement(); //
    - writer.writeStartElement("entry"); - writer.writeAttribute("outputclass","topAlign"); - writer.writeStartElement("ul"); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); //
    + xmlWriter().writeStartElement("entry"); + xmlWriter().writeAttribute("outputclass","topAlign"); + xmlWriter().writeStartElement("ul"); } - writer.writeStartElement("li"); - writer.writeAttribute("outputclass","fn"); + xmlWriter().writeStartElement("li"); + xmlWriter().writeAttribute("outputclass","fn"); } QString marked = getMarkedUpSynopsis(*m, relative, marker, style); writeText(marked, marker, relative, name_alignment); if (name_alignment) { - writer.writeEndElement(); //
    - writer.writeEndElement(); // + xmlWriter().writeEndElement(); //
    + xmlWriter().writeEndElement(); // } else { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } i++; ++m; } if (name_alignment) { - writer.writeEndElement(); // - writer.writeEndElement(); // - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } else { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // if (twoColumn) { - writer.writeEndElement(); //
    - writer.writeEndElement(); // - writer.writeEndElement(); // - writer.writeEndElement(); // - writer.writeEndElement(); // + xmlWriter().writeEndElement(); //
    + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } } } } -void DitaXmlGenerator::generateSectionList(const Section& section, - const Node* relative, - CodeMarker* marker, - CodeMarker::SynopsisStyle style) -{ - bool name_alignment = true; - if (!section.members.isEmpty()) { - bool twoColumn = false; - if (style == CodeMarker::SeparateList) { - name_alignment = false; - twoColumn = (section.members.count() >= 16); - } - else if (section.members.first()->type() == Node::Property) { - twoColumn = (section.members.count() >= 5); - name_alignment = false; - } - if (name_alignment) { - out() << "\n"; - } - else { - if (twoColumn) - out() << "
    \n" - << "\n"; - else - out() << "\n"; - i++; - ++m; - } - if (name_alignment) - out() << "
    "; - out() << "
      \n"; - } - - int i = 0; - NodeList::ConstIterator m = section.members.begin(); - while (m != section.members.end()) { - if ((*m)->access() == Node::Private) { - ++m; - continue; - } - - if (name_alignment) { - out() << "
    "; - } - else { - if (twoColumn && i == (int) (section.members.count() + 1) / 2) - out() << "
      \n"; - out() << "
    • "; - } - - QString marked = getMarkedUpSynopsis(*m, relative, marker, style); - writeText(marked, marker, relative, name_alignment); - if (name_alignment) - out() << "
    \n"; - else { - out() << "\n"; - if (twoColumn) - out() << "\n\n"; - } - } - - if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { - out() << "
      \n"; - generateSectionInheritedList(section, relative, marker, name_alignment); - out() << "
    \n"; - } -} - +/*! + Writes the "inherited from" lists. + */ void DitaXmlGenerator::generateSectionInheritedList(const Section& section, const Node* relative, - CodeMarker* marker, - bool nameAlignment) + CodeMarker* marker) { + if (section.inherited.isEmpty()) + return; + xmlWriter().writeStartElement("ul"); QList >::ConstIterator p = section.inherited.begin(); while (p != section.inherited.end()) { - if (nameAlignment) - out() << "
  • "; + xmlWriter().writeStartElement("li"); + xmlWriter().writeAttribute("outputclass","fn"); + QString text = (*p).second + " "; + if ((*p).second == 1) + text += section.singularMember; else - out() << "
  • "; - out() << (*p).second << " "; - if ((*p).second == 1) { - out() << section.singularMember; - } - else { - out() << section.pluralMember; - } - out() << " inherited from " - << protectEnc(marker->plainFullName((*p).first, relative)) - << "
  • \n"; + text += section.pluralMember; + text += " inherited from "; + text += protectEnc(marker->plainFullName((*p).first, relative)) + ""; + xmlWriter().writeCharacters(text); ++p; } + xmlWriter().writeEndElement(); // } /*! @@ -3044,12 +2977,12 @@ void DitaXmlGenerator::writeText(const QString& markedCode, if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { if (nameAlignment && !done) {// && (i != 0)) Why was this here? if (!html.isEmpty()) { - writer.writeCharacters(html); + xmlWriter().writeCharacters(html); html.clear(); } - writer.writeEndElement(); // - writer.writeStartElement("entry"); - writer.writeAttribute("outputclass=","memItemRight bottomAlign"); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement("entry"); + xmlWriter().writeAttribute("outputclass=","memItemRight bottomAlign"); done = true; } i += 2; @@ -3166,7 +3099,7 @@ void DitaXmlGenerator::writeText(const QString& markedCode, } } if (!html.isEmpty()) - writer.writeCharacters(html); + xmlWriter().writeCharacters(html); } void DitaXmlGenerator::generateLink(const Atom* atom, @@ -3178,33 +3111,33 @@ void DitaXmlGenerator::generateLink(const Atom* atom, if (funcLeftParen.indexIn(atom->string()) != -1 && marker->recognizeLanguage("Cpp")) { // hack for C++: move () outside of link int k = funcLeftParen.pos(1); - writer.writeCharacters(protectEnc(atom->string().left(k))); + xmlWriter().writeCharacters(protectEnc(atom->string().left(k))); if (link.isEmpty()) { if (showBrokenLinks) - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } else { - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } inLink = false; - writer.writeCharacters(protectEnc(atom->string().mid(k))); + xmlWriter().writeCharacters(protectEnc(atom->string().mid(k))); } else if (marker->recognizeLanguage("Java")) { // hack for Java: remove () and use when appropriate bool func = atom->string().endsWith("()"); bool tt = (func || atom->string().contains(camelCase)); if (tt) - writer.writeStartElement("tt"); + xmlWriter().writeStartElement("tt"); if (func) { - writer.writeCharacters(protectEnc(atom->string().left(atom->string().length() - 2))); + xmlWriter().writeCharacters(protectEnc(atom->string().left(atom->string().length() - 2))); } else { - writer.writeCharacters(protectEnc(atom->string())); + xmlWriter().writeCharacters(protectEnc(atom->string())); } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } else { - writer.writeCharacters(protectEnc(atom->string())); + xmlWriter().writeCharacters(protectEnc(atom->string())); } } @@ -3478,22 +3411,22 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode, { if (actualNode == 0) actualNode = apparentNode; - writer.writeStartElement("xref"); - writer.writeAttribute("href",linkForNode(actualNode, relative)); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",linkForNode(actualNode, relative)); if (true || relative == 0 || relative->status() != actualNode->status()) { switch (actualNode->status()) { case Node::Obsolete: - writer.writeAttribute("outputclass","obsolete"); + xmlWriter().writeAttribute("outputclass","obsolete"); break; case Node::Compat: - writer.writeAttribute("outputclass","compat"); + xmlWriter().writeAttribute("outputclass","compat"); break; default: ; } } - writer.writeCharacters(protectEnc(fullName(apparentNode, relative, marker))); - writer.writeEndElement(); // + xmlWriter().writeCharacters(protectEnc(fullName(apparentNode, relative, marker))); + xmlWriter().writeEndElement(); // } void DitaXmlGenerator::generateDetailedMember(const Node* node, @@ -3505,21 +3438,25 @@ void DitaXmlGenerator::generateDetailedMember(const Node* node, if ((node->type() == Node::Enum) && (en = static_cast(node))->flagsType()) { - out() << "

    "; - out() << ""; + xmlWriter().writeStartElement("p"); + writeGuidAttribute(refForNode(node)); + xmlWriter().writeAttribute("outputclass","h3 flags"); + xmlWriter().writeCharacters(refForNode(node)); marked = getMarkedUpSynopsis(en, relative, marker, CodeMarker::Detailed); writeText(marked, marker, relative); - out() << "
    "; + xmlWriter().writeCharacters("\n"); marked = getMarkedUpSynopsis(en->flagsType(),relative,marker,CodeMarker::Detailed); writeText(marked,marker,relative); - out() << "

    \n"; + xmlWriter().writeEndElement(); //

    } else { - out() << "

    "; - out() << ""; - marked = getMarkedUpSynopsis(node,relative,marker,CodeMarker::Detailed); - writeText(marked,marker,relative); - out() << "

    \n"; + xmlWriter().writeStartElement("p"); + writeGuidAttribute(refForNode(node)); + xmlWriter().writeAttribute("outputclass","h3 fn"); + xmlWriter().writeCharacters(refForNode(node)); + marked = getMarkedUpSynopsis(node, relative, marker, CodeMarker::Detailed); + writeText(marked, marker, relative); + xmlWriter().writeEndElement(); //

    } generateStatus(node, marker); @@ -3536,29 +3473,34 @@ void DitaXmlGenerator::generateDetailedMember(const Node* node, section.members += property->resetters(); if (!section.members.isEmpty()) { - out() << "

    Access functions:

    \n"; - generateSectionList(section, node, marker, CodeMarker::Accessors); + xmlWriter().writeStartElement("p"); + xmlWriter().writeCharacters("Access functions:"); + xmlWriter().writeEndElement(); //

    + generateSection(section.members, node, marker, CodeMarker::Accessors); } Section notifiers; notifiers.members += property->notifiers(); if (!notifiers.members.isEmpty()) { - out() << "

    Notifier signal:

    \n"; - //out() << "

    This signal is emitted when the property value is changed.

    \n"; - generateSectionList(notifiers, node, marker, CodeMarker::Accessors); + xmlWriter().writeStartElement("p"); + xmlWriter().writeCharacters("Notifier signal:"); + xmlWriter().writeEndElement(); //

    + generateSection(notifiers.members, node, marker, CodeMarker::Accessors); } } else if (node->type() == Node::Enum) { en = static_cast(node); if (en->flagsType()) { - out() << "

    The " << protectEnc(en->flagsType()->name()) - << " type is a typedef for " - << "QFlags<" - << protectEnc(en->name()) - << ">. It stores an OR combination of " - << protectEnc(en->name()) - << " values.

    \n"; + xmlWriter().writeStartElement("p"); + QString text = "The " + protectEnc(en->flagsType()->name()) + + " type is a typedef for " + + "QFlags<" + + protectEnc(en->name()) + + ">. It stores an OR combination of " + + protectEnc(en->name()) + " values."; + xmlWriter().writeCharacters(text); + xmlWriter().writeEndElement(); //

    } } generateAlsoList(node, marker); @@ -3984,28 +3926,28 @@ void DitaXmlGenerator::beginLink(const QString& link, this->link = link; if (link.isEmpty()) { if (showBrokenLinks) - writer.writeStartElement("i"); + xmlWriter().writeStartElement("i"); } else if (node == 0 || (relative != 0 && node->status() == relative->status())) { - writer.writeStartElement("xref"); - writer.writeAttribute("href",link); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",link); } else { switch (node->status()) { case Node::Obsolete: - writer.writeStartElement("xref"); - writer.writeAttribute("href",link); - writer.writeAttribute("outputclass","obsolete"); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",link); + xmlWriter().writeAttribute("outputclass","obsolete"); break; case Node::Compat: - writer.writeStartElement("xref"); - writer.writeAttribute("href",link); - writer.writeAttribute("outputclass","compat"); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",link); + xmlWriter().writeAttribute("outputclass","compat"); break; default: - writer.writeStartElement("xref"); - writer.writeAttribute("href",link); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",link); } } inLink = true; @@ -4016,15 +3958,15 @@ void DitaXmlGenerator::endLink() if (inLink) { if (link.isEmpty()) { if (showBrokenLinks) - writer.writeEndElement(); // i + xmlWriter().writeEndElement(); // i } else { if (inObsoleteLink) { - writer.writeStartElement("sup"); - writer.writeCharacters("(obsolete)"); - writer.writeEndElement(); // sup + xmlWriter().writeStartElement("sup"); + xmlWriter().writeCharacters("(obsolete)"); + xmlWriter().writeEndElement(); // sup } - writer.writeEndElement(); // xref + xmlWriter().writeEndElement(); // xref } } inLink = false; @@ -4273,130 +4215,6 @@ void DitaXmlGenerator::generateInstantiatedBy(const ClassNode* cn, } /*! - Generate the element for the given \a node using the \a writer. - Return true if a element was written; otherwise return false. - */ -bool DitaXmlGenerator::generatePageElement(QXmlStreamWriter& writer, - const Node* node, - CodeMarker* marker) const -{ - if (node->pageType() == Node::NoPageType) - return false; - if (node->name().isEmpty()) - return true; - if (node->access() == Node::Private) - return false; - if (!node->isInnerNode()) - return false; - - QString title; - QString rawTitle; - QString fullTitle; - const InnerNode* inner = static_cast(node); - - writer.writeStartElement("page"); - QXmlStreamAttributes attributes; - QString t; - t.setNum(id++); - switch (node->type()) { - case Node::Fake: - { - const FakeNode* fake = static_cast(node); - title = fake->fullTitle(); - break; - } - case Node::Class: - { - title = node->name() + " Class Reference"; - break; - } - case Node::Namespace: - { - rawTitle = marker->plainName(inner); - fullTitle = marker->plainFullName(inner); - title = rawTitle + " Namespace Reference"; - break; - } - default: - title = node->name(); - break; - } - writer.writeAttribute("id",t); - writer.writeStartElement("pageWords"); - writer.writeCharacters(title); - if (!inner->pageKeywords().isEmpty()) { - const QStringList& w = inner->pageKeywords(); - for (int i = 0; i < w.size(); ++i) { - writer.writeCharacters(" "); - writer.writeCharacters(w.at(i).toLocal8Bit().constData()); - } - } - writer.writeEndElement(); - writer.writeStartElement("pageTitle"); - writer.writeCharacters(title); - writer.writeEndElement(); - writer.writeStartElement("pageUrl"); - writer.writeCharacters(PageGenerator::fileName(node)); - writer.writeEndElement(); - writer.writeStartElement("pageType"); - switch (node->pageType()) { - case Node::ApiPage: - writer.writeCharacters("APIPage"); - break; - case Node::ArticlePage: - writer.writeCharacters("Article"); - break; - case Node::ExamplePage: - writer.writeCharacters("Example"); - break; - default: - break; - } - writer.writeEndElement(); - writer.writeEndElement(); - return true; -} - -/*! - Traverse the tree recursively and generate the - elements. - */ -void DitaXmlGenerator::generatePageElements(QXmlStreamWriter& writer, const Node* node, CodeMarker* marker) const -{ - if (generatePageElement(writer, node, marker)) { - - if (node->isInnerNode()) { - const InnerNode *inner = static_cast(node); - - // Recurse to write an element for this child node and all its children. - foreach (const Node *child, inner->childNodes()) - generatePageElements(writer, child, marker); - } - } -} - -/*! - Outputs the file containing the index used for searching the html docs. - */ -void DitaXmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* marker) const -{ - QFile file(fileName); - if (!file.open(QFile::WriteOnly | QFile::Text)) - return ; - - QXmlStreamWriter writer(&file); - writer.setAutoFormatting(true); - writer.writeStartDocument(); - writer.writeStartElement("qtPageIndex"); - - generatePageElements(writer, myTree->root(), marker); - - writer.writeEndElement(); // qtPageIndex - writer.writeEndDocument(); - file.close(); -} - -/*! Return the full qualification of the node \a n, but without the name of \a n itself. e.g. A::B::C */ @@ -4447,31 +4265,31 @@ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker) int index; if (!cn->baseClasses().isEmpty()) { - writer.writeStartElement(CXXCLASSDERIVATIONS); + xmlWriter().writeStartElement(CXXCLASSDERIVATIONS); r = cn->baseClasses().begin(); index = 0; while (r != cn->baseClasses().end()) { - writer.writeStartElement(CXXCLASSDERIVATION); - writer.writeStartElement(CXXCLASSDERIVATIONACCESSSPECIFIER); - writer.writeAttribute("value",(*r).accessString()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXCLASSDERIVATION); + xmlWriter().writeStartElement(CXXCLASSDERIVATIONACCESSSPECIFIER); + xmlWriter().writeAttribute("value",(*r).accessString()); + xmlWriter().writeEndElement(); // // not included: - writer.writeStartElement(CXXCLASSBASECLASS); - writer.writeAttribute("href",(*r).node->ditaXmlHref()); - writer.writeCharacters(marker->plainFullName((*r).node)); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXCLASSBASECLASS); + xmlWriter().writeAttribute("href",(*r).node->ditaXmlHref()); + xmlWriter().writeCharacters(marker->plainFullName((*r).node)); + xmlWriter().writeEndElement(); // // not included: or - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: ++r; } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } } @@ -4509,21 +4327,21 @@ void DitaXmlGenerator::writeLocation(const Node* n) s2 = CXXVARIABLEDECLARATIONFILE; s3 = CXXVARIABLEDECLARATIONFILELINE; } - writer.writeStartElement(s1); - writer.writeStartElement(s2); - writer.writeAttribute("name","filePath"); - writer.writeAttribute("value",n->location().filePath()); - writer.writeEndElement(); // DeclarationFile> - writer.writeStartElement(s3); - writer.writeAttribute("name","lineNumber"); + xmlWriter().writeStartElement(s1); + xmlWriter().writeStartElement(s2); + xmlWriter().writeAttribute("name","filePath"); + xmlWriter().writeAttribute("value",n->location().filePath()); + xmlWriter().writeEndElement(); // DeclarationFile> + xmlWriter().writeStartElement(s3); + xmlWriter().writeAttribute("name","lineNumber"); QString lineNr; - writer.writeAttribute("value",lineNr.setNum(n->location().lineNo())); - writer.writeEndElement(); // DeclarationFileLine> + xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo())); + xmlWriter().writeEndElement(); // DeclarationFileLine> // not included: , , // and - writer.writeEndElement(); // ApiItemLocation> + xmlWriter().writeEndElement(); // ApiItemLocation> } /*! @@ -4537,88 +4355,88 @@ void DitaXmlGenerator::writeFunctions(const Section& s, while (m != s.members.end()) { if ((*m)->type() == Node::Function) { FunctionNode* fn = const_cast(static_cast(*m)); - writer.writeStartElement(CXXFUNCTION); - writer.writeAttribute("id",fn->guid()); - writer.writeStartElement(APINAME); + xmlWriter().writeStartElement(CXXFUNCTION); + xmlWriter().writeAttribute("id",fn->guid()); + xmlWriter().writeStartElement(APINAME); if (fn->metaness() == FunctionNode::Signal) - writer.writeAttribute("class","signal"); + xmlWriter().writeAttribute("class","signal"); else if (fn->metaness() == FunctionNode::Slot) - writer.writeAttribute("class","slot"); - writer.writeCharacters(fn->name()); - writer.writeEndElement(); // + xmlWriter().writeAttribute("class","slot"); + xmlWriter().writeCharacters(fn->name()); + xmlWriter().writeEndElement(); // generateBrief(fn,marker); // not included: - writer.writeStartElement(CXXFUNCTIONDETAIL); - writer.writeStartElement(CXXFUNCTIONDEFINITION); - writer.writeStartElement(CXXFUNCTIONACCESSSPECIFIER); - writer.writeAttribute("value",fn->accessString()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONDETAIL); + xmlWriter().writeStartElement(CXXFUNCTIONDEFINITION); + xmlWriter().writeStartElement(CXXFUNCTIONACCESSSPECIFIER); + xmlWriter().writeAttribute("value",fn->accessString()); + xmlWriter().writeEndElement(); // // not included: if (fn->isStatic()) { - writer.writeStartElement(CXXFUNCTIONSTORAGECLASSSPECIFIERSTATIC); - writer.writeAttribute("name","static"); - writer.writeAttribute("value","static"); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONSTORAGECLASSSPECIFIERSTATIC); + xmlWriter().writeAttribute("name","static"); + xmlWriter().writeAttribute("value","static"); + xmlWriter().writeEndElement(); // } // not included: , if (fn->isConst()) { - writer.writeStartElement(CXXFUNCTIONCONST); - writer.writeAttribute("name","const"); - writer.writeAttribute("value","const"); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONCONST); + xmlWriter().writeAttribute("name","const"); + xmlWriter().writeAttribute("value","const"); + xmlWriter().writeEndElement(); // } // not included: // virtualness() != FunctionNode::NonVirtual) { - writer.writeStartElement(CXXFUNCTIONVIRTUAL); - writer.writeAttribute("name","virtual"); - writer.writeAttribute("value","virtual"); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONVIRTUAL); + xmlWriter().writeAttribute("name","virtual"); + xmlWriter().writeAttribute("value","virtual"); + xmlWriter().writeEndElement(); // if (fn->virtualness() == FunctionNode::PureVirtual) { - writer.writeStartElement(CXXFUNCTIONPUREVIRTUAL); - writer.writeAttribute("name","pure virtual"); - writer.writeAttribute("value","pure virtual"); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONPUREVIRTUAL); + xmlWriter().writeAttribute("name","pure virtual"); + xmlWriter().writeAttribute("value","pure virtual"); + xmlWriter().writeEndElement(); // } } if (fn->name() == cn->name()) { - writer.writeStartElement(CXXFUNCTIONCONSTRUCTOR); - writer.writeAttribute("name","constructor"); - writer.writeAttribute("value","constructor"); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONCONSTRUCTOR); + xmlWriter().writeAttribute("name","constructor"); + xmlWriter().writeAttribute("value","constructor"); + xmlWriter().writeEndElement(); // } else if (fn->name()[0] == QChar('~')) { - writer.writeStartElement(CXXFUNCTIONDESTRUCTOR); - writer.writeAttribute("name","destructor"); - writer.writeAttribute("value","destructor"); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONDESTRUCTOR); + xmlWriter().writeAttribute("name","destructor"); + xmlWriter().writeAttribute("value","destructor"); + xmlWriter().writeEndElement(); // } else { - writer.writeStartElement(CXXFUNCTIONDECLAREDTYPE); - writer.writeCharacters(fn->returnType()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONDECLAREDTYPE); + xmlWriter().writeCharacters(fn->returnType()); + xmlWriter().writeEndElement(); // } // not included: QString fq = fullQualification(fn); if (!fq.isEmpty()) { - writer.writeStartElement(CXXFUNCTIONSCOPEDNAME); - writer.writeCharacters(fq); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONSCOPEDNAME); + xmlWriter().writeCharacters(fq); + xmlWriter().writeEndElement(); // } - writer.writeStartElement(CXXFUNCTIONPROTOTYPE); - writer.writeCharacters(fn->signature(true)); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONPROTOTYPE); + xmlWriter().writeCharacters(fn->signature(true)); + xmlWriter().writeEndElement(); // QString fnl = fn->signature(false); int idx = fnl.indexOf(' '); @@ -4627,33 +4445,33 @@ void DitaXmlGenerator::writeFunctions(const Section& s, else ++idx; fnl = fn->parent()->name() + "::" + fnl.mid(idx); - writer.writeStartElement(CXXFUNCTIONNAMELOOKUP); - writer.writeCharacters(fnl); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONNAMELOOKUP); + xmlWriter().writeCharacters(fnl); + xmlWriter().writeEndElement(); // if (fn->isReimp() && fn->reimplementedFrom() != 0) { FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom(); - writer.writeStartElement(CXXFUNCTIONREIMPLEMENTED); - writer.writeAttribute("href",rfn->ditaXmlHref()); - writer.writeCharacters(marker->plainFullName(rfn)); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONREIMPLEMENTED); + xmlWriter().writeAttribute("href",rfn->ditaXmlHref()); + xmlWriter().writeCharacters(marker->plainFullName(rfn)); + xmlWriter().writeEndElement(); // } writeParameters(fn,marker); writeLocation(fn); - writer.writeEndElement(); // - writer.writeStartElement(APIDESC); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement(APIDESC); if (!fn->doc().isEmpty()) { generateBody(fn, marker); // generateAlsoList(inner, marker); } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: ,
    , or - writer.writeEndElement(); // - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // if (fn->metaness() == FunctionNode::Ctor || fn->metaness() == FunctionNode::Dtor || @@ -4671,33 +4489,33 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke { const QList& parameters = fn->parameters(); if (!parameters.isEmpty()) { - writer.writeStartElement(CXXFUNCTIONPARAMETERS); + xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERS); QList::ConstIterator p = parameters.begin(); while (p != parameters.end()) { - writer.writeStartElement(CXXFUNCTIONPARAMETER); - writer.writeStartElement(CXXFUNCTIONPARAMETERDECLAREDTYPE); - writer.writeCharacters((*p).leftType()); + xmlWriter().writeStartElement(CXXFUNCTIONPARAMETER); + xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERDECLAREDTYPE); + xmlWriter().writeCharacters((*p).leftType()); if (!(*p).rightType().isEmpty()) - writer.writeCharacters((*p).rightType()); - writer.writeEndElement(); // - writer.writeStartElement(CXXFUNCTIONPARAMETERDECLARATIONNAME); - writer.writeCharacters((*p).name()); - writer.writeEndElement(); // + xmlWriter().writeCharacters((*p).rightType()); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERDECLARATIONNAME); + xmlWriter().writeCharacters((*p).name()); + xmlWriter().writeEndElement(); // // not included: if (!(*p).defaultValue().isEmpty()) { - writer.writeStartElement(CXXFUNCTIONPARAMETERDEFAULTVALUE); - writer.writeCharacters((*p).defaultValue()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERDEFAULTVALUE); + xmlWriter().writeCharacters((*p).defaultValue()); + xmlWriter().writeEndElement(); // } // not included: - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // ++p; } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } } @@ -4712,111 +4530,111 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, while (m != s.members.end()) { if ((*m)->type() == Node::Enum) { const EnumNode* en = static_cast(*m); - writer.writeStartElement(CXXENUMERATION); - writer.writeAttribute("id",en->guid()); - writer.writeStartElement(APINAME); - writer.writeCharacters(en->name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXENUMERATION); + xmlWriter().writeAttribute("id",en->guid()); + xmlWriter().writeStartElement(APINAME); + xmlWriter().writeCharacters(en->name()); + xmlWriter().writeEndElement(); // generateBrief(en,marker); // not included - writer.writeStartElement(CXXENUMERATIONDETAIL); - writer.writeStartElement(CXXENUMERATIONDEFINITION); - writer.writeStartElement(CXXENUMERATIONACCESSSPECIFIER); - writer.writeAttribute("value",en->accessString()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXENUMERATIONDETAIL); + xmlWriter().writeStartElement(CXXENUMERATIONDEFINITION); + xmlWriter().writeStartElement(CXXENUMERATIONACCESSSPECIFIER); + xmlWriter().writeAttribute("value",en->accessString()); + xmlWriter().writeEndElement(); // QString fq = fullQualification(en); if (!fq.isEmpty()) { - writer.writeStartElement(CXXENUMERATIONSCOPEDNAME); - writer.writeCharacters(fq); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXENUMERATIONSCOPEDNAME); + xmlWriter().writeCharacters(fq); + xmlWriter().writeEndElement(); // } const QList& items = en->items(); if (!items.isEmpty()) { - writer.writeStartElement(CXXENUMERATIONPROTOTYPE); - writer.writeCharacters(en->name()); - writer.writeCharacters(" = { "); + xmlWriter().writeStartElement(CXXENUMERATIONPROTOTYPE); + xmlWriter().writeCharacters(en->name()); + xmlWriter().writeCharacters(" = { "); QList::ConstIterator i = items.begin(); while (i != items.end()) { - writer.writeCharacters((*i).name()); + xmlWriter().writeCharacters((*i).name()); if (!(*i).value().isEmpty()) { - writer.writeCharacters(" = "); - writer.writeCharacters((*i).value()); + xmlWriter().writeCharacters(" = "); + xmlWriter().writeCharacters((*i).value()); } ++i; if (i != items.end()) - writer.writeCharacters(", "); + xmlWriter().writeCharacters(", "); } - writer.writeCharacters(" }"); - writer.writeEndElement(); // + xmlWriter().writeCharacters(" }"); + xmlWriter().writeEndElement(); // } - writer.writeStartElement(CXXENUMERATIONNAMELOOKUP); - writer.writeCharacters(en->parent()->name() + "::" + en->name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXENUMERATIONNAMELOOKUP); + xmlWriter().writeCharacters(en->parent()->name() + "::" + en->name()); + xmlWriter().writeEndElement(); // // not included: if (!items.isEmpty()) { - writer.writeStartElement(CXXENUMERATORS); + xmlWriter().writeStartElement(CXXENUMERATORS); QList::ConstIterator i = items.begin(); while (i != items.end()) { - writer.writeStartElement(CXXENUMERATOR); - writer.writeStartElement(APINAME); - writer.writeCharacters((*i).name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXENUMERATOR); + xmlWriter().writeStartElement(APINAME); + xmlWriter().writeCharacters((*i).name()); + xmlWriter().writeEndElement(); // QString fq = fullQualification(en->parent()); if (!fq.isEmpty()) { - writer.writeStartElement(CXXENUMERATORSCOPEDNAME); - writer.writeCharacters(fq + "::" + (*i).name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXENUMERATORSCOPEDNAME); + xmlWriter().writeCharacters(fq + "::" + (*i).name()); + xmlWriter().writeEndElement(); // } - writer.writeStartElement(CXXENUMERATORPROTOTYPE); - writer.writeCharacters((*i).name()); - writer.writeEndElement(); // - writer.writeStartElement(CXXENUMERATORNAMELOOKUP); - writer.writeCharacters(en->parent()->name() + "::" + (*i).name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXENUMERATORPROTOTYPE); + xmlWriter().writeCharacters((*i).name()); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement(CXXENUMERATORNAMELOOKUP); + xmlWriter().writeCharacters(en->parent()->name() + "::" + (*i).name()); + xmlWriter().writeEndElement(); // if (!(*i).value().isEmpty()) { - writer.writeStartElement(CXXENUMERATORINITIALISER); - writer.writeAttribute("value", (*i).value()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXENUMERATORINITIALISER); + xmlWriter().writeAttribute("value", (*i).value()); + xmlWriter().writeEndElement(); // } // not included: if (!(*i).text().isEmpty()) { - writer.writeStartElement(APIDESC); + xmlWriter().writeStartElement(APIDESC); generateText((*i).text(), en, marker); - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // ++i; } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } writeLocation(en); - writer.writeEndElement(); // - writer.writeStartElement(APIDESC); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement(APIDESC); if (!en->doc().isEmpty()) { generateBody(en, marker); } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: ,
    , or - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } ++m; } @@ -4833,55 +4651,55 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, while (m != s.members.end()) { if ((*m)->type() == Node::Typedef) { const TypedefNode* tn = static_cast(*m); - writer.writeStartElement(CXXTYPEDEF); - writer.writeAttribute("id",tn->guid()); - writer.writeStartElement(APINAME); - writer.writeCharacters(tn->name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXTYPEDEF); + xmlWriter().writeAttribute("id",tn->guid()); + xmlWriter().writeStartElement(APINAME); + xmlWriter().writeCharacters(tn->name()); + xmlWriter().writeEndElement(); // generateBrief(tn,marker); // not included: - writer.writeStartElement(CXXTYPEDEFDETAIL); - writer.writeStartElement(CXXTYPEDEFDEFINITION); - writer.writeStartElement(CXXTYPEDEFACCESSSPECIFIER); - writer.writeAttribute("value",tn->accessString()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXTYPEDEFDETAIL); + xmlWriter().writeStartElement(CXXTYPEDEFDEFINITION); + xmlWriter().writeStartElement(CXXTYPEDEFACCESSSPECIFIER); + xmlWriter().writeAttribute("value",tn->accessString()); + xmlWriter().writeEndElement(); // // not included: QString fq = fullQualification(tn); if (!fq.isEmpty()) { - writer.writeStartElement(CXXTYPEDEFSCOPEDNAME); - writer.writeCharacters(fq); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXTYPEDEFSCOPEDNAME); + xmlWriter().writeCharacters(fq); + xmlWriter().writeEndElement(); // } // not included: - writer.writeStartElement(CXXTYPEDEFNAMELOOKUP); - writer.writeCharacters(tn->parent()->name() + "::" + tn->name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXTYPEDEFNAMELOOKUP); + xmlWriter().writeCharacters(tn->parent()->name() + "::" + tn->name()); + xmlWriter().writeEndElement(); // // not included: writeLocation(tn); - writer.writeEndElement(); // - writer.writeStartElement(APIDESC); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement(APIDESC); if (!tn->doc().isEmpty()) { generateBody(tn, marker); } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: ,
    , or - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } ++m; } @@ -4899,20 +4717,20 @@ void DitaXmlGenerator::writeProperties(const Section& s, while (m != s.members.end()) { if ((*m)->type() == Node::Property) { const PropertyNode* pn = static_cast(*m); - writer.writeStartElement(CXXVARIABLE); - writer.writeAttribute("id",pn->guid()); - writer.writeStartElement(APINAME); - writer.writeCharacters(pn->name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLE); + xmlWriter().writeAttribute("id",pn->guid()); + xmlWriter().writeStartElement(APINAME); + xmlWriter().writeCharacters(pn->name()); + xmlWriter().writeEndElement(); // generateBrief(pn,marker); // not included: - writer.writeStartElement(CXXVARIABLEDETAIL); - writer.writeStartElement(CXXVARIABLEDEFINITION); - writer.writeStartElement(CXXVARIABLEACCESSSPECIFIER); - writer.writeAttribute("value",pn->accessString()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLEDETAIL); + xmlWriter().writeStartElement(CXXVARIABLEDEFINITION); + xmlWriter().writeStartElement(CXXVARIABLEACCESSSPECIFIER); + xmlWriter().writeAttribute("value",pn->accessString()); + xmlWriter().writeEndElement(); // // not included: , // , @@ -4920,84 +4738,84 @@ void DitaXmlGenerator::writeProperties(const Section& s, // , if (!pn->qualifiedDataType().isEmpty()) { - writer.writeStartElement(CXXVARIABLEDECLAREDTYPE); - writer.writeCharacters(pn->qualifiedDataType()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLEDECLAREDTYPE); + xmlWriter().writeCharacters(pn->qualifiedDataType()); + xmlWriter().writeEndElement(); // } QString fq = fullQualification(pn); if (!fq.isEmpty()) { - writer.writeStartElement(CXXVARIABLESCOPEDNAME); - writer.writeCharacters(fq); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLESCOPEDNAME); + xmlWriter().writeCharacters(fq); + xmlWriter().writeEndElement(); // } - writer.writeStartElement(CXXVARIABLEPROTOTYPE); - writer.writeCharacters("Q_PROPERTY("); - writer.writeCharacters(pn->qualifiedDataType()); - writer.writeCharacters(" "); - writer.writeCharacters(pn->name()); + xmlWriter().writeStartElement(CXXVARIABLEPROTOTYPE); + xmlWriter().writeCharacters("Q_PROPERTY("); + xmlWriter().writeCharacters(pn->qualifiedDataType()); + xmlWriter().writeCharacters(" "); + xmlWriter().writeCharacters(pn->name()); writePropertyParameter("READ",pn->getters()); writePropertyParameter("WRITE",pn->setters()); writePropertyParameter("RESET",pn->resetters()); writePropertyParameter("NOTIFY",pn->notifiers()); if (pn->isDesignable() != pn->designableDefault()) { - writer.writeCharacters(" DESIGNABLE "); + xmlWriter().writeCharacters(" DESIGNABLE "); if (!pn->runtimeDesignabilityFunction().isEmpty()) - writer.writeCharacters(pn->runtimeDesignabilityFunction()); + xmlWriter().writeCharacters(pn->runtimeDesignabilityFunction()); else - writer.writeCharacters(pn->isDesignable() ? "true" : "false"); + xmlWriter().writeCharacters(pn->isDesignable() ? "true" : "false"); } if (pn->isScriptable() != pn->scriptableDefault()) { - writer.writeCharacters(" SCRIPTABLE "); + xmlWriter().writeCharacters(" SCRIPTABLE "); if (!pn->runtimeScriptabilityFunction().isEmpty()) - writer.writeCharacters(pn->runtimeScriptabilityFunction()); + xmlWriter().writeCharacters(pn->runtimeScriptabilityFunction()); else - writer.writeCharacters(pn->isScriptable() ? "true" : "false"); + xmlWriter().writeCharacters(pn->isScriptable() ? "true" : "false"); } if (pn->isWritable() != pn->writableDefault()) { - writer.writeCharacters(" STORED "); - writer.writeCharacters(pn->isStored() ? "true" : "false"); + xmlWriter().writeCharacters(" STORED "); + xmlWriter().writeCharacters(pn->isStored() ? "true" : "false"); } if (pn->isUser() != pn->userDefault()) { - writer.writeCharacters(" USER "); - writer.writeCharacters(pn->isUser() ? "true" : "false"); + xmlWriter().writeCharacters(" USER "); + xmlWriter().writeCharacters(pn->isUser() ? "true" : "false"); } if (pn->isConstant()) - writer.writeCharacters(" CONSTANT"); + xmlWriter().writeCharacters(" CONSTANT"); if (pn->isFinal()) - writer.writeCharacters(" FINAL"); - writer.writeCharacters(")"); - writer.writeEndElement(); // + xmlWriter().writeCharacters(" FINAL"); + xmlWriter().writeCharacters(")"); + xmlWriter().writeEndElement(); // - writer.writeStartElement(CXXVARIABLENAMELOOKUP); - writer.writeCharacters(pn->parent()->name() + "::" + pn->name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLENAMELOOKUP); + xmlWriter().writeCharacters(pn->parent()->name() + "::" + pn->name()); + xmlWriter().writeEndElement(); // if (pn->overriddenFrom() != 0) { PropertyNode* opn = (PropertyNode*)pn->overriddenFrom(); - writer.writeStartElement(CXXVARIABLEREIMPLEMENTED); - writer.writeAttribute("href",opn->ditaXmlHref()); - writer.writeCharacters(marker->plainFullName(opn)); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLEREIMPLEMENTED); + xmlWriter().writeAttribute("href",opn->ditaXmlHref()); + xmlWriter().writeCharacters(marker->plainFullName(opn)); + xmlWriter().writeEndElement(); // } writeLocation(pn); - writer.writeEndElement(); // - writer.writeStartElement(APIDESC); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement(APIDESC); if (!pn->doc().isEmpty()) { generateBody(pn, marker); } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: ,
    , or - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } ++m; } @@ -5014,77 +4832,77 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, while (m != s.members.end()) { if ((*m)->type() == Node::Variable) { const VariableNode* vn = static_cast(*m); - writer.writeStartElement(CXXVARIABLE); - writer.writeAttribute("id",vn->guid()); - writer.writeStartElement(APINAME); - writer.writeCharacters(vn->name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLE); + xmlWriter().writeAttribute("id",vn->guid()); + xmlWriter().writeStartElement(APINAME); + xmlWriter().writeCharacters(vn->name()); + xmlWriter().writeEndElement(); // generateBrief(vn,marker); // not included: - writer.writeStartElement(CXXVARIABLEDETAIL); - writer.writeStartElement(CXXVARIABLEDEFINITION); - writer.writeStartElement(CXXVARIABLEACCESSSPECIFIER); - writer.writeAttribute("value",vn->accessString()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLEDETAIL); + xmlWriter().writeStartElement(CXXVARIABLEDEFINITION); + xmlWriter().writeStartElement(CXXVARIABLEACCESSSPECIFIER); + xmlWriter().writeAttribute("value",vn->accessString()); + xmlWriter().writeEndElement(); // // not included: if (vn->isStatic()) { - writer.writeStartElement(CXXVARIABLESTORAGECLASSSPECIFIERSTATIC); - writer.writeAttribute("name","static"); - writer.writeAttribute("value","static"); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLESTORAGECLASSSPECIFIERSTATIC); + xmlWriter().writeAttribute("name","static"); + xmlWriter().writeAttribute("value","static"); + xmlWriter().writeEndElement(); // } // not included: , // , - writer.writeStartElement(CXXVARIABLEDECLAREDTYPE); - writer.writeCharacters(vn->leftType()); + xmlWriter().writeStartElement(CXXVARIABLEDECLAREDTYPE); + xmlWriter().writeCharacters(vn->leftType()); if (!vn->rightType().isEmpty()) - writer.writeCharacters(vn->rightType()); - writer.writeEndElement(); // + xmlWriter().writeCharacters(vn->rightType()); + xmlWriter().writeEndElement(); // QString fq = fullQualification(vn); if (!fq.isEmpty()) { - writer.writeStartElement(CXXVARIABLESCOPEDNAME); - writer.writeCharacters(fq); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLESCOPEDNAME); + xmlWriter().writeCharacters(fq); + xmlWriter().writeEndElement(); // } - writer.writeStartElement(CXXVARIABLEPROTOTYPE); - writer.writeCharacters(vn->leftType() + " "); - //writer.writeCharacters(vn->parent()->name() + "::" + vn->name()); - writer.writeCharacters(vn->name()); + xmlWriter().writeStartElement(CXXVARIABLEPROTOTYPE); + xmlWriter().writeCharacters(vn->leftType() + " "); + //xmlWriter().writeCharacters(vn->parent()->name() + "::" + vn->name()); + xmlWriter().writeCharacters(vn->name()); if (!vn->rightType().isEmpty()) - writer.writeCharacters(vn->rightType()); - writer.writeEndElement(); // + xmlWriter().writeCharacters(vn->rightType()); + xmlWriter().writeEndElement(); // - writer.writeStartElement(CXXVARIABLENAMELOOKUP); - writer.writeCharacters(vn->parent()->name() + "::" + vn->name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXVARIABLENAMELOOKUP); + xmlWriter().writeCharacters(vn->parent()->name() + "::" + vn->name()); + xmlWriter().writeEndElement(); // // not included: writeLocation(vn); - writer.writeEndElement(); // - writer.writeStartElement(APIDESC); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement(APIDESC); if (!vn->doc().isEmpty()) { generateBody(vn, marker); } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: ,
    , - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } ++m; } @@ -5102,88 +4920,88 @@ void DitaXmlGenerator::writeMacros(const Section& s, if ((*m)->type() == Node::Function) { const FunctionNode* fn = static_cast(*m); if (fn->isMacro()) { - writer.writeStartElement(CXXDEFINE); - writer.writeAttribute("id",fn->guid()); - writer.writeStartElement(APINAME); - writer.writeCharacters(fn->name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXDEFINE); + xmlWriter().writeAttribute("id",fn->guid()); + xmlWriter().writeStartElement(APINAME); + xmlWriter().writeCharacters(fn->name()); + xmlWriter().writeEndElement(); // generateBrief(fn,marker); // not included: - writer.writeStartElement(CXXDEFINEDETAIL); - writer.writeStartElement(CXXDEFINEDEFINITION); - writer.writeStartElement(CXXDEFINEACCESSSPECIFIER); - writer.writeAttribute("value",fn->accessString()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXDEFINEDETAIL); + xmlWriter().writeStartElement(CXXDEFINEDEFINITION); + xmlWriter().writeStartElement(CXXDEFINEACCESSSPECIFIER); + xmlWriter().writeAttribute("value",fn->accessString()); + xmlWriter().writeEndElement(); // - writer.writeStartElement(CXXDEFINEPROTOTYPE); - writer.writeCharacters("#define "); - writer.writeCharacters(fn->name()); + xmlWriter().writeStartElement(CXXDEFINEPROTOTYPE); + xmlWriter().writeCharacters("#define "); + xmlWriter().writeCharacters(fn->name()); if (fn->metaness() == FunctionNode::MacroWithParams) { QStringList params = fn->parameterNames(); if (!params.isEmpty()) { - writer.writeCharacters("("); + xmlWriter().writeCharacters("("); for (int i = 0; i < params.size(); ++i) { if (params[i].isEmpty()) - writer.writeCharacters("..."); + xmlWriter().writeCharacters("..."); else - writer.writeCharacters(params[i]); + xmlWriter().writeCharacters(params[i]); if ((i+1) < params.size()) - writer.writeCharacters(", "); + xmlWriter().writeCharacters(", "); } - writer.writeCharacters(")"); + xmlWriter().writeCharacters(")"); } } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // - writer.writeStartElement(CXXDEFINENAMELOOKUP); - writer.writeCharacters(fn->name()); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXDEFINENAMELOOKUP); + xmlWriter().writeCharacters(fn->name()); + xmlWriter().writeEndElement(); // if (fn->reimplementedFrom() != 0) { FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom(); - writer.writeStartElement(CXXDEFINEREIMPLEMENTED); - writer.writeAttribute("href",rfn->ditaXmlHref()); - writer.writeCharacters(marker->plainFullName(rfn)); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXDEFINEREIMPLEMENTED); + xmlWriter().writeAttribute("href",rfn->ditaXmlHref()); + xmlWriter().writeCharacters(marker->plainFullName(rfn)); + xmlWriter().writeEndElement(); // } if (fn->metaness() == FunctionNode::MacroWithParams) { QStringList params = fn->parameterNames(); if (!params.isEmpty()) { - writer.writeStartElement(CXXDEFINEPARAMETERS); + xmlWriter().writeStartElement(CXXDEFINEPARAMETERS); for (int i = 0; i < params.size(); ++i) { - writer.writeStartElement(CXXDEFINEPARAMETER); - writer.writeStartElement(CXXDEFINEPARAMETERDECLARATIONNAME); - writer.writeCharacters(params[i]); - writer.writeEndElement(); // + xmlWriter().writeStartElement(CXXDEFINEPARAMETER); + xmlWriter().writeStartElement(CXXDEFINEPARAMETERDECLARATIONNAME); + xmlWriter().writeCharacters(params[i]); + xmlWriter().writeEndElement(); // // not included: - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } } writeLocation(fn); - writer.writeEndElement(); // - writer.writeStartElement(APIDESC); + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement(APIDESC); if (!fn->doc().isEmpty()) { generateBody(fn, marker); } - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: ,
    , or - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // // not included: - writer.writeEndElement(); // + xmlWriter().writeEndElement(); // } } ++m; @@ -5199,14 +5017,51 @@ void DitaXmlGenerator::writePropertyParameter(const QString& tag, const NodeList { NodeList::const_iterator n = nlist.begin(); while (n != nlist.end()) { - writer.writeCharacters(" "); - writer.writeCharacters(tag); - writer.writeCharacters(" "); - writer.writeCharacters((*n)->name()); + xmlWriter().writeCharacters(" "); + xmlWriter().writeCharacters(tag); + xmlWriter().writeCharacters(" "); + xmlWriter().writeCharacters((*n)->name()); ++n; } } +/*! + Calls beginSubPage() in the base class to open the file. + Then creates a new XML stream writer using the IO device + from opened file and pushes the XML writer onto a stackj. + Creates the file named \a fileName in the output directory. + Attaches a QTextStream to the created file, which is written + to all over the place using out(). Finally, it sets some + parameters in the XML writer and calls writeStartDocument(). + */ +void DitaXmlGenerator::beginSubPage(const Location& location, + const QString& fileName) +{ + PageGenerator::beginSubPage(location,fileName); + QXmlStreamWriter* writer = new QXmlStreamWriter(out().device()); + xmlWriterStack.push(writer); + writer->setAutoFormatting(true); + writer->setAutoFormattingIndent(4); + writer->writeStartDocument(); +} + +/*! + Calls writeEndDocument() and then pops the XML stream writer + off the stack and deletes it. Then it calls endSubPage() in + the base class to close the device. + */ +void DitaXmlGenerator::endSubPage() +{ + xmlWriter().writeEndDocument(); + delete xmlWriterStack.pop(); + PageGenerator::endSubPage(); +} + +QXmlStreamWriter& DitaXmlGenerator::xmlWriter() +{ + return *xmlWriterStack.top(); +} + QT_END_NAMESPACE #ifdef TO_BE_INCLUDED_IN_API_DESC @@ -5305,27 +5160,19 @@ QT_END_NAMESPACE out() << "

    " << protectEnc(name) << "

    \n"; generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); } - - if (!s->inherited.isEmpty()) { - out() << "
      \n"; - generateSectionInheritedList(*s, inner, marker, true); - out() << "
    \n"; - } + generateSectionInheritedList(*s, inner, marker, true); } ++s; } if (needOtherSection) { - out() << "

    Additional Inherited Members

    \n" - "
      \n"; - + out() << "

      Additional Inherited Members

      \n"; s = sections.begin(); while (s != sections.end()) { - if (s->members.isEmpty() && !s->inherited.isEmpty()) + if (s->members.isEmpty()) generateSectionInheritedList(*s, inner, marker); ++s; } - out() << "
    \n"; } out() << "\n"; diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index dad1c6f..bd78e93 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -150,7 +150,7 @@ class DitaXmlGenerator : public PageGenerator void generateBreadCrumbs(const QString& title, const Node* node, CodeMarker* marker); - void generateHeader(const Node* node); + void generateHeader(const Node* node, const QString& name); void generateTitle(const QString& title, const Text& subTitle, SubTitleSize subTitleSize, @@ -184,10 +184,7 @@ class DitaXmlGenerator : public PageGenerator void generateFunctionIndex(const Node* relative, CodeMarker* marker); void generateLegaleseList(const Node* relative, CodeMarker* marker); void generateOverviewList(const Node* relative, CodeMarker* marker); - void generateSectionList(const Section& section, - const Node* relative, - CodeMarker* marker, - CodeMarker::SynopsisStyle style); + #ifdef QDOC_QML void generateQmlSummary(const Section& section, const Node* relative, @@ -215,8 +212,7 @@ class DitaXmlGenerator : public PageGenerator CodeMarker::SynopsisStyle style); void generateSectionInheritedList(const Section& section, const Node* relative, - CodeMarker* marker, - bool nameAlignment = false); + CodeMarker* marker); void writeText(const QString& markedCode, CodeMarker* marker, const Node* relative, @@ -262,16 +258,11 @@ class DitaXmlGenerator : public PageGenerator const Node* relative, CodeMarker* marker); void endLink(); - bool generatePageElement(QXmlStreamWriter& writer, - const Node* node, - CodeMarker* marker) const; - void generatePageElements(QXmlStreamWriter& writer, - const Node* node, - CodeMarker* marker) const; - void generatePageIndex(const QString& fileName, - CodeMarker* marker) const; QString writeGuidAttribute(QString text); QString lookupGuid(QString text); + virtual void beginSubPage(const Location& location, const QString& fileName); + virtual void endSubPage(); + QXmlStreamWriter& xmlWriter(); private: QMap refMap; @@ -324,7 +315,8 @@ class DitaXmlGenerator : public PageGenerator NewClassMaps newClassMaps; NewClassMaps newQmlClassMaps; static int id; - QXmlStreamWriter writer; + + QStack xmlWriterStack; }; #define DITAXMLGENERATOR_ADDRESS "address" diff --git a/tools/qdoc3/pagegenerator.h b/tools/qdoc3/pagegenerator.h index 1aa24a1..0fea67a 100644 --- a/tools/qdoc3/pagegenerator.h +++ b/tools/qdoc3/pagegenerator.h @@ -48,14 +48,12 @@ #include #include - #include "generator.h" #include "location.h" QT_BEGIN_NAMESPACE class QTextCodec; - class ClassNode; class InnerNode; class NamespaceNode; @@ -66,16 +64,16 @@ class PageGenerator : public Generator PageGenerator(); ~PageGenerator(); - virtual void generateTree(const Tree *tree, CodeMarker *marker); + virtual void generateTree(const Tree* tree, CodeMarker* marker); protected: - virtual QString fileBase(const Node *node) const; - virtual QString fileExtension(const Node *node) const = 0; - QString fileName(const Node *node) const; + virtual QString fileBase(const Node* node) const; + virtual QString fileExtension(const Node* node) const = 0; + QString fileName(const Node* node) const; QString outFileName(); - void beginSubPage(const Location& location, const QString& fileName); - void endSubPage(); - virtual void generateInnerNode(const InnerNode *node, CodeMarker *marker); + virtual void beginSubPage(const Location& location, const QString& fileName); + virtual void endSubPage(); + virtual void generateInnerNode(const InnerNode* node, CodeMarker* marker); QTextStream& out(); QString naturalLanguage; @@ -89,7 +87,7 @@ class PageGenerator : public Generator QStringRef* par1 = 0, bool debug = false); - private: + protected: QStack outStreamStack; }; -- cgit v0.12 From ecc772100760cd4afafa424b6bf19fb95f8fa82b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 14 Sep 2010 14:30:11 +0200 Subject: qdoc: Converted some more html output to xml output. --- tests/auto/qlineedit/tst_qlineedit.cpp | 18 +- tools/qdoc3/ditaxmlgenerator.cpp | 348 ++++++++++++++++++++------------- 2 files changed, 217 insertions(+), 149 deletions(-) diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index bfa9406..93bd447 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -3747,15 +3747,15 @@ void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup() void tst_QLineEdit::QTBUG13520_textNotVisible() { LineEdit le; - le.setAlignment( Qt::AlignRight | Qt::AlignVCenter); - le.show(); - QTest::qWaitForWindowShown(&le); - le.setText("01-ST16-01SIL-MPL001wfgsdfgsdgsdfgsdfgsdfgsdfgsdfg"); - le.setCursorPosition(0); - QTest::qWait(100); //just make sure we get he lineedit correcly painted - - QVERIFY(le.cursorRect().center().x() < le.width() / 2); - + le.setAlignment( Qt::AlignRight | Qt::AlignVCenter); + le.show(); + QTest::qWaitForWindowShown(&le); + le.setText("01-ST16-01SIL-MPL001wfgsdfgsdgsdfgsdfgsdfgsdfgsdfg"); + le.setCursorPosition(0); + QTest::qWait(100); //just make sure we get he lineedit correcly painted + + QVERIFY(le.cursorRect().center().x() < le.width() / 2); + } diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index f572cc7..24f3e77 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -371,7 +371,9 @@ static void addLink(const QString &linkTarget, } } - +/*! + The default constructor. + */ DitaXmlGenerator::DitaXmlGenerator() : inLink(false), inContents(false), @@ -390,11 +392,17 @@ DitaXmlGenerator::DitaXmlGenerator() { } +/*! + The destructor has nothing to do. + */ DitaXmlGenerator::~DitaXmlGenerator() { // nothing yet. } +/*! + A lot of internal structures are initialized. + */ void DitaXmlGenerator::initializeGenerator(const Config &config) { static const struct { @@ -491,11 +499,17 @@ void DitaXmlGenerator::initializeGenerator(const Config &config) } +/*! + All this does is call the same function in the base class. + */ void DitaXmlGenerator::terminateGenerator() { Generator::terminateGenerator(); } +/*! + Returns "DITAXML". + */ QString DitaXmlGenerator::format() { return "DITAXML"; @@ -587,7 +601,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::AutoLink: if ((noLinks > 0) && !inLink && !inContents && !inSectionHeading) { - const Node *node = 0; + const Node* node = 0; QString link = getLink(atom, relative, marker, &node); if (!link.isEmpty()) { beginLink(link, node, relative, marker); @@ -1528,15 +1542,12 @@ void DitaXmlGenerator::writeTargetAndHeader(const QString& target, */ void DitaXmlGenerator::writeXrefListItem(const QString& link, const QString& text) { - qDebug() << "WXLI 1" << link; xmlWriter().writeStartElement("li"); xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href",link); - qDebug() << "WXLI 2"; xmlWriter().writeCharacters(text); xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // - qDebug() << "WXLI 3"; } /*! @@ -1622,7 +1633,8 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker xmlWriter().writeEndElement(); // } -#if 0 +#if 0 +zzz /* Generate the TOC for the new doc format. Don't generate a TOC for the home page. @@ -1677,7 +1689,8 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker } #endif -#if 0 +#if 0 +zzz sections = marker->sections(fake, CodeMarker::Summary, CodeMarker::Okay); s = sections.begin(); while (s != sections.end()) { @@ -1713,7 +1726,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker #endif /*! - Returns "xml" for this subclass of Generator. + Returns "xml" for this subclass of class Generator. */ QString DitaXmlGenerator::fileExtension(const Node * /* node */) const { @@ -1721,6 +1734,7 @@ QString DitaXmlGenerator::fileExtension(const Node * /* node */) const } /*! + zzz Output breadcrumb list in the html file. */ void DitaXmlGenerator::generateBreadCrumbs(const QString& title, @@ -1809,10 +1823,8 @@ void DitaXmlGenerator::generateBreadCrumbs(const QString& title, } /*! - Outputs an XML file header depending on which kind of DITA + Outputs an XML file header depending on which kind of DITA XML file is being generated. - - \note This does not cover all cases yet. */ void DitaXmlGenerator::generateHeader(const Node* node, const QString& name) { @@ -1887,11 +1899,18 @@ void DitaXmlGenerator::generateHeader(const Node* node, const QString& name) xmlWriter().writeEndElement(); // } +/*! + Writes a \a title as a

    element with an \c {outputclass} + attribute of "h1 title". + + Also generates and writes a \a subTitle as a

    element, + if one is provided, but this probably doesn't work right. + */ void DitaXmlGenerator::generateTitle(const QString& title, - const Text &subTitle, + const Text& subTitle, SubTitleSize subTitleSize, - const Node *relative, - CodeMarker *marker) + const Node* relative, + CodeMarker* marker) { if (!title.isEmpty()) { xmlWriter().writeStartElement("p"); @@ -1913,7 +1932,7 @@ void DitaXmlGenerator::generateTitle(const QString& title, } /*! - Outputs the brief command as a element. + Outputs the \e brief command as a element. */ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) { @@ -1927,10 +1946,14 @@ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) } } -void DitaXmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) +/*! + Writes the \c {#include ...} required to include the class + or namespace in a compilation. + */ +void DitaXmlGenerator::generateIncludes(const InnerNode* inner, CodeMarker* marker) { if (!inner->includes().isEmpty()) { - xmlWriter().writeStartElement("pree"); + xmlWriter().writeStartElement("pre"); xmlWriter().writeAttribute("outputclass","highlightedcode"); writeText(marker->markedUpIncludes(inner->includes()), marker, inner); xmlWriter().writeEndElement(); // @@ -1938,13 +1961,15 @@ void DitaXmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *mark } /*! + zzz Generates a table of contents begining at \a node. + Currently just returns without writing anything. */ -void DitaXmlGenerator::generateTableOfContents(const Node *node, - CodeMarker *marker, - Doc::SectioningUnit sectioningUnit, - int numColumns, - const Node *relative) +void DitaXmlGenerator::generateTableOfContents(const Node* node, + CodeMarker* marker, + Doc::SectioningUnit sectioningUnit, + int numColumns, + const Node* relative) { return; @@ -2023,12 +2048,13 @@ void DitaXmlGenerator::generateTableOfContents(const Node *node, } /*! + zzz Revised for the new doc format. Generates a table of contents begining at \a node. */ -void DitaXmlGenerator::generateTableOfContents(const Node *node, - CodeMarker *marker, - QList

    * sections) +void DitaXmlGenerator::generateTableOfContents(const Node* node, + CodeMarker* marker, + QList
    * sections) { QList toc; if (node->doc().hasTableOfContents()) @@ -2155,9 +2181,11 @@ QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode* inner, generateHeader(inner, title); xmlWriter().writeStartElement("body"); generateTitle(title, Text(), SmallSubTitle, inner, marker); - out() << "

    This is the complete list of members for "; + xmlWriter().writeStartElement("p"); + xmlWriter().writeCharacters("This is the complete list of members for "); generateFullName(inner, 0, marker); - out() << ", including inherited members.

    \n"; + xmlWriter().writeCharacters(", including inherited members."); + xmlWriter().writeEndElement(); //

    Section section = sections.first(); generateSection(section.members, 0, marker, CodeMarker::SeparateList); @@ -2200,16 +2228,16 @@ QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, if (status == CodeMarker::Compat) { xmlWriter().writeStartElement("p"); xmlWriter().writeCharacters("

    The following class members are part of the " - "Qt 3 support layer." - " They are provided to help you port old code to Qt 4. " - "We advise against using them in new code."); + "Qt 3 support layer." + " They are provided to help you port old code to Qt 4. " + "We advise against using them in new code."); xmlWriter().writeEndElement(); //

    } else { xmlWriter().writeStartElement("p"); xmlWriter().writeCharacters("The following class members are obsolete. " - "They are provided to keep old source code working. " - "We strongly advise against using them in new code."); + "They are provided to keep old source code working. " + "We strongly advise against using them in new code."); xmlWriter().writeEndElement(); //

    } xmlWriter().writeStartElement("p"); @@ -2252,9 +2280,12 @@ QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, return fileName; } -void DitaXmlGenerator::generateClassHierarchy(const Node *relative, - CodeMarker *marker, - const QMap &classMap) +/*! + Write the XML for the class hierarchy to the current XML stream. + */ +void DitaXmlGenerator::generateClassHierarchy(const Node* relative, + CodeMarker* marker, + const QMap& classMap) { if (classMap.isEmpty()) return; @@ -2262,7 +2293,7 @@ void DitaXmlGenerator::generateClassHierarchy(const Node *relative, NodeMap topLevel; NodeMap::ConstIterator c = classMap.begin(); while (c != classMap.end()) { - const ClassNode *classe = static_cast(*c); + const ClassNode* classe = static_cast(*c); if (classe->baseClasses().isEmpty()) topLevel.insert(classe->name(), classe); ++c; @@ -2271,18 +2302,18 @@ void DitaXmlGenerator::generateClassHierarchy(const Node *relative, QStack stack; stack.push(topLevel); - out() << "
      \n"; + xmlWriter().writeStartElement("ul"); while (!stack.isEmpty()) { if (stack.top().isEmpty()) { stack.pop(); - out() << "
    \n"; + xmlWriter().writeEndElement(); // } else { const ClassNode *child = static_cast(*stack.top().begin()); - out() << "
  • "; + xmlWriter().writeStartElement("li"); generateFullName(child, relative, marker); - out() << "
  • \n"; + xmlWriter().writeEndElement(); // stack.top().erase(stack.top().begin()); NodeMap newTop; @@ -2292,12 +2323,16 @@ void DitaXmlGenerator::generateClassHierarchy(const Node *relative, } if (!newTop.isEmpty()) { stack.push(newTop); - out() << "
      \n"; + xmlWriter().writeStartElement("ul"); } } } } +/*! + Write XML for the contents of the \a nodeMap to the current + XML stream. + */ void DitaXmlGenerator::generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeMap& nodeMap) @@ -2578,6 +2613,9 @@ void DitaXmlGenerator::generateCompactList(const Node* relative, xmlWriter().writeEndElement(); //

      } +/*! + Write XML for a function index to the current XML stream. + */ void DitaXmlGenerator::generateFunctionIndex(const Node* relative, CodeMarker* marker) { @@ -2624,22 +2662,25 @@ void DitaXmlGenerator::generateFunctionIndex(const Node* relative, xmlWriter().writeEndElement(); //
    } -void DitaXmlGenerator::generateLegaleseList(const Node *relative, - CodeMarker *marker) +/*! + Write the legalese texts as XML to the current XML stream. + */ +void DitaXmlGenerator::generateLegaleseList(const Node* relative, + CodeMarker* marker) { - QMap::ConstIterator it = legaleseTexts.begin(); + QMap::ConstIterator it = legaleseTexts.begin(); while (it != legaleseTexts.end()) { Text text = it.key(); - out() << "
    \n"; + //out() << "
    \n"; generateText(text, relative, marker); - out() << "
      \n"; + xmlWriter().writeStartElement("ul"); do { - out() << "
    • "; + xmlWriter().writeStartElement("li"); generateFullName(it.value(), relative, marker); - out() << "
    • \n"; + xmlWriter().writeEndElement(); // ++it; } while (it != legaleseTexts.end() && it.key() == text); - out() << "
    \n"; + xmlWriter().writeEndElement(); // } } @@ -2674,6 +2715,9 @@ void DitaXmlGenerator::generateQmlItem(const Node* node, writeText(marked, marker, relative); } +/*! + Writher the XML for the overview list to the current XML stream. + */ void DitaXmlGenerator::generateOverviewList(const Node* relative, CodeMarker* /* marker */) { QMap > fakeNodeMap; @@ -2753,42 +2797,60 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative, CodeMarker* /* // pages in that group are listed for completeness. if (!fakeNodeMap.isEmpty()) { - foreach (const QString &groupTitle, groupTitlesMap.keys()) { - const FakeNode *groupNode = groupTitlesMap[groupTitle]; - out() << QString("

    %2

    \n").arg( - linkForNode(groupNode, relative)).arg( - protectEnc(groupNode->fullTitle())); - + foreach (const QString& groupTitle, groupTitlesMap.keys()) { + const FakeNode* groupNode = groupTitlesMap[groupTitle]; + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","h3"); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",linkForNode(groupNode, relative)); + xmlWriter().writeCharacters(protectEnc(groupNode->fullTitle())); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); //

    if (fakeNodeMap[groupNode].count() == 0) continue; - out() << "
      \n"; - - foreach (const FakeNode *fakeNode, fakeNodeMap[groupNode]) { + xmlWriter().writeStartElement("ul"); + foreach (const FakeNode* fakeNode, fakeNodeMap[groupNode]) { QString title = fakeNode->fullTitle(); if (title.startsWith("The ")) title.remove(0, 4); - out() << "
    • " - << protectEnc(title) << "
    • \n"; + xmlWriter().writeStartElement("li"); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",linkForNode(fakeNode, relative)); + xmlWriter().writeCharacters(protectEnc(title)); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } - out() << "
    \n"; + xmlWriter().writeEndElement(); // } } if (!uncategorizedNodeMap.isEmpty()) { - out() << QString("

    Miscellaneous

    \n"); - out() << "
      \n"; + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","h3"); + xmlWriter().writeCharacters("Miscellaneous"); + xmlWriter().writeEndElement(); //

      + xmlWriter().writeStartElement("ul"); foreach (const FakeNode *fakeNode, uncategorizedNodeMap) { QString title = fakeNode->fullTitle(); if (title.startsWith("The ")) title.remove(0, 4); - out() << "
    • " - << protectEnc(title) << "
    • \n"; + xmlWriter().writeStartElement("li"); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",linkForNode(fakeNode, relative)); + xmlWriter().writeCharacters(protectEnc(title)); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } - out() << "
    \n"; + xmlWriter().writeEndElement(); // } } +/*! + Write the XML for a standard section of a page, e.g. + "Public Functions" or "Protected Slots." The section + is written too the current XML stream as a table. + */ void DitaXmlGenerator::generateSection(const NodeList& nl, const Node* relative, CodeMarker* marker, @@ -2882,7 +2944,7 @@ void DitaXmlGenerator::generateSection(const NodeList& nl, } /*! - Writes the "inherited from" lists. + Writes the "inherited from" lists to the current XML stream. */ void DitaXmlGenerator::generateSectionInheritedList(const Section& section, const Node* relative, @@ -2957,6 +3019,10 @@ QString DitaXmlGenerator::getMarkedUpSynopsis(const Node* node, return marked; } +/*! + Renamed from highlightedCode() in the html generator. Writes + the \a markedCode to the current XML stream. + */ void DitaXmlGenerator::writeText(const QString& markedCode, CodeMarker* marker, const Node* relative, @@ -3116,9 +3182,8 @@ void DitaXmlGenerator::generateLink(const Atom* atom, if (showBrokenLinks) xmlWriter().writeEndElement(); // } - else { + else xmlWriter().writeEndElement(); // - } inLink = false; xmlWriter().writeCharacters(protectEnc(atom->string().mid(k))); } @@ -3128,17 +3193,14 @@ void DitaXmlGenerator::generateLink(const Atom* atom, bool tt = (func || atom->string().contains(camelCase)); if (tt) xmlWriter().writeStartElement("tt"); - if (func) { + if (func) xmlWriter().writeCharacters(protectEnc(atom->string().left(atom->string().length() - 2))); - } - else { + else xmlWriter().writeCharacters(protectEnc(atom->string())); - } xmlWriter().writeEndElement(); // } - else { + else xmlWriter().writeCharacters(protectEnc(atom->string())); - } } QString DitaXmlGenerator::cleanRef(const QString& ref) @@ -3215,14 +3277,16 @@ QString DitaXmlGenerator::registerRef(const QString& ref) prevRef = ref; break; } - else if (prevRef == ref) { + else if (prevRef == ref) break; - } clean += "x"; } return clean; } +/*! + Calls protect() with the \a string. Returns the result. + */ QString DitaXmlGenerator::protectEnc(const QString& string) { return protect(string, outputEncoding); @@ -3276,6 +3340,10 @@ QString DitaXmlGenerator::protect(const QString& string, const QString& outputEn #undef APPEND } +/*! + Constructs a file name appropriate for the \a node + and returns the file name. + */ QString DitaXmlGenerator::fileBase(const Node* node) { QString result; @@ -3295,6 +3363,13 @@ QString DitaXmlGenerator::fileBase(const Node* node) return result; } +/*! + Constructs a file name appropriate for the \a node + and returns the file name. If the \a node is not a + fake node, or if it is a fake node but it is neither + an external page node nor an image node, call the + PageGenerator::fileName() function. + */ QString DitaXmlGenerator::fileName(const Node* node) { if (node->type() == Node::Fake) { @@ -3393,15 +3468,11 @@ QString DitaXmlGenerator::linkForNode(const Node* node, const Node* relative) QString DitaXmlGenerator::refForAtom(Atom* atom, const Node* /* node */) { - if (atom->type() == Atom::SectionLeft) { + if (atom->type() == Atom::SectionLeft) return Doc::canonicalTitle(Text::sectionHeading(atom).toString()); - } - else if (atom->type() == Atom::Target) { + if (atom->type() == Atom::Target) return Doc::canonicalTitle(atom->string()); - } - else { - return QString(); - } + return QString(); } void DitaXmlGenerator::generateFullName(const Node* apparentNode, @@ -3422,7 +3493,7 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode, xmlWriter().writeAttribute("outputclass","compat"); break; default: - ; + break; } } xmlWriter().writeCharacters(protectEnc(fullName(apparentNode, relative, marker))); @@ -3745,7 +3816,6 @@ const Node* DitaXmlGenerator::findNodeForTarget(const QString& target, const QPair DitaXmlGenerator::anchorForNode(const Node* node) { QPair anchorPair; - anchorPair.first = PageGenerator::fileName(node); if (node->type() == Node::Fake) { const FakeNode *fakeNode = static_cast(node); @@ -3765,40 +3835,34 @@ QString DitaXmlGenerator::getLink(const Atom* atom, inObsoleteLink = false; if (atom->string().contains(":") && - (atom->string().startsWith("file:") - || atom->string().startsWith("http:") - || atom->string().startsWith("https:") - || atom->string().startsWith("ftp:") - || atom->string().startsWith("mailto:"))) { - + (atom->string().startsWith("file:") + || atom->string().startsWith("http:") + || atom->string().startsWith("https:") + || atom->string().startsWith("ftp:") + || atom->string().startsWith("mailto:"))) { + link = atom->string(); } else { QStringList path; - if (atom->string().contains('#')) { + if (atom->string().contains('#')) path = atom->string().split('#'); - } - else { + else path.append(atom->string()); - } - - Atom *targetAtom = 0; + Atom* targetAtom = 0; QString first = path.first().trimmed(); - if (first.isEmpty()) { + + if (first.isEmpty()) *node = relative; - } - else if (first.endsWith(".html")) { + else if (first.endsWith(".html")) *node = myTree->root()->findNode(first, Node::Fake); - } else { *node = marker->resolveTarget(first, myTree, relative); - if (!*node) { + if (!*node) *node = myTree->findFakeNodeByTitle(first); - } - if (!*node) { + if (!*node) *node = myTree->findUnambiguousTarget(first, targetAtom); - } } if (*node) { @@ -3807,36 +3871,26 @@ QString DitaXmlGenerator::getLink(const Atom* atom, else path.removeFirst(); } - else { + else *node = relative; - } - if (*node) { - if ((*node)->status() == Node::Obsolete) { - if (relative) { - if (relative->parent() != *node) { - if (relative->status() != Node::Obsolete) { - bool porting = false; - if (relative->type() == Node::Fake) { - const FakeNode* fake = static_cast(relative); - if (fake->title().startsWith("Porting")) - porting = true; - } - QString name = marker->plainFullName(relative); - if (!porting && !name.startsWith("Q3")) { - if (obsoleteLinks) { - relative->doc().location().warning(tr("Link to obsolete item '%1' in %2") - .arg(atom->string()) - .arg(name)); - } - inObsoleteLink = true; - } - } - } + if (*node && (*node)->status() == Node::Obsolete) { + if (relative && (relative->parent() != *node) && + (relative->status() != Node::Obsolete)) { + bool porting = false; + if (relative->type() == Node::Fake) { + const FakeNode* fake = static_cast(relative); + if (fake->title().startsWith("Porting")) + porting = true; } - else { - qDebug() << "Link to Obsolete entity" - << (*node)->name() << "no relative"; + QString name = marker->plainFullName(relative); + if (!porting && !name.startsWith("Q3")) { + if (obsoleteLinks) { + relative->doc().location().warning(tr("Link to obsolete item '%1' in %2") + .arg(atom->string()) + .arg(name)); + } + inObsoleteLink = true; } } } @@ -3958,15 +4012,15 @@ void DitaXmlGenerator::endLink() if (inLink) { if (link.isEmpty()) { if (showBrokenLinks) - xmlWriter().writeEndElement(); // i + xmlWriter().writeEndElement(); // } else { if (inObsoleteLink) { xmlWriter().writeStartElement("sup"); xmlWriter().writeCharacters("(obsolete)"); - xmlWriter().writeEndElement(); // sup + xmlWriter().writeEndElement(); // } - xmlWriter().writeEndElement(); // xref + xmlWriter().writeEndElement(); // } } inLink = false; @@ -3974,6 +4028,7 @@ void DitaXmlGenerator::endLink() } /*! + zzz Generates the summary for the \a section. Only used for sections of QML element documentation. @@ -4017,6 +4072,7 @@ void DitaXmlGenerator::generateQmlSummary(const Section& section, } /*! + zzz Outputs the html detailed documentation for a section on a QML element reference page. */ @@ -4103,6 +4159,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node *node, } /*! + zzz Output the "Inherits" line for the QML element, if there should be one. */ @@ -4153,6 +4210,7 @@ void DitaXmlGenerator::generateQmlInheritedBy(const QmlClassNode* cn, } /*! + zzz text Output the "[Xxx instantiates the C++ class QmlGraphicsXxx]" line for the QML element, if there should be one. @@ -4164,7 +4222,8 @@ void DitaXmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, { const ClassNode* cn = qcn->classNode(); if (cn && (cn->status() != Node::Internal)) { - out() << "

    "; + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","centerAlign"); Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4178,11 +4237,12 @@ void DitaXmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK); text << "]"; generateText(text, qcn, marker); - out() << "

    "; + xmlWriter().writeEndElement(); //

    } } /*! + zzz text Output the "[QmlGraphicsXxx is instantiated by QML element Xxx]" line for the class, if there should be one. @@ -4195,7 +4255,8 @@ void DitaXmlGenerator::generateInstantiatedBy(const ClassNode* cn, if (cn && cn->status() != Node::Internal && !cn->qmlElement().isEmpty()) { const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake); if (n && n->subType() == Node::QmlClass) { - out() << "

    "; + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","centerAlign"); Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn)); @@ -4209,7 +4270,7 @@ void DitaXmlGenerator::generateInstantiatedBy(const ClassNode* cn, text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK); text << "]"; generateText(text, cn, marker); - out() << "

    "; + xmlWriter().writeEndElement(); //

    } } } @@ -5057,6 +5118,12 @@ void DitaXmlGenerator::endSubPage() PageGenerator::endSubPage(); } +/*! + Returns a reference to the XML stream writer currently in use. + There is one XML stream writer open for each XML file being + written, and they are kept on a stack. The one on top of the + stack is the one being written to at the moment. + */ QXmlStreamWriter& DitaXmlGenerator::xmlWriter() { return *xmlWriterStack.top(); @@ -5065,6 +5132,7 @@ QXmlStreamWriter& DitaXmlGenerator::xmlWriter() QT_END_NAMESPACE #ifdef TO_BE_INCLUDED_IN_API_DESC +zzzz Text subtitleText; if (rawTitle != fullTitle) subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")" -- cgit v0.12 From 4b8542e958ebced0b324e64291c6d10d79680021 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 15 Sep 2010 09:03:02 +0200 Subject: qdoc: Converted some more html output to xml output. --- tools/qdoc3/ditaxmlgenerator.cpp | 60 ++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 24f3e77..90b2f06 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2684,18 +2684,20 @@ void DitaXmlGenerator::generateLegaleseList(const Node* relative, } } +/*! + Generate the text for the QML item described by \a node + and write it to the current XML stream. + */ void DitaXmlGenerator::generateQmlItem(const Node* node, const Node* relative, CodeMarker* marker, bool summary) { QString marked = marker->markedUpQmlItem(node,summary); - QRegExp templateTag("(<[^@>]*>)"); - if (marked.indexOf(templateTag) != -1) { - QString contents = protectEnc(marked.mid(templateTag.pos(1), - templateTag.cap(1).length())); - marked.replace(templateTag.pos(1), templateTag.cap(1).length(), - contents); + QRegExp tag("(<[^@>]*>)"); + if (marked.indexOf(tag) != -1) { + QString tmp = protectEnc(marked.mid(tag.pos(1), tag.cap(1).length())); + marked.replace(tag.pos(1), tag.cap(1).length(), tmp); } marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])"), "\\1\\2"); @@ -2984,13 +2986,10 @@ QString DitaXmlGenerator::getMarkedUpSynopsis(const Node* node, CodeMarker::SynopsisStyle style) { QString marked = marker->markedUpSynopsis(node, relative, style); - QRegExp templateTag("(<[^@>]*>)"); - if (marked.indexOf(templateTag) != -1) { - QString contents = protectEnc(marked.mid(templateTag.pos(1), - templateTag.cap(1).length())); - marked.replace(templateTag.pos(1), - templateTag.cap(1).length(), - contents); + QRegExp tag("(<[^@>]*>)"); + if (marked.indexOf(tag) != -1) { + QString tmp = protectEnc(marked.mid(tag.pos(1), tag.cap(1).length())); + marked.replace(tag.pos(1), tag.cap(1).length(), tmp); } marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])"), "\\1\\2"); @@ -4028,7 +4027,6 @@ void DitaXmlGenerator::endLink() } /*! - zzz Generates the summary for the \a section. Only used for sections of QML element documentation. @@ -4039,35 +4037,17 @@ void DitaXmlGenerator::generateQmlSummary(const Section& section, CodeMarker* marker) { if (!section.members.isEmpty()) { + xmlWriter().writeStartElement("ul"); NodeList::ConstIterator m; - int count = section.members.size(); - bool twoColumn = false; - if (section.members.first()->type() == Node::QmlProperty) { - twoColumn = (count >= 5); - } - if (twoColumn) - out() << "\n"; - if (++numTableRows % 2 == 1) - out() << ""; - else - out() << ""; - // << "\n
    "; - out() << "
      \n"; - - int row = 0; m = section.members.begin(); while (m != section.members.end()) { - if (twoColumn && row == (int) (count + 1) / 2) - out() << "
      \n"; - out() << "
    • "; + xmlWriter().writeStartElement("li"); + xmlWriter().writeAttribute("outputclass", "fn"); generateQmlItem(*m,relative,marker,true); - out() << "
    • \n"; - row++; + xmlWriter().writeEndElement(); // ++m; } - out() << "
    \n"; - if (twoColumn) - out() << "
    \n"; + xmlWriter().writeEndElement(); // } } @@ -4076,9 +4056,9 @@ void DitaXmlGenerator::generateQmlSummary(const Section& section, Outputs the html detailed documentation for a section on a QML element reference page. */ -void DitaXmlGenerator::generateDetailedQmlMember(const Node *node, - const InnerNode *relative, - CodeMarker *marker) +void DitaXmlGenerator::generateDetailedQmlMember(const Node* node, + const InnerNode* relative, + CodeMarker* marker) { QString marked; const QmlPropertyNode* qpn = 0; -- cgit v0.12 From ed73f806928760ace1d4c7c2a6327875725bcb05 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Sat, 18 Sep 2010 13:37:32 +0200 Subject: qdoc: DITA XML generator now uses
    elements... ...instead of

    elements with the outputclass attribute set to some h value. Also added some missing macros to qt-ditaxml.qdocconf, but there is more to think about here. --- src/corelib/tools/qeasingcurve.cpp | 20 +- tools/qdoc3/ditaxmlgenerator.cpp | 354 +++++++++++++++++++---------------- tools/qdoc3/ditaxmlgenerator.h | 7 + tools/qdoc3/generator.cpp | 72 +++---- tools/qdoc3/generator.h | 3 +- tools/qdoc3/test/qt-ditaxml.qdocconf | 31 +++ 6 files changed, 270 insertions(+), 217 deletions(-) diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 7fe9170..aee9356 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -92,14 +92,18 @@ animation.setEasingCurve(QEasingCurve::InOutQuad); \endcode - The ability to set an amplitude, overshoot, or period depends on the QEasingCurve type. Amplitude access - is available to curves that behave as springs such as elastic and bounce curves. Changing the amplitude changes - the height of the curve. Period access is only available to elastic curves and setting a higher period slows - the rate of bounce. Only curves that have "boomerang" behaviors such as the InBack, OutBack, InOutBack, and OutInBack - have overshoot settings. These curves will interpolate beyond the end points and return to the end point, - acting similar to a boomerang. - - The \l{Easing Curves Example} contains samples of QEasingCurve types and lets you change the curve settings. + The ability to set an amplitude, overshoot, or period depends on + the QEasingCurve type. Amplitude access is available to curves + that behave as springs such as elastic and bounce curves. Changing + the amplitude changes the height of the curve. Period access is + only available to elastic curves and setting a higher period slows + the rate of bounce. Only curves that have "boomerang" behaviors + such as the InBack, OutBack, InOutBack, and OutInBack have + overshoot settings. These curves will interpolate beyond the end + points and return to the end point, acting similar to a boomerang. + + The \l{Easing Curves Example} contains samples of QEasingCurve + types and lets you change the curve settings. */ diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 90b2f06..9c70cb5 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -60,6 +60,9 @@ QT_BEGIN_NAMESPACE #define COMMAND_VERSION Doc::alias("version") int DitaXmlGenerator::id = 0; +bool DitaXmlGenerator::inApiDesc = false; +bool DitaXmlGenerator::inSection = false; +bool DitaXmlGenerator::inDetailedDescription = false; #define cxxapi_d_xref Doc::alias("cxxapi-d-xref") #define cxxclass Doc::alias("cxxclass") @@ -623,7 +626,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, skipAhead = skipAtoms(atom, Atom::BriefRight); break; } - xmlWriter().writeStartElement(SHORTDESC); + if (inApiDesc) + xmlWriter().writeStartElement("p"); + else + xmlWriter().writeStartElement(SHORTDESC); if (relative->type() == Node::Property || relative->type() == Node::Variable) { QString str; @@ -655,7 +661,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::BriefRight: if (relative->type() != Node::Fake) { - xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // or

    } break; case Atom::C: @@ -842,19 +848,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, generateAnnotatedList(fake, marker, groupMembersMap); } } - else if (atom->string() == "relatedinline") { - const FakeNode *fake = static_cast(relative); - if (fake && !fake->groupMembers().isEmpty()) { - // Reverse the list into the original scan order. - // Should be sorted. But on what? It may not be a - // regular class or page definition. - QList list; - foreach (const Node *node, fake->groupMembers()) - list.prepend(node); - foreach (const Node *node, list) - generateBody(node, marker); - } - } break; case Atom::SinceList: { @@ -1009,10 +1002,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, QString text; if (atom->next() != 0) text = atom->next()->string(); - if (atom->type() == Atom::Image) { - xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","centerAlign"); - } if (fileName.isEmpty()) { xmlWriter().writeStartElement("font"); xmlWriter().writeAttribute("color","red"); @@ -1021,14 +1010,23 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeEndElement(); // } else { - xmlWriter().writeStartElement("img"); - xmlWriter().writeAttribute("src",protectEnc(fileName)); - if (!text.isEmpty()) - xmlWriter().writeAttribute("alt",protectEnc(text)); - xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement("fig"); + xmlWriter().writeStartElement("image"); + xmlWriter().writeAttribute("href",protectEnc(fileName)); + if (atom->type() == Atom::InlineImage) + xmlWriter().writeAttribute("placement","inline"); + else { + xmlWriter().writeAttribute("placement","break"); + xmlWriter().writeAttribute("align","center"); + } + if (!text.isEmpty()) { + xmlWriter().writeStartElement("alt"); + xmlWriter().writeCharacters(protectEnc(text)); + xmlWriter().writeEndElement(); // + } + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } - if (atom->type() == Atom::Image) - xmlWriter().writeEndElement(); //

    } break; case Atom::ImageText: @@ -1221,7 +1219,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::ParaRight: endLink(); if (in_para) { - xmlWriter().writeEndElement(); // in_para = false; } break; @@ -1235,23 +1233,28 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeCharacters(atom->string()); break; case Atom::SectionLeft: - xmlWriter().writeStartElement("p"); + if (inSection || inApiDesc) { + inApiDesc = false; + xmlWriter().writeEndElement(); //
    or + } + inSection = true; + xmlWriter().writeStartElement("section"); writeGuidAttribute(Doc::canonicalTitle(Text::sectionHeading(atom).toString())); - xmlWriter().writeAttribute("outputclass","target"); - xmlWriter().writeCharacters(protectEnc(Text::sectionHeading(atom).toString())); - xmlWriter().writeEndElement(); //

    break; case Atom::SectionRight: - // nothing + if (inSection) { + inSection = false; + xmlWriter().writeEndElement(); //
    + } break; case Atom::SectionHeadingLeft: - xmlWriter().writeStartElement("p"); + xmlWriter().writeStartElement("title"); hx = "h" + QString::number(atom->string().toInt() + hOffset(relative)); xmlWriter().writeAttribute("outputclass",hx); inSectionHeading = true; break; case Atom::SectionHeadingRight: - xmlWriter().writeEndElement(); //

    (see case Atom::SectionHeadingLeft) + xmlWriter().writeEndElement(); // (see case Atom::SectionHeadingLeft) inSectionHeading = false; break; case Atom::SidebarLeft: @@ -1470,20 +1473,10 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writeLocation(cn); xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement(APIDESC); - if (!inner->doc().isEmpty()) { - xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters("Detailed Description"); - xmlWriter().writeEndElement(); //

    - generateBody(inner, marker); - // generateAlsoList(inner, marker); - } - - xmlWriter().writeEndElement(); // - - // not included: ,
    , or + writeDetailSections(cn, marker, true, QString("Detailed Description")); + // zzz writeSections() gores here. + // not included: or xmlWriter().writeEndElement(); // @@ -1610,13 +1603,54 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker xmlWriter().writeEndElement(); // } + else if (fake->subType() == Node::QmlClass) { + const QmlClassNode* qml_cn = static_cast(fake); + const ClassNode* cn = qml_cn->classNode(); + generateQmlInherits(qml_cn, marker); + generateQmlInstantiates(qml_cn, marker); + generateBrief(qml_cn, marker); + generateQmlInheritedBy(qml_cn, marker); + sections = marker->qmlSections(qml_cn,CodeMarker::Summary,0); + s = sections.begin(); + while (s != sections.end()) { + writeTargetAndHeader((*s).name,protectEnc((*s).name),"h2"); + generateQmlSummary(*s,fake,marker); + ++s; + } + + writeDetailSections(fake, marker, false, QString("Detailed Description")); + + if (cn) + generateQmlText(cn->doc().body(), cn, marker, fake->name()); + + generateAlsoList(fake, marker); + //out() << "
    \n"; + + sections = marker->qmlSections(qml_cn,CodeMarker::Detailed,0); + s = sections.begin(); + while (s != sections.end()) { + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc((*s).name)); + xmlWriter().writeEndElement(); //

    + NodeList::ConstIterator m = (*s).members.begin(); + while (m != (*s).members.end()) { + generateDetailedQmlMember(*m, fake, marker); + //out() << "
    \n"; + ++m; + } + ++s; + } + return; + } if (!fake->doc().isEmpty()) { xmlWriter().writeStartElement("body"); if (fake->subType() == Node::Module) { - writeTargetAndHeader("details","Detailed Description","h2"); + writeDetailSections(fake, marker, false, QString("Detailed Description")); } - generateBody(fake, marker); + else + writeDetailSections(fake, marker, false, QString()); generateAlsoList(fake, marker); if (!fake->groupMembers().isEmpty()) { @@ -1649,44 +1683,6 @@ zzz marker); - else if (fake->subType() == Node::QmlClass) { - const QmlClassNode* qml_cn = static_cast(fake); - const ClassNode* cn = qml_cn->classNode(); - generateQmlInherits(qml_cn, marker); - generateQmlInstantiates(qml_cn, marker); - generateBrief(qml_cn, marker); - generateQmlInheritedBy(qml_cn, marker); - sections = marker->qmlSections(qml_cn,CodeMarker::Summary,0); - s = sections.begin(); - while (s != sections.end()) { - out() << "\n"; - out() << "

    " << protectEnc((*s).name) << "

    \n"; - generateQmlSummary(*s,fake,marker); - ++s; - } - - out() << "\n"; - out() << "

    " << "Detailed Description" << "

    \n"; - generateBody(fake, marker); - if (cn) - generateQmlText(cn->doc().body(), cn, marker, fake->name()); - generateAlsoList(fake, marker); - out() << "
    \n"; - - sections = marker->qmlSections(qml_cn,CodeMarker::Detailed,0); - s = sections.begin(); - while (s != sections.end()) { - out() << "

    " << protectEnc((*s).name) << "

    \n"; - NodeList::ConstIterator m = (*s).members.begin(); - while (m != (*s).members.end()) { - generateDetailedQmlMember(*m, fake, marker); - out() << "
    \n"; - ++m; - } - ++s; - } - return; - } #endif #if 0 @@ -1880,7 +1876,7 @@ void DitaXmlGenerator::generateHeader(const Node* node, const QString& name) outputclass = "externalpage"; break; case Node::QmlClass: - outputclass = "QML"; + outputclass = "QML-class"; break; default: outputclass = "page"; @@ -1889,7 +1885,6 @@ void DitaXmlGenerator::generateHeader(const Node* node, const QString& name) xmlWriter().writeDTD(doctype); xmlWriter().writeComment(node->doc().location().fileName()); - xmlWriter().writeStartElement(mainElement); xmlWriter().writeAttribute("id",node->guid()); if (!outputclass.isEmpty()) @@ -2180,7 +2175,13 @@ QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode* inner, QString title = "List of All Members for " + inner->name(); generateHeader(inner, title); xmlWriter().writeStartElement("body"); - generateTitle(title, Text(), SmallSubTitle, inner, marker); + xmlWriter().writeStartElement("section"); + if (!title.isEmpty()) { + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass", "h1"); + xmlWriter().writeCharacters(protectEnc(title)); + xmlWriter().writeEndElement(); // + } xmlWriter().writeStartElement("p"); xmlWriter().writeCharacters("This is the complete list of members for "); generateFullName(inner, 0, marker); @@ -2189,6 +2190,7 @@ QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode* inner, Section section = sections.first(); generateSection(section.members, 0, marker, CodeMarker::SeparateList); + xmlWriter().writeEndElement(); //
    xmlWriter().writeEndElement(); // endSubPage(); return fileName; @@ -2219,52 +2221,64 @@ QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, title = "Obsolete Members for " + inner->name(); fileName = fileBase(inner) + "-obsolete." + fileExtension(inner); } - beginSubPage(inner->location(), fileName); generateHeader(inner, title); xmlWriter().writeStartElement("body"); - generateTitle(title, Text(), SmallSubTitle, inner, marker); + xmlWriter().writeStartElement("section"); + if (!title.isEmpty()) { + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass", "h1"); + xmlWriter().writeCharacters(protectEnc(title)); + xmlWriter().writeEndElement(); // + } + xmlWriter().writeStartElement("p"); if (status == CodeMarker::Compat) { - xmlWriter().writeStartElement("p"); - xmlWriter().writeCharacters("

    The following class members are part of the " - "Qt 3 support layer." - " They are provided to help you port old code to Qt 4. " + xmlWriter().writeStartElement("b"); + xmlWriter().writeCharacters("The following class members are part of the "); + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href","qt3support.html"); + xmlWriter().writeCharacters("Qt 3 support layer"); + xmlWriter().writeEndElement(); // + xmlWriter().writeCharacters("."); + xmlWriter().writeEndElement(); // + xmlWriter().writeCharacters(" They are provided to help you port old code to Qt 4. " "We advise against using them in new code."); - xmlWriter().writeEndElement(); //

    } else { - xmlWriter().writeStartElement("p"); - xmlWriter().writeCharacters("The following class members are obsolete. " - "They are provided to keep old source code working. " + xmlWriter().writeStartElement("b"); + xmlWriter().writeCharacters("The following class members are obsolete."); + xmlWriter().writeEndElement(); // + xmlWriter().writeCharacters("They are provided to keep old source code working. " "We strongly advise against using them in new code."); - xmlWriter().writeEndElement(); //

    } + xmlWriter().writeEndElement(); //

    xmlWriter().writeStartElement("p"); xmlWriter().writeStartElement("ul"); QString text = protectEnc(inner->name()) + " class reference"; writeXrefListItem(linkForNode(inner,0),text); xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); //

    + xmlWriter().writeEndElement(); //
    for (i = 0; i < sections.size(); ++i) { - xmlWriter().writeStartElement("p"); + xmlWriter().writeStartElement("section"); xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeStartElement("title"); xmlWriter().writeCharacters(protectEnc(sections.at(i).name)); - xmlWriter().writeEndElement(); //

    + xmlWriter().writeEndElement(); // generateSection(sections.at(i).members, inner, marker, CodeMarker::Summary); generateSectionInheritedList(sections.at(i), inner, marker); + xmlWriter().writeEndElement(); //
    } sections = marker->sections(inner, CodeMarker::Detailed, status); for (i = 0; i < sections.size(); ++i) { - xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","separator"); - xmlWriter().writeEndElement(); //

    - xmlWriter().writeStartElement("p"); + xmlWriter().writeStartElement("section"); + xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); xmlWriter().writeCharacters(protectEnc(sections.at(i).name)); - xmlWriter().writeEndElement(); //

    + xmlWriter().writeEndElement(); // NodeList::ConstIterator m = sections.at(i).members.begin(); while (m != sections.at(i).members.end()) { @@ -2273,6 +2287,7 @@ QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, } ++m; } + xmlWriter().writeEndElement(); //
    } xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // @@ -3511,7 +3526,6 @@ void DitaXmlGenerator::generateDetailedMember(const Node* node, xmlWriter().writeStartElement("p"); writeGuidAttribute(refForNode(node)); xmlWriter().writeAttribute("outputclass","h3 flags"); - xmlWriter().writeCharacters(refForNode(node)); marked = getMarkedUpSynopsis(en, relative, marker, CodeMarker::Detailed); writeText(marked, marker, relative); xmlWriter().writeCharacters("\n"); @@ -3523,7 +3537,6 @@ void DitaXmlGenerator::generateDetailedMember(const Node* node, xmlWriter().writeStartElement("p"); writeGuidAttribute(refForNode(node)); xmlWriter().writeAttribute("outputclass","h3 fn"); - xmlWriter().writeCharacters(refForNode(node)); marked = getMarkedUpSynopsis(node, relative, marker, CodeMarker::Detailed); writeText(marked, marker, relative); xmlWriter().writeEndElement(); //

    @@ -4139,12 +4152,11 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node* node, } /*! - zzz Output the "Inherits" line for the QML element, if there should be one. */ void DitaXmlGenerator::generateQmlInherits(const QmlClassNode* cn, - CodeMarker* marker) + CodeMarker* marker) { if (cn && !cn->links().empty()) { if (cn->links().contains(Node::InheritsLink)) { @@ -4154,7 +4166,8 @@ void DitaXmlGenerator::generateQmlInherits(const QmlClassNode* cn, const Node* n = myTree->findNode(strList,Node::Fake); if (n && n->subType() == Node::QmlClass) { const QmlClassNode* qcn = static_cast(n); - out() << "

    "; + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","centerAlign"); Text text; text << "[Inherits "; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4163,7 +4176,7 @@ void DitaXmlGenerator::generateQmlInherits(const QmlClassNode* cn, text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK); text << "]"; generateText(text, cn, marker); - out() << "

    "; + xmlWriter().writeEndElement(); //

    } } } @@ -4174,7 +4187,7 @@ void DitaXmlGenerator::generateQmlInherits(const QmlClassNode* cn, if it is inherited by any other elements. */ void DitaXmlGenerator::generateQmlInheritedBy(const QmlClassNode* cn, - CodeMarker* marker) + CodeMarker* marker) { if (cn) { NodeList subs; @@ -4190,7 +4203,6 @@ void DitaXmlGenerator::generateQmlInheritedBy(const QmlClassNode* cn, } /*! - zzz text Output the "[Xxx instantiates the C++ class QmlGraphicsXxx]" line for the QML element, if there should be one. @@ -4198,7 +4210,7 @@ void DitaXmlGenerator::generateQmlInheritedBy(const QmlClassNode* cn, is set to Node::Internal, do nothing. */ void DitaXmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, - CodeMarker* marker) + CodeMarker* marker) { const ClassNode* cn = qcn->classNode(); if (cn && (cn->status() != Node::Internal)) { @@ -4222,7 +4234,6 @@ void DitaXmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, } /*! - zzz text Output the "[QmlGraphicsXxx is instantiated by QML element Xxx]" line for the class, if there should be one. @@ -4500,16 +4511,11 @@ void DitaXmlGenerator::writeFunctions(const Section& s, writeParameters(fn,marker); writeLocation(fn); xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement(APIDESC); - - if (!fn->doc().isEmpty()) { - generateBody(fn, marker); - // generateAlsoList(inner, marker); - } - xmlWriter().writeEndElement(); // + writeDetailSections(fn, marker, true, QString()); + // generateAlsoList(inner, marker); - // not included: ,
    , or + // not included: or xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // @@ -4661,15 +4667,10 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, writeLocation(en); xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement(APIDESC); - - if (!en->doc().isEmpty()) { - generateBody(en, marker); - } - xmlWriter().writeEndElement(); // + writeDetailSections(en, marker, true, QString()); - // not included: ,
    , or + // not included: or xmlWriter().writeEndElement(); // @@ -4726,15 +4727,10 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, writeLocation(tn); xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement(APIDESC); - - if (!tn->doc().isEmpty()) { - generateBody(tn, marker); - } - xmlWriter().writeEndElement(); // + writeDetailSections(tn, marker, true, QString()); - // not included: ,
    , or + // not included: or xmlWriter().writeEndElement(); // @@ -4842,15 +4838,10 @@ void DitaXmlGenerator::writeProperties(const Section& s, writeLocation(pn); xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement(APIDESC); - if (!pn->doc().isEmpty()) { - generateBody(pn, marker); - } - - xmlWriter().writeEndElement(); // - - // not included: ,
    , or + writeDetailSections(pn, marker, true, QString()); + + // not included: or xmlWriter().writeEndElement(); // @@ -4929,15 +4920,10 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, writeLocation(vn); xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement(APIDESC); - - if (!vn->doc().isEmpty()) { - generateBody(vn, marker); - } - xmlWriter().writeEndElement(); // + writeDetailSections(vn, marker, true, QString()); - // not included: ,
    , + // not included: or xmlWriter().writeEndElement(); // @@ -5028,15 +5014,10 @@ void DitaXmlGenerator::writeMacros(const Section& s, writeLocation(fn); xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement(APIDESC); - - if (!fn->doc().isEmpty()) { - generateBody(fn, marker); - } - xmlWriter().writeEndElement(); // + writeDetailSections(fn, marker, true, QString()); - // not included: ,
    , or + // not included: or xmlWriter().writeEndElement(); // @@ -5109,6 +5090,55 @@ QXmlStreamWriter& DitaXmlGenerator::xmlWriter() return *xmlWriterStack.top(); } +/*! + Writes the \e {Detailed Description} section(s) for \a node + to the current XML stream using the code \a marker. if the + \a apiDesc flag is true, then the first section of the + sequence of sections written will be an \c {apiDesc>} + element with a \e {spectitle} attribute of \e {Detailed + Description}. Otherwise, the first section will be a + \c {
    } element with a \c {} element of + \e {Detailed Description}. This function calls the + Generator::generateBody() function to write the XML for + the section list. + */ +void DitaXmlGenerator::writeDetailSections(const Node* node, + CodeMarker* marker, + bool apiDesc, + const QString& title) +{ + if (!node->doc().isEmpty()) { + inDetailedDescription = true; + if (apiDesc) { + inApiDesc = true; + xmlWriter().writeStartElement(APIDESC); + xmlWriter().writeAttribute("id",node->guid()); + if (!title.isEmpty()) + xmlWriter().writeAttribute("spectitle",title); + } + else { + inSection = true; + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("id",node->guid()); + if (!title.isEmpty()) { + xmlWriter().writeStartElement("title"); + xmlWriter().writeCharacters(title); + xmlWriter().writeEndElement(); // + } + } + generateBody(node, marker); + if (inApiDesc) { + xmlWriter().writeEndElement(); // + inApiDesc = false; + } + else if (inSection) { + xmlWriter().writeEndElement(); //
    + inSection = false; + } + } + inDetailedDescription = false; +} + QT_END_NAMESPACE #ifdef TO_BE_INCLUDED_IN_API_DESC diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index bd78e93..35c49ae 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -263,6 +263,10 @@ class DitaXmlGenerator : public PageGenerator virtual void beginSubPage(const Location& location, const QString& fileName); virtual void endSubPage(); QXmlStreamWriter& xmlWriter(); + void writeDetailSections(const Node* node, + CodeMarker* marker, + bool apiDesc, + const QString& title); private: QMap refMap; @@ -315,6 +319,9 @@ class DitaXmlGenerator : public PageGenerator NewClassMaps newClassMaps; NewClassMaps newQmlClassMaps; static int id; + static bool inApiDesc; + static bool inSection; + static bool inDetailedDescription; QStack xmlWriterStack; }; diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 5bd5156..1a41399 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -327,6 +327,7 @@ bool Generator::generateText(const Text& text, const Node *relative, CodeMarker *marker) { + bool result = false; if (text.firstAtom() != 0) { int numAtoms = 0; startText(relative, marker); @@ -336,9 +337,9 @@ bool Generator::generateText(const Text& text, true, numAtoms); endText(relative, marker); - return true; + result = true; } - return false; + return result; } #ifdef QDOC_QML @@ -352,24 +353,26 @@ bool Generator::generateQmlText(const Text& text, const QString& /* qmlName */ ) { const Atom* atom = text.firstAtom(); - if (atom == 0) - return false; + bool result = false; - startText(relative, marker); - while (atom) { - if (atom->type() != Atom::QmlText) - atom = atom->next(); - else { - atom = atom->next(); - while (atom && (atom->type() != Atom::EndQmlText)) { - int n = 1 + generateAtom(atom, relative, marker); - while (n-- > 0) - atom = atom->next(); + if (atom != 0) { + startText(relative, marker); + while (atom) { + if (atom->type() != Atom::QmlText) + atom = atom->next(); + else { + atom = atom->next(); + while (atom && (atom->type() != Atom::EndQmlText)) { + int n = 1 + generateAtom(atom, relative, marker); + while (n-- > 0) + atom = atom->next(); + } } } + endText(relative, marker); + result = true; } - endText(relative, marker); - return true; + return result; } #endif @@ -377,14 +380,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) { bool quiet = false; - if (node->type() == Node::Function) { -#if 0 - const FunctionNode *func = (const FunctionNode *) node; - if (func->isOverload() && func->metaness() != FunctionNode::Ctor) - generateOverload(node, marker); -#endif - } - else if (node->type() == Node::Fake) { + if (node->type() == Node::Fake) { const FakeNode *fake = static_cast(node); if (fake->subType() == Node::Example) { generateExampleFiles(fake, marker); @@ -501,18 +497,16 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) ++a; } } -/* Something like this return value check should be implemented at some point. */ + /* + Something like this return value check should + be implemented at some point. + */ if (func->status() > Node::Obsolete && func->returnType() == "bool" && func->reimplementedFrom() == 0 && !func->isOverload()) { QString body = func->doc().body().toString(); if (!body.contains("return", Qt::CaseInsensitive)) node->doc().location().warning(tr("Undocumented return value")); } -#if 0 - // Now we put this at the top, before the other text. - if (func->reimplementedFrom() != 0) - generateReimplementedFrom(func, marker); -#endif } } @@ -1091,20 +1085,6 @@ void Generator::generateSince(const Node *node, CodeMarker *marker) } } -/*! - No longer in use. - */ -void Generator::generateOverload(const Node *node, CodeMarker *marker) -{ - Text text; - text << Atom::ParaLeft - << "This function overloads "; - QString t = node->name() + "()"; - text << Atom::AutoLink << t - << Atom::ParaRight; - generateText(text, node, marker); -} - void Generator::generateReimplementedFrom(const FunctionNode *func, CodeMarker *marker) { @@ -1153,8 +1133,8 @@ const Atom *Generator::generateAtomList(const Atom *atom, if (atom->type() == Atom::FormatEndif) { if (generate && numAtoms0 == numAtoms) { - relative->location().warning(tr("Output format %1 not handled") - .arg(format())); + relative->location().warning(tr("Output format %1 not handled %2") + .arg(format()).arg(outFileName())); Atom unhandledFormatAtom(Atom::UnhandledFormat, format()); generateAtomList(&unhandledFormatAtom, relative, diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index 326a247..bccfc5d 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -130,6 +130,8 @@ class Generator const Node *relative, CodeMarker *marker) const; + virtual QString outFileName() { return QString(); } + const QString& outputDir() { return outDir; } QString indent(int level, const QString& markedCode); QString plainCode(const QString& markedCode); @@ -148,7 +150,6 @@ class Generator static void supplementAlsoList(const Node *node, QList &alsoList); private: - void generateOverload(const Node *node, CodeMarker *marker); void generateReimplementedFrom(const FunctionNode *func, CodeMarker *marker); void appendFullName(Text& text, diff --git a/tools/qdoc3/test/qt-ditaxml.qdocconf b/tools/qdoc3/test/qt-ditaxml.qdocconf index 66f30e3..63baead 100644 --- a/tools/qdoc3/test/qt-ditaxml.qdocconf +++ b/tools/qdoc3/test/qt-ditaxml.qdocconf @@ -9,3 +9,34 @@ outputformats = DITAXML generateindex = true url = . +macro.aacute.DITAXML = "á" +macro.Aring.DITAXML = "Å" +macro.aring.DITAXML = "å" +macro.Auml.DITAXML = "Ä" +macro.author = "\\bold{Author:}" +macro.br.DITAXML = " " +macro.BR.DITAXML = " " +macro.copyright.DITAXML = "©" +macro.eacute.DITAXML = "é" +macro.gui = "\\bold" +macro.hr.DITAXML = "
    " +macro.iacute.DITAXML = "í" +macro.key = "\\bold" +macro.menu = "\\bold" +macro.note = "\\bold{Note:}" +macro.oslash.DITAXML = "ø" +macro.ouml.DITAXML = "ö" +macro.QA = "\\e{Qt Assistant}" +macro.QD = "\\e{Qt Designer}" +macro.QL = "\\e{Qt Linguist}" +macro.QQV = "\\e{Qt QML Viewer}" +macro.param = "\\e" +macro.raisedaster.DITAXML = "*" +macro.rarrow.DITAXML = "→" +macro.reg.DITAXML = "®" +macro.return = "Returns" +macro.starslash = "\\c{*/}" +macro.begincomment = "\\c{/*}" +macro.endcomment = "\\c{*/}" +macro.uuml.DITAXML = "ü" +macro.mdash.DITAXML = "—" -- cgit v0.12 From 839938e86dd22601b679c5f33606830850d6df81 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 20 Sep 2010 14:40:42 +0200 Subject: qdoc: DITA XML generator now avoids escaping elements. Still escapes and , for example. --- tools/qdoc3/ditaxmlgenerator.cpp | 191 +++++++++++++++++---------------------- tools/qdoc3/ditaxmlgenerator.h | 1 + 2 files changed, 84 insertions(+), 108 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 9c70cb5..0170644 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -358,19 +358,21 @@ QString DitaXmlGenerator::sinceTitles[] = static bool showBrokenLinks = false; -static void addLink(const QString &linkTarget, - const QStringRef &nestedStuff, - QString *res) +/*! + Appends an element to the current XML stream + with the \a href attribute and the \a text. + */ +void DitaXmlGenerator::addLink(const QString& href, + const QStringRef& text) { - if (!linkTarget.isEmpty()) { - *res += ""; - *res += nestedStuff; - *res += ""; + if (!href.isEmpty()) { + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href", href); + xmlWriter().writeCharacters(text.toString()); + xmlWriter().writeEndElement(); // } else { - *res += nestedStuff; + xmlWriter().writeCharacters(text.toString()); } } @@ -2240,14 +2242,14 @@ QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, xmlWriter().writeAttribute("href","qt3support.html"); xmlWriter().writeCharacters("Qt 3 support layer"); xmlWriter().writeEndElement(); // - xmlWriter().writeCharacters("."); + xmlWriter().writeCharacters(". "); xmlWriter().writeEndElement(); // - xmlWriter().writeCharacters(" They are provided to help you port old code to Qt 4. " + xmlWriter().writeCharacters("They are provided to help you port old code to Qt 4. " "We advise against using them in new code."); } else { xmlWriter().writeStartElement("b"); - xmlWriter().writeCharacters("The following class members are obsolete."); + xmlWriter().writeCharacters("The following class members are obsolete. "); xmlWriter().writeEndElement(); // xmlWriter().writeCharacters("They are provided to keep old source code working. " "We strongly advise against using them in new code."); @@ -3050,101 +3052,20 @@ void DitaXmlGenerator::writeText(const QString& markedCode, const QChar charLangle = '<'; const QChar charAt = '@'; - // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*()" - static const QString linkTag("link"); - bool done = false; - for (int i = 0, n = src.size(); i < n;) { - if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { - if (nameAlignment && !done) {// && (i != 0)) Why was this here? - if (!html.isEmpty()) { - xmlWriter().writeCharacters(html); - html.clear(); - } - xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement("entry"); - xmlWriter().writeAttribute("outputclass=","memItemRight bottomAlign"); - done = true; - } - i += 2; - if (parseArg(src, linkTag, &i, n, &arg, &par1)) { - html += ""; - QString link = linkForNode( - CodeMarker::nodeForString(par1.toString()), relative); - addLink(link, arg, &html); - html += ""; - } - else { - html += charLangle; - html += charAt; - } - } - else { - html += src.at(i++); - } - } - - // replace all "(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)()" tags - src = html; - html = QString(); - static const QString typeTags[] = { "type", "headerfile", "func" }; - for (int i = 0, n = src.size(); i < n;) { - if (src.at(i) == charLangle && src.at(i + 1) == charAt) { - i += 2; - bool handled = false; - for (int k = 0; k != 3; ++k) { - if (parseArg(src, typeTags[k], &i, n, &arg, &par1)) { - par1 = QStringRef(); - QString link = linkForNode( - marker->resolveTarget(arg.toString(), myTree, relative), - relative); - addLink(link, arg, &html); - handled = true; - break; - } - } - if (!handled) { - html += charLangle; - html += charAt; - } - } - else { - html += src.at(i++); - } - } - - // replace all - // "<@comment>" -> ""; - // "<@preprocessor>" -> ""; - // "<@string>" -> ""; - // "<@char>" -> ""; - // "" -> "" - src = html; - html = QString(); + /* + First strip out all the extraneous markup. The table + below contains the markup we want to keep. Everything + else that begins with "<@" or "", "", - "<@preprocessor>", "", - "<@string>", "", - "<@char>", "", - "", "", - "","", - "", "", - "", "" - // "<@char>", "", - // "", "", - // "<@func>", "", - // "", "", - // "<@id>", "", - // "", "", - // "<@keyword>", "", - // "", "", - // "<@number>", "", - // "", "", - // "<@op>", "", - // "", "", - // "<@param>", "", - // "", "", - // "<@string>", "", - // "", "", + "<@link ", "<@link ", + "<@type>", "<@type>", + "<@headerfile>", "<@headerfile>", + "<@func>", "<@func>", + "", "", + "", "", + "", "", + "", "" }; for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle) { @@ -3178,8 +3099,62 @@ void DitaXmlGenerator::writeText(const QString& markedCode, ++i; } } - if (!html.isEmpty()) + + // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*()" + // replace all "(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)()" tags + src = html; + html = QString(); + static const QString markTags[] = { "link", "type", "headerfile", "func" }; + bool done = false; + for (int i = 0, n = src.size(); i < n;) { + if (src.at(i) == charLangle && src.at(i + 1) == charAt) { + if (nameAlignment && !done) { + if (!html.isEmpty()) { + xmlWriter().writeCharacters(html); + html.clear(); + } + xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement("entry"); + xmlWriter().writeAttribute("outputclass=","memItemRight bottomAlign"); + done = true; + } + i += 2; + bool handled = false; + for (int k = 0; k != 4; ++k) { + if (parseArg(src, markTags[k], &i, n, &arg, &par1)) { + const Node* n = 0; + if (k == 0) { + if (!html.isEmpty()) { + xmlWriter().writeCharacters(html); + html.clear(); + } + n = CodeMarker::nodeForString(par1.toString()); + QString link = linkForNode(n, relative); + addLink(link, arg); + } + else { + if (!html.isEmpty()) { + xmlWriter().writeCharacters(html); + html.clear(); + } + par1 = QStringRef(); + marker->resolveTarget(arg.toString(), myTree, relative); + QString link = linkForNode(n,relative); + addLink(link, arg); + } + handled = true; + break; + } + } + } + else { + html += src.at(i++); + } + } + + if (!html.isEmpty()) { xmlWriter().writeCharacters(html); + } } void DitaXmlGenerator::generateLink(const Atom* atom, diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 35c49ae..a5346a5 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -267,6 +267,7 @@ class DitaXmlGenerator : public PageGenerator CodeMarker* marker, bool apiDesc, const QString& title); + void addLink(const QString& href, const QStringRef& text); private: QMap refMap; -- cgit v0.12 From 445513153c6c4f80eccf77c33ca38574b5972922 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 21 Sep 2010 09:35:32 +0200 Subject: qdoc: DITA XML generator now avoids escaping and elements. --- tools/qdoc3/ditaxmlgenerator.cpp | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 0170644..de70d29 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -3010,9 +3010,10 @@ QString DitaXmlGenerator::getMarkedUpSynopsis(const Node* node, } marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])"), "\\1\\2"); +#if 0 marked.replace("<@param>",""); marked.replace("",""); - +#endif if (style == CodeMarker::Summary) { marked.replace("<@name>",""); // was "" marked.replace("",""); // was "" @@ -3023,10 +3024,12 @@ QString DitaXmlGenerator::getMarkedUpSynopsis(const Node* node, extraRegExp.setMinimal(true); marked.replace(extraRegExp,""); } +#if 0 else { marked.replace("<@extra>",""); marked.replace("",""); } +#endif if (style != CodeMarker::Detailed) { marked.replace("<@type>",""); @@ -3062,15 +3065,19 @@ void DitaXmlGenerator::writeText(const QString& markedCode, "<@type>", "<@type>", "<@headerfile>", "<@headerfile>", "<@func>", "<@func>", + "<@param>", "<@param>", + "<@extra>", "<@extra>", "", "", "", "", "", "", - "", "" + "", "", + "", "", + "", "" }; for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle) { bool handled = false; - for (int k = 0; k != 8; ++k) { + for (int k = 0; k != 12; ++k) { const QString & tag = spanTags[2 * k]; if (tag == QStringRef(&src, i, tag.length())) { html += spanTags[2 * k + 1]; @@ -3104,7 +3111,10 @@ void DitaXmlGenerator::writeText(const QString& markedCode, // replace all "(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)()" tags src = html; html = QString(); - static const QString markTags[] = { "link", "type", "headerfile", "func" }; + static const QString markTags[] = { + // 0 1 2 3 4 5 + "link", "type", "headerfile", "func", "param", "extra" + }; bool done = false; for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1) == charAt) { @@ -3120,10 +3130,10 @@ void DitaXmlGenerator::writeText(const QString& markedCode, } i += 2; bool handled = false; - for (int k = 0; k != 4; ++k) { + for (int k = 0; k != 6; ++k) { if (parseArg(src, markTags[k], &i, n, &arg, &par1)) { const Node* n = 0; - if (k == 0) { + if (k == 0) { // <@link> if (!html.isEmpty()) { xmlWriter().writeCharacters(html); html.clear(); @@ -3132,6 +3142,24 @@ void DitaXmlGenerator::writeText(const QString& markedCode, QString link = linkForNode(n, relative); addLink(link, arg); } + else if (k == 4) { // <@param> + if (!html.isEmpty()) { + xmlWriter().writeCharacters(html); + html.clear(); + } + xmlWriter().writeStartElement("i"); + xmlWriter().writeCharacters(arg.toString()); + xmlWriter().writeEndElement(); // + } + else if (k == 5) { // <@extra> + if (!html.isEmpty()) { + xmlWriter().writeCharacters(html); + html.clear(); + } + xmlWriter().writeStartElement("tt"); + xmlWriter().writeCharacters(arg.toString()); + xmlWriter().writeEndElement(); // + } else { if (!html.isEmpty()) { xmlWriter().writeCharacters(html); -- cgit v0.12 From 5d1a38fc9e5a8fbbbb78ed8aeb7e328b97781474 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 21 Sep 2010 13:05:07 +0200 Subject: qdoc: Replaced missing "const" That caused link errors. A const had been erroneously dropped from some fileBase() functions. --- tools/qdoc3/ditaxmlgenerator.cpp | 2 +- tools/qdoc3/ditaxmlgenerator.h | 5 +---- tools/qdoc3/htmlgenerator.cpp | 4 ++-- tools/qdoc3/htmlgenerator.h | 4 ++-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index de70d29..d25c76c 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -3361,7 +3361,7 @@ QString DitaXmlGenerator::protect(const QString& string, const QString& outputEn Constructs a file name appropriate for the \a node and returns the file name. */ -QString DitaXmlGenerator::fileBase(const Node* node) +QString DitaXmlGenerator::fileBase(const Node* node) const { QString result; result = PageGenerator::fileBase(node); diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index a5346a5..6f99e90 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -231,10 +231,7 @@ class DitaXmlGenerator : public PageGenerator void generateStatus(const Node* node, CodeMarker* marker); QString registerRef(const QString& ref); - QString fileBase(const Node* node); -#if 0 - QString fileBase(const Node* node, const SectionIterator& section); -#endif + QString fileBase(const Node* node) const; QString fileName(const Node* node); void findAllClasses(const InnerNode* node); void findAllFunctions(const InnerNode* node); diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 77e306a..2849325 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -3417,7 +3417,7 @@ QString HtmlGenerator::protect(const QString &string, const QString &outputEncod #undef APPEND } -QString HtmlGenerator::fileBase(const Node *node) +QString HtmlGenerator::fileBase(const Node *node) const { QString result; @@ -3440,7 +3440,7 @@ QString HtmlGenerator::fileBase(const Node *node) #if 0 QString HtmlGenerator::fileBase(const Node *node, - const SectionIterator& section) + const SectionIterator& section) const { QStringList::ConstIterator s = section.sectionNumber().end(); QStringList::ConstIterator b = section.baseNameStack().end(); diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index d885ada..430aca2 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -241,9 +241,9 @@ class HtmlGenerator : public PageGenerator void generateStatus(const Node *node, CodeMarker *marker); QString registerRef(const QString& ref); - QString fileBase(const Node *node); + QString fileBase(const Node *node) const; #if 0 - QString fileBase(const Node *node, const SectionIterator& section); + QString fileBase(const Node *node, const SectionIterator& section) const; #endif QString fileName(const Node *node); void findAllClasses(const InnerNode *node); -- cgit v0.12 From 0840b0a1c14093c3dc1cbe16561ae6c8d7096fa9 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 21 Sep 2010 14:23:11 +0200 Subject: qdoc: YREKA! Now using GUIDs for node href attributes. --- tools/qdoc3/ditaxmlgenerator.cpp | 26 +++++++++++++++++++++----- tools/qdoc3/ditaxmlgenerator.h | 3 ++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index d25c76c..13d33e8 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -531,6 +531,17 @@ QString DitaXmlGenerator::writeGuidAttribute(QString text) return guid; } + +/*! + Write's the GUID for the \a node to the current XML stream + as an "id" attribute. If the \a node doesn't yet have a GUID, + one is generated. + */ +void DitaXmlGenerator::writeGuidAttribute(Node* node) +{ + xmlWriter().writeAttribute("id",node->guid()); +} + /*! Looks up \a text in the GUID map. If it finds \a text, it returns the associated GUID. Otherwise it inserts @@ -1863,7 +1874,7 @@ void DitaXmlGenerator::generateHeader(const Node* node, const QString& name) outputclass = "example"; break; case Node::HeaderFile: - outputclass = "header"; + outputclass = "headerfile"; break; case Node::File: outputclass = "file"; @@ -3296,6 +3307,8 @@ QString DitaXmlGenerator::registerRef(const QString& ref) } else if (prevRef == ref) break; + else + qDebug() << "PREVREF:" << prevRef; clean += "x"; } return clean; @@ -3470,8 +3483,10 @@ QString DitaXmlGenerator::linkForNode(const Node* node, const Node* relative) return QString(); fn = fileName(node); - link += fn; + link += fn + "#" + node->guid(); + return link; +#if 0 if (!node->isInnerNode() || node->subType() == Node::QmlPropertyGroup) { ref = refForNode(node); if (relative && fn == fileName(relative) && ref == refForNode(relative)) @@ -3481,6 +3496,7 @@ QString DitaXmlGenerator::linkForNode(const Node* node, const Node* relative) link += ref; } return link; +#endif } QString DitaXmlGenerator::refForAtom(Atom* atom, const Node* /* node */) @@ -3517,7 +3533,7 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode, xmlWriter().writeEndElement(); // } -void DitaXmlGenerator::generateDetailedMember(const Node* node, +void DitaXmlGenerator::generateDetailedMember(Node* node, const InnerNode* relative, CodeMarker* marker) { @@ -3527,7 +3543,7 @@ void DitaXmlGenerator::generateDetailedMember(const Node* node, if ((node->type() == Node::Enum) && (en = static_cast(node))->flagsType()) { xmlWriter().writeStartElement("p"); - writeGuidAttribute(refForNode(node)); + writeGuidAttribute(node); xmlWriter().writeAttribute("outputclass","h3 flags"); marked = getMarkedUpSynopsis(en, relative, marker, CodeMarker::Detailed); writeText(marked, marker, relative); @@ -3538,7 +3554,7 @@ void DitaXmlGenerator::generateDetailedMember(const Node* node, } else { xmlWriter().writeStartElement("p"); - writeGuidAttribute(refForNode(node)); + writeGuidAttribute(node); xmlWriter().writeAttribute("outputclass","h3 fn"); marked = getMarkedUpSynopsis(node, relative, marker, CodeMarker::Detailed); writeText(marked, marker, relative); diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 6f99e90..6a52441 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -222,7 +222,7 @@ class DitaXmlGenerator : public PageGenerator const Node* relative, CodeMarker* marker, const Node* actualNode = 0); - void generateDetailedMember(const Node* node, + void generateDetailedMember(Node* node, const InnerNode* relative, CodeMarker* marker); void generateLink(const Atom* atom, @@ -256,6 +256,7 @@ class DitaXmlGenerator : public PageGenerator CodeMarker* marker); void endLink(); QString writeGuidAttribute(QString text); + void writeGuidAttribute(Node* node); QString lookupGuid(QString text); virtual void beginSubPage(const Location& location, const QString& fileName); virtual void endSubPage(); -- cgit v0.12 From d10863a6d155f5a57fc30dbaf1229e29eef1ba98 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 22 Sep 2010 10:04:45 +0200 Subject: qdoc: Changed the in the . This is now the first part of the generated documentation for a C++ class rather than the first section of the detailed description. This includes the brief text, the inheritance stuff, the inherited-by stuff, and a few other preamble type texts. --- tools/qdoc3/ditaxmlgenerator.cpp | 134 ++++++++++++++++++++++++++------------- tools/qdoc3/ditaxmlgenerator.h | 12 ++-- 2 files changed, 97 insertions(+), 49 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 13d33e8..3efd98b 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1443,7 +1443,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, void DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* marker) { - QList
    sections; QList
    ::ConstIterator s; const ClassNode* cn = 0; @@ -1487,7 +1486,50 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writeLocation(cn); xmlWriter().writeEndElement(); // - writeDetailSections(cn, marker, true, QString("Detailed Description")); + xmlWriter().writeStartElement(APIDESC); + xmlWriter().writeAttribute("spectitle",title); + Text brief = cn->doc().briefText(); + if (!brief.isEmpty()) { + xmlWriter().writeStartElement("p"); + generateText(brief, cn, marker); + xmlWriter().writeEndElement(); //

    + } + generateIncludes(cn, marker); + generateStatus(cn, marker); + generateInherits(cn, marker); + generateInheritedBy(cn, marker); + generateThreadSafeness(cn, marker); + generateSince(cn, marker); + + xmlWriter().writeStartElement("ul"); + + QString membersLink = generateListOfAllMemberFile(inner, marker); + if (!membersLink.isEmpty()) { + writeXrefListItem(membersLink,"List of all members, including inherited members"); + } + + QString obsoleteLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Obsolete); + if (!obsoleteLink.isEmpty()) { + writeXrefListItem(obsoleteLink,"Obsolete members"); + } + + QString compatLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Compat); + if (!compatLink.isEmpty()) { + writeXrefListItem(compatLink,"Qt 3 support members"); + } + + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + + QList
    summarySections; + summarySections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); + + writeDetailedDescription(cn, marker, false, QString("Detailed Description")); + // zzz writeSections() gores here. // not included: or @@ -1496,9 +1538,10 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark // not included: // not included: - sections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay); - s = sections.begin(); - while (s != sections.end()) { + QList
    detailSections; + detailSections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay); + s = detailSections.begin(); + while (s != detailSections.end()) { if ((*s).name == "Member Function Documentation") { writeFunctions((*s),cn,marker); } @@ -1631,7 +1674,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker ++s; } - writeDetailSections(fake, marker, false, QString("Detailed Description")); + writeDetailedDescription(fake, marker, false, QString("Detailed Description")); if (cn) generateQmlText(cn->doc().body(), cn, marker, fake->name()); @@ -1660,10 +1703,10 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker if (!fake->doc().isEmpty()) { xmlWriter().writeStartElement("body"); if (fake->subType() == Node::Module) { - writeDetailSections(fake, marker, false, QString("Detailed Description")); + writeDetailedDescription(fake, marker, false, QString("Detailed Description")); } else - writeDetailSections(fake, marker, false, QString()); + writeDetailedDescription(fake, marker, false, QString()); generateAlsoList(fake, marker); if (!fake->groupMembers().isEmpty()) { @@ -1832,10 +1875,15 @@ void DitaXmlGenerator::generateBreadCrumbs(const QString& title, } /*! - Outputs an XML file header depending on which kind of DITA XML - file is being generated. + Writes an XML file header to the current XML stream. This + depends on which kind of DITA XML file is being generated, + which is determined by the \a node type and subtype and the + \a subpage flag. If the \subpage flag is true, a \c{} + header is written, regardless of the type of \a node. */ -void DitaXmlGenerator::generateHeader(const Node* node, const QString& name) +void DitaXmlGenerator::generateHeader(const Node* node, + const QString& name, + bool subpage) { if (!node) return; @@ -1848,16 +1896,7 @@ void DitaXmlGenerator::generateHeader(const Node* node, const QString& name) QString version; QString outputclass; - if (node->type() == Node::Class) { - mainElement = "cxxClass"; - nameElement = "apiName"; - dtd = "dtd/cxxClass.dtd"; - version = "0.6.0"; - doctype = ""; - } - else if (node->type() == Node::Fake) { + if (node->type() == Node::Fake || subpage) { mainElement = "topic"; nameElement = "title"; dtd = "dtd/topic.dtd"; @@ -1895,6 +1934,15 @@ void DitaXmlGenerator::generateHeader(const Node* node, const QString& name) outputclass = "page"; } } + else if (node->type() == Node::Class) { + mainElement = "cxxClass"; + nameElement = "apiName"; + dtd = "dtd/cxxClass.dtd"; + version = "0.6.0"; + doctype = ""; + } xmlWriter().writeDTD(doctype); xmlWriter().writeComment(node->doc().location().fileName()); @@ -1949,7 +1997,7 @@ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) ++noLinks; xmlWriter().writeStartElement(SHORTDESC); generateText(brief, node, marker); - xmlWriter().writeEndElement(); // shortdesc + xmlWriter().writeEndElement(); // --noLinks; } } @@ -2186,7 +2234,7 @@ QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode* inner, QString fileName = fileBase(inner) + "-members." + fileExtension(inner); beginSubPage(inner->location(), fileName); QString title = "List of All Members for " + inner->name(); - generateHeader(inner, title); + generateHeader(inner, title, true); xmlWriter().writeStartElement("body"); xmlWriter().writeStartElement("section"); if (!title.isEmpty()) { @@ -2235,7 +2283,7 @@ QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, fileName = fileBase(inner) + "-obsolete." + fileExtension(inner); } beginSubPage(inner->location(), fileName); - generateHeader(inner, title); + generateHeader(inner, title, true); xmlWriter().writeStartElement("body"); xmlWriter().writeStartElement("section"); if (!title.isEmpty()) { @@ -4531,7 +4579,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, writeLocation(fn); xmlWriter().writeEndElement(); // - writeDetailSections(fn, marker, true, QString()); + writeDetailedDescription(fn, marker, true, QString()); // generateAlsoList(inner, marker); // not included: or @@ -4687,7 +4735,7 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, writeLocation(en); xmlWriter().writeEndElement(); // - writeDetailSections(en, marker, true, QString()); + writeDetailedDescription(en, marker, true, QString()); // not included: or @@ -4747,7 +4795,7 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, writeLocation(tn); xmlWriter().writeEndElement(); // - writeDetailSections(tn, marker, true, QString()); + writeDetailedDescription(tn, marker, true, QString()); // not included: or @@ -4858,7 +4906,7 @@ void DitaXmlGenerator::writeProperties(const Section& s, writeLocation(pn); xmlWriter().writeEndElement(); // - writeDetailSections(pn, marker, true, QString()); + writeDetailedDescription(pn, marker, true, QString()); // not included: or @@ -4940,7 +4988,7 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, writeLocation(vn); xmlWriter().writeEndElement(); // - writeDetailSections(vn, marker, true, QString()); + writeDetailedDescription(vn, marker, true, QString()); // not included: or @@ -5034,7 +5082,7 @@ void DitaXmlGenerator::writeMacros(const Section& s, writeLocation(fn); xmlWriter().writeEndElement(); // - writeDetailSections(fn, marker, true, QString()); + writeDetailedDescription(fn, marker, true, QString()); // not included: or @@ -5110,21 +5158,19 @@ QXmlStreamWriter& DitaXmlGenerator::xmlWriter() } /*! - Writes the \e {Detailed Description} section(s) for \a node - to the current XML stream using the code \a marker. if the - \a apiDesc flag is true, then the first section of the - sequence of sections written will be an \c {apiDesc>} - element with a \e {spectitle} attribute of \e {Detailed - Description}. Otherwise, the first section will be a - \c {
    } element with a \c {} element of - \e {Detailed Description}. This function calls the - Generator::generateBody() function to write the XML for - the section list. + Writes the \e {Detailed Description} section(s) for \a node to the + current XML stream using the code \a marker. if the \a apiDesc flag + is true, then the first section of the sequence of sections written + will be an \c {apiDesc>} element with a \e {spectitle} attribute of + \e {Detailed Description}. Otherwise, the first section will be a + \c {<section>} element with a \c {<title>} element of \e {Detailed + Description}. This function calls the Generator::generateBody() + function to write the XML for the section list. */ -void DitaXmlGenerator::writeDetailSections(const Node* node, - CodeMarker* marker, - bool apiDesc, - const QString& title) +void DitaXmlGenerator::writeDetailedDescription(const Node* node, + CodeMarker* marker, + bool apiDesc, + const QString& title) { if (!node->doc().isEmpty()) { inDetailedDescription = true; diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 6a52441..5ec4a6c 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -150,7 +150,9 @@ class DitaXmlGenerator : public PageGenerator void generateBreadCrumbs(const QString& title, const Node* node, CodeMarker* marker); - void generateHeader(const Node* node, const QString& name); + void generateHeader(const Node* node, + const QString& name, + bool subpage = false); void generateTitle(const QString& title, const Text& subTitle, SubTitleSize subTitleSize, @@ -261,10 +263,10 @@ class DitaXmlGenerator : public PageGenerator virtual void beginSubPage(const Location& location, const QString& fileName); virtual void endSubPage(); QXmlStreamWriter& xmlWriter(); - void writeDetailSections(const Node* node, - CodeMarker* marker, - bool apiDesc, - const QString& title); + void writeDetailedDescription(const Node* node, + CodeMarker* marker, + bool apiDesc, + const QString& title); void addLink(const QString& href, const QStringRef& text); private: -- cgit v0.12 From 40479a41ce6e51f32c4120f290cbe36b3d7424b0 Mon Sep 17 00:00:00 2001 From: Martin Smith <martin.smith@nokia.com> Date: Wed, 22 Sep 2010 12:57:25 +0200 Subject: qdoc: Added the summary sections to the cxxClass. --- tools/qdoc3/ditaxmlgenerator.cpp | 71 ++++++++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 3efd98b..02be9fd 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1525,12 +1525,56 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeEndElement(); // </ul> xmlWriter().writeEndElement(); // </apiDesc> + bool needOtherSection = false; QList<Section> summarySections; summarySections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); - + s = summarySections.begin(); + while (s != summarySections.end()) { + if (s->members.isEmpty() && s->reimpMembers.isEmpty()) { + if (!s->inherited.isEmpty()) + needOtherSection = true; + } + else { + if (!s->members.isEmpty()) { + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeStartElement("title"); + xmlWriter().writeCharacters(protectEnc((*s).name)); + xmlWriter().writeEndElement(); // + generateSection(s->members, inner, marker, CodeMarker::Summary); + generateSectionInheritedList(*s, inner, marker); + xmlWriter().writeEndElement(); //
    + } + if (!s->reimpMembers.isEmpty()) { + QString name = QString("Reimplemented ") + (*s).name; + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeStartElement("title"); + xmlWriter().writeCharacters(protectEnc(name)); + xmlWriter().writeEndElement(); // + generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); + generateSectionInheritedList(*s, inner, marker); + xmlWriter().writeEndElement(); //
    + } + } + ++s; + } + if (needOtherSection) { + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","h3"); + xmlWriter().writeStartElement("title"); + xmlWriter().writeCharacters("Additional Inherited Members"); + xmlWriter().writeEndElement(); // + s = summarySections.begin(); + while (s != summarySections.end()) { + if (s->members.isEmpty()) + generateSectionInheritedList(*s, inner, marker); + ++s; + } + } + writeDetailedDescription(cn, marker, false, QString("Detailed Description")); - // zzz writeSections() gores here. // not included: or xmlWriter().writeEndElement(); // @@ -3022,7 +3066,7 @@ void DitaXmlGenerator::generateSection(const NodeList& nl, } /*! - Writes the "inherited from" lists to the current XML stream. + Writes the "inherited from" list to the current XML stream. */ void DitaXmlGenerator::generateSectionInheritedList(const Section& section, const Node* relative, @@ -3031,19 +3075,26 @@ void DitaXmlGenerator::generateSectionInheritedList(const Section& section, if (section.inherited.isEmpty()) return; xmlWriter().writeStartElement("ul"); - QList >::ConstIterator p = section.inherited.begin(); + QList >::ConstIterator p = section.inherited.begin(); while (p != section.inherited.end()) { xmlWriter().writeStartElement("li"); xmlWriter().writeAttribute("outputclass","fn"); - QString text = (*p).second + " "; + QString text; + text.setNum((*p).second); + text += " "; if ((*p).second == 1) text += section.singularMember; else text += section.pluralMember; - text += " inherited from "; - text += protectEnc(marker->plainFullName((*p).first, relative)) + ""; + text += " inherited from "; + xmlWriter().writeCharacters(text); + xmlWriter().writeStartElement("xref"); + text = fileName((*p).first) + "#"; + text += DitaXmlGenerator::cleanRef(section.name.toLower()); + xmlWriter().writeAttribute("href",text); + text = protectEnc(marker->plainFullName((*p).first, relative)); xmlWriter().writeCharacters(text); + xmlWriter().writeEndElement(); // ++p; } xmlWriter().writeEndElement(); // @@ -5177,14 +5228,14 @@ void DitaXmlGenerator::writeDetailedDescription(const Node* node, if (apiDesc) { inApiDesc = true; xmlWriter().writeStartElement(APIDESC); - xmlWriter().writeAttribute("id",node->guid()); + // zzz xmlWriter().writeAttribute("id",node->guid()); if (!title.isEmpty()) xmlWriter().writeAttribute("spectitle",title); } else { inSection = true; xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("id",node->guid()); + // zzz xmlWriter().writeAttribute("id",node->guid()); if (!title.isEmpty()) { xmlWriter().writeStartElement("title"); xmlWriter().writeCharacters(title); -- cgit v0.12 From 6cff9860c5390cceee4973fce20798939fae088b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 22 Sep 2010 13:42:15 +0200 Subject: qdoc: Removed some unused parameters. --- tools/qdoc3/ditaxmlgenerator.cpp | 19 +++++++------------ tools/qdoc3/ditaxmlgenerator.h | 22 ++++++---------------- 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 02be9fd..921fdbc 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1590,17 +1590,17 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writeFunctions((*s),cn,marker); } else if ((*s).name == "Member Type Documentation") { - writeEnumerations((*s),cn,marker); - writeTypedefs((*s),cn,marker); + writeEnumerations((*s),marker); + writeTypedefs((*s),marker); } else if ((*s).name == "Member Variable Documentation") { - writeDataMembers((*s),cn,marker); + writeDataMembers((*s),marker); } else if ((*s).name == "Property Documentation") { - writeProperties((*s),cn,marker); + writeProperties((*s),marker); } else if ((*s).name == "Macro Documentation") { - writeMacros((*s),cn,marker); + writeMacros((*s),marker); } ++s; } @@ -4626,7 +4626,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, xmlWriter().writeCharacters(marker->plainFullName(rfn)); xmlWriter().writeEndElement(); // } - writeParameters(fn,marker); + writeParameters(fn); writeLocation(fn); xmlWriter().writeEndElement(); // @@ -4650,7 +4650,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, /*! This function writes the element. */ -void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marker) +void DitaXmlGenerator::writeParameters(const FunctionNode* fn) { const QList& parameters = fn->parameters(); if (!parameters.isEmpty()) { @@ -4688,7 +4688,6 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke This function writes the enum types. */ void DitaXmlGenerator::writeEnumerations(const Section& s, - const ClassNode* cn, CodeMarker* marker) { NodeList::ConstIterator m = s.members.begin(); @@ -4804,7 +4803,6 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, This function writes the output for the \typedef commands. */ void DitaXmlGenerator::writeTypedefs(const Section& s, - const ClassNode* cn, CodeMarker* marker) { NodeList::ConstIterator m = s.members.begin(); @@ -4865,7 +4863,6 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, This is the Q_PROPERTYs. */ void DitaXmlGenerator::writeProperties(const Section& s, - const ClassNode* cn, CodeMarker* marker) { NodeList::ConstIterator m = s.members.begin(); @@ -4975,7 +4972,6 @@ void DitaXmlGenerator::writeProperties(const Section& s, This function outputs the nodes resulting from \variable commands. */ void DitaXmlGenerator::writeDataMembers(const Section& s, - const ClassNode* cn, CodeMarker* marker) { NodeList::ConstIterator m = s.members.begin(); @@ -5057,7 +5053,6 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, This function writes a \macro as a . */ void DitaXmlGenerator::writeMacros(const Section& s, - const ClassNode* cn, CodeMarker* marker) { NodeList::ConstIterator m = s.members.begin(); diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 5ec4a6c..dd0d56e 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -121,22 +121,12 @@ class DitaXmlGenerator : public PageGenerator void writeFunctions(const Section& s, const ClassNode* cn, CodeMarker* marker); - void writeParameters(const FunctionNode* fn, CodeMarker* marker); - void writeEnumerations(const Section& s, - const ClassNode* cn, - CodeMarker* marker); - void writeTypedefs(const Section& s, - const ClassNode* cn, - CodeMarker* marker); - void writeDataMembers(const Section& s, - const ClassNode* cn, - CodeMarker* marker); - void writeProperties(const Section& s, - const ClassNode* cn, - CodeMarker* marker); - void writeMacros(const Section& s, - const ClassNode* cn, - CodeMarker* marker); + void writeParameters(const FunctionNode* fn); + void writeEnumerations(const Section& s, CodeMarker* marker); + void writeTypedefs(const Section& s, CodeMarker* marker); + void writeDataMembers(const Section& s, CodeMarker* marker); + void writeProperties(const Section& s, CodeMarker* marker); + void writeMacros(const Section& s, CodeMarker* marker); void writePropertyParameter(const QString& tag, const NodeList& nlist); private: -- cgit v0.12 From 4ea898fe70fd7a77a95c87668807f8af8342780b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 24 Sep 2010 15:30:29 +0200 Subject: qdoc: Corrected many GUIDs. Still more to do here. --- tools/qdoc3/atom.cpp | 1 + tools/qdoc3/atom.h | 1 + tools/qdoc3/ditaxmlgenerator.cpp | 215 +++++++++++++++++++++++++++++---------- tools/qdoc3/ditaxmlgenerator.h | 11 +- tools/qdoc3/pagegenerator.cpp | 17 +++- tools/qdoc3/text.cpp | 4 +- 6 files changed, 189 insertions(+), 60 deletions(-) diff --git a/tools/qdoc3/atom.cpp b/tools/qdoc3/atom.cpp index 6f1602e..d18c3c4 100644 --- a/tools/qdoc3/atom.cpp +++ b/tools/qdoc3/atom.cpp @@ -190,6 +190,7 @@ static const struct { { "FormattingLeft", Atom::FormattingLeft }, { "FormattingRight", Atom::FormattingRight }, { "GeneratedList", Atom::GeneratedList }, + { "GuidLink", Atom::GuidLink}, { "Image", Atom::Image }, { "ImageText", Atom::ImageText }, { "InlineImage", Atom::InlineImage }, diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h index 70fbae9..13df07b 100644 --- a/tools/qdoc3/atom.h +++ b/tools/qdoc3/atom.h @@ -83,6 +83,7 @@ class Atom FormattingLeft, FormattingRight, GeneratedList, + GuidLink, Image, ImageText, InlineImage, diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 921fdbc..16215cd 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -395,6 +395,7 @@ DitaXmlGenerator::DitaXmlGenerator() noLinks(0), tableColumnCount(0) { + // nothing yet. } /*! @@ -402,7 +403,11 @@ DitaXmlGenerator::DitaXmlGenerator() */ DitaXmlGenerator::~DitaXmlGenerator() { - // nothing yet. + GuidMaps::iterator i = guidMaps.begin(); + while (i != guidMaps.end()) { + delete i.value(); + ++i; + } } /*! @@ -526,7 +531,7 @@ QString DitaXmlGenerator::format() */ QString DitaXmlGenerator::writeGuidAttribute(QString text) { - QString guid = lookupGuid(text); + QString guid = lookupGuid(outFileName(),text); xmlWriter().writeAttribute("id",guid); return guid; } @@ -559,6 +564,41 @@ QString DitaXmlGenerator::lookupGuid(QString text) } /*! + First, look up the GUID map for \a fileName. If there isn't + a GUID map for \a fileName, create one and insert it into + the map of GUID maps. Then look up \a text in that GUID map. + If \a text is found, return the associated GUID. Otherwise, + insert \a text into the GUID map with a new GUID, and return + the new GUID. + */ +QString DitaXmlGenerator::lookupGuid(const QString& fileName, const QString& text) +{ + GuidMap* gm = lookupGuidMap(fileName); + GuidMap::const_iterator i = gm->find(text); + if (i != gm->end()) + return i.value(); + QString guid = QUuid::createUuid().toString(); + gm->insert(text,guid); + return guid; +} + +/*! + Looks up \a fileName in the map of GUID maps. If it finds + \a fileName, it returns a pointer to the associated GUID + map. Otherwise it creates a new GUID map and inserts it + into the map of GUID maps with \a fileName as its key. + */ +GuidMap* DitaXmlGenerator::lookupGuidMap(const QString& fileName) +{ + GuidMaps::const_iterator i = guidMaps.find(fileName); + if (i != guidMaps.end()) + return i.value(); + GuidMap* gm = new GuidMap; + guidMaps.insert(fileName,gm); + return gm; +} + +/*! This is where the DITA XML files are written. \note The file generation is done in the base class, PageGenerator::generateTree(). @@ -688,10 +728,13 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeEndElement(); // sse writeStartElement() above break; case Atom::Code: - xmlWriter().writeStartElement("pre"); - xmlWriter().writeAttribute("outputclass","highlightedcode"); - writeText(trimmedTrailing(atom->string()), marker, relative); - xmlWriter().writeEndElement(); // + { + xmlWriter().writeStartElement("pre"); + xmlWriter().writeAttribute("outputclass","highlightedcode"); + QString chars = trimmedTrailing(atom->string()); + writeText(chars, marker, relative); + xmlWriter().writeEndElement(); // + } break; case Atom::Qml: xmlWriter().writeStartElement("pre"); @@ -1060,14 +1103,27 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, const Node *node = 0; QString myLink = getLink(atom, relative, marker, &node); if (myLink.isEmpty()) { - relative->doc().location().warning(tr("Cannot link to '%1' in %2") + relative->doc().location().warning(tr("Can't link to '%1' in %2") .arg(atom->string()) .arg(marker->plainFullName(relative))); } +#if 0 + else + qDebug() << "MYLINK:" << myLink << outFileName();; +#endif beginLink(myLink, node, relative, marker); skipAhead = 1; } break; + case Atom::GuidLink: + { +#if 0 + qDebug() << "GUID LINK:" << atom->string() << outFileName(); +#endif + beginLink(atom->string(), 0, relative, marker); + skipAhead = 1; + } + break; case Atom::LinkNode: { const Node *node = CodeMarker::nodeForString(atom->string()); @@ -3089,12 +3145,14 @@ void DitaXmlGenerator::generateSectionInheritedList(const Section& section, text += " inherited from "; xmlWriter().writeCharacters(text); xmlWriter().writeStartElement("xref"); + // zzz text = fileName((*p).first) + "#"; text += DitaXmlGenerator::cleanRef(section.name.toLower()); xmlWriter().writeAttribute("href",text); text = protectEnc(marker->plainFullName((*p).first, relative)); xmlWriter().writeCharacters(text); xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // ++p; } xmlWriter().writeEndElement(); // @@ -3406,8 +3464,10 @@ QString DitaXmlGenerator::registerRef(const QString& ref) } else if (prevRef == ref) break; +#if 0 else qDebug() << "PREVREF:" << prevRef; +#endif clean += "x"; } return clean; @@ -3492,28 +3552,10 @@ QString DitaXmlGenerator::fileBase(const Node* node) const return result; } -/*! - Constructs a file name appropriate for the \a node - and returns the file name. If the \a node is not a - fake node, or if it is a fake node but it is neither - an external page node nor an image node, call the - PageGenerator::fileName() function. - */ -QString DitaXmlGenerator::fileName(const Node* node) -{ - if (node->type() == Node::Fake) { - if (static_cast(node)->subType() == Node::ExternalPage) - return node->name(); - if (static_cast(node)->subType() == Node::Image) - return node->name(); - } - return PageGenerator::fileName(node); -} - QString DitaXmlGenerator::refForNode(const Node* node) { const FunctionNode* func; - const TypedefNode* typedeffe; + const TypedefNode* tdn; QString ref; switch (node->type()) { @@ -3525,9 +3567,9 @@ QString DitaXmlGenerator::refForNode(const Node* node) ref = node->name() + "-enum"; break; case Node::Typedef: - typedeffe = static_cast(node); - if (typedeffe->associatedEnum()) { - return refForNode(typedeffe->associatedEnum()); + tdn = static_cast(node); + if (tdn->associatedEnum()) { + return refForNode(tdn->associatedEnum()); } else { ref = node->name() + "-typedef"; @@ -3566,12 +3608,77 @@ QString DitaXmlGenerator::refForNode(const Node* node) return registerRef(ref); } -QString DitaXmlGenerator::linkForNode(const Node* node, const Node* relative) +QString DitaXmlGenerator::guidForNode(const Node* node) { - QString link; - QString fn; QString ref; + switch (node->type()) { + case Node::Namespace: + case Node::Class: + default: + break; + case Node::Enum: + return node->guid(); + case Node::Typedef: + { + const TypedefNode* tdn = static_cast(node); + if (tdn->associatedEnum()) + return guidForNode(tdn->associatedEnum()); + } + return node->guid(); + case Node::Function: + { + const FunctionNode* fn = static_cast(node); + if (fn->associatedProperty()) { + return guidForNode(fn->associatedProperty()); + } + else { + ref = fn->name(); + if (fn->overloadNumber() != 1) { + ref += "-" + QString::number(fn->overloadNumber()); +#if 0 + qDebug() << "guidForNode() overloaded function:" << ref; +#endif + } + } + } + case Node::Fake: + if (node->subType() != Node::QmlPropertyGroup) + break; + case Node::QmlProperty: + case Node::Property: + return node->guid(); + case Node::QmlSignal: + return node->guid(); + case Node::QmlMethod: + return node->guid(); + case Node::Variable: + return node->guid(); + case Node::Target: + return node->guid(); + } + return registerRef(ref); +} + +/*! + Constructs a file name appropriate for the \a node and returns + it. If the \a node is not a fake node, or if it is a fake node but + it is neither an external page node nor an image node, call the + PageGenerator::fileName() function. + */ +QString DitaXmlGenerator::fileName(const Node* node) +{ + if (node->type() == Node::Fake) { + if (static_cast(node)->subType() == Node::ExternalPage) + return node->name(); + if (static_cast(node)->subType() == Node::Image) + return node->name(); + } + return PageGenerator::fileName(node); +} + +QString DitaXmlGenerator::linkForNode(const Node* node, const Node* relative) +{ if (node == 0 || node == relative) return QString(); if (!node->url().isEmpty()) @@ -3581,21 +3688,18 @@ QString DitaXmlGenerator::linkForNode(const Node* node, const Node* relative) if (node->access() == Node::Private) return QString(); - fn = fileName(node); - link += fn + "#" + node->guid(); - return link; + QString fn = fileName(node); + QString link = fn; -#if 0 if (!node->isInnerNode() || node->subType() == Node::QmlPropertyGroup) { - ref = refForNode(node); - if (relative && fn == fileName(relative) && ref == refForNode(relative)) + QString guid = guidForNode(node); + if (relative && fn == fileName(relative) && guid == guidForNode(relative)) { return QString(); - + } link += "#"; - link += ref; + link += guid; } return link; -#endif } QString DitaXmlGenerator::refForAtom(Atom* atom, const Node* /* node */) @@ -3983,26 +4087,33 @@ QString DitaXmlGenerator::getLink(const Atom* atom, Atom* targetAtom = 0; QString first = path.first().trimmed(); - if (first.isEmpty()) + if (first.isEmpty()) { *node = relative; - else if (first.endsWith(".html")) + } + else if (first.endsWith(".html")) { *node = myTree->root()->findNode(first, Node::Fake); + } else { *node = marker->resolveTarget(first, myTree, relative); - if (!*node) + if (!*node) { *node = myTree->findFakeNodeByTitle(first); - if (!*node) + } + if (!*node) { *node = myTree->findUnambiguousTarget(first, targetAtom); + } } if (*node) { - if (!(*node)->url().isEmpty()) + if (!(*node)->url().isEmpty()) { return (*node)->url(); - else + } + else { path.removeFirst(); + } } - else + else { *node = relative; + } if (*node && (*node)->status() == Node::Obsolete) { if (relative && (relative->parent() != *node) && @@ -4075,13 +4186,13 @@ void DitaXmlGenerator::generateStatus(const Node* node, CodeMarker* marker) Atom *targetAtom = 0; if (fakeNode && node->type() == Node::Class) { QString oldName(node->name()); - targetAtom = myTree->findTarget(oldName.replace("3", ""), - fakeNode); + targetAtom = myTree->findTarget(oldName.replace("3",""),fakeNode); } if (targetAtom) { - text << Atom(Atom::Link, linkForNode(fakeNode, node) + "#" + - refForAtom(targetAtom, fakeNode)); + QString fn = fileName(fakeNode); + QString guid = lookupGuid(fn,refForAtom(targetAtom,fakeNode)); + text << Atom(Atom::GuidLink, fn + "#" + guid); } else text << Atom(Atom::Link, "Porting to Qt 4"); diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index dd0d56e..f781290 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -39,10 +39,6 @@ ** ****************************************************************************/ -/* - ditaxmlgenerator.h -*/ - #ifndef DITAXMLGENERATOR_H #define DITAXMLGENERATOR_H @@ -61,7 +57,8 @@ typedef QMap ParentMaps; typedef QMap NodeMap; typedef QMap NewClassMaps; -class HelpProjectWriter; +typedef QMap GuidMap; +typedef QMap GuidMaps; class DitaXmlGenerator : public PageGenerator { @@ -107,6 +104,7 @@ class DitaXmlGenerator : public PageGenerator virtual void generateFakeNode(const FakeNode* fake, CodeMarker* marker); virtual QString fileExtension(const Node* node) const; virtual QString refForNode(const Node* node); + virtual QString guidForNode(const Node* node); virtual QString linkForNode(const Node* node, const Node* relative); virtual QString refForAtom(Atom* atom, const Node* node); @@ -250,6 +248,8 @@ class DitaXmlGenerator : public PageGenerator QString writeGuidAttribute(QString text); void writeGuidAttribute(Node* node); QString lookupGuid(QString text); + QString lookupGuid(const QString& fileName, const QString& text); + GuidMap* lookupGuidMap(const QString& fileName); virtual void beginSubPage(const Location& location, const QString& fileName); virtual void endSubPage(); QXmlStreamWriter& xmlWriter(); @@ -262,6 +262,7 @@ class DitaXmlGenerator : public PageGenerator private: QMap refMap; QMap name2guidMap; + GuidMaps guidMaps; int codeIndent; bool inLink; bool inObsoleteLink; diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index 39ee98b..f4c471c 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -257,7 +257,12 @@ QString PageGenerator::fileBase(const Node *node) const return res; } -QString PageGenerator::fileName(const Node *node) const +/*! + If the \a node has a URL, return the URL as the file name. + Otherwise, construct the file name from the fileBase() and + the fileExtension(), and return the constructed name. + */ +QString PageGenerator::fileName(const Node* node) const { if (!node->url().isEmpty()) return node->url(); @@ -268,9 +273,12 @@ QString PageGenerator::fileName(const Node *node) const return name; } +/*! + Return the current output file name. + */ QString PageGenerator::outFileName() { - return QFileInfo(static_cast(out().device())->fileName()).fileName(); + return QFileInfo(static_cast(out().device())->fileName()).fileName(); } /*! @@ -302,6 +310,11 @@ void PageGenerator::endSubPage() delete outStreamStack.pop(); } +/*! + Used for writing to the current output stream. Returns a + reference to the crrent output stream, which is then used + with the \c {<<} operator for writing. + */ QTextStream &PageGenerator::out() { return *outStreamStack.top(); diff --git a/tools/qdoc3/text.cpp b/tools/qdoc3/text.cpp index 7093a43..11d7edd 100644 --- a/tools/qdoc3/text.cpp +++ b/tools/qdoc3/text.cpp @@ -144,7 +144,9 @@ QString Text::toString() const QString str; const Atom *atom = firstAtom(); while ( atom != 0 ) { - if ( atom->type() == Atom::String || atom->type() == Atom::AutoLink ) + if ( atom->type() == Atom::String || + atom->type() == Atom::AutoLink || + atom->type() == Atom::GuidLink) str += atom->string(); atom = atom->next(); } -- cgit v0.12 From 7d61e1d6d32d93fa5a023caade59f3af4923f2e8 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 27 Sep 2010 12:13:16 +0200 Subject: qdoc: Corrected output for the AutoLink case. Now many more elements are generated correctly. --- tools/qdoc3/ditaxmlgenerator.cpp | 26 +++++++++++++------------- tools/qdoc3/ditaxmlgenerator.h | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 16215cd..9652f48 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -392,7 +392,7 @@ DitaXmlGenerator::DitaXmlGenerator() myTree(0), slow(false), obsoleteLinks(false), - noLinks(0), + noLinks(false), tableColumnCount(0) { // nothing yet. @@ -656,7 +656,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::AbstractRight: break; case Atom::AutoLink: - if ((noLinks > 0) && !inLink && !inContents && !inSectionHeading) { + if (!noLinks && !inLink && !inContents && !inSectionHeading) { const Node* node = 0; QString link = getLink(atom, relative, marker, &node); if (!link.isEmpty()) { @@ -681,8 +681,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } if (inApiDesc) xmlWriter().writeStartElement("p"); - else + else { + noLinks = true; xmlWriter().writeStartElement(SHORTDESC); + } if (relative->type() == Node::Property || relative->type() == Node::Variable) { QString str; @@ -715,6 +717,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::BriefRight: if (relative->type() != Node::Fake) { xmlWriter().writeEndElement(); // or

    + noLinks = false; } break; case Atom::C: @@ -1126,7 +1129,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::LinkNode: { - const Node *node = CodeMarker::nodeForString(atom->string()); + const Node* node = CodeMarker::nodeForString(atom->string()); beginLink(linkForNode(node, relative), node, relative, marker); skipAhead = 1; } @@ -2094,11 +2097,11 @@ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) { Text brief = node->doc().briefText(); if (!brief.isEmpty()) { - ++noLinks; + noLinks = true; xmlWriter().writeStartElement(SHORTDESC); generateText(brief, node, marker); xmlWriter().writeEndElement(); // - --noLinks; + noLinks = false; } } @@ -3610,8 +3613,6 @@ QString DitaXmlGenerator::refForNode(const Node* node) QString DitaXmlGenerator::guidForNode(const Node* node) { - QString ref; - switch (node->type()) { case Node::Namespace: case Node::Class: @@ -3633,14 +3634,13 @@ QString DitaXmlGenerator::guidForNode(const Node* node) return guidForNode(fn->associatedProperty()); } else { - ref = fn->name(); + QString ref = fn->name(); if (fn->overloadNumber() != 1) { ref += "-" + QString::number(fn->overloadNumber()); -#if 0 - qDebug() << "guidForNode() overloaded function:" << ref; -#endif + //qDebug() << "guidForNode() overloaded function:" << outFileName() << ref; } } + return fn->guid(); } case Node::Fake: if (node->subType() != Node::QmlPropertyGroup) @@ -3657,7 +3657,7 @@ QString DitaXmlGenerator::guidForNode(const Node* node) case Node::Target: return node->guid(); } - return registerRef(ref); + return QString(); } /*! diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index f781290..484ff2f 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -291,7 +291,7 @@ class DitaXmlGenerator : public PageGenerator const Tree* myTree; bool slow; bool obsoleteLinks; - int noLinks; + bool noLinks; int tableColumnCount; QMap moduleClassMap; QMap moduleNamespaceMap; -- cgit v0.12 From 6461147a04f7c230c000d2de8fbbbe336b0f8345 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 27 Sep 2010 15:00:42 +0200 Subject: qdoc: Added outputclass attribute for class summary sections. --- tools/qdoc3/ditaxmlgenerator.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 9652f48..ce140af 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1594,9 +1594,11 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark needOtherSection = true; } else { + QString attr; if (!s->members.isEmpty()) { xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("outputclass","h2"); + attr = "h2 " + cleanRef((*s).name).toLower(); + xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); xmlWriter().writeCharacters(protectEnc((*s).name)); xmlWriter().writeEndElement(); // @@ -1606,8 +1608,9 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } if (!s->reimpMembers.isEmpty()) { QString name = QString("Reimplemented ") + (*s).name; + attr = "h2 " + cleanRef(name).toLower(); xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); xmlWriter().writeCharacters(protectEnc(name)); xmlWriter().writeEndElement(); // @@ -1620,7 +1623,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } if (needOtherSection) { xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("outputclass","h3"); + xmlWriter().writeAttribute("outputclass","h3 additional-inherited-members"); xmlWriter().writeStartElement("title"); xmlWriter().writeCharacters("Additional Inherited Members"); xmlWriter().writeEndElement(); // -- cgit v0.12 From 0385fc6ae80a324feb8e8c19e015e4a485bb56d1 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 29 Sep 2010 11:52:03 +0200 Subject: qdoc: Added outputclass attribute for sections and titles. --- tools/qdoc3/ditaxmlgenerator.cpp | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index ce140af..c3b6fab 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1312,6 +1312,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, inSection = true; xmlWriter().writeStartElement("section"); writeGuidAttribute(Doc::canonicalTitle(Text::sectionHeading(atom).toString())); + xmlWriter().writeAttribute("outputclass","details"); break; case Atom::SectionRight: if (inSection) { @@ -1597,9 +1598,10 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark QString attr; if (!s->members.isEmpty()) { xmlWriter().writeStartElement("section"); - attr = "h2 " + cleanRef((*s).name).toLower(); + attr = cleanRef((*s).name).toLower() + " redundant"; xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); xmlWriter().writeCharacters(protectEnc((*s).name)); xmlWriter().writeEndElement(); // generateSection(s->members, inner, marker, CodeMarker::Summary); @@ -1608,10 +1610,11 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } if (!s->reimpMembers.isEmpty()) { QString name = QString("Reimplemented ") + (*s).name; - attr = "h2 " + cleanRef(name).toLower(); + attr = cleanRef(name).toLower() + " redundant"; xmlWriter().writeStartElement("section"); xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); xmlWriter().writeCharacters(protectEnc(name)); xmlWriter().writeEndElement(); // generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); @@ -1623,8 +1626,9 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } if (needOtherSection) { xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("outputclass","h3 additional-inherited-members"); + xmlWriter().writeAttribute("outputclass","additional-inherited-members redundant"); xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h3"); xmlWriter().writeCharacters("Additional Inherited Members"); xmlWriter().writeEndElement(); // s = summarySections.begin(); @@ -2430,8 +2434,8 @@ QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, for (i = 0; i < sections.size(); ++i) { xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("outputclass","h2"); xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); xmlWriter().writeCharacters(protectEnc(sections.at(i).name)); xmlWriter().writeEndElement(); // generateSection(sections.at(i).members, inner, marker, CodeMarker::Summary); @@ -5337,19 +5341,29 @@ void DitaXmlGenerator::writeDetailedDescription(const Node* node, if (apiDesc) { inApiDesc = true; xmlWriter().writeStartElement(APIDESC); - // zzz xmlWriter().writeAttribute("id",node->guid()); - if (!title.isEmpty()) + if (!title.isEmpty()) { + writeGuidAttribute(title); xmlWriter().writeAttribute("spectitle",title); + } + else + writeGuidAttribute("Detailed Description"); + xmlWriter().writeAttribute("outputclass","details"); } else { inSection = true; xmlWriter().writeStartElement("section"); - // zzz xmlWriter().writeAttribute("id",node->guid()); if (!title.isEmpty()) { + writeGuidAttribute(title); + xmlWriter().writeAttribute("outputclass","details"); xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); xmlWriter().writeCharacters(title); xmlWriter().writeEndElement(); // } + else { + writeGuidAttribute("Detailed Description"); + xmlWriter().writeAttribute("outputclass","details"); + } } generateBody(node, marker); if (inApiDesc) { -- cgit v0.12 From 03ac8b6a7bfc0ef819cf2155e338252ca9fb77af Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 30 Sep 2010 12:13:57 +0200 Subject: qdoc: Added missing
    ; added "span" infor temporarily. There is an empty
    at the start of some xml files generated from qdoc files, but I don't think I can get rid of it. --- src/gui/widgets/qscrollbar.cpp | 39 +++++++++++++++---------------- tools/qdoc3/ditaxmlgenerator.cpp | 50 +++++++++++++++++++++++++--------------- 2 files changed, 51 insertions(+), 38 deletions(-) diff --git a/src/gui/widgets/qscrollbar.cpp b/src/gui/widgets/qscrollbar.cpp index 4ee9f27..a07e2cb 100644 --- a/src/gui/widgets/qscrollbar.cpp +++ b/src/gui/widgets/qscrollbar.cpp @@ -82,21 +82,21 @@ QT_BEGIN_NAMESPACE needs. \table - \row \i \image qscrollbar-picture.png - \i Scroll bars typically include four separate controls: a slider, + \row \o \image qscrollbar-picture.png + \o Scroll bars typically include four separate controls: a slider, scroll arrows, and a page control. \list - \i a. The slider provides a way to quickly go to any part of the + \o a. The slider provides a way to quickly go to any part of the document, but does not support accurate navigation within large documents. - \i b. The scroll arrows are push buttons which can be used to accurately + \o b. The scroll arrows are push buttons which can be used to accurately navigate to a particular place in a document. For a vertical scroll bar connected to a text editor, these typically move the current position one "line" up or down, and adjust the position of the slider by a small amount. In editors and list boxes a "line" might mean one line of text; in an image viewer it might mean 20 pixels. - \i c. The page control is the area over which the slider is dragged (the + \o c. The page control is the area over which the slider is dragged (the scroll bar's background). Clicking here moves the scroll bar towards the click by one "page". This value is usually the same as the length of the slider. @@ -134,13 +134,12 @@ QT_BEGIN_NAMESPACE value of 80. This would give us a scroll bar with five "pages". \table - \row \i \inlineimage qscrollbar-values.png - \i The relationship between a document length, the range of values used + \row \o \inlineimage qscrollbar-values.png + \o The relationship between a document length, the range of values used in a scroll bar, and the page step is simple in many common situations. The scroll bar's range of values is determined by subtracting a chosen page step from some value representing the length of the document. In such cases, the following equation is useful: - \e{document length} = maximum() - minimum() + pageStep(). \endtable @@ -153,18 +152,18 @@ QT_BEGIN_NAMESPACE ScrollBar inherits a comprehensive set of signals from QAbstractSlider: \list - \i \l{QAbstractSlider::valueChanged()}{valueChanged()} is emitted when the + \o \l{QAbstractSlider::valueChanged()}{valueChanged()} is emitted when the scroll bar's value has changed. The tracking() determines whether this signal is emitted during user interaction. - \i \l{QAbstractSlider::rangeChanged()}{rangeChanged()} is emitted when the + \o \l{QAbstractSlider::rangeChanged()}{rangeChanged()} is emitted when the scroll bar's range of values has changed. - \i \l{QAbstractSlider::sliderPressed()}{sliderPressed()} is emitted when + \o \l{QAbstractSlider::sliderPressed()}{sliderPressed()} is emitted when the user starts to drag the slider. - \i \l{QAbstractSlider::sliderMoved()}{sliderMoved()} is emitted when the user + \o \l{QAbstractSlider::sliderMoved()}{sliderMoved()} is emitted when the user drags the slider. - \i \l{QAbstractSlider::sliderReleased()}{sliderReleased()} is emitted when + \o \l{QAbstractSlider::sliderReleased()}{sliderReleased()} is emitted when the user releases the slider. - \i \l{QAbstractSlider::actionTriggered()}{actionTriggered()} is emitted + \o \l{QAbstractSlider::actionTriggered()}{actionTriggered()} is emitted when the scroll bar is changed by user interaction or via the \l{QAbstractSlider::triggerAction()}{triggerAction()} function. \endlist @@ -173,12 +172,12 @@ QT_BEGIN_NAMESPACE default focusPolicy() of Qt::NoFocus. Use setFocusPolicy() to enable keyboard interaction with the scroll bar: \list - \i Left/Right move a horizontal scroll bar by one single step. - \i Up/Down move a vertical scroll bar by one single step. - \i PageUp moves up one page. - \i PageDown moves down one page. - \i Home moves to the start (mininum). - \i End moves to the end (maximum). + \o Left/Right move a horizontal scroll bar by one single step. + \o Up/Down move a vertical scroll bar by one single step. + \o PageUp moves up one page. + \o PageDown moves down one page. + \o Home moves to the start (mininum). + \o End moves to the end (maximum). \endlist The slider itself can be controlled by using the diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index c3b6fab..2ee7a45 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -679,7 +679,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, skipAhead = skipAtoms(atom, Atom::BriefRight); break; } - if (inApiDesc) + if (inApiDesc || inSection) xmlWriter().writeStartElement("p"); else { noLinks = true; @@ -1358,27 +1358,37 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, tableColumnCount = 0; } const Atom* t = atom->next(); - while ((t->type() != Atom::TableHeaderRight) && - (t->type() != Atom::TableRowRight) && - (t->type() != Atom::TableRight)) { - if (t->type() == Atom::TableItemLeft) - ++tableColumnCount; + while (t->type() == Atom::TableHeaderLeft) { + int count = 0; + t = t->next(); + while (t->type() != Atom::TableHeaderRight) { + if (t->type() == Atom::TableItemLeft) + ++count; + t = t->next(); + } + if (count > tableColumnCount) + tableColumnCount = count; t = t->next(); } xmlWriter().writeStartElement("tgroup"); xmlWriter().writeAttribute("cols",QString::number(tableColumnCount)); + inTableHeader = false; + inTableBody = false; } break; case Atom::TableRight: xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // + inTableHeader = false; + inTableBody = false; tableColumnCount = 0; break; case Atom::TableHeaderLeft: xmlWriter().writeStartElement("thead"); + xmlWriter().writeAttribute("valign","top"); xmlWriter().writeStartElement("row"); - xmlWriter().writeAttribute("outputclass","qt-style topAlign"); + xmlWriter().writeAttribute("valign","top"); inTableHeader = true; inTableBody = false; break; @@ -1387,7 +1397,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (matchAhead(atom, Atom::TableHeaderLeft)) { skipAhead = 1; xmlWriter().writeStartElement("row"); - xmlWriter().writeAttribute("outputclass","qt-style topAlign"); + xmlWriter().writeAttribute("valign","top"); } else { xmlWriter().writeEndElement(); // @@ -1402,25 +1412,28 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeStartElement("tbody"); } xmlWriter().writeStartElement("row"); + xmlWriter().writeAttribute("valign","top"); if (++numTableRows % 2 == 1) - xmlWriter().writeAttribute("outputclass","odd topAlign"); + xmlWriter().writeAttribute("outputclass","odd"); else - xmlWriter().writeAttribute("outputclass","even topAlign"); + xmlWriter().writeAttribute("outputclass","even"); break; case Atom::TableRowRight: - xmlWriter().writeEndElement(); // \n"; + xmlWriter().writeEndElement(); // break; case Atom::TableItemLeft: { - if (inTableHeader) - xmlWriter().writeStartElement("entry"); - else - xmlWriter().writeStartElement("entry"); - + xmlWriter().writeStartElement("entry"); QStringList spans = atom->string().split(","); if (spans.size() == 2) { + if (inTableHeader || + (spans[0].toInt() != 1) || + (spans[1].toInt() != 1)) { + QString s = "span(" + spans[0] + "," + spans[1] + ")"; + xmlWriter().writeAttribute("outputclass",s); + } if (!inTableHeader) - xmlWriter().writeStartElement("p"); + xmlWriter().writeStartElement("p"); } if (matchAhead(atom, Atom::ParaLeft)) skipAhead = 1; @@ -1439,7 +1452,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::TableOfContents: { int numColumns = 1; - const Node *node = relative; + const Node* node = relative; Doc::SectioningUnit sectioningUnit = Doc::Section4; QStringList params = atom->string().split(","); @@ -1637,6 +1650,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateSectionInheritedList(*s, inner, marker); ++s; } + xmlWriter().writeEndElement(); //
    } writeDetailedDescription(cn, marker, false, QString("Detailed Description")); -- cgit v0.12 From c0608b2ca1468e1bb1ba6eec835118b459240cc5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 1 Oct 2010 15:02:00 +0200 Subject: qdoc: More complete QML elements. Still missing some links for QML basic types. --- tools/qdoc3/ditaxmlgenerator.cpp | 158 ++++++++++++++++++++------------------- 1 file changed, 82 insertions(+), 76 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 2ee7a45..0291054 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -638,6 +638,33 @@ void DitaXmlGenerator::startText(const Node* /* relative */, sectionNumber.clear(); } +static int countTableColumns(const Atom* t) +{ + int result = 0; + if (t->type() == Atom::TableHeaderLeft) { + while (t->type() == Atom::TableHeaderLeft) { + int count = 0; + t = t->next(); + while (t->type() != Atom::TableHeaderRight) { + if (t->type() == Atom::TableItemLeft) + ++count; + t = t->next(); + } + if (count > result) + result = count; + t = t->next(); + } + } + else if (t->type() == Atom::TableRowLeft) { + while (t->type() != Atom::TableRowRight) { + if (t->type() == Atom::TableItemLeft) + ++result; + t = t->next(); + } + } + return result; +} + /*! Generate html from an instance of Atom. */ @@ -1357,19 +1384,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, qDebug() << "ERROR: Nested tables!"; tableColumnCount = 0; } - const Atom* t = atom->next(); - while (t->type() == Atom::TableHeaderLeft) { - int count = 0; - t = t->next(); - while (t->type() != Atom::TableHeaderRight) { - if (t->type() == Atom::TableItemLeft) - ++count; - t = t->next(); - } - if (count > tableColumnCount) - tableColumnCount = count; - t = t->next(); - } + tableColumnCount = countTableColumns(atom->next()); xmlWriter().writeStartElement("tgroup"); xmlWriter().writeAttribute("cols",QString::number(tableColumnCount)); inTableHeader = false; @@ -1793,8 +1808,15 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker sections = marker->qmlSections(qml_cn,CodeMarker::Summary,0); s = sections.begin(); while (s != sections.end()) { - writeTargetAndHeader((*s).name,protectEnc((*s).name),"h2"); + xmlWriter().writeStartElement("section"); + QString attr = cleanRef((*s).name).toLower(); + xmlWriter().writeAttribute("outputclass",attr); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc((*s).name)); + xmlWriter().writeEndElement(); // generateQmlSummary(*s,fake,marker); + xmlWriter().writeEndElement(); //
    ++s; } @@ -1809,15 +1831,21 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker sections = marker->qmlSections(qml_cn,CodeMarker::Detailed,0); s = sections.begin(); while (s != sections.end()) { - xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc((*s).name)); - xmlWriter().writeEndElement(); //

    - NodeList::ConstIterator m = (*s).members.begin(); - while (m != (*s).members.end()) { - generateDetailedQmlMember(*m, fake, marker); - //out() << "
    \n"; - ++m; + if (!s->members.isEmpty()) { + QString attr; + xmlWriter().writeStartElement("section"); + attr = cleanRef((*s).name).toLower(); + xmlWriter().writeAttribute("outputclass",attr); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc((*s).name)); + xmlWriter().writeEndElement(); // + NodeList::ConstIterator m = (*s).members.begin(); + while (m != (*s).members.end()) { + generateDetailedQmlMember(*m, fake, marker); + ++m; + } + xmlWriter().writeEndElement(); //
    } ++s; } @@ -3317,7 +3345,7 @@ void DitaXmlGenerator::writeText(const QString& markedCode, } xmlWriter().writeEndElement(); // xmlWriter().writeStartElement("entry"); - xmlWriter().writeAttribute("outputclass=","memItemRight bottomAlign"); + xmlWriter().writeAttribute("outputclass","memItemRight bottomAlign"); done = true; } i += 2; @@ -4324,81 +4352,59 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node* node, CodeMarker* marker) { QString marked; - const QmlPropertyNode* qpn = 0; - out() << "
    "; + QmlPropertyNode* qpn = 0; if (node->subType() == Node::QmlPropertyGroup) { const QmlPropGroupNode* qpgn = static_cast(node); NodeList::ConstIterator p = qpgn->childNodes().begin(); - out() << "
    "; - out() << ""; - + xmlWriter().writeStartElement("ul"); while (p != qpgn->childNodes().end()) { if ((*p)->type() == Node::QmlProperty) { qpn = static_cast(*p); - - if (++numTableRows % 2 == 1) - out() << ""; - else - out() << ""; - - out() << ""; + xmlWriter().writeEndElement(); // } ++p; } - out() << "

    "; - //out() << "

    "; // old - out() << ""; + xmlWriter().writeStartElement("li"); + writeGuidAttribute(qpn); + QString attr; if (!qpn->isWritable(myTree)) - out() << "read-only"; - if (qpgn->isDefault()) - out() << "default"; + attr = "read-only"; + if (qpgn->isDefault()) { + if (!attr.isEmpty()) + attr += " "; + attr += "default"; + } + if (!attr.isEmpty()) + xmlWriter().writeAttribute("outputclass",attr); generateQmlItem(qpn, relative, marker, false); - out() << "
    "; - out() << "
    "; + xmlWriter().writeEndElement(); // } else if (node->type() == Node::QmlSignal) { - const FunctionNode* qsn = static_cast(node); - out() << "
    "; - out() << ""; - //out() << ""; - if (++numTableRows % 2 == 1) - out() << ""; - else - out() << ""; - out() << ""; - out() << "

    "; - out() << ""; - marked = getMarkedUpSynopsis(qsn, relative, marker, CodeMarker::Detailed); + Node* n = const_cast(node); + xmlWriter().writeStartElement("ul"); + xmlWriter().writeStartElement("li"); + writeGuidAttribute(n); + marked = getMarkedUpSynopsis(n, relative, marker, CodeMarker::Detailed); writeText(marked, marker, relative); - //generateQmlItem(qsn,relative,marker,false); - out() << "

    "; - out() << "
    "; + generateQmlItem(n, relative, marker, false); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } else if (node->type() == Node::QmlMethod) { - const FunctionNode* qmn = static_cast(node); - out() << "
    "; - out() << ""; - //out() << ""; - if (++numTableRows % 2 == 1) - out() << ""; - else - out() << ""; - out() << ""; - out() << "

    "; - out() << ""; - marked = getMarkedUpSynopsis(qmn, relative, marker, CodeMarker::Detailed); + Node* n = const_cast(node); + xmlWriter().writeStartElement("ul"); + xmlWriter().writeStartElement("li"); + writeGuidAttribute(n); + marked = getMarkedUpSynopsis(n, relative, marker, CodeMarker::Detailed); writeText(marked, marker, relative); - out() << "

    "; - out() << "
    "; + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } - out() << "
    "; generateStatus(node, marker); generateBody(node, marker); generateThreadSafeness(node, marker); generateSince(node, marker); generateAlsoList(node, marker); - out() << "
    "; - out() << "
    "; } /*! -- cgit v0.12 From c86449e2e45b67662b652d58e95e0ca7c99782fd Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 1 Oct 2010 15:18:40 +0200 Subject: qdoc: Removed extraneous call to generateQmlItem(). --- tools/qdoc3/ditaxmlgenerator.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 0291054..3fb90d2 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -4386,7 +4386,6 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node* node, writeGuidAttribute(n); marked = getMarkedUpSynopsis(n, relative, marker, CodeMarker::Detailed); writeText(marked, marker, relative); - generateQmlItem(n, relative, marker, false); xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // } -- cgit v0.12 From 77a701d8657118d2c611d521a95dad42a845b42b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 4 Oct 2010 10:50:41 +0200 Subject: qdoc: Changed type names to links to types. This wasn't happeneiung everywhere that it should have been, especially for QML basic types. --- tools/qdoc3/ditaxmlgenerator.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 3fb90d2..2d8eec2 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -3386,9 +3386,22 @@ void DitaXmlGenerator::writeText(const QString& markedCode, html.clear(); } par1 = QStringRef(); - marker->resolveTarget(arg.toString(), myTree, relative); - QString link = linkForNode(n,relative); - addLink(link, arg); + QString link; + n = marker->resolveTarget(arg.toString(), myTree, relative); + if (n && n->subType() == Node::QmlBasicType) { + if (relative && relative->subType() == Node::QmlClass) { + link = linkForNode(n,relative); + addLink(link, arg); + } + else { + link = arg.toString(); + } + } + else { + // (zzz) Is this correct for all cases? + link = linkForNode(n,relative); + addLink(link, arg); + } } handled = true; break; -- cgit v0.12 From edbe8f8f8c284b4cac52ff1e97a2065dc4f89d74 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 4 Oct 2010 13:14:22 +0200 Subject: qdoc: Outputting each namespace as a element. Still missing nested classes. --- tools/qdoc3/ditaxmlgenerator.cpp | 164 +++++++++++++++++++++++++++++++++++++-- tools/qdoc3/ditaxmlgenerator.h | 2 +- 2 files changed, 159 insertions(+), 7 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 2d8eec2..2b90d8e 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1534,16 +1534,160 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark QList
    ::ConstIterator s; const ClassNode* cn = 0; - const NamespaceNode* namespasse = 0; + const NamespaceNode* nsn = 0; QString title; QString rawTitle; QString fullTitle; if (inner->type() == Node::Namespace) { - namespasse = const_cast(static_cast(inner)); + nsn = const_cast(static_cast(inner)); rawTitle = marker->plainName(inner); fullTitle = marker->plainFullName(inner); title = rawTitle + " Namespace"; + + /* + Note: Because the C++ specialization we are using + has no element, we are using the + element with an outputclass attribute + set to "namespace" . + */ + generateHeader(inner, fullTitle); + generateBrief(inner, marker); // + + // not included: + + xmlWriter().writeStartElement(CXXCLASSDETAIL); + xmlWriter().writeStartElement(CXXCLASSDEFINITION); + writeLocation(nsn); + xmlWriter().writeEndElement(); // + + xmlWriter().writeStartElement(APIDESC); + xmlWriter().writeAttribute("spectitle",title); + Text brief = nsn->doc().briefText(); + if (!brief.isEmpty()) { + xmlWriter().writeStartElement("p"); + generateText(brief, nsn, marker); + xmlWriter().writeEndElement(); //

    + } + generateIncludes(nsn, marker); + generateStatus(nsn, marker); + generateThreadSafeness(nsn, marker); + generateSince(nsn, marker); + + xmlWriter().writeStartElement("ul"); + + QString membersLink = generateListOfAllMemberFile(inner, marker); + if (!membersLink.isEmpty()) { + writeXrefListItem(membersLink,"List of all members, including inherited members"); + } + + QString obsoleteLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Obsolete); + if (!obsoleteLink.isEmpty()) { + writeXrefListItem(obsoleteLink,"Obsolete members"); + } + + QString compatLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Compat); + if (!compatLink.isEmpty()) { + writeXrefListItem(compatLink,"Qt 3 support members"); + } + + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + + bool needOtherSection = false; + QList
    summarySections; + summarySections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); + s = summarySections.begin(); + while (s != summarySections.end()) { + if (s->members.isEmpty() && s->reimpMembers.isEmpty()) { + if (!s->inherited.isEmpty()) + needOtherSection = true; + } + else { + QString attr; + if (!s->members.isEmpty()) { + xmlWriter().writeStartElement("section"); + attr = cleanRef((*s).name).toLower() + " redundant"; + xmlWriter().writeAttribute("outputclass",attr); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc((*s).name)); + xmlWriter().writeEndElement(); // + generateSection(s->members, inner, marker, CodeMarker::Summary); + generateSectionInheritedList(*s, inner, marker); + xmlWriter().writeEndElement(); //
    + } + if (!s->reimpMembers.isEmpty()) { + QString name = QString("Reimplemented ") + (*s).name; + attr = cleanRef(name).toLower() + " redundant"; + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass",attr); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc(name)); + xmlWriter().writeEndElement(); // + generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); + generateSectionInheritedList(*s, inner, marker); + xmlWriter().writeEndElement(); //
    + } + } + ++s; + } + if (needOtherSection) { + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","additional-inherited-members redundant"); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h3"); + xmlWriter().writeCharacters("Additional Inherited Members"); + xmlWriter().writeEndElement(); // + s = summarySections.begin(); + while (s != summarySections.end()) { + if (s->members.isEmpty()) + generateSectionInheritedList(*s, inner, marker); + ++s; + } + xmlWriter().writeEndElement(); //
    + } + + writeDetailedDescription(nsn, marker, false, QString("Detailed Description")); + + // not included: or + + xmlWriter().writeEndElement(); // + + // not included: + // not included: + + QList
    detailSections; + detailSections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay); + s = detailSections.begin(); + while (s != detailSections.end()) { + if ((*s).name == "Function Documentation") { + writeFunctions((*s),nsn,marker); + } + else if ((*s).name == "Type Documentation") { + writeEnumerations((*s),marker); + writeTypedefs((*s),marker); + } + else if ((*s).name == "Variable Documentation") { + writeDataMembers((*s),marker); + } + else if ((*s).name == "Property Documentation") { + writeProperties((*s),marker); + } + else if ((*s).name == "Macro Documentation") { + writeMacros((*s),marker); + } + ++s; + } + + // not included: + + xmlWriter().writeEndElement(); // } else if (inner->type() == Node::Class) { cn = const_cast(static_cast(inner)); @@ -1826,7 +1970,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker generateQmlText(cn->doc().body(), cn, marker, fake->name()); generateAlsoList(fake, marker); - //out() << "
    \n"; sections = marker->qmlSections(qml_cn,CodeMarker::Detailed,0); s = sections.begin(); @@ -2095,6 +2238,16 @@ void DitaXmlGenerator::generateHeader(const Node* node, " PUBLIC \"-//NOKIA//DTD DITA C++ API Class Reference Type v" + version + "//EN\" \"" + dtd + "\">"; } + else if (node->type() == Node::Namespace) { + mainElement = "cxxClass"; + nameElement = "apiName"; + dtd = "dtd/cxxClass.dtd"; + version = "0.6.0"; + doctype = ""; + outputclass = "namespace"; + } xmlWriter().writeDTD(doctype); xmlWriter().writeComment(node->doc().location().fileName()); @@ -2899,7 +3052,6 @@ void DitaXmlGenerator::generateLegaleseList(const Node* relative, QMap::ConstIterator it = legaleseTexts.begin(); while (it != legaleseTexts.end()) { Text text = it.key(); - //out() << "
    \n"; generateText(text, relative, marker); xmlWriter().writeStartElement("ul"); do { @@ -4668,7 +4820,7 @@ void DitaXmlGenerator::writeLocation(const Node* n) Write the elements. */ void DitaXmlGenerator::writeFunctions(const Section& s, - const ClassNode* cn, + const Node* n, CodeMarker* marker) { NodeList::ConstIterator m = s.members.begin(); @@ -4728,7 +4880,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, } } - if (fn->name() == cn->name()) { + if (fn->name() == n->name()) { xmlWriter().writeStartElement(CXXFUNCTIONCONSTRUCTOR); xmlWriter().writeAttribute("name","constructor"); xmlWriter().writeAttribute("value","constructor"); diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 484ff2f..746bbe9 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -117,7 +117,7 @@ class DitaXmlGenerator : public PageGenerator void writeDerivations(const ClassNode* cn, CodeMarker* marker); void writeLocation(const Node* n); void writeFunctions(const Section& s, - const ClassNode* cn, + const Node* n, CodeMarker* marker); void writeParameters(const FunctionNode* fn); void writeEnumerations(const Section& s, CodeMarker* marker); -- cgit v0.12 From 9b6be16181d0e17f61551d3d231f1a997fdcd9e1 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 5 Oct 2010 15:16:41 +0200 Subject: qdoc: Added the remaining names bits. Needs careful proofreading of results. --- tools/qdoc3/ditaxmlgenerator.cpp | 228 +++++++-------------------------------- tools/qdoc3/ditaxmlgenerator.h | 3 + 2 files changed, 40 insertions(+), 191 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 2b90d8e..6ec8934 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1654,9 +1654,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } writeDetailedDescription(nsn, marker, false, QString("Detailed Description")); - - // not included: or - xmlWriter().writeEndElement(); // // not included: @@ -1666,6 +1663,15 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark detailSections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay); s = detailSections.begin(); while (s != detailSections.end()) { + if ((*s).name == "Classes") { + writeNestedClasses((*s),nsn,marker); + break; + } + ++s; + } + + s = detailSections.begin(); + while (s != detailSections.end()) { if ((*s).name == "Function Documentation") { writeFunctions((*s),nsn,marker); } @@ -1673,20 +1679,14 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writeEnumerations((*s),marker); writeTypedefs((*s),marker); } - else if ((*s).name == "Variable Documentation") { - writeDataMembers((*s),marker); - } - else if ((*s).name == "Property Documentation") { - writeProperties((*s),marker); + else if ((*s).name == "Namespaces") { + qDebug() << "Nested namespaces" << outFileName(); } else if ((*s).name == "Macro Documentation") { writeMacros((*s),marker); } ++s; } - - // not included: - xmlWriter().writeEndElement(); // } else if (inner->type() == Node::Class) { @@ -4773,7 +4773,7 @@ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker) void DitaXmlGenerator::writeLocation(const Node* n) { QString s1, s2, s3; - if (n->type() == Node::Class) { + if (n->type() == Node::Class || n->type() == Node::Namespace) { s1 = CXXCLASSAPIITEMLOCATION; s2 = CXXCLASSDECLARATIONFILE; s3 = CXXCLASSDECLARATIONFILELINE; @@ -5562,186 +5562,32 @@ void DitaXmlGenerator::writeDetailedDescription(const Node* node, inDetailedDescription = false; } -QT_END_NAMESPACE - -#ifdef TO_BE_INCLUDED_IN_API_DESC -zzzz - Text subtitleText; - if (rawTitle != fullTitle) - subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")" - << Atom(Atom::LineBreak); - - QString shortVersion; - shortVersion = project + " " + shortVersion + ": "; - shortVersion = myTree->version(); - if (shortVersion.count(QChar('.')) == 2) - shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); - if (!shortVersion.isEmpty()) { - if (project == "QSA") - shortVersion = "QSA " + shortVersion + ": "; - else - shortVersion = "Qt " + shortVersion + ": "; - } - - out() << " " << shortVersion << protectEnc(title) << "\n"; - -#if 0 - out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - generateBreadCrumbs(title,node,marker); - out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); -#endif - - sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); - generateTableOfContents(inner,marker,§ions); - generateTitle(title, subtitleText, SmallSubTitle, inner, marker); - - if (cn && !cn->qmlElement().isEmpty()) { - generateInstantiatedBy(cn,marker); - } +/*! + Write the nested class elements. + */ +void DitaXmlGenerator::writeNestedClasses(const Section& s, + const Node* n, + CodeMarker* marker) +{ + if (s.members.isEmpty()) + return; + xmlWriter().writeStartElement("cxxClassNested"); + xmlWriter().writeStartElement("cxxClassNestedDetail"); - generateBrief(inner, marker); - generateIncludes(inner, marker); - generateStatus(inner, marker); - if (cn) { - generateInherits(cn, marker); - generateInheritedBy(cn, marker); - } - generateThreadSafeness(inner, marker); - generateSince(inner, marker); - - out() << "
      \n"; - - QString membersLink = generateListOfAllMemberFile(inner, marker); - if (!membersLink.isEmpty()) - out() << "
    • " - << "List of all members, including inherited members
    • \n"; - - QString obsoleteLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Obsolete); - if (!obsoleteLink.isEmpty()) - out() << "
    • " - << "Obsolete members
    • \n"; - - QString compatLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Compat); - if (!compatLink.isEmpty()) - out() << "
    • " - << "Qt 3 support members
    • \n"; - - out() << "
    \n"; - - bool needOtherSection = false; - - /* - sections is built above for the call to generateTableOfContents(). - */ - s = sections.begin(); - while (s != sections.end()) { - if (s->members.isEmpty() && s->reimpMembers.isEmpty()) { - if (!s->inherited.isEmpty()) - needOtherSection = true; - } - else { - if (!s->members.isEmpty()) { - out() << "
    \n"; - out() << "\n"; - out() << "

    " << protectEnc((*s).name) << "

    \n"; - generateSection(s->members, inner, marker, CodeMarker::Summary); - } - if (!s->reimpMembers.isEmpty()) { - QString name = QString("Reimplemented ") + (*s).name; - out() << "
    \n"; - out() << "\n"; - out() << "

    " << protectEnc(name) << "

    \n"; - generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); - } - generateSectionInheritedList(*s, inner, marker, true); - } - ++s; - } - - if (needOtherSection) { - out() << "

    Additional Inherited Members

    \n"; - s = sections.begin(); - while (s != sections.end()) { - if (s->members.isEmpty()) - generateSectionInheritedList(*s, inner, marker); - ++s; + NodeList::ConstIterator m = s.members.begin(); + while (m != s.members.end()) { + if ((*m)->type() == Node::Class) { + xmlWriter().writeStartElement("cxxClassNestedClass"); + QString link = linkForNode((*m), n); + xmlWriter().writeAttribute("href", link); + QString name = n->name() + "::" + (*m)->name(); + xmlWriter().writeCharacters(name); + xmlWriter().writeEndElement(); // } + ++m; } + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // +} - out() << "\n"; - - if (!inner->doc().isEmpty()) { - out() << "
    \n" - << "
    \n" // QTBUG-9504 - << "

    " << "Detailed Description" << "

    \n"; - generateBody(inner, marker); - out() << "
    \n"; // QTBUG-9504 - generateAlsoList(inner, marker); - } - - sections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay); - s = sections.begin(); - while (s != sections.end()) { - out() << "
    \n"; - if (!(*s).divClass.isEmpty()) - out() << "
    \n"; // QTBUG-9504 - out() << "

    " << protectEnc((*s).name) << "

    \n"; - - NodeList::ConstIterator m = (*s).members.begin(); - while (m != (*s).members.end()) { - if ((*m)->access() != Node::Private) { // ### check necessary? - if ((*m)->type() != Node::Class) - generateDetailedMember(*m, inner, marker); - else { - out() << "

    class "; - generateFullName(*m, inner, marker); - out() << "

    "; - generateBrief(*m, marker, inner); - } - - QStringList names; - names << (*m)->name(); - if ((*m)->type() == Node::Function) { - const FunctionNode *func = reinterpret_cast(*m); - if (func->metaness() == FunctionNode::Ctor || - func->metaness() == FunctionNode::Dtor || - func->overloadNumber() != 1) - names.clear(); - } - else if ((*m)->type() == Node::Property) { - const PropertyNode *prop = reinterpret_cast(*m); - if (!prop->getters().isEmpty() && - !names.contains(prop->getters().first()->name())) - names << prop->getters().first()->name(); - if (!prop->setters().isEmpty()) - names << prop->setters().first()->name(); - if (!prop->resetters().isEmpty()) - names << prop->resetters().first()->name(); - } - else if ((*m)->type() == Node::Enum) { - const EnumNode *enume = reinterpret_cast(*m); - if (enume->flagsType()) - names << enume->flagsType()->name(); - - foreach (const QString &enumName, - enume->doc().enumItemNames().toSet() - - enume->doc().omitEnumItemNames().toSet()) - names << plainCode(marker->markedUpEnumValue(enumName, - enume)); - } - } - ++m; - } - if (!(*s).divClass.isEmpty()) - out() << "
    \n"; // QTBUG-9504 - ++s; - } -#endif // TO_BE_INCLUDED_IN_API_DESC +QT_END_NAMESPACE diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 746bbe9..cf26274 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -119,6 +119,9 @@ class DitaXmlGenerator : public PageGenerator void writeFunctions(const Section& s, const Node* n, CodeMarker* marker); + void writeNestedClasses(const Section& s, + const Node* n, + CodeMarker* marker); void writeParameters(const FunctionNode* fn); void writeEnumerations(const Section& s, CodeMarker* marker); void writeTypedefs(const Section& s, CodeMarker* marker); -- cgit v0.12 From f6b489885b75001b373c3aa2d3c7f1bd33520c06 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 6 Oct 2010 10:30:21 +0200 Subject: qdoc: Cleaned up a lot of redundant table stuff. Now just uses
      for redundant lists. --- tools/qdoc3/ditaxmlgenerator.cpp | 96 +++------------------------------------- tools/qdoc3/ditaxmlgenerator.h | 3 +- 2 files changed, 8 insertions(+), 91 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 6ec8934..5458b7c 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -3238,90 +3238,19 @@ void DitaXmlGenerator::generateSection(const NodeList& nl, CodeMarker* marker, CodeMarker::SynopsisStyle style) { - bool name_alignment = true; if (!nl.isEmpty()) { - bool twoColumn = false; - if (style == CodeMarker::SeparateList) { - name_alignment = false; - twoColumn = (nl.count() >= 16); - } - else if (nl.first()->type() == Node::Property) { - twoColumn = (nl.count() >= 5); - name_alignment = false; - } - if (name_alignment) { - xmlWriter().writeStartElement("table"); - xmlWriter().writeAttribute("outputclass","alignedsummary"); - xmlWriter().writeStartElement("tgroup"); - xmlWriter().writeAttribute("cols","2"); - xmlWriter().writeStartElement("tbody"); - } - else { - if (twoColumn) { - xmlWriter().writeStartElement("table"); - xmlWriter().writeAttribute("outputclass","propsummary"); - xmlWriter().writeStartElement("tgroup"); - xmlWriter().writeAttribute("cols","1"); - xmlWriter().writeStartElement("tbody"); - xmlWriter().writeStartElement("row"); - xmlWriter().writeStartElement("entry"); - xmlWriter().writeAttribute("outputclass","topAlign"); - } - xmlWriter().writeStartElement("ul"); - } - - int i = 0; + xmlWriter().writeStartElement("ul"); NodeList::ConstIterator m = nl.begin(); while (m != nl.end()) { - if ((*m)->access() == Node::Private) { - ++m; - continue; - } - - if (name_alignment) { - xmlWriter().writeStartElement("row"); - xmlWriter().writeStartElement("entry"); - xmlWriter().writeAttribute("outputclass","memItemLeft rightAlign topAlign"); - } - else { - if (twoColumn && i == (int) (nl.count() + 1) / 2) { - xmlWriter().writeEndElement(); //
    - xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement("entry"); - xmlWriter().writeAttribute("outputclass","topAlign"); - xmlWriter().writeStartElement("ul"); - } + if ((*m)->access() != Node::Private) { xmlWriter().writeStartElement("li"); - xmlWriter().writeAttribute("outputclass","fn"); - } - - QString marked = getMarkedUpSynopsis(*m, relative, marker, style); - writeText(marked, marker, relative, name_alignment); - if (name_alignment) { - xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); // - } - else { + QString marked = getMarkedUpSynopsis(*m, relative, marker, style); + writeText(marked, marker, relative); xmlWriter().writeEndElement(); // } - i++; ++m; } - if (name_alignment) { - xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); // - } - else { - xmlWriter().writeEndElement(); // - if (twoColumn) { - xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); // - } - } + xmlWriter().writeEndElement(); // } } @@ -3416,8 +3345,7 @@ QString DitaXmlGenerator::getMarkedUpSynopsis(const Node* node, */ void DitaXmlGenerator::writeText(const QString& markedCode, CodeMarker* marker, - const Node* relative, - bool nameAlignment) + const Node* relative) { QString src = markedCode; QString html; @@ -3487,19 +3415,9 @@ void DitaXmlGenerator::writeText(const QString& markedCode, // 0 1 2 3 4 5 "link", "type", "headerfile", "func", "param", "extra" }; - bool done = false; + for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1) == charAt) { - if (nameAlignment && !done) { - if (!html.isEmpty()) { - xmlWriter().writeCharacters(html); - html.clear(); - } - xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement("entry"); - xmlWriter().writeAttribute("outputclass","memItemRight bottomAlign"); - done = true; - } i += 2; bool handled = false; for (int k = 0; k != 6; ++k) { diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index cf26274..8bd9406 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -208,8 +208,7 @@ class DitaXmlGenerator : public PageGenerator CodeMarker* marker); void writeText(const QString& markedCode, CodeMarker* marker, - const Node* relative, - bool nameAlignment = false); + const Node* relative); void generateFullName(const Node* apparentNode, const Node* relative, -- cgit v0.12 From 94cae67da50d68f70d728a7fb231de89d47263db Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 6 Oct 2010 12:32:34 +0200 Subject: qdoc: Cleaned up a lot of unneeded outputclass attributes. --- tools/qdoc3/ditaxmlgenerator.cpp | 30 +++--------------------------- tools/qdoc3/ditaxmlgenerator.h | 4 +--- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 5458b7c..9e41a00 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1178,10 +1178,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeStartElement("simpletable"); xmlWriter().writeAttribute("outputclass","valuelist"); xmlWriter().writeStartElement("sthead"); - if (++numTableRows % 2 == 1) - xmlWriter().writeAttribute("outputclass","odd"); - else - xmlWriter().writeAttribute("outputclass","even"); xmlWriter().writeStartElement("stentry"); xmlWriter().writeCharacters("Constant"); xmlWriter().writeEndElement(); // @@ -1234,14 +1230,12 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, else { // (atom->string() == ATOM_LIST_VALUE) xmlWriter().writeStartElement("strow"); xmlWriter().writeStartElement("stentry"); - xmlWriter().writeAttribute("outputclass","topAlign"); xmlWriter().writeStartElement("tt"); xmlWriter().writeCharacters(protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(), relative)))); xmlWriter().writeEndElement(); //
    xmlWriter().writeEndElement(); // xmlWriter().writeStartElement("stentry"); - xmlWriter().writeAttribute("outputclass","topAlign"); QString itemValue; if (relative->type() == Node::Enum) { @@ -1271,7 +1265,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (threeColumnEnumValueTable) { xmlWriter().writeEndElement(); // xmlWriter().writeStartElement("stentry"); - xmlWriter().writeAttribute("outputclass","topAlign"); if (matchAhead(atom, Atom::ListItemRight)) xmlWriter().writeCharacters(" "); } @@ -1378,7 +1371,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, in_para = false; } xmlWriter().writeStartElement("table"); - xmlWriter().writeAttribute("outputclass","generic"); numTableRows = 0; if (tableColumnCount != 0) { qDebug() << "ERROR: Nested tables!"; @@ -1428,10 +1420,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } xmlWriter().writeStartElement("row"); xmlWriter().writeAttribute("valign","top"); - if (++numTableRows % 2 == 1) - xmlWriter().writeAttribute("outputclass","odd"); - else - xmlWriter().writeAttribute("outputclass","even"); break; case Atom::TableRowRight: xmlWriter().writeEndElement(); // @@ -1664,7 +1652,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark s = detailSections.begin(); while (s != detailSections.end()) { if ((*s).name == "Classes") { - writeNestedClasses((*s),nsn,marker); + writeNestedClasses((*s),nsn); break; } ++s; @@ -2724,7 +2712,6 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative, xmlWriter().writeAttribute("cols","2"); xmlWriter().writeStartElement("tbody"); - int row = 0; foreach (const QString& name, nodeMap.keys()) { const Node* node = nodeMap[name]; @@ -2732,10 +2719,6 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative, continue; xmlWriter().writeStartElement("row"); - if (++row % 2 == 1) - xmlWriter().writeAttribute("outputclass","odd topAlign"); - else - xmlWriter().writeAttribute("outputclass","even topAlign"); xmlWriter().writeStartElement("entry"); xmlWriter().writeStartElement("p"); generateFullName(node, relative, marker); @@ -2919,7 +2902,7 @@ void DitaXmlGenerator::generateCompactList(const Node* relative, Output a

    element to contain all the

    elements. */ xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","compactlist flowListDiv"); + xmlWriter().writeAttribute("outputclass","compactlist"); for (int i=0; i } xmlWriter().writeStartElement("dl"); - if (++numTableRows % 2 == 1) - xmlWriter().writeAttribute("outputclass","flowList odd"); - else - xmlWriter().writeAttribute("outputclass","flowList even"); xmlWriter().writeStartElement("dlentry"); xmlWriter().writeStartElement("dt"); xmlWriter().writeAttribute("outputclass","alphaChar"); @@ -3267,7 +3246,6 @@ void DitaXmlGenerator::generateSectionInheritedList(const Section& section, QList >::ConstIterator p = section.inherited.begin(); while (p != section.inherited.end()) { xmlWriter().writeStartElement("li"); - xmlWriter().writeAttribute("outputclass","fn"); QString text; text.setNum((*p).second); text += " "; @@ -4416,7 +4394,6 @@ void DitaXmlGenerator::generateQmlSummary(const Section& section, m = section.members.begin(); while (m != section.members.end()) { xmlWriter().writeStartElement("li"); - xmlWriter().writeAttribute("outputclass", "fn"); generateQmlItem(*m,relative,marker,true); xmlWriter().writeEndElement(); // ++m; @@ -5484,8 +5461,7 @@ void DitaXmlGenerator::writeDetailedDescription(const Node* node, Write the nested class elements. */ void DitaXmlGenerator::writeNestedClasses(const Section& s, - const Node* n, - CodeMarker* marker) + const Node* n) { if (s.members.isEmpty()) return; diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 8bd9406..c0cb0db 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -119,9 +119,7 @@ class DitaXmlGenerator : public PageGenerator void writeFunctions(const Section& s, const Node* n, CodeMarker* marker); - void writeNestedClasses(const Section& s, - const Node* n, - CodeMarker* marker); + void writeNestedClasses(const Section& s, const Node* n); void writeParameters(const FunctionNode* fn); void writeEnumerations(const Section& s, CodeMarker* marker); void writeTypedefs(const Section& s, CodeMarker* marker); -- cgit v0.12 From e4f69ae9bd749db3defababa226b4d28051558ce Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 13 Oct 2010 10:18:41 +0200 Subject: qdoc: Fix const problem. --- tools/qdoc3/ditaxmlgenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 9e41a00..ec82344 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -4412,7 +4412,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node* node, CodeMarker* marker) { QString marked; - QmlPropertyNode* qpn = 0; + const QmlPropertyNode* qpn = 0; if (node->subType() == Node::QmlPropertyGroup) { const QmlPropGroupNode* qpgn = static_cast(node); NodeList::ConstIterator p = qpgn->childNodes().begin(); @@ -4421,7 +4421,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node* node, if ((*p)->type() == Node::QmlProperty) { qpn = static_cast(*p); xmlWriter().writeStartElement("li"); - writeGuidAttribute(qpn); + writeGuidAttribute((Node*)qpn); QString attr; if (!qpn->isWritable(myTree)) attr = "read-only"; -- cgit v0.12 From d32706acebf37bd1e93e1c045cb46c7898ffed19 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 14 Oct 2010 13:11:03 +0200 Subject: qdoc: Fixed bug where cpp and h files not copied for examples. --- tools/qdoc3/ditaxmlgenerator.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index ec82344..9715b9d 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -47,6 +47,7 @@ #include "codeparser.h" #include "ditaxmlgenerator.h" #include "node.h" +#include "quoter.h" #include "separator.h" #include "tree.h" #include @@ -1983,7 +1984,19 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker return; } - if (!fake->doc().isEmpty()) { + if (fake->doc().isEmpty()) { + if (fake->subType() == Node::File) { + xmlWriter().writeStartElement("body"); + Text text; + Quoter quoter; + Doc::quoteFromFile(fake->doc().location(), quoter, fake->name()); + QString code = quoter.quoteTo(fake->location(), "", ""); + text << Atom(Atom::Code, code); + generateText(text, fake, marker); + xmlWriter().writeEndElement(); // + } + } + else { xmlWriter().writeStartElement("body"); if (fake->subType() == Node::Module) { writeDetailedDescription(fake, marker, false, QString("Detailed Description")); @@ -2000,7 +2013,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker } generateAnnotatedList(fake, marker, groupMembersMap); } - xmlWriter().writeEndElement(); // } xmlWriter().writeEndElement(); // -- cgit v0.12 From e7d0747e31fbf0226a7cb639ca52f984cdd8d3ea Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 14 Oct 2010 14:09:08 +0200 Subject: qdoc: Included file path as small-subtitle for example source files. --- tools/qdoc3/ditaxmlgenerator.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 9715b9d..b9ceb0a 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1986,11 +1986,17 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker if (fake->doc().isEmpty()) { if (fake->subType() == Node::File) { - xmlWriter().writeStartElement("body"); Text text; Quoter quoter; + xmlWriter().writeStartElement("body"); + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass", "small-subtitle"); + text << fake->subTitle(); + generateText(text, fake, marker); + xmlWriter().writeEndElement(); //

    Doc::quoteFromFile(fake->doc().location(), quoter, fake->name()); QString code = quoter.quoteTo(fake->location(), "", ""); + text.clear(); text << Atom(Atom::Code, code); generateText(text, fake, marker); xmlWriter().writeEndElement(); // -- cgit v0.12 From 101148b86d356295b559c60c304714e8a07aafd6 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 15 Oct 2010 13:35:56 +0200 Subject: qdoc: Fixed invalid element nesting in some elements. --- tools/qdoc3/ditaxmlgenerator.cpp | 67 ++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index b9ceb0a..42f6d1d 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1895,49 +1895,66 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker generateHeader(fake, fullTitle); generateBrief(fake, marker); // + xmlWriter().writeStartElement("body"); if (fake->subType() == Node::Module) { generateStatus(fake, marker); if (moduleNamespaceMap.contains(fake->name())) { - writeTargetAndHeader("namespaces","Namespaces","h2"); + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","namespaces"); + xmlWriter().writeStartElement("ttitle"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters("Namespaces"); + xmlWriter().writeEndElement(); // generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]); + xmlWriter().writeEndElement(); //
    } if (moduleClassMap.contains(fake->name())) { - writeTargetAndHeader("classes","Classes","h2"); + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","classes"); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters("Classes"); + xmlWriter().writeEndElement(); // generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]); + xmlWriter().writeEndElement(); //
    } } else if (fake->subType() == Node::HeaderFile) { generateStatus(fake, marker); - xmlWriter().writeStartElement("ul"); - QString membersLink = generateListOfAllMemberFile(fake, marker); - if (!membersLink.isEmpty()) { - writeXrefListItem(membersLink,"List of all members, including inherited members"); - } - QString obsoleteLink = generateLowStatusMemberFile(fake, marker, CodeMarker::Obsolete); - if (!obsoleteLink.isEmpty()) { - writeXrefListItem(obsoleteLink,"Obsolete members"); - } - QString compatLink = generateLowStatusMemberFile(fake, marker, CodeMarker::Compat); - if (!compatLink.isEmpty()) { - writeXrefListItem(compatLink,"Qt 3 support members"); - } - xmlWriter().writeEndElement(); // + if (!membersLink.isEmpty() || !obsoleteLink.isEmpty() || !compatLink.isEmpty()) { + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","member-lists"); + xmlWriter().writeStartElement("ul"); + if (!membersLink.isEmpty()) { + writeXrefListItem(membersLink,"List of all members, including inherited members"); + } + if (!obsoleteLink.isEmpty()) { + writeXrefListItem(obsoleteLink,"Obsolete members"); + } + if (!compatLink.isEmpty()) { + writeXrefListItem(compatLink,"Qt 3 support members"); + } + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); //
    + } } else if (fake->subType() == Node::QmlClass) { const QmlClassNode* qml_cn = static_cast(fake); const ClassNode* cn = qml_cn->classNode(); - generateQmlInherits(qml_cn, marker); + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","apidesc"); generateQmlInstantiates(qml_cn, marker); - generateBrief(qml_cn, marker); + generateQmlInherits(qml_cn, marker); generateQmlInheritedBy(qml_cn, marker); + xmlWriter().writeEndElement(); //
    sections = marker->qmlSections(qml_cn,CodeMarker::Summary,0); s = sections.begin(); while (s != sections.end()) { @@ -1981,6 +1998,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker } ++s; } + xmlWriter().writeEndElement(); // return; } @@ -1988,7 +2006,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker if (fake->subType() == Node::File) { Text text; Quoter quoter; - xmlWriter().writeStartElement("body"); xmlWriter().writeStartElement("p"); xmlWriter().writeAttribute("outputclass", "small-subtitle"); text << fake->subTitle(); @@ -1999,11 +2016,9 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker text.clear(); text << Atom(Atom::Code, code); generateText(text, fake, marker); - xmlWriter().writeEndElement(); // } } else { - xmlWriter().writeStartElement("body"); if (fake->subType() == Node::Module) { writeDetailedDescription(fake, marker, false, QString("Detailed Description")); } @@ -2019,8 +2034,8 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker } generateAnnotatedList(fake, marker, groupMembersMap); } - xmlWriter().writeEndElement(); // } + xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // } @@ -2219,13 +2234,13 @@ void DitaXmlGenerator::generateHeader(const Node* node, case Node::File: outputclass = "file"; break; - case Node::Image: + case Node::Image: // not used outputclass = "image"; break; case Node::Module: outputclass = "module"; break; - case Node::ExternalPage: + case Node::ExternalPage: // not used outputclass = "externalpage"; break; case Node::QmlClass: @@ -2261,9 +2276,9 @@ void DitaXmlGenerator::generateHeader(const Node* node, xmlWriter().writeAttribute("id",node->guid()); if (!outputclass.isEmpty()) xmlWriter().writeAttribute("outputclass",outputclass); - xmlWriter().writeStartElement(nameElement); + xmlWriter().writeStartElement(nameElement); // or <apiName> xmlWriter().writeCharacters(name); - xmlWriter().writeEndElement(); // <nameElement> + xmlWriter().writeEndElement(); // or } /*! -- cgit v0.12 From 410f203fd3542af182a6fe4406cc5094b65a90f8 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 18 Oct 2010 13:22:40 +0200 Subject: qdoc: Changed GUIDs from "{xxxxxx}" to "id-xxxxxxx". --- tools/qdoc3/ditaxmlgenerator.cpp | 25 ++++--------------------- tools/qdoc3/ditaxmlgenerator.h | 3 --- tools/qdoc3/htmlgenerator.cpp | 1 + tools/qdoc3/node.cpp | 16 +++++++++------- tools/qdoc3/node.h | 5 ++--- 5 files changed, 16 insertions(+), 34 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 42f6d1d..9108d7b 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -559,7 +559,8 @@ QString DitaXmlGenerator::lookupGuid(QString text) QMap::const_iterator i = name2guidMap.find(text); if (i != name2guidMap.end()) return i.value(); - QString guid = QUuid::createUuid().toString(); + QString t = QUuid::createUuid().toString(); + QString guid = "id-" + t.mid(1,t.length()-2); name2guidMap.insert(text,guid); return guid; } @@ -578,7 +579,8 @@ QString DitaXmlGenerator::lookupGuid(const QString& fileName, const QString& tex GuidMap::const_iterator i = gm->find(text); if (i != gm->end()) return i.value(); - QString guid = QUuid::createUuid().toString(); + QString t = QUuid::createUuid().toString(); + QString guid = "id-" + t.mid(1,t.length()-2); gm->insert(text,guid); return guid; } @@ -1840,25 +1842,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } /*! - Write a paragraph for the \a target and a poaragraph for - the \a header. Use the \a attribute for the \a header. - */ -void DitaXmlGenerator::writeTargetAndHeader(const QString& target, - const QString& header, - const QString& attribute) -{ - xmlWriter().writeStartElement("p"); - writeGuidAttribute(registerRef(target)); - xmlWriter().writeAttribute("outputclass","target"); - xmlWriter().writeCharacters(header); - xmlWriter().writeEndElement(); //

    - xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass",attribute); - xmlWriter().writeCharacters(header); - xmlWriter().writeEndElement(); //

    -} - -/*! Write a list item for a \a link with the given \a text. */ void DitaXmlGenerator::writeXrefListItem(const QString& link, const QString& text) diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index c0cb0db..e564f58 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -108,9 +108,6 @@ class DitaXmlGenerator : public PageGenerator virtual QString linkForNode(const Node* node, const Node* relative); virtual QString refForAtom(Atom* atom, const Node* node); - void writeTargetAndHeader(const QString& target, - const QString& header, - const QString& attribute); void writeXrefListItem(const QString& link, const QString& text); QString fullQualification(const Node* n); diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 726196f..19b86e0 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -56,6 +56,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index ce53b86..f4736f3 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -46,6 +46,7 @@ #include "node.h" #include "tree.h" #include "codemarker.h" +#include #include QT_BEGIN_NAMESPACE @@ -103,7 +104,6 @@ Node::Node(Type type, InnerNode *parent, const QString& name) { if (par) par->addChild(this); - //uuid = QUuid::createUuid(); } /*! @@ -270,14 +270,16 @@ QString Node::fileBase() const } /*! - Returns this node's Universally Unique IDentifier. - If its UUID has not yet been created, it is created - first. + Returns this node's Universally Unique IDentifier as a + QString. Creates the UUID first, if it has not been created. */ -QUuid Node::guid() const +QString Node::guid() const { - if (uuid.isNull()) - uuid = QUuid::createUuid(); + if (uuid.isEmpty()) { + QUuid quuid = QUuid::createUuid(); + QString t = quuid.toString(); + uuid = "id-" + t.mid(1,t.length()-2); + } return uuid; } diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 40b78ef..0b493ee 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -55,7 +55,6 @@ #include "doc.h" #include "location.h" #include "text.h" -#include QT_BEGIN_NAMESPACE @@ -191,7 +190,7 @@ class Node void clearRelated() { rel = 0; } virtual QString fileBase() const; - QUuid guid() const; + QString guid() const; QString ditaXmlHref(); QString extractClassName(const QString &string) const; @@ -223,7 +222,7 @@ class Node QString u; QString sinc; QString tpl; - mutable QUuid uuid; + mutable QString uuid; }; class FunctionNode; -- cgit v0.12 From 8f3e9dc22c5d4d72984473139d2c9a382c79b963 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 18 Oct 2010 14:35:04 +0200 Subject: qdoc: Added extraneous enum Definition File elements Removed bread crumb generator from DITA XML generator. --- tools/qdoc3/ditaxmlgenerator.cpp | 168 +++++---------------------------------- tools/qdoc3/ditaxmlgenerator.h | 3 - 2 files changed, 21 insertions(+), 150 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 9108d7b..b69f511 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2022,60 +2022,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker xmlWriter().writeEndElement(); // } -#if 0 -zzz - /* - Generate the TOC for the new doc format. - Don't generate a TOC for the home page. - */ - if (fake->name() != QString("index.html")) - generateTableOfContents(fake,marker,0); - - generateTitle(fullTitle, - Text() << fake->subTitle(), - subTitleSize, - fake, - marker); - - -#endif - -#if 0 -zzz - sections = marker->sections(fake, CodeMarker::Summary, CodeMarker::Okay); - s = sections.begin(); - while (s != sections.end()) { - out() << "\n"; - out() << "

    " << protectEnc((*s).name) << "

    \n"; - generateSection(s->members, fake, marker, CodeMarker::Summary); - generateSectionInheritedList(*s, relative, marker, name_alignment); - ++s; - } - - Text brief = fake->doc().briefText(); - if (fake->subType() == Node::Module && !brief.isEmpty()) { - out() << "\n"; - out() << "
    \n"; // QTBUG-9504 - out() << "

    " << "Detailed Description" << "

    \n"; - } - else - out() << "
    \n"; // QTBUG-9504 - - sections = marker->sections(fake, CodeMarker::Detailed, CodeMarker::Okay); - s = sections.begin(); - while (s != sections.end()) { - out() << "
    \n"; - out() << "

    " << protectEnc((*s).name) << "

    \n"; - - NodeList::ConstIterator m = (*s).members.begin(); - while (m != (*s).members.end()) { - generateDetailedMember(*m, fake, marker); - ++m; - } - ++s; - } -#endif - /*! Returns "xml" for this subclass of class Generator. */ @@ -2085,95 +2031,6 @@ QString DitaXmlGenerator::fileExtension(const Node * /* node */) const } /*! - zzz - Output breadcrumb list in the html file. - */ -void DitaXmlGenerator::generateBreadCrumbs(const QString& title, - const Node *node, - CodeMarker *marker) -{ - Text breadcrumb; - if (node->type() == Node::Class) { - const ClassNode* cn = static_cast(node); - QString name = node->moduleName(); - out() << "
  • All Modules
  • "; - if (!name.isEmpty()) { - out() << "
  • "; - breadcrumb << Atom(Atom::AutoLink,name); - generateText(breadcrumb, node, marker); - out() << "
  • \n"; - } - breadcrumb.clear(); - if (!cn->name().isEmpty()) { - out() << "
  • "; - breadcrumb << Atom(Atom::AutoLink,cn->name()); - generateText(breadcrumb, 0, marker); - out() << "
  • \n"; - } - } - else if (node->type() == Node::Fake) { - const FakeNode* fn = static_cast(node); - if (node->subType() == Node::Module) { - out() << "
  • All Modules
  • "; - QString name = node->name(); - if (!name.isEmpty()) { - out() << "
  • "; - breadcrumb << Atom(Atom::AutoLink,name); - generateText(breadcrumb, 0, marker); - out() << "
  • \n"; - } - } - else if (node->subType() == Node::Group) { - if (fn->name() == QString("modules")) - out() << "
  • All Modules
  • "; - else { - out() << "
  • name() << "\">" << title - << "
  • "; - } - } - else if (node->subType() == Node::Page) { - if (fn->name() == QString("examples.html")) { - out() << "
  • Examples
  • "; - } - else if (fn->name().startsWith("examples-")) { - out() << "
  • Examples
  • "; - out() << "
  • name() << "\">" << title - << "
  • "; - } - else if (fn->name() == QString("namespaces.html")) { - out() << "
  • All Namespaces
  • "; - } - else { - out() << "
  • name() << "\">" << title - << "
  • "; - } - } - else if (node->subType() == Node::QmlClass) { - out() << "
  • QML Elements
  • "; - out() << "
  • name() << "\">" << title - << "
  • "; - } - else if (node->subType() == Node::Example) { - out() << "
  • Examples
  • "; - QStringList sl = fn->name().split('/'); - QString name = "examples-" + sl.at(0) + ".html"; - QString t = CodeParser::titleFromName(name); - out() << "
  • " - << t << "
  • "; - out() << "
  • " - << title << "
  • "; - } - } - else if (node->type() == Node::Namespace) { - const NamespaceNode* nsn = static_cast(node); - out() << "
  • All Namespaces
  • "; - out() << "
  • " << title - << "
  • "; - } -} - -/*! Writes an XML file header to the current XML stream. This depends on which kind of DITA XML file is being generated, which is determined by the \a node type and subtype and the @@ -4683,7 +4540,7 @@ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker) */ void DitaXmlGenerator::writeLocation(const Node* n) { - QString s1, s2, s3; + QString s1, s2, s3, s4, s5, s6; if (n->type() == Node::Class || n->type() == Node::Namespace) { s1 = CXXCLASSAPIITEMLOCATION; s2 = CXXCLASSDECLARATIONFILE; @@ -4698,6 +4555,9 @@ void DitaXmlGenerator::writeLocation(const Node* n) s1 = CXXENUMERATIONAPIITEMLOCATION; s2 = CXXENUMERATIONDECLARATIONFILE; s3 = CXXENUMERATIONDECLARATIONFILELINE; + s4 = CXXENUMERATIONDEFINITIONFILE; + s5 = CXXENUMERATIONDEFINITIONFILELINESTART; + s6 = CXXENUMERATIONDEFINITIONFILELINEEND; } else if (n->type() == Node::Typedef) { s1 = CXXTYPEDEFAPIITEMLOCATION; @@ -4720,9 +4580,23 @@ void DitaXmlGenerator::writeLocation(const Node* n) QString lineNr; xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo())); xmlWriter().writeEndElement(); // DeclarationFileLine> - - // not included: , , - // and + if (!s4.isEmpty()) { // zzz This stuff is temporary, I think. + xmlWriter().writeStartElement(s4); + xmlWriter().writeAttribute("name","filePath"); + xmlWriter().writeAttribute("value",n->location().filePath()); + xmlWriter().writeEndElement(); // DefinitionFile> + xmlWriter().writeStartElement(s5); + xmlWriter().writeAttribute("name","lineNumber"); + xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo())); + xmlWriter().writeEndElement(); // DefinitionFileLineStart> + xmlWriter().writeStartElement(s6); + xmlWriter().writeAttribute("name","lineNumber"); + xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo())); + xmlWriter().writeEndElement(); // DefinitionFileLineEnd> + } + + // not included: , , + // and xmlWriter().writeEndElement(); // ApiItemLocation> } diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index e564f58..30c398b 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -133,9 +133,6 @@ class DitaXmlGenerator : public PageGenerator const Node* relative, CodeMarker* marker, const Atom* atom = 0); - void generateBreadCrumbs(const QString& title, - const Node* node, - CodeMarker* marker); void generateHeader(const Node* node, const QString& name, bool subpage = false); -- cgit v0.12 From c004bfbfcdb5110ae1545e013ca555a9f4b75337 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 18 Oct 2010 15:26:33 +0200 Subject: qdoc: Fixed

    inside of

    for legalese text. --- tools/qdoc3/ditaxmlgenerator.cpp | 22 ++++++++++++++++------ tools/qdoc3/ditaxmlgenerator.h | 1 + 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index b69f511..27f36ff 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -64,6 +64,7 @@ int DitaXmlGenerator::id = 0; bool DitaXmlGenerator::inApiDesc = false; bool DitaXmlGenerator::inSection = false; bool DitaXmlGenerator::inDetailedDescription = false; +bool DitaXmlGenerator::inLegaleseText = false; #define cxxapi_d_xref Doc::alias("cxxapi-d-xref") #define cxxclass Doc::alias("cxxclass") @@ -1122,11 +1123,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, // nothing break; case Atom::LegaleseLeft: - xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","legalese"); + inLegaleseText = true; break; case Atom::LegaleseRight: - xmlWriter().writeEndElement(); //

    + inLegaleseText = false; break; case Atom::LineBreak: xmlWriter().writeEmptyElement("br"); @@ -1309,6 +1309,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::ParaLeft: xmlWriter().writeStartElement("p"); + if (inLegaleseText) + xmlWriter().writeAttribute("outputclass","legalese"); in_para = true; break; case Atom::ParaRight: @@ -4547,9 +4549,17 @@ void DitaXmlGenerator::writeLocation(const Node* n) s3 = CXXCLASSDECLARATIONFILELINE; } else if (n->type() == Node::Function) { - s1 = CXXFUNCTIONAPIITEMLOCATION; - s2 = CXXFUNCTIONDECLARATIONFILE; - s3 = CXXFUNCTIONDECLARATIONFILELINE; + FunctionNode* fn = const_cast(static_cast(n)); + if (fn->isMacro()) { + s1 = CXXDEFINEAPIITEMLOCATION; + s2 = CXXDEFINEDECLARATIONFILE; + s3 = CXXDEFINEDECLARATIONFILELINE; + } + else { + s1 = CXXFUNCTIONAPIITEMLOCATION; + s2 = CXXFUNCTIONDECLARATIONFILE; + s3 = CXXFUNCTIONDECLARATIONFILELINE; + } } else if (n->type() == Node::Enum) { s1 = CXXENUMERATIONAPIITEMLOCATION; diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 30c398b..0a9fc4a 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -308,6 +308,7 @@ class DitaXmlGenerator : public PageGenerator static bool inApiDesc; static bool inSection; static bool inDetailedDescription; + static bool inLegaleseText; QStack xmlWriterStack; }; -- cgit v0.12 From c0836f9101f48c3c37ea477c66c49fd3dc08dfb5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 20 Oct 2010 12:36:14 +0200 Subject: qdoc: Fixed some DITA XML validation errors. --- tools/qdoc3/ditaxmlgenerator.cpp | 66 ++++++++++--------- tools/qdoc3/doc.cpp | 4 +- tools/qdoc3/doc.h | 2 +- tools/qdoc3/text.cpp | 136 ++++++++++++++++++++------------------- tools/qdoc3/text.h | 2 +- 5 files changed, 108 insertions(+), 102 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 27f36ff..668d6ed 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -337,8 +337,6 @@ bool DitaXmlGenerator::inLegaleseText = false; #define APIMAP Doc::alias("apiMap") #define APIITEMREF Doc::alias("apiItemRef") -#define SHORTDESC Doc::alias("shortdesc") - QString DitaXmlGenerator::sinceTitles[] = { " New Namespaces", @@ -677,7 +675,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, CodeMarker *marker) { int skipAhead = 0; - QString hx; + QString hx, str; static bool in_para = false; QString guid, hc; @@ -710,30 +708,20 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, skipAhead = skipAtoms(atom, Atom::BriefRight); break; } - if (inApiDesc || inSection) + if (inApiDesc || inSection) { xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","brief"); + } else { noLinks = true; - xmlWriter().writeStartElement(SHORTDESC); + xmlWriter().writeStartElement("shortdesc"); } if (relative->type() == Node::Property || relative->type() == Node::Variable) { - QString str; - atom = atom->next(); - while (atom != 0 && atom->type() != Atom::BriefRight) { - if (atom->type() == Atom::String || - atom->type() == Atom::AutoLink) - str += atom->string(); - skipAhead++; - atom = atom->next(); - } - str[0] = str[0].toLower(); - if (str.right(1) == ".") - str.truncate(str.length() - 1); xmlWriter().writeCharacters("This "); if (relative->type() == Node::Property) xmlWriter().writeCharacters("property"); - else + else if (relative->type() == Node::Variable) xmlWriter().writeCharacters("variable"); QStringList words = str.split(" "); if (!(words.first() == "contains" || words.first() == "specifies" @@ -742,14 +730,27 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeCharacters(" holds "); else xmlWriter().writeCharacters(" "); + } + if (noLinks) { + atom = atom->next(); + while (atom != 0 && atom->type() != Atom::BriefRight) { + if (atom->type() == Atom::String || + atom->type() == Atom::AutoLink) + str += atom->string(); + skipAhead++; + atom = atom->next(); + } + str[0] = str[0].toLower(); + if (str.right(1) == ".") + str.truncate(str.length() - 1); + str[0] = str[0].toUpper(); xmlWriter().writeCharacters(str + "."); } break; case Atom::BriefRight: - if (relative->type() != Node::Fake) { + if (relative->type() != Node::Fake) xmlWriter().writeEndElement(); // or

    - noLinks = false; - } + noLinks = false; break; case Atom::C: xmlWriter().writeStartElement(formattingLeftMap()[ATOM_FORMATTING_TELETYPE]); @@ -1141,8 +1142,13 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, .arg(marker->plainFullName(relative))); } #if 0 - else - qDebug() << "MYLINK:" << myLink << outFileName();; + else if (noLinks) { + //xmlWriter().writeCharacters(atom->string()); + qDebug() << "MYLINK:" << myLink << outFileName() << atom->string(); + } + else { + beginLink(myLink, node, relative, marker); + } #endif beginLink(myLink, node, relative, marker); skipAhead = 1; @@ -1556,7 +1562,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeStartElement(APIDESC); xmlWriter().writeAttribute("spectitle",title); - Text brief = nsn->doc().briefText(); + Text brief = nsn->doc().briefText(); // zzz if (!brief.isEmpty()) { xmlWriter().writeStartElement("p"); generateText(brief, nsn, marker); @@ -1713,7 +1719,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeStartElement(APIDESC); xmlWriter().writeAttribute("spectitle",title); - Text brief = cn->doc().briefText(); + Text brief = cn->doc().briefText(); // zzz if (!brief.isEmpty()) { xmlWriter().writeStartElement("p"); generateText(brief, cn, marker); @@ -2107,7 +2113,7 @@ void DitaXmlGenerator::generateHeader(const Node* node, dtd = "dtd/cxxClass.dtd"; version = "0.6.0"; doctype = ""; outputclass = "namespace"; } @@ -2160,13 +2166,9 @@ void DitaXmlGenerator::generateTitle(const QString& title, */ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) { - Text brief = node->doc().briefText(); + Text brief = node->doc().briefText(true); // zzz if (!brief.isEmpty()) { - noLinks = true; - xmlWriter().writeStartElement(SHORTDESC); generateText(brief, node, marker); - xmlWriter().writeEndElement(); // - noLinks = false; } } @@ -2613,7 +2615,7 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative, else { xmlWriter().writeStartElement("entry"); xmlWriter().writeStartElement("p"); - xmlWriter().writeCharacters(protectEnc(node->doc().briefText().toString())); + xmlWriter().writeCharacters(protectEnc(node->doc().briefText().toString())); // zzz xmlWriter().writeEndElement(); //

    xmlWriter().writeEndElement(); // } diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index 280f055..5adb282 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -2621,9 +2621,9 @@ const Text& Doc::body() const return priv == 0 ? dummy : priv->text; } -Text Doc::briefText() const +Text Doc::briefText(bool inclusive) const { - return body().subText(Atom::BriefLeft, Atom::BriefRight); + return body().subText(Atom::BriefLeft, Atom::BriefRight, 0, inclusive); } Text Doc::trimmedBriefText(const QString &className) const diff --git a/tools/qdoc3/doc.h b/tools/qdoc3/doc.h index 3e76456..cf93151 100644 --- a/tools/qdoc3/doc.h +++ b/tools/qdoc3/doc.h @@ -100,7 +100,7 @@ class Doc bool isEmpty() const; const QString& source() const; const Text& body() const; - Text briefText() const; + Text briefText(bool inclusive = false) const; Text trimmedBriefText(const QString &className) const; Text legaleseText() const; const QString& baseName() const; diff --git a/tools/qdoc3/text.cpp b/tools/qdoc3/text.cpp index 11d7edd..ecec5eb 100644 --- a/tools/qdoc3/text.cpp +++ b/tools/qdoc3/text.cpp @@ -60,10 +60,10 @@ Text::Text(const QString &str) operator<<(str); } -Text::Text( const Text& text ) +Text::Text(const Text& text) : first(0), last(0) { - operator=( text ); + operator=(text); } Text::~Text() @@ -71,41 +71,41 @@ Text::~Text() clear(); } -Text& Text::operator=( const Text& text ) +Text& Text::operator=(const Text& text) { - if ( this != &text ) { + if (this != &text) { clear(); - operator<<( text ); + operator<<(text); } return *this; } -Text& Text::operator<<( Atom::Type atomType ) +Text& Text::operator<<(Atom::Type atomType) { - return operator<<( Atom(atomType) ); + return operator<<(Atom(atomType)); } -Text& Text::operator<<( const QString& string ) +Text& Text::operator<<(const QString& string) { - return operator<<( Atom(Atom::String, string) ); + return operator<<(Atom(Atom::String, string)); } -Text& Text::operator<<( const Atom& atom ) +Text& Text::operator<<(const Atom& atom) { - if ( first == 0 ) { - first = new Atom( atom.type(), atom.string() ); + if (first == 0) { + first = new Atom(atom.type(), atom.string()); last = first; } else { - last = new Atom( last, atom.type(), atom.string() ); + last = new Atom(last, atom.type(), atom.string()); } return *this; } -Text& Text::operator<<( const Text& text ) +Text& Text::operator<<(const Text& text) { - const Atom *atom = text.firstAtom(); - while ( atom != 0 ) { - operator<<( *atom ); + const Atom* atom = text.firstAtom(); + while (atom != 0) { + operator<<(*atom); atom = atom->next(); } return *this; @@ -113,10 +113,10 @@ Text& Text::operator<<( const Text& text ) void Text::stripFirstAtom() { - if ( first != 0 ) { - if ( first == last ) + if (first != 0) { + if (first == last) last = 0; - Atom *oldFirst = first; + Atom* oldFirst = first; first = first->next(); delete oldFirst; } @@ -124,16 +124,16 @@ void Text::stripFirstAtom() void Text::stripLastAtom() { - if ( last != 0 ) { - Atom *oldLast = last; - if ( first == last ) { + if (last != 0) { + Atom* oldLast = last; + if (first == last) { first = 0; last = 0; } else { last = first; - while ( last->next() != oldLast ) + while (last->next() != oldLast) last = last->next(); - last->setNext( 0 ); + last->setNext(0); } delete oldLast; } @@ -142,9 +142,9 @@ void Text::stripLastAtom() QString Text::toString() const { QString str; - const Atom *atom = firstAtom(); - while ( atom != 0 ) { - if ( atom->type() == Atom::String || + const Atom* atom = firstAtom(); + while (atom != 0) { + if (atom->type() == Atom::String || atom->type() == Atom::AutoLink || atom->type() == Atom::GuidLink) str += atom->string(); @@ -153,50 +153,54 @@ QString Text::toString() const return str; } -Text Text::subText( Atom::Type left, Atom::Type right, const Atom *from ) const +Text Text::subText(Atom::Type left, Atom::Type right, const Atom* from, bool inclusive) const { - const Atom *begin = from ? from : firstAtom(); - const Atom *end; + const Atom* begin = from ? from : firstAtom(); + const Atom* end; - while ( begin != 0 && begin->type() != left ) - begin = begin->next(); - if ( begin != 0 ) + while (begin != 0 && begin->type() != left) begin = begin->next(); + if (begin != 0) { + if (!inclusive) + begin = begin->next(); + } end = begin; - while ( end != 0 && end->type() != right ) + while (end != 0 && end->type() != right) end = end->next(); - if ( end == 0 ) + if (end == 0) begin = 0; - return subText( begin, end ); + else if (inclusive) + end = end->next(); + return subText(begin, end); } -Text Text::sectionHeading(const Atom *sectionLeft) +Text Text::sectionHeading(const Atom* sectionLeft) { - if ( sectionLeft != 0 ) { - const Atom *begin = sectionLeft; - while ( begin != 0 && begin->type() != Atom::SectionHeadingLeft ) + if (sectionLeft != 0) { + const Atom* begin = sectionLeft; + while (begin != 0 && begin->type() != Atom::SectionHeadingLeft) begin = begin->next(); - if ( begin != 0 ) + if (begin != 0) begin = begin->next(); - const Atom *end = begin; - while ( end != 0 && end->type() != Atom::SectionHeadingRight ) + const Atom* end = begin; + while (end != 0 && end->type() != Atom::SectionHeadingRight) end = end->next(); - if ( end != 0 ) - return subText( begin, end ); + if (end != 0) + return subText(begin, end); } return Text(); } -const Atom *Text::sectionHeadingAtom(const Atom *sectionLeft) +const Atom* Text::sectionHeadingAtom(const Atom* sectionLeft) { - if ( sectionLeft != 0 ) { - const Atom *begin = sectionLeft; - while ( begin != 0 && begin->type() != Atom::SectionHeadingLeft ) + if (sectionLeft != 0) { + const Atom* begin = sectionLeft; + while (begin != 0 && begin->type() != Atom::SectionHeadingLeft) begin = begin->next(); - if ( begin != 0 ) + if (begin != 0) begin = begin->next(); return begin; @@ -206,25 +210,25 @@ const Atom *Text::sectionHeadingAtom(const Atom *sectionLeft) void Text::dump() const { - const Atom *atom = firstAtom(); - while ( atom != 0 ) { + const Atom* atom = firstAtom(); + while (atom != 0) { QString str = atom->string(); - str.replace( "\\", "\\\\" ); - str.replace( "\"", "\\\"" ); - str.replace( "\n", "\\n" ); - str.replace( QRegExp("[^\x20-\x7e]"), "?" ); - if ( !str.isEmpty() ) + str.replace("\\", "\\\\"); + str.replace("\"", "\\\""); + str.replace("\n", "\\n"); + str.replace(QRegExp("[^\x20-\x7e]"), "?"); + if (!str.isEmpty()) str = " \"" + str + "\""; - fprintf(stderr, " %-15s%s\n", atom->typeString().toLatin1().data(), str.toLatin1().data() ); + fprintf(stderr, " %-15s%s\n", atom->typeString().toLatin1().data(), str.toLatin1().data()); atom = atom->next(); } } -Text Text::subText( const Atom *begin, const Atom *end ) +Text Text::subText(const Atom* begin, const Atom* end) { Text text; - if ( begin != 0 ) { - while ( begin != end ) { + if (begin != 0) { + while (begin != end) { text << *begin; begin = begin->next(); } @@ -234,8 +238,8 @@ Text Text::subText( const Atom *begin, const Atom *end ) void Text::clear() { - while ( first != 0 ) { - Atom *atom = first; + while (first != 0) { + Atom* atom = first; first = first->next(); delete atom; } @@ -250,8 +254,8 @@ int Text::compare(const Text &text1, const Text &text2) if (text2.isEmpty()) return 1; - const Atom *atom1 = text1.firstAtom(); - const Atom *atom2 = text2.firstAtom(); + const Atom* atom1 = text1.firstAtom(); + const Atom* atom2 = text2.firstAtom(); for (;;) { if (atom1->type() != atom2->type()) diff --git a/tools/qdoc3/text.h b/tools/qdoc3/text.h index 879f6da..93428ed 100644 --- a/tools/qdoc3/text.h +++ b/tools/qdoc3/text.h @@ -73,7 +73,7 @@ class Text QString toString() const; const Atom *firstAtom() const { return first; } const Atom *lastAtom() const { return last; } - Text subText(Atom::Type left, Atom::Type right, const Atom *from = 0) const; + Text subText(Atom::Type left, Atom::Type right, const Atom *from = 0, bool inclusive = false) const; void dump() const; void clear(); -- cgit v0.12 From 2ec8af79c81caf960c54913d0a57c89b74606b34 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 20 Oct 2010 13:40:49 +0200 Subject: qdoc: Fixed some DITA XML validation errors. --- tools/qdoc3/ditaxmlgenerator.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 668d6ed..062a023 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1403,6 +1403,19 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, tableColumnCount = 0; break; case Atom::TableHeaderLeft: + if (inTableBody) { + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + inTableHeader = false; + inTableBody = false; + tableColumnCount = 0; + xmlWriter().writeStartElement("table"); + numTableRows = 0; + tableColumnCount = countTableColumns(atom); + xmlWriter().writeStartElement("tgroup"); + xmlWriter().writeAttribute("cols",QString::number(tableColumnCount)); + } xmlWriter().writeStartElement("thead"); xmlWriter().writeAttribute("valign","top"); xmlWriter().writeStartElement("row"); @@ -1446,8 +1459,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, QString s = "span(" + spans[0] + "," + spans[1] + ")"; xmlWriter().writeAttribute("outputclass",s); } - if (!inTableHeader) - xmlWriter().writeStartElement("p"); } if (matchAhead(atom, Atom::ParaLeft)) skipAhead = 1; @@ -1457,7 +1468,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (inTableHeader) xmlWriter().writeEndElement(); // else { - xmlWriter().writeEndElement(); //

    xmlWriter().writeEndElement(); // } if (matchAhead(atom, Atom::ParaLeft)) @@ -1493,10 +1503,14 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } break; case Atom::Target: + if (in_para) { + xmlWriter().writeEndElement(); //

    + in_para = false; + } xmlWriter().writeStartElement("p"); writeGuidAttribute(Doc::canonicalTitle(atom->string())); xmlWriter().writeAttribute("outputclass","target"); - xmlWriter().writeCharacters(protectEnc(atom->string())); + //xmlWriter().writeCharacters(protectEnc(atom->string())); xmlWriter().writeEndElement(); //

    break; case Atom::UnhandledFormat: -- cgit v0.12 From 0df0141ac041fdd65564908f233c29da0fd5c067 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 20 Oct 2010 14:02:22 +0200 Subject: doc: Moved some table headers to be before the rows. --- src/gui/painting/qpainter.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 7fed7e4..9afb62f 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1113,14 +1113,14 @@ void QPainterPrivate::updateState(QPainterState *newState) the range of available patterns. \table - \row - \o \inlineimage qpainter-vectordeformation.png - \o \inlineimage qpainter-gradients.png - \o \inlineimage qpainter-pathstroking.png \header \o \l {demos/deform}{Vector Deformation} \o \l {demos/gradients}{Gradients} \o \l {demos/pathstroke}{Path Stroking} + \row + \o \inlineimage qpainter-vectordeformation.png + \o \inlineimage qpainter-gradients.png + \o \inlineimage qpainter-pathstroking.png \endtable @@ -1193,13 +1193,13 @@ void QPainterPrivate::updateState(QPainterState *newState) coordinate transformations. \table + \header + \o nop \o rotate() \o scale() \o translate() \row \o \inlineimage qpainter-clock.png \o \inlineimage qpainter-rotation.png \o \inlineimage qpainter-scale.png \o \inlineimage qpainter-translation.png - \header - \o nop \o rotate() \o scale() \o translate() \endtable The most commonly used transformations are scaling, rotation, -- cgit v0.12 From 4f91ec092e62f03cc68cde4d6a070d3caa8c657d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 20 Oct 2010 14:42:43 +0200 Subject: doc: Moved some table headers before the rows. --- src/gui/painting/qpainterpath.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index ffd0d5c..d96c9b7 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -240,12 +240,12 @@ static void qt_debug_path(const QPainterPath &path) provides two methods for filling paths: \table - \row - \o \inlineimage qt-fillrule-oddeven.png - \o \inlineimage qt-fillrule-winding.png \header \o Qt::OddEvenFill \o Qt::WindingFill + \row + \o \inlineimage qt-fillrule-oddeven.png + \o \inlineimage qt-fillrule-winding.png \endtable See the Qt::FillRule documentation for the definition of the @@ -315,12 +315,12 @@ static void qt_debug_path(const QPainterPath &path) QPainterPath to draw text. \table - \row - \o \inlineimage qpainterpath-example.png - \o \inlineimage qpainterpath-demo.png \header \o \l {painting/painterpaths}{Painter Paths Example} \o \l {demos/deform}{Vector Deformation Demo} + \row + \o \inlineimage qpainterpath-example.png + \o \inlineimage qpainterpath-demo.png \endtable \sa QPainterPathStroker, QPainter, QRegion, {Painter Paths Example} @@ -1244,12 +1244,12 @@ Qt::FillRule QPainterPath::fillRule() const fillRule. Qt provides two methods for filling paths: \table - \row - \o \inlineimage qt-fillrule-oddeven.png - \o \inlineimage qt-fillrule-winding.png \header \o Qt::OddEvenFill (default) \o Qt::WindingFill + \row + \o \inlineimage qt-fillrule-oddeven.png + \o \inlineimage qt-fillrule-winding.png \endtable \sa fillRule() -- cgit v0.12 From e3d8c3b9ca03a90be0b5032f195acfb4d0ce7bb4 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 20 Oct 2010 14:43:18 +0200 Subject: qdoc: Fixed some DITA XML validation errors. --- tools/qdoc3/ditaxmlgenerator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 062a023..2d719cf 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1333,6 +1333,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeEndElement(); // break; case Atom::RawString: + qDebug() << "RAW:" << atom->string(); xmlWriter().writeCharacters(atom->string()); break; case Atom::SectionLeft: @@ -2597,6 +2598,8 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeMap& nodeMap) { + if (nodeMap.isEmpty()) + return; xmlWriter().writeStartElement("table"); xmlWriter().writeAttribute("outputclass","annotated"); xmlWriter().writeStartElement("tgroup"); -- cgit v0.12 From 1a0394398bbb7bb03356a5b06582f99d412366f6 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 20 Oct 2010 14:49:54 +0200 Subject: qdoc: Fixed some DITA XML validation errors. --- tools/qdoc3/ditaxmlgenerator.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 2d719cf..2e5652c 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1094,11 +1094,11 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (atom->next() != 0) text = atom->next()->string(); if (fileName.isEmpty()) { - xmlWriter().writeStartElement("font"); - xmlWriter().writeAttribute("color","red"); + xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","error"); xmlWriter().writeCharacters("[Missing image: "); xmlWriter().writeCharacters(protectEnc(atom->string())); - xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); //

    } else { xmlWriter().writeStartElement("fig"); @@ -1333,7 +1333,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeEndElement(); // break; case Atom::RawString: - qDebug() << "RAW:" << atom->string(); xmlWriter().writeCharacters(atom->string()); break; case Atom::SectionLeft: -- cgit v0.12 From b55cb6f7801dadc2b442589d9584f8946ac00a52 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 22 Oct 2010 13:48:21 +0200 Subject: doc: Moved some table headers ahead of the rows. --- src/gui/image/qimage.cpp | 8 ++++---- src/gui/painting/qbrush.cpp | 8 ++++---- src/gui/painting/qcolor.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 1157b93..2bb0897 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -513,12 +513,12 @@ bool QImageData::checkForAlphaPixels() const function. For example: \table + \header + \o {2,1}32-bit \row \o \inlineimage qimage-32bit_scaled.png \o \snippet doc/src/snippets/code/src_gui_image_qimage.cpp 0 - \header - \o {2,1}32-bit \endtable In case of a 8-bit and monchrome images, the pixel value is only @@ -534,12 +534,12 @@ bool QImageData::checkForAlphaPixels() const example: \table + \header + \o {2,1} 8-bit \row \o \inlineimage qimage-8bit_scaled.png \o \snippet doc/src/snippets/code/src_gui_image_qimage.cpp 1 - \header - \o {2,1} 8-bit \endtable QImage also provide the scanLine() function which returns a diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index d0788c7..55e5ca4 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -1208,14 +1208,14 @@ QDataStream &operator>>(QDataStream &s, QBrush &b) Each of the types is represented by a subclass of QGradient: \table - \row - \o \inlineimage qgradient-linear.png - \o \inlineimage qgradient-radial.png - \o \inlineimage qgradient-conical.png \header \o QLinearGradient \o QRadialGradient \o QConicalGradient + \row + \o \inlineimage qgradient-linear.png + \o \inlineimage qgradient-radial.png + \o \inlineimage qgradient-conical.png \endtable The colors in a gradient are defined using stop points of the diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 37d7fa3..b2ce69c 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -78,12 +78,12 @@ QT_BEGIN_NAMESPACE names. \table + \header + \o RGB \o HSV \o CMYK \row \o \inlineimage qcolor-rgb.png \o \inlineimage qcolor-hsv.png \o \inlineimage qcolor-cmyk.png - \header - \o RGB \o HSV \o CMYK \endtable The QColor constructor creates the color based on RGB values. To -- cgit v0.12 From b8ea919c8b77ef6b6e980dda12e9e907ab39653c Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 22 Oct 2010 13:49:27 +0200 Subject: qdoc: Output the \headerfile as a . --- tools/qdoc3/ditaxmlgenerator.cpp | 455 +++++++++++++++++++++++++-------------- tools/qdoc3/ditaxmlgenerator.h | 1 + 2 files changed, 299 insertions(+), 157 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 2e5652c..42fa40a 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -286,57 +286,6 @@ bool DitaXmlGenerator::inLegaleseText = false; #define CXXVARIABLESTORAGECLASSSPECIFIERSTATIC Doc::alias("cxxVariableStorageClassSpecifierStatic") #define CXXVARIABLEVOLATILE Doc::alias("cxxVariableVolatile") -#define APIREF Doc::alias("apiRef") -#define APINAME Doc::alias("apiName") -#define APIDETAIL Doc::alias("apiDetail") -#define APISYNTAX Doc::alias("apiSyntax") -#define APISYNTAXTEXT Doc::alias("apiSyntaxText") -#define APISYNTAXITEM Doc::alias("apiSyntaxItem") -#define APIDEF Doc::alias("apiDef") -#define APIQUALIFIER Doc::alias("apiQualifier") -#define APIRELATION Doc::alias("apiRelation") -#define APITYPE Doc::alias("apiType") -#define APIARRAY Doc::alias("apiArray") -#define APIDATA Doc::alias("apiData") -#define APIDEFNOTE Doc::alias("apiDefNote") -#define APIDEFITEM Doc::alias("apiDefItem") -#define APIITEMNAME Doc::alias("apiItemName") -#define APIDESC Doc::alias("apiDesc") -#define APIIMPL Doc::alias("apiImpl") - -#define APIPACKAGE Doc::alias("apiPackage") - -#define APICLASSIFIER Doc::alias("apiClassifier") -#define APICLASSIFIERDETAIL Doc::alias("apiClassifierDetail") -#define APICLASSIFIERDEF Doc::alias("apiClassifierDef") -#define APICLASSIFIERMEMBER Doc::alias("apiClassifierMember") -#define APIOTHERCLASSIFIER Doc::alias("apiOtherClassifier") -#define APIBASECLASSIFIER Doc::alias("apiBaseClassifier") - -#define APIOPERATION Doc::alias("apiOperation") -#define APIOPERATIONDETAIL Doc::alias("apiOperationDetail") -#define APIOPERATIONDEF Doc::alias("apiOperationDef") -#define APIRETURN Doc::alias("apiReturn") -#define APIPARAM Doc::alias("apiParam") -#define APIEVENT Doc::alias("apiEvent") -#define APIOPERATIONDEFITEM Doc::alias("apiOperationDefItem") -#define APIOPERATIONCLASSIFIER Doc::alias("apiOperationClassifier") -#define APICONSTRUCTORDEF Doc::alias("apiConstructorDef") - -#define APIVALUE Doc::alias("apiValue") -#define APIVALUEDETAIL Doc::alias("apiValueDetail") -#define APIVALUEDEF Doc::alias("apiValueDef") -#define APIVALUEMEMBER Doc::alias("apiValueMember") -#define APIVALUECLASSIFIER Doc::alias("apiValueClassifier") - -#define APIclassifier Doc::alias("apiclassifier") -#define APIoperation Doc::alias("apioperation") -#define APIpackage Doc::alias("apipackage") -#define APIvalue Doc::alias("apivalue") - -#define APIMAP Doc::alias("apiMap") -#define APIITEMREF Doc::alias("apiItemRef") - QString DitaXmlGenerator::sinceTitles[] = { " New Namespaces", @@ -1094,11 +1043,11 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (atom->next() != 0) text = atom->next()->string(); if (fileName.isEmpty()) { - xmlWriter().writeStartElement("p"); + xmlWriter().writeStartElement("b"); xmlWriter().writeAttribute("outputclass","error"); xmlWriter().writeCharacters("[Missing image: "); xmlWriter().writeCharacters(protectEnc(atom->string())); - xmlWriter().writeEndElement(); //

    + xmlWriter().writeEndElement(); // } else { xmlWriter().writeStartElement("fig"); @@ -1515,7 +1464,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::UnhandledFormat: xmlWriter().writeStartElement("b"); - xmlWriter().writeAttribute("outputclass","redFont"); + xmlWriter().writeAttribute("outputclass","error"); xmlWriter().writeCharacters("<Missing DITAXML>"); xmlWriter().writeEndElement(); // break; @@ -1546,14 +1495,11 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark { QList
    ::ConstIterator s; - const ClassNode* cn = 0; - const NamespaceNode* nsn = 0; - QString title; QString rawTitle; QString fullTitle; if (inner->type() == Node::Namespace) { - nsn = const_cast(static_cast(inner)); + const NamespaceNode* nsn = const_cast(static_cast(inner)); rawTitle = marker->plainName(inner); fullTitle = marker->plainFullName(inner); title = rawTitle + " Namespace"; @@ -1574,7 +1520,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writeLocation(nsn); xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement(APIDESC); + xmlWriter().writeStartElement("apiDesc"); xmlWriter().writeAttribute("spectitle",title); Text brief = nsn->doc().briefText(); // zzz if (!brief.isEmpty()) { @@ -1586,29 +1532,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateStatus(nsn, marker); generateThreadSafeness(nsn, marker); generateSince(nsn, marker); - - xmlWriter().writeStartElement("ul"); - - QString membersLink = generateListOfAllMemberFile(inner, marker); - if (!membersLink.isEmpty()) { - writeXrefListItem(membersLink,"List of all members, including inherited members"); - } - - QString obsoleteLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Obsolete); - if (!obsoleteLink.isEmpty()) { - writeXrefListItem(obsoleteLink,"Obsolete members"); - } - - QString compatLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Compat); - if (!compatLink.isEmpty()) { - writeXrefListItem(compatLink,"Qt 3 support members"); - } - - xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // bool needOtherSection = false; @@ -1700,10 +1623,31 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } ++s; } +#if 0 + QString membersLink = generateListOfAllMemberFile(inner, marker); + QString obsoleteLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Obsolete); + QString compatLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Compat); + if (!membersLink.isEmpty() || + !obsoleteLink.isEmpty() || + !compatLink.isEmpty()) { + xmlWriter().writeStartElement("ul"); + if (!membersLink.isEmpty()) + writeXrefListItem(membersLink,"List of all members, including inherited members"); + if (!obsoleteLink.isEmpty()) + writeXrefListItem(obsoleteLink,"Obsolete members"); + if (!compatLink.isEmpty()) + writeXrefListItem(compatLink,"Qt 3 support members"); + xmlWriter().writeEndElement(); // + } +#endif xmlWriter().writeEndElement(); // } else if (inner->type() == Node::Class) { - cn = const_cast(static_cast(inner)); + const ClassNode* cn = const_cast(static_cast(inner)); rawTitle = marker->plainName(inner); fullTitle = marker->plainFullName(inner); title = rawTitle + " Class Reference"; @@ -1731,7 +1675,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writeLocation(cn); xmlWriter().writeEndElement(); // - xmlWriter().writeStartElement(APIDESC); + xmlWriter().writeStartElement("apiDesc"); xmlWriter().writeAttribute("spectitle",title); Text brief = cn->doc().briefText(); // zzz if (!brief.isEmpty()) { @@ -1745,29 +1689,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateInheritedBy(cn, marker); generateThreadSafeness(cn, marker); generateSince(cn, marker); - - xmlWriter().writeStartElement("ul"); - - QString membersLink = generateListOfAllMemberFile(inner, marker); - if (!membersLink.isEmpty()) { - writeXrefListItem(membersLink,"List of all members, including inherited members"); - } - - QString obsoleteLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Obsolete); - if (!obsoleteLink.isEmpty()) { - writeXrefListItem(obsoleteLink,"Obsolete members"); - } - - QString compatLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Compat); - if (!compatLink.isEmpty()) { - writeXrefListItem(compatLink,"Qt 3 support members"); - } - - xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // bool needOtherSection = false; @@ -1859,6 +1780,168 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark // not included: +#if 0 + QString membersLink = generateListOfAllMemberFile(inner, marker); + QString obsoleteLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Obsolete); + QString compatLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Compat); + if (!membersLink.isEmpty() || + !obsoleteLink.isEmpty() || + !compatLink.isEmpty()) { + xmlWriter().writeStartElement("ul"); + if (!membersLink.isEmpty()) + writeXrefListItem(membersLink,"List of all members, including inherited members"); + if (!obsoleteLink.isEmpty()) + writeXrefListItem(obsoleteLink,"Obsolete members"); + if (!compatLink.isEmpty()) + writeXrefListItem(compatLink,"Qt 3 support members"); + xmlWriter().writeEndElement(); // + } +#endif + xmlWriter().writeEndElement(); // + } + else if ((inner->type() == Node::Fake) && (inner->subType() == Node::HeaderFile)) { + const FakeNode* fn = const_cast(static_cast(inner)); + rawTitle = marker->plainName(inner); + fullTitle = marker->plainFullName(inner); + title = rawTitle; + + /* + Note: Because the C++ specialization we are using + has no element, we are using the + element with an outputclass attribute + set to "headerfile" . + */ + generateHeader(inner, fullTitle); + generateBrief(inner, marker); // + xmlWriter().writeStartElement(CXXCLASSDETAIL); + xmlWriter().writeStartElement("apiDesc"); + xmlWriter().writeAttribute("spectitle",title); + Text brief = fn->doc().briefText(); // zzz + if (!brief.isEmpty()) { + xmlWriter().writeStartElement("p"); + generateText(brief, fn, marker); + xmlWriter().writeEndElement(); //

    + } + generateIncludes(fn, marker); + generateStatus(fn, marker); + generateThreadSafeness(fn, marker); + generateSince(fn, marker); + xmlWriter().writeEndElement(); // + + bool needOtherSection = false; + QList
    summarySections; + summarySections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); + s = summarySections.begin(); + while (s != summarySections.end()) { + if (s->members.isEmpty() && s->reimpMembers.isEmpty()) { + if (!s->inherited.isEmpty()) + needOtherSection = true; + } + else { + QString attr; + if (!s->members.isEmpty()) { + xmlWriter().writeStartElement("section"); + attr = cleanRef((*s).name).toLower() + " redundant"; + xmlWriter().writeAttribute("outputclass",attr); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc((*s).name)); + xmlWriter().writeEndElement(); // + generateSection(s->members, inner, marker, CodeMarker::Summary); + generateSectionInheritedList(*s, inner, marker); + xmlWriter().writeEndElement(); //
    + } + if (!s->reimpMembers.isEmpty()) { + QString name = QString("Reimplemented ") + (*s).name; + attr = cleanRef(name).toLower() + " redundant"; + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass",attr); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc(name)); + xmlWriter().writeEndElement(); // + generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); + generateSectionInheritedList(*s, inner, marker); + xmlWriter().writeEndElement(); //
    + } + } + ++s; + } + if (needOtherSection) { + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","additional-inherited-members redundant"); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h3"); + xmlWriter().writeCharacters("Additional Inherited Members"); + xmlWriter().writeEndElement(); // + s = summarySections.begin(); + while (s != summarySections.end()) { + if (s->members.isEmpty()) + generateSectionInheritedList(*s, inner, marker); + ++s; + } + xmlWriter().writeEndElement(); //
    + } + + writeDetailedDescription(fn, marker, false, QString("Detailed Description")); + xmlWriter().writeEndElement(); // + + // not included: + // not included: + + QList
    detailSections; + detailSections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay); + s = detailSections.begin(); + while (s != detailSections.end()) { + if ((*s).name == "Classes") { + writeNestedClasses((*s),fn); + break; + } + ++s; + } + + s = detailSections.begin(); + while (s != detailSections.end()) { + if ((*s).name == "Function Documentation") { + writeFunctions((*s),fn,marker); + } + else if ((*s).name == "Type Documentation") { + writeEnumerations((*s),marker); + writeTypedefs((*s),marker); + } + else if ((*s).name == "Namespaces") { + qDebug() << "Nested namespaces" << outFileName(); + } + else if ((*s).name == "Macro Documentation") { + writeMacros((*s),marker); + } + ++s; + } +#if 0 + QString membersLink = generateListOfAllMemberFile(inner, marker); + QString obsoleteLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Obsolete); + QString compatLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Compat); + if (!membersLink.isEmpty() || + !obsoleteLink.isEmpty() || + !compatLink.isEmpty()) { + xmlWriter().writeStartElement("ul"); + if (!membersLink.isEmpty()) + writeXrefListItem(membersLink,"List of all members, including inherited members"); + if (!obsoleteLink.isEmpty()) + writeXrefListItem(obsoleteLink,"Obsolete members"); + if (!compatLink.isEmpty()) + writeXrefListItem(compatLink,"Qt 3 support members"); + xmlWriter().writeEndElement(); // + } +#endif xmlWriter().writeEndElement(); // } } @@ -1906,7 +1989,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker if (moduleNamespaceMap.contains(fake->name())) { xmlWriter().writeStartElement("section"); xmlWriter().writeAttribute("outputclass","namespaces"); - xmlWriter().writeStartElement("ttitle"); + xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); xmlWriter().writeCharacters("Namespaces"); xmlWriter().writeEndElement(); // @@ -1924,6 +2007,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker xmlWriter().writeEndElement(); //
    } } +#if 0 else if (fake->subType() == Node::HeaderFile) { generateStatus(fake, marker); QString membersLink = generateListOfAllMemberFile(fake, marker); @@ -1951,11 +2035,12 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker xmlWriter().writeEndElement(); //
    } } +#endif else if (fake->subType() == Node::QmlClass) { const QmlClassNode* qml_cn = static_cast(fake); const ClassNode* cn = qml_cn->classNode(); xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("outputclass","apidesc"); + xmlWriter().writeAttribute("outputclass","apiDesc"); generateQmlInstantiates(qml_cn, marker); generateQmlInherits(qml_cn, marker); generateQmlInheritedBy(qml_cn, marker); @@ -2074,45 +2159,7 @@ void DitaXmlGenerator::generateHeader(const Node* node, QString version; QString outputclass; - if (node->type() == Node::Fake || subpage) { - mainElement = "topic"; - nameElement = "title"; - dtd = "dtd/topic.dtd"; - doctype = ""; - switch (node->subType()) { - case Node::Page: - outputclass = "page"; - break; - case Node::Group: - outputclass = "group"; - break; - case Node::Example: - outputclass = "example"; - break; - case Node::HeaderFile: - outputclass = "headerfile"; - break; - case Node::File: - outputclass = "file"; - break; - case Node::Image: // not used - outputclass = "image"; - break; - case Node::Module: - outputclass = "module"; - break; - case Node::ExternalPage: // not used - outputclass = "externalpage"; - break; - case Node::QmlClass: - outputclass = "QML-class"; - break; - default: - outputclass = "page"; - } - } - else if (node->type() == Node::Class) { + if (node->type() == Node::Class) { mainElement = "cxxClass"; nameElement = "apiName"; dtd = "dtd/cxxClass.dtd"; @@ -2131,6 +2178,53 @@ void DitaXmlGenerator::generateHeader(const Node* node, version + "//EN\" \"" + dtd + "\">"; outputclass = "namespace"; } + else if (node->type() == Node::Fake || subpage) { + if (node->subType() == Node::HeaderFile) { + mainElement = "cxxClass"; + nameElement = "apiName"; + dtd = "dtd/cxxClass.dtd"; + version = "0.6.0"; + doctype = ""; + outputclass = "headerfile"; + } + else { + mainElement = "topic"; + nameElement = "title"; + dtd = "dtd/topic.dtd"; + doctype = ""; + switch (node->subType()) { + case Node::Page: + outputclass = "page"; + break; + case Node::Group: + outputclass = "group"; + break; + case Node::Example: + outputclass = "example"; + break; + case Node::File: + outputclass = "file"; + break; + case Node::Image: // not used + outputclass = "image"; + break; + case Node::Module: + outputclass = "module"; + break; + case Node::ExternalPage: // not used + outputclass = "externalpage"; + break; + case Node::QmlClass: + outputclass = "QML-class"; + break; + default: + outputclass = "page"; + } + } + } xmlWriter().writeDTD(doctype); xmlWriter().writeComment(node->doc().location().fileName()); @@ -2441,6 +2535,7 @@ QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode* inner, return fileName; } +#if 0 QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, CodeMarker* marker, CodeMarker::Status status) @@ -2539,6 +2634,7 @@ QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, endSubPage(); return fileName; } +#endif /*! Write the XML for the class hierarchy to the current XML stream. @@ -4642,7 +4738,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, FunctionNode* fn = const_cast(static_cast(*m)); xmlWriter().writeStartElement(CXXFUNCTION); xmlWriter().writeAttribute("id",fn->guid()); - xmlWriter().writeStartElement(APINAME); + xmlWriter().writeStartElement("apiName"); if (fn->metaness() == FunctionNode::Signal) xmlWriter().writeAttribute("class","signal"); else if (fn->metaness() == FunctionNode::Slot) @@ -4811,7 +4907,7 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, const EnumNode* en = static_cast(*m); xmlWriter().writeStartElement(CXXENUMERATION); xmlWriter().writeAttribute("id",en->guid()); - xmlWriter().writeStartElement(APINAME); + xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters(en->name()); xmlWriter().writeEndElement(); // generateBrief(en,marker); @@ -4861,7 +4957,7 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, QList::ConstIterator i = items.begin(); while (i != items.end()) { xmlWriter().writeStartElement(CXXENUMERATOR); - xmlWriter().writeStartElement(APINAME); + xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters((*i).name()); xmlWriter().writeEndElement(); // @@ -4887,7 +4983,7 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, // not included: if (!(*i).text().isEmpty()) { - xmlWriter().writeStartElement(APIDESC); + xmlWriter().writeStartElement("apiDesc"); generateText((*i).text(), en, marker); xmlWriter().writeEndElement(); // } @@ -4926,7 +5022,7 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, const TypedefNode* tn = static_cast(*m); xmlWriter().writeStartElement(CXXTYPEDEF); xmlWriter().writeAttribute("id",tn->guid()); - xmlWriter().writeStartElement(APINAME); + xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters(tn->name()); xmlWriter().writeEndElement(); // generateBrief(tn,marker); @@ -4986,7 +5082,7 @@ void DitaXmlGenerator::writeProperties(const Section& s, const PropertyNode* pn = static_cast(*m); xmlWriter().writeStartElement(CXXVARIABLE); xmlWriter().writeAttribute("id",pn->guid()); - xmlWriter().writeStartElement(APINAME); + xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters(pn->name()); xmlWriter().writeEndElement(); // generateBrief(pn,marker); @@ -5095,7 +5191,7 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, const VariableNode* vn = static_cast(*m); xmlWriter().writeStartElement(CXXVARIABLE); xmlWriter().writeAttribute("id",vn->guid()); - xmlWriter().writeStartElement(APINAME); + xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters(vn->name()); xmlWriter().writeEndElement(); // generateBrief(vn,marker); @@ -5177,7 +5273,7 @@ void DitaXmlGenerator::writeMacros(const Section& s, if (fn->isMacro()) { xmlWriter().writeStartElement(CXXDEFINE); xmlWriter().writeAttribute("id",fn->guid()); - xmlWriter().writeStartElement(APINAME); + xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters(fn->name()); xmlWriter().writeEndElement(); // generateBrief(fn,marker); @@ -5337,7 +5433,7 @@ void DitaXmlGenerator::writeDetailedDescription(const Node* node, inDetailedDescription = true; if (apiDesc) { inApiDesc = true; - xmlWriter().writeStartElement(APIDESC); + xmlWriter().writeStartElement("apiDesc"); if (!title.isEmpty()) { writeGuidAttribute(title); xmlWriter().writeAttribute("spectitle",title); @@ -5402,4 +5498,49 @@ void DitaXmlGenerator::writeNestedClasses(const Section& s, xmlWriter().writeEndElement(); // } +/*! + Recursive writing of DITA XML files from the root \a node. + */ +void +DitaXmlGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) +{ + if (!node->url().isNull()) + return; + + if (node->type() == Node::Fake) { + const FakeNode *fakeNode = static_cast(node); + if (fakeNode->subType() == Node::ExternalPage) + return; + if (fakeNode->subType() == Node::Image) + return; + if (fakeNode->subType() == Node::QmlPropertyGroup) + return; + if (fakeNode->subType() == Node::Page) { + if (node->count() > 0) + qDebug("PAGE %s HAS CHILDREN", qPrintable(fakeNode->title())); + } + } + + if (node->parent() != 0) { + beginSubPage(node->location(), fileName(node)); + if (node->type() == Node::Namespace || node->type() == Node::Class) { + generateClassLikeNode(node, marker); + } + else if (node->type() == Node::Fake) { + if (node->subType() == Node::HeaderFile) + generateClassLikeNode(node, marker); + else + generateFakeNode(static_cast(node), marker); + } + endSubPage(); + } + + NodeList::ConstIterator c = node->childNodes().begin(); + while (c != node->childNodes().end()) { + if ((*c)->isInnerNode() && (*c)->access() != Node::Private) + generateInnerNode((const InnerNode*) *c, marker); + ++c; + } +} + QT_END_NAMESPACE diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 0a9fc4a..b457061 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -246,6 +246,7 @@ class DitaXmlGenerator : public PageGenerator GuidMap* lookupGuidMap(const QString& fileName); virtual void beginSubPage(const Location& location, const QString& fileName); virtual void endSubPage(); + virtual void generateInnerNode(const InnerNode* node, CodeMarker* marker); QXmlStreamWriter& xmlWriter(); void writeDetailedDescription(const Node* node, CodeMarker* marker, -- cgit v0.12 From 68d0073707e8c3e3d7a5f93b5cf8ba9d02e2a468 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Sat, 23 Oct 2010 11:00:46 +0200 Subject: qdoc: Output the \qmlclass as a . Still more work to do here to make the detail sections correct. --- tools/qdoc3/ditaxmlgenerator.cpp | 155 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 151 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 42fa40a..8ae109d 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1944,8 +1944,146 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark #endif xmlWriter().writeEndElement(); // } + else if ((inner->type() == Node::Fake) && (inner->subType() == Node::QmlClass)) { + const QmlClassNode* qcn = const_cast(static_cast(inner)); + const ClassNode* cn = qcn->classNode(); + rawTitle = marker->plainName(inner); + fullTitle = marker->plainFullName(inner); + title = rawTitle + " Element Reference"; + //QString fullTitle = fake->fullTitle(); + //QString htmlTitle = fullTitle; + + generateHeader(inner, fullTitle); + generateBrief(inner, marker); // + + // not included: + + xmlWriter().writeStartElement(CXXCLASSDETAIL); + xmlWriter().writeStartElement("apiDesc"); + xmlWriter().writeAttribute("spectitle",title); + Text brief = qcn->doc().briefText(); // zzz + if (!brief.isEmpty()) { + xmlWriter().writeStartElement("p"); + generateText(brief, qcn, marker); + xmlWriter().writeEndElement(); //

    + } + generateQmlInstantiates(qcn, marker); + generateQmlInherits(qcn, marker); + generateQmlInheritedBy(qcn, marker); + generateSince(qcn, marker); + xmlWriter().writeEndElement(); // + + QList
    summarySections; + summarySections = marker->qmlSections(qcn,CodeMarker::Summary,0); + s = summarySections.begin(); + while (s != summarySections.end()) { + QString attr; + if (!s->members.isEmpty()) { + xmlWriter().writeStartElement("section"); + attr = cleanRef((*s).name).toLower() + " redundant"; + xmlWriter().writeAttribute("outputclass",attr); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc((*s).name)); + xmlWriter().writeEndElement(); // + generateQmlSummary(*s,qcn,marker); + //generateSection(s->members, inner, marker, CodeMarker::Summary); + //generateSectionInheritedList(*s, inner, marker); + xmlWriter().writeEndElement(); //
    + } + if (!s->reimpMembers.isEmpty()) { + qDebug() << "GOT HEAH!"; + QString name = QString("Reimplemented ") + (*s).name; + attr = cleanRef(name).toLower() + " redundant"; + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass",attr); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc(name)); + xmlWriter().writeEndElement(); // + generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); + generateSectionInheritedList(*s, inner, marker); + xmlWriter().writeEndElement(); //
    + } + ++s; + } + + writeDetailedDescription(qcn, marker, false, QString("Detailed Description")); + if (cn) + generateQmlText(cn->doc().body(), cn, marker, qcn->name()); + + QList
    detailSections; + detailSections = marker->qmlSections(qcn,CodeMarker::Detailed,0); + s = detailSections.begin(); + while (s != detailSections.end()) { + if (!s->members.isEmpty()) { + QString attr; + xmlWriter().writeStartElement("section"); + attr = cleanRef((*s).name).toLower(); + xmlWriter().writeAttribute("outputclass",attr); + xmlWriter().writeStartElement("title"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeCharacters(protectEnc((*s).name)); + xmlWriter().writeEndElement(); // + NodeList::ConstIterator m = (*s).members.begin(); + while (m != (*s).members.end()) { + generateDetailedQmlMember(*m, qcn, marker); + ++m; + } + xmlWriter().writeEndElement(); //
    + } + ++s; + } + + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + } } + +#if 0 + while (s != detailSections.end()) { + if ((*s).name == "Member Function Documentation") { + writeFunctions((*s),qcn,marker); + } + else if ((*s).name == "Member Type Documentation") { + writeEnumerations((*s),marker); + writeTypedefs((*s),marker); + } + else if ((*s).name == "Member Variable Documentation") { + writeDataMembers((*s),marker); + } + else if ((*s).name == "Property Documentation") { + writeProperties((*s),marker); + } + else if ((*s).name == "Macro Documentation") { + writeMacros((*s),marker); + } + ++s; + } +#endif +#if 0 + QString membersLink = generateListOfAllMemberFile(inner, marker); + QString obsoleteLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Obsolete); + QString compatLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Compat); + if (!membersLink.isEmpty() || + !obsoleteLink.isEmpty() || + !compatLink.isEmpty()) { + xmlWriter().writeStartElement("ul"); + if (!membersLink.isEmpty()) + writeXrefListItem(membersLink,"List of all members, including inherited members"); + if (!obsoleteLink.isEmpty()) + writeXrefListItem(obsoleteLink,"Obsolete members"); + if (!compatLink.isEmpty()) + writeXrefListItem(compatLink,"Qt 3 support members"); + xmlWriter().writeEndElement(); // + } +#endif + /*! Write a list item for a \a link with the given \a text. */ @@ -2035,7 +2173,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker xmlWriter().writeEndElement(); //
    } } -#endif else if (fake->subType() == Node::QmlClass) { const QmlClassNode* qml_cn = static_cast(fake); const ClassNode* cn = qml_cn->classNode(); @@ -2091,6 +2228,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker xmlWriter().writeEndElement(); // return; } +#endif if (fake->doc().isEmpty()) { if (fake->subType() == Node::File) { @@ -2189,6 +2327,16 @@ void DitaXmlGenerator::generateHeader(const Node* node, version + "//EN\" \"" + dtd + "\">"; outputclass = "headerfile"; } + else if (node->subType() == Node::QmlClass) { + mainElement = "cxxClass"; + nameElement = "apiName"; + dtd = "dtd/cxxClass.dtd"; + version = "0.6.0"; + doctype = ""; + outputclass = "QML-class"; + } else { mainElement = "topic"; nameElement = "title"; @@ -2217,9 +2365,6 @@ void DitaXmlGenerator::generateHeader(const Node* node, case Node::ExternalPage: // not used outputclass = "externalpage"; break; - case Node::QmlClass: - outputclass = "QML-class"; - break; default: outputclass = "page"; } @@ -5529,6 +5674,8 @@ DitaXmlGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) else if (node->type() == Node::Fake) { if (node->subType() == Node::HeaderFile) generateClassLikeNode(node, marker); + else if (node->subType() == Node::QmlClass) + generateClassLikeNode(node, marker); else generateFakeNode(static_cast(node), marker); } -- cgit v0.12 From af7346651038054b1cc72e2475a01315fbc9966e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 Oct 2010 09:46:48 +0200 Subject: doc: Moved a \target that was in the wrong place. --- doc/src/widgets-and-layouts/stylesheet.qdoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/src/widgets-and-layouts/stylesheet.qdoc b/doc/src/widgets-and-layouts/stylesheet.qdoc index 6343e6a..e02e8c2 100644 --- a/doc/src/widgets-and-layouts/stylesheet.qdoc +++ b/doc/src/widgets-and-layouts/stylesheet.qdoc @@ -2091,8 +2091,7 @@ \row - \o \bold{\c messagebox-text- \target messagebox-text-interaction-flags-prop - \BR \c interaction-flags}* + \o \bold{\c messagebox-text-interaction-flags*} \target messagebox-text-interaction-flags-prop \o \l{#Number}{Number} \o The interaction behavior for text in a message box. Possible values are based on Qt::TextInteractionFlags. -- cgit v0.12 From 89df9c49f89a66feef720bcc81fba84c5632552f Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 Oct 2010 09:47:58 +0200 Subject: qdoc: Fixed some DITA XML validation errors. --- tools/qdoc3/ditaxmlgenerator.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 8ae109d..3397033 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1276,10 +1276,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } break; case Atom::QuotationLeft: - xmlWriter().writeStartElement("blockquote"); + xmlWriter().writeStartElement("lq"); break; case Atom::QuotationRight: - xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // break; case Atom::RawString: xmlWriter().writeCharacters(atom->string()); @@ -1991,20 +1991,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark //generateSectionInheritedList(*s, inner, marker); xmlWriter().writeEndElement(); //
    } - if (!s->reimpMembers.isEmpty()) { - qDebug() << "GOT HEAH!"; - QString name = QString("Reimplemented ") + (*s).name; - attr = cleanRef(name).toLower() + " redundant"; - xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("outputclass",attr); - xmlWriter().writeStartElement("title"); - xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc(name)); - xmlWriter().writeEndElement(); // - generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); - generateSectionInheritedList(*s, inner, marker); - xmlWriter().writeEndElement(); //
    - } ++s; } @@ -2018,6 +2004,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark while (s != detailSections.end()) { if (!s->members.isEmpty()) { QString attr; + inSection = true; xmlWriter().writeStartElement("section"); attr = cleanRef((*s).name).toLower(); xmlWriter().writeAttribute("outputclass",attr); @@ -2031,6 +2018,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark ++m; } xmlWriter().writeEndElement(); //
    + inSection = false; } ++s; } -- cgit v0.12 From b0d64717d2c541976dc5524e4100c62f060e206f Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 Oct 2010 11:07:37 +0200 Subject: doc: Changed a table into 3 tables to eliminate a \raw. --- src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc index 0335d46..2be8e5e 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc +++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc @@ -103,8 +103,8 @@ The following locations are searched for plugins: \table - \header \o Linux/Unix (X11) \o Windows - \row \o{1,3} + \header \o Linux/Unix (X11) + \row \o \list \o \c{.mozilla/plugins} in the user's home directory \o \c{.netscape/plugins} in the user's home directory @@ -134,19 +134,20 @@ \o \c{$QTWEBKIT_PLUGIN_PATH} \endlist \endlist + \endtable - \o + \table + \header \o Windows + \row \o \list \o The user's \c{Application Data\Mozilla\plugins} directory \o Standard system locations of plugins for Quicktime, Flash, etc. \endlist + \endtable - \row - \raw HTML - Mac OS X - \endraw - \row - \o + \table + \header \o Mac OS X + \row \o \list \o \c{Library/Internet Plug-Ins} in the user's home directory \o The system \c{/Library/Internet Plug-Ins} directory -- cgit v0.12 From db88727a7dbf46e773745a7e22da6cf1e91611a8 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 Oct 2010 11:19:51 +0200 Subject: doc: Changed a \section in a \table into a \header. --- src/corelib/tools/qstring.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index d8dab43..74eb7d4 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -646,10 +646,12 @@ const QString::Null QString::null = { }; class.) \table 100 % - \row + \header \o \section1 Note for C Programmers + \row + \o Due to C++'s type system and the fact that QString is \l{implicitly shared}, QStrings may be treated like \c{int}s or other basic types. For example: -- cgit v0.12 From 7e11ffb60b2c1259b1d43f99147db53c0f004f25 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 Oct 2010 11:32:49 +0200 Subject: doc: Removed illegal \section1. --- src/corelib/tools/qstring.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 74eb7d4..8083aee 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -647,8 +647,7 @@ const QString::Null QString::null = { }; \table 100 % \header - \o - \section1 Note for C Programmers + \o Note for C Programmers \row \o -- cgit v0.12 From cbcaa64e3ff7ad8293c95df938901694b3f472bd Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 Oct 2010 12:30:07 +0200 Subject: doc: Moved many \target commands that were in the wrong place. --- doc/src/widgets-and-layouts/stylesheet.qdoc | 62 +++++++++++++---------------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/doc/src/widgets-and-layouts/stylesheet.qdoc b/doc/src/widgets-and-layouts/stylesheet.qdoc index e02e8c2..b35232e 100644 --- a/doc/src/widgets-and-layouts/stylesheet.qdoc +++ b/doc/src/widgets-and-layouts/stylesheet.qdoc @@ -1995,7 +1995,7 @@ \l{#bottom-prop}{bottom}. \row - \o \bold{\c lineedit-password- \BR \c character}* \target lineedit-password-character-prop + \o \bold{\c lineedit-password-character*} \target lineedit-password-character-prop \o \l{#Number}{Number} \o The QLineEdit password character as a Unicode number. @@ -2152,7 +2152,7 @@ See also \l{#min-height-prop}{min-height}. \row - \o \bold{\c opacity}* \target opacity-prop + \o \bold{\c opacity*} \target opacity-prop \o \l{#Number}{Number} \o The opacity for a widget. Possible values are from 0 (transparent) to 255 (opaque). For the moment, this is @@ -2248,7 +2248,7 @@ \l{#bottom-prop}{bottom}. \row - \o \bold{\c selection-background-color}* \target selection-background-color-prop + \o \bold{\c selection-background-color*} \target selection-background-color-prop \o \l{#Brush}{Brush} \BR \o The background of selected text or items. @@ -2267,7 +2267,7 @@ \l{Qt Style Sheets Reference#background-prop}{background}. \row - \o \bold{\c selection-color}* \target selection-color-prop + \o \bold{\c selection-color*} \target selection-color-prop \o \l{#Brush}{Brush} \BR \o The foreground of selected text or items. @@ -2287,8 +2287,7 @@ and \l{#color-prop}{color}. \row - \o \bold{\c show-decoration- \target show-decoration-selected-prop - \BR \c selected}* + \o \bold{\c show-decoration-selected*} \target show-decoration-selected-prop \o \l{#Boolean}{Boolean} \o Controls whether selections in a QListView cover the entire row or just the extent of the text. @@ -2303,7 +2302,7 @@ \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 73 \row - \o \bold{\c spacing}* \target spacing-prop + \o \bold{\c spacing*} \target spacing-prop \o \l{#Length}{Length} \o Internal spacing in the widget. @@ -2321,7 +2320,7 @@ \l{#margin-prop}{margin}. \row - \o \bold{\c subcontrol-origin}* \target subcontrol-origin-prop + \o \bold{\c subcontrol-origin*} \target subcontrol-origin-prop \o \l{#Origin}{Origin} \o The origin rectangle of the \l subcontrol within the parent element. @@ -2337,7 +2336,7 @@ \l{Qt Style Sheets Reference#subcontrol-position-prop}{subcontrol-position}. \row - \o \bold{\c subcontrol-position}* \target subcontrol-position-prop + \o \bold{\c subcontrol-position*} \target subcontrol-position-prop \o \l{#Alignment}{Alignment} \o The alignment of the \l subcontrol within the origin rectangle specified by \l{Qt Style Sheets Reference#subcontrol-origin-prop} @@ -2705,8 +2704,7 @@ \o Shorthand border property. \row - \o \bold{Border \target Border Image - Image} + \o \bold{Border Image} \target Border Image \o \c none \BR | \l{Url} \l{Number}\{4\} \BR (\c stretch | \c repeat){0,2} \o A border image is an image that is composed of nine parts @@ -2722,8 +2720,7 @@ {CSS3 Draft Specification} for details. \row - \o \bold{Border \target Border Style - Style} + \o \bold{Border Style} \target Border Style \o \c dashed \BR | \c dot-dash \BR | \c dot-dot-dash \BR @@ -2740,8 +2737,7 @@ {CSS3 Draft Specification} for details. \row - \o \bold{Box \target Box Colors - Colors} + \o \bold{Box Colors} \target Box Colors \o \l{#Brush}{Brush}\{1,4\} \o One to four occurrences of \l{#Brush}{Brush}, specifying the top, right, bottom, and left edges of a box, respectively. If @@ -2756,8 +2752,7 @@ \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 82 \row - \o \bold{Box \target Box Lengths - Lengths} + \o \bold{Box Lengths} \target Box Lengths \o \l{#Length}{Length}\{1,4\} \o One to four occurrences of \l{#Length}{Length}, specifying the top, right, bottom, and left edges of a box, @@ -2772,14 +2767,14 @@ \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 83 \row - \o \bold Brush \target Brush + \o \bold{Brush} \target Brush \o \l{#Color}{Color} \BR | \l{Gradient} \BR | \l{PaletteRole} \o Specifies a Color or a Gradient or an entry in the Palette. \row - \o \bold Color \target Color + \o \bold{Color} \target Color \o \tt{rgb(\e{r}, \e{g}, \e{b})} \BR | \tt{rgba(\e{r}, \e{g}, \e{b}, \e{a})} \BR | \tt{hsv(\e{h}, \e{s}, \e{v})} \BR @@ -2802,27 +2797,24 @@ \l{http://www.w3.org/TR/CSS21/syndata.html#color-units}{here}. \row - \o \bold Font \target Font + \o \bold{Font} \target Font \o (\l{#Font Style}{Font Style} | \l{#Font Weight}{Font Weight}){0,2} \l{#Font Size}{Font Size} String \o Shorthand font property. \row - \o \bold{Font \target Font Size - Size} + \o \bold{Font Size} \target Font Size \o \l{Length} \o The size of a font. \row - \o \bold{Font \target Font Style - Style} + \o \bold{Font Style} \target Font Style \o \c normal \BR | \c italic \BR | \c oblique \o The style of a font. \row - \o \bold{Font \target Font Weight - Weight} + \o \bold{Font Weight} \target Font Weight \o \c normal \BR | \c bold \BR | \c 100 \BR @@ -2832,7 +2824,7 @@ \o The weight of a font. \row - \o \bold Gradient \target Gradient + \o \bold{Gradient} \target Gradient \o \c qlineargradient \BR | \c qradialgradient \BR | \c qconicalgradient @@ -2862,7 +2854,7 @@ \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 85 \row - \o \bold Icon \target Icon + \o \bold{Icon} \target Icon \o (\l{#Url}{Url} (\c disabled | \c active | \c normal | \c selected)? (\c on | \c off)? )* \o A list of url, QIcon::Mode and QIcon::State. @@ -2871,7 +2863,7 @@ \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 86 \row - \o \bold Length \target Length + \o \bold{Length} \target Length \o \l{#Number}{Number} (\c px | \c pt | \c em | \c ex)? \o A number followed by a measurement unit. The CSS standard recommends that user agents must @@ -2889,13 +2881,13 @@ \endlist \row - \o \bold Number \target Number + \o \bold{Number} \target Number \o A decimal integer or a real number \o Examples: \c 0, \c 18, \c +127, \c -255, \c 12.34, \c -.5, \c 0009. \row - \o \bold Origin \target Origin + \o \bold{Origin} \target Origin \o \c margin \BR | \c border \BR | \c padding \BR @@ -2915,7 +2907,7 @@ See also \l{The Box Model}. \row - \o \bold PaletteRole \target PaletteRole + \o \bold{PaletteRole} \target PaletteRole \o \c alternate-base \BR | \c base \BR | \c bright-text \BR @@ -2940,7 +2932,7 @@ \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 87 \row - \o \bold Radius \target Radius + \o \bold{Radius} \target Radius \o \l{#Length}{Length}\{1, 2\} \o One or two occurrences of \l{#Length}{Length}. If only one length is specified, it is used as the radius of the quarter circle @@ -2949,7 +2941,7 @@ ellipse, whereas the second length is the vertical radius. \row - \o \bold Repeat \target Repeat + \o \bold{Repeat} \target Repeat \o \c repeat-x \BR | \c repeat-y \BR | \c repeat \BR @@ -2964,7 +2956,7 @@ \endlist \row - \o \bold Url \target Url + \o \bold{Url} \target Url \o \tt{url(\e{filename})} \o \tt{\e{filename}} is the name of a file on the local disk or stored using \l{the Qt Resource System}. Setting an -- cgit v0.12 From 766b23e722743c0b99c03cf4a035b5b20cb8a88f Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 Oct 2010 12:30:50 +0200 Subject: qdoc: Fixed some DITA XML validation errors. --- tools/qdoc3/ditaxmlgenerator.cpp | 11 +++++++++++ tools/qdoc3/ditaxmlgenerator.h | 2 +- tools/qdoc3/generator.h | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 3397033..e1aa519 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1282,7 +1282,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeEndElement(); // break; case Atom::RawString: + xmlWriter().writeStartElement("pre"); + xmlWriter().writeAttribute("outputclass","raw-html"); xmlWriter().writeCharacters(atom->string()); + xmlWriter().writeEndElement(); // break; case Atom::SectionLeft: if (inSection || inApiDesc) { @@ -5678,4 +5681,12 @@ DitaXmlGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) } } +/*! + Returns true if \a format is "XML" or "HTML" . + */ +bool DitaXmlGenerator::canHandleFormat(const QString& format) +{ + return (format == "HTML") || (format == this->format()); +} + QT_END_NAMESPACE diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index b457061..afa77bb 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -88,6 +88,7 @@ class DitaXmlGenerator : public PageGenerator virtual void initializeGenerator(const Config& config); virtual void terminateGenerator(); virtual QString format(); + virtual bool canHandleFormat(const QString& format); virtual void generateTree(const Tree* tree, CodeMarker* marker); QString protectEnc(const QString& string); @@ -326,4 +327,3 @@ class DitaXmlGenerator : public PageGenerator QT_END_NAMESPACE #endif - diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index bccfc5d..26d5269 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -114,7 +114,7 @@ class Generator void generateThreadSafeness(const Node *node, CodeMarker *marker); void generateSince(const Node *node, CodeMarker *marker); void generateStatus(const Node *node, CodeMarker *marker); - const Atom *generateAtomList(const Atom *atom, + const Atom* generateAtomList(const Atom *atom, const Node *relative, CodeMarker *marker, bool generate, -- cgit v0.12 From cd3d9ea937a77c5caad276ac279e550ae74b60d6 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 Oct 2010 13:18:14 +0200 Subject: doc: Fixed some DITA XML validation errors. --- doc/src/internationalization/linguist-manual.qdoc | 2 +- doc/src/platforms/emb-qvfb.qdoc | 1 - tools/qdoc3/ditaxmlgenerator.cpp | 14 ++++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/src/internationalization/linguist-manual.qdoc b/doc/src/internationalization/linguist-manual.qdoc index 57b98b8..baf37b0 100644 --- a/doc/src/internationalization/linguist-manual.qdoc +++ b/doc/src/internationalization/linguist-manual.qdoc @@ -95,7 +95,7 @@ \o A single phrase may need to be translated into several different forms depending on context, e.g. \e open in English - might become \e{\ouml\c{}ffnen}, "open file", or \e aufbauen, + might become \e{\ouml}\e{ffnen}, "open file", or \e aufbauen, "open internet connection", in German. \o Keyboard accelerators may need to be changed but without diff --git a/doc/src/platforms/emb-qvfb.qdoc b/doc/src/platforms/emb-qvfb.qdoc index 4be2f64..78bdd73 100644 --- a/doc/src/platforms/emb-qvfb.qdoc +++ b/doc/src/platforms/emb-qvfb.qdoc @@ -197,7 +197,6 @@ for the button are redrawn from the activated skin. \row - \row \o \image qt-embedded-clamshellphone-closed.png The ClamshellPhone Skin (closed) \o diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index e1aa519..bb2e817 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1282,10 +1282,16 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeEndElement(); // break; case Atom::RawString: - xmlWriter().writeStartElement("pre"); - xmlWriter().writeAttribute("outputclass","raw-html"); - xmlWriter().writeCharacters(atom->string()); - xmlWriter().writeEndElement(); // + if (atom->string() == " ") + break; + if (atom->string().startsWith("&")) + xmlWriter().writeCharacters(atom->string()); + else { + xmlWriter().writeStartElement("pre"); + xmlWriter().writeAttribute("outputclass","raw-html"); + xmlWriter().writeCharacters(atom->string()); + xmlWriter().writeEndElement(); // + } break; case Atom::SectionLeft: if (inSection || inApiDesc) { -- cgit v0.12 From 7f8bb137427160070c3461fc161199f82d4731e4 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 26 Oct 2010 10:30:58 +0200 Subject: doc: Fixed some DITA XML validation errors. Also fixed a bug in qdoc3 for html generation. --- tools/qdoc3/atom.h | 64 ++++++++++++++++++++-------------------- tools/qdoc3/ditaxmlgenerator.cpp | 4 +-- tools/qdoc3/doc.cpp | 2 +- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h index 13df07b..4639711 100644 --- a/tools/qdoc3/atom.h +++ b/tools/qdoc3/atom.h @@ -56,20 +56,20 @@ class Atom { public: enum Type { - AbstractLeft, - AbstractRight, + AbstractLeft, // 00 + AbstractRight, AnnotatedList, AutoLink, - BaseName, + BaseName, BriefLeft, - BriefRight, + BriefRight, C, - CaptionLeft, + CaptionLeft, CaptionRight, - Code, - CodeBad, - CodeNew, - CodeOld, + Code, // 10 + CodeBad, + CodeNew, + CodeOld, CodeQuoteArgument, CodeQuoteCommand, #ifdef QDOC_QML @@ -77,59 +77,59 @@ class Atom #endif FootnoteLeft, FootnoteRight, - FormatElse, - FormatEndif, + FormatElse, + FormatEndif, // 20 FormatIf, FormattingLeft, FormattingRight, GeneratedList, GuidLink, - Image, + Image, ImageText, InlineImage, LegaleseLeft, - LegaleseRight, - LineBreak, - Link, + LegaleseRight, // 30 + LineBreak, + Link, LinkNode, - ListLeft, + ListLeft, ListItemNumber, - ListTagLeft, - ListTagRight, - ListItemLeft, - ListItemRight, - ListRight, - Nop, + ListTagLeft, // 36 + ListTagRight, // 37 + ListItemLeft, // 38 + ListItemRight, // 39 + ListRight, // 40 + Nop, ParaLeft, - ParaRight, + ParaRight, #ifdef QDOC_QML Qml, QmlText, #endif - QuotationLeft, + QuotationLeft, QuotationRight, RawString, - SectionLeft, + SectionLeft, // 49 SectionRight, SectionHeadingLeft, SectionHeadingRight, - SidebarLeft, + SidebarLeft, SidebarRight, SinceList, SnippetCommand, SnippetIdentifier, SnippetLocation, - String, - TableLeft, - TableRight, + String, // 59 + TableLeft, // 60 + TableRight, TableHeaderLeft, TableHeaderRight, TableRowLeft, - TableRowRight, - TableItemLeft, + TableRowRight, + TableItemLeft, TableItemRight, TableOfContents, - Target, + Target, // 69 UnhandledFormat, UnknownCommand, Last = UnknownCommand diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index bb2e817..542960d 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1157,7 +1157,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeStartElement("stentry"); xmlWriter().writeCharacters("Value"); xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } } else { @@ -1223,8 +1223,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (threeColumnEnumValueTable) { xmlWriter().writeEndElement(); // xmlWriter().writeStartElement("stentry"); - if (matchAhead(atom, Atom::ListItemRight)) - xmlWriter().writeCharacters(" "); } } else { diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index 5adb282..4b1bec8 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -1682,7 +1682,7 @@ bool DocParser::closeCommand(int endCmd) void DocParser::startSection(Doc::SectioningUnit unit, int cmd) { - leavePara(); + leaveValueList(); if (currentSectioningUnit == Doc::Book) { #if 0 -- cgit v0.12 From b65b6ac831ddfae4b9c08d26e5087d98ce9c0f2e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 27 Oct 2010 10:05:30 +0200 Subject: doc: Fixed some DITA XML validation errors. These were in the compact list. --- tools/qdoc3/ditaxmlgenerator.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 542960d..30d1d74 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -3006,24 +3006,24 @@ void DitaXmlGenerator::generateCompactList(const Node* relative, int curParNr = 0; int curParOffset = 0; + QMap cmap; /* Output the alphabet as a row of links. */ if (includeAlphabet) { xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","centerAlign functionIndex"); - xmlWriter().writeStartElement("b"); + xmlWriter().writeAttribute("outputclass","alphabet"); for (int i = 0; i < 26; i++) { QChar ch('a' + i); if (usedParagraphNames.contains(char('a' + i))) { xmlWriter().writeStartElement("xref"); - xmlWriter().writeAttribute("href",QString("#%1").arg(ch)); + QString guid = lookupGuid(outFileName(),QString(ch)); + xmlWriter().writeAttribute("href",QString("#%1").arg(guid)); xmlWriter().writeCharacters(QString(ch.toUpper())); xmlWriter().writeEndElement(); // } } - xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); //

    } @@ -3051,15 +3051,12 @@ void DitaXmlGenerator::generateCompactList(const Node* relative, xmlWriter().writeStartElement("dl"); xmlWriter().writeStartElement("dlentry"); xmlWriter().writeStartElement("dt"); - xmlWriter().writeAttribute("outputclass","alphaChar"); if (includeAlphabet) { QChar c = paragraphName[curParNr][0].toLower(); - xmlWriter().writeStartElement("a"); - xmlWriter().writeAttribute("name",c); + writeGuidAttribute(QString(c)); } - xmlWriter().writeStartElement("b"); + xmlWriter().writeAttribute("outputclass","sublist-header"); xmlWriter().writeCharacters(paragraphName[curParNr]); - xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // } -- cgit v0.12 From 7ee572661f9de00b7b1bf0f24b0145e06077553f Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 27 Oct 2010 10:44:07 +0200 Subject: doc: Fixed some DITA XML validation errors. No links in the text. --- tools/qdoc3/ditaxmlgenerator.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 30d1d74..edb8677 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1090,16 +1090,15 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, .arg(atom->string()) .arg(marker->plainFullName(relative))); } -#if 0 - else if (noLinks) { - //xmlWriter().writeCharacters(atom->string()); - qDebug() << "MYLINK:" << myLink << outFileName() << atom->string(); + else if (!inSectionHeading) { + beginLink(myLink, node, relative, marker); } +#if 0 else { - beginLink(myLink, node, relative, marker); + //xmlWriter().writeCharacters(atom->string()); + //qDebug() << "MYLINK:" << myLink << outFileName() << atom->string(); } -#endif - beginLink(myLink, node, relative, marker); +#endif skipAhead = 1; } break; -- cgit v0.12 From 6a018c73d24594e7a78829e7607133f39eb33fd9 Mon Sep 17 00:00:00 2001 From: Martin Smith <martin.smith@nokia.com> Date: Wed, 27 Oct 2010 10:54:59 +0200 Subject: doc: Fixed some DITA XML validation errors. No <br> elements allowed. --- tools/qdoc3/ditaxmlgenerator.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index edb8677..2cbbfd5 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1021,7 +1021,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeEndElement(); // </p> generateSection(nlist, 0, marker, CodeMarker::Summary); - xmlWriter().writeEmptyElement("br"); ++pmap; } } @@ -1079,7 +1078,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, inLegaleseText = false; break; case Atom::LineBreak: - xmlWriter().writeEmptyElement("br"); + //xmlWriter().writeEmptyElement("br"); break; case Atom::Link: { -- cgit v0.12 From 9b83b7708f02779d0d0405fd05468f03e32de133 Mon Sep 17 00:00:00 2001 From: Martin Smith <martin.smith@nokia.com> Date: Wed, 27 Oct 2010 12:45:17 +0200 Subject: doc: Removed an illegal character. --- doc/src/snippets/code/doc_src_lgpl.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/snippets/code/doc_src_lgpl.qdoc b/doc/src/snippets/code/doc_src_lgpl.qdoc index 8f21642..36b8294 100644 --- a/doc/src/snippets/code/doc_src_lgpl.qdoc +++ b/doc/src/snippets/code/doc_src_lgpl.qdoc @@ -96,7 +96,7 @@ modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - + Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a -- cgit v0.12 From a57e16bcc728cd71ab4b8b2b86fe25a9b36078e5 Mon Sep 17 00:00:00 2001 From: Martin Smith <martin.smith@nokia.com> Date: Wed, 27 Oct 2010 12:46:12 +0200 Subject: qdoc: Fixed some DITA XML validation errors. --- tools/qdoc3/ditaxmlgenerator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 2cbbfd5..a47a956 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2801,6 +2801,8 @@ void DitaXmlGenerator::generateClassHierarchy(const Node* relative, if (stack.top().isEmpty()) { stack.pop(); xmlWriter().writeEndElement(); // </ul> + if (!stack.isEmpty()) + xmlWriter().writeEndElement(); // </li> } else { const ClassNode *child = @@ -2817,6 +2819,7 @@ void DitaXmlGenerator::generateClassHierarchy(const Node* relative, } if (!newTop.isEmpty()) { stack.push(newTop); + xmlWriter().writeStartElement("li"); xmlWriter().writeStartElement("ul"); } } -- cgit v0.12 From ac8d82a85369424830b7b8cf9d568e25bfa791e7 Mon Sep 17 00:00:00 2001 From: Martin Smith <martin.smith@nokia.com> Date: Wed, 27 Oct 2010 12:56:09 +0200 Subject: doc: Removed some illegal characters. --- doc/src/snippets/code/doc_src_lgpl.qdoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/src/snippets/code/doc_src_lgpl.qdoc b/doc/src/snippets/code/doc_src_lgpl.qdoc index 36b8294..e532406 100644 --- a/doc/src/snippets/code/doc_src_lgpl.qdoc +++ b/doc/src/snippets/code/doc_src_lgpl.qdoc @@ -199,7 +199,7 @@ Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -257,7 +257,7 @@ instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -308,7 +308,7 @@ Library will still fall under Section 6.) distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -370,7 +370,7 @@ restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -388,7 +388,7 @@ permitted, and provided that you do these two things: where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any +0the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, @@ -411,7 +411,7 @@ subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -463,7 +463,7 @@ conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -497,7 +497,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest -- cgit v0.12 From 649ff059fbb8a3a288dbb112edb65e8f9f4e29cb Mon Sep 17 00:00:00 2001 From: Martin Smith <martin.smith@nokia.com> Date: Wed, 27 Oct 2010 13:12:17 +0200 Subject: doc: Removed an illegal char and some empty \row commands. --- doc/src/platforms/compiler-notes.qdoc | 3 --- doc/src/snippets/code/doc_src_lgpl.qdoc | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/doc/src/platforms/compiler-notes.qdoc b/doc/src/platforms/compiler-notes.qdoc index 5ff3112..316b635 100644 --- a/doc/src/platforms/compiler-notes.qdoc +++ b/doc/src/platforms/compiler-notes.qdoc @@ -55,14 +55,11 @@ \header \o \o Concurrent \o XmlPatterns \o WebKit(*) \o CLucene \o Phonon \row \o g++ 3.3 \o \o \bold{X} \o \o \bold{X} \o \bold{X} \row \o g++ 3.4 and up \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} - \row \row \o SunCC 5.5 \o \o \o \o \bold{X} \o \bold{X} - \row \row \o aCC series 3 \o \o \o \o \bold{X} \o \bold{X} \row \o aCC series 6 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \row \o xlC 6 \o \o \o \o \bold{X} \o \bold{X} \row \o Intel CC 10 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} - \row \row \o MSVC 2003 \o \bold{X} \o \bold{X} \o \o \bold{X} \o \bold{X} \row \o MSVC 2005 and up \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \endtable diff --git a/doc/src/snippets/code/doc_src_lgpl.qdoc b/doc/src/snippets/code/doc_src_lgpl.qdoc index e532406..fa155fc 100644 --- a/doc/src/snippets/code/doc_src_lgpl.qdoc +++ b/doc/src/snippets/code/doc_src_lgpl.qdoc @@ -152,7 +152,7 @@ modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. - + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -- cgit v0.12 From 14dd3da129e26872296435814694a3251ef5e52f Mon Sep 17 00:00:00 2001 From: Martin Smith <martin.smith@nokia.com> Date: Thu, 28 Oct 2010 12:36:57 +0200 Subject: qdoc: Fixed some DITA XML validation errors. Fixed some \table problems as well. --- doc/src/getting-started/installation.qdoc | 11 ++++++----- tools/qdoc3/ditaxmlgenerator.cpp | 24 ++++++++++++++++++------ 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index c6e79d9..fdb88f5 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -990,9 +990,9 @@ applications using Qt for Symbian can start right away. Qt from its source code, you will also need to install the development packages for these libraries for your system. - \table 90% - \header \o Name \o Library \o Notes \o Configuration options \o Minimum working version \raw HTML + <table class="generic"> + <thead><tr class="qt-style topAlign"><th>Name</th><th>Library</th><th>Notes</th><th>Configuration options</th><th>Minimum working version <tr id="OptionalColor"> <td> XRender </td><td> libXrender </td><td> X Rendering Extension; used for anti-aliasing</td> <td><tt>-xrender</tt> or auto-detected</td><td>0.9.0</td> @@ -1039,9 +1039,9 @@ applications using Qt for Symbian can start right away. </tr><tr id="PthreadColor"> <td> pthread </td><td> libpthread </td><td> Multithreading</td> <td></td><td>2.3.5</td> - </tr> + </tr></th></tr></thead> + </table> \endraw - \endtable \note You must compile with XRender support to get alpha transparency support for pixmaps and images. @@ -1129,8 +1129,9 @@ applications using Qt for Symbian can start right away. {Windows Mobile 6 Professional/Standard} \endlist + \bold{Note:} \table - \row \bold{Note:} + \row \o \list 1 \o Currently, there is only compile support for Windows CE 5.0 diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index a47a956..581335a 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -653,10 +653,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::BaseName: break; case Atom::BriefLeft: - if (relative->type() == Node::Fake) { - skipAhead = skipAtoms(atom, Atom::BriefRight); - break; - } + //if (relative->type() == Node::Fake) { + //skipAhead = skipAtoms(atom, Atom::BriefRight); + //break; + //} if (inApiDesc || inSection) { xmlWriter().writeStartElement("p"); xmlWriter().writeAttribute("outputclass","brief"); @@ -697,8 +697,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } break; case Atom::BriefRight: - if (relative->type() != Node::Fake) - xmlWriter().writeEndElement(); // </shortdesc> or </p> + // if (relative->type() != Node::Fake) + xmlWriter().writeEndElement(); // </shortdesc> or </p> noLinks = false; break; case Atom::C: @@ -2413,6 +2413,18 @@ void DitaXmlGenerator::generateTitle(const QString& title, void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) { Text brief = node->doc().briefText(true); // zzz + if (outFileName() == "requirements-x11.xml") { + if (brief.isEmpty()) + qDebug() << "EMPTY BRIEF"; + else { + qDebug() << "NON-EMPTY BRIEF"; + Atom* a = brief.firstAtom(); + while (a != 0) { + qDebug() << " " << a->type() << a->typeString() << a->string(); + a = a->next(); + } + } + } if (!brief.isEmpty()) { generateText(brief, node, marker); } -- cgit v0.12 From dafb371f89c14f99082289feba66fa21b28ecd37 Mon Sep 17 00:00:00 2001 From: Martin Smith <martin.smith@nokia.com> Date: Thu, 28 Oct 2010 15:15:27 +0200 Subject: qdoc: Fixed some DITA XML validation errors. The obsolete and Qt3 support files no longer exist, so all the references to them had to be cleaned up, and the elements that were formerly in those files had to be included in the class, namespace, or header file with the appropriate outputclass attr. --- tools/qdoc3/ditaxmlgenerator.cpp | 315 +++++++++------------------------------ tools/qdoc3/ditaxmlgenerator.h | 26 +++- 2 files changed, 89 insertions(+), 252 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 581335a..fa0aa43 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1628,27 +1628,9 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } ++s; } -#if 0 - QString membersLink = generateListOfAllMemberFile(inner, marker); - QString obsoleteLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Obsolete); - QString compatLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Compat); - if (!membersLink.isEmpty() || - !obsoleteLink.isEmpty() || - !compatLink.isEmpty()) { - xmlWriter().writeStartElement("ul"); - if (!membersLink.isEmpty()) - writeXrefListItem(membersLink,"List of all members, including inherited members"); - if (!obsoleteLink.isEmpty()) - writeXrefListItem(obsoleteLink,"Obsolete members"); - if (!compatLink.isEmpty()) - writeXrefListItem(compatLink,"Qt 3 support members"); - xmlWriter().writeEndElement(); // </ul> - } -#endif + + generateLowStatusMembers(inner,marker,CodeMarker::Obsolete); + generateLowStatusMembers(inner,marker,CodeMarker::Compat); xmlWriter().writeEndElement(); // </cxxClass> } else if (inner->type() == Node::Class) { @@ -1783,29 +1765,8 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark ++s; } - // not included: <cxxClassInherits> - -#if 0 - QString membersLink = generateListOfAllMemberFile(inner, marker); - QString obsoleteLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Obsolete); - QString compatLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Compat); - if (!membersLink.isEmpty() || - !obsoleteLink.isEmpty() || - !compatLink.isEmpty()) { - xmlWriter().writeStartElement("ul"); - if (!membersLink.isEmpty()) - writeXrefListItem(membersLink,"List of all members, including inherited members"); - if (!obsoleteLink.isEmpty()) - writeXrefListItem(obsoleteLink,"Obsolete members"); - if (!compatLink.isEmpty()) - writeXrefListItem(compatLink,"Qt 3 support members"); - xmlWriter().writeEndElement(); // </ul> - } -#endif + generateLowStatusMembers(inner,marker,CodeMarker::Obsolete); + generateLowStatusMembers(inner,marker,CodeMarker::Compat); xmlWriter().writeEndElement(); // </cxxClass> } else if ((inner->type() == Node::Fake) && (inner->subType() == Node::HeaderFile)) { @@ -1926,27 +1887,8 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } ++s; } -#if 0 - QString membersLink = generateListOfAllMemberFile(inner, marker); - QString obsoleteLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Obsolete); - QString compatLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Compat); - if (!membersLink.isEmpty() || - !obsoleteLink.isEmpty() || - !compatLink.isEmpty()) { - xmlWriter().writeStartElement("ul"); - if (!membersLink.isEmpty()) - writeXrefListItem(membersLink,"List of all members, including inherited members"); - if (!obsoleteLink.isEmpty()) - writeXrefListItem(obsoleteLink,"Obsolete members"); - if (!compatLink.isEmpty()) - writeXrefListItem(compatLink,"Qt 3 support members"); - xmlWriter().writeEndElement(); // </ul> - } -#endif + generateLowStatusMembers(inner,marker,CodeMarker::Obsolete); + generateLowStatusMembers(inner,marker,CodeMarker::Compat); xmlWriter().writeEndElement(); // </cxxClass> } else if ((inner->type() == Node::Fake) && (inner->subType() == Node::QmlClass)) { @@ -2138,90 +2080,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker xmlWriter().writeEndElement(); // </section> } } -#if 0 - else if (fake->subType() == Node::HeaderFile) { - generateStatus(fake, marker); - QString membersLink = generateListOfAllMemberFile(fake, marker); - QString obsoleteLink = generateLowStatusMemberFile(fake, - marker, - CodeMarker::Obsolete); - QString compatLink = generateLowStatusMemberFile(fake, - marker, - CodeMarker::Compat); - - if (!membersLink.isEmpty() || !obsoleteLink.isEmpty() || !compatLink.isEmpty()) { - xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("outputclass","member-lists"); - xmlWriter().writeStartElement("ul"); - if (!membersLink.isEmpty()) { - writeXrefListItem(membersLink,"List of all members, including inherited members"); - } - if (!obsoleteLink.isEmpty()) { - writeXrefListItem(obsoleteLink,"Obsolete members"); - } - if (!compatLink.isEmpty()) { - writeXrefListItem(compatLink,"Qt 3 support members"); - } - xmlWriter().writeEndElement(); // </ul> - xmlWriter().writeEndElement(); // </section> - } - } - else if (fake->subType() == Node::QmlClass) { - const QmlClassNode* qml_cn = static_cast<const QmlClassNode*>(fake); - const ClassNode* cn = qml_cn->classNode(); - xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("outputclass","apiDesc"); - generateQmlInstantiates(qml_cn, marker); - generateQmlInherits(qml_cn, marker); - generateQmlInheritedBy(qml_cn, marker); - xmlWriter().writeEndElement(); // </section> - sections = marker->qmlSections(qml_cn,CodeMarker::Summary,0); - s = sections.begin(); - while (s != sections.end()) { - xmlWriter().writeStartElement("section"); - QString attr = cleanRef((*s).name).toLower(); - xmlWriter().writeAttribute("outputclass",attr); - xmlWriter().writeStartElement("title"); - xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc((*s).name)); - xmlWriter().writeEndElement(); // - generateQmlSummary(*s,fake,marker); - xmlWriter().writeEndElement(); //
    - ++s; - } - - writeDetailedDescription(fake, marker, false, QString("Detailed Description")); - - if (cn) - generateQmlText(cn->doc().body(), cn, marker, fake->name()); - - generateAlsoList(fake, marker); - - sections = marker->qmlSections(qml_cn,CodeMarker::Detailed,0); - s = sections.begin(); - while (s != sections.end()) { - if (!s->members.isEmpty()) { - QString attr; - xmlWriter().writeStartElement("section"); - attr = cleanRef((*s).name).toLower(); - xmlWriter().writeAttribute("outputclass",attr); - xmlWriter().writeStartElement("title"); - xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc((*s).name)); - xmlWriter().writeEndElement(); // - NodeList::ConstIterator m = (*s).members.begin(); - while (m != (*s).members.end()) { - generateDetailedQmlMember(*m, fake, marker); - ++m; - } - xmlWriter().writeEndElement(); //
    - } - ++s; - } - xmlWriter().writeEndElement(); // - return; - } -#endif if (fake->doc().isEmpty()) { if (fake->subType() == Node::File) { @@ -2685,106 +2543,48 @@ QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode* inner, return fileName; } -#if 0 -QString DitaXmlGenerator::generateLowStatusMemberFile(const InnerNode* inner, - CodeMarker* marker, - CodeMarker::Status status) +void DitaXmlGenerator::generateLowStatusMembers(const InnerNode* inner, + CodeMarker* marker, + CodeMarker::Status status) { - QList
    sections = marker->sections(inner,CodeMarker::Summary,status); + QString attribute; + if (status == CodeMarker::Compat) + attribute = "Qt3-support"; + else if (status == CodeMarker::Obsolete) + attribute = "obsolete"; + else + return; + + QList
    sections = marker->sections(inner, CodeMarker::Detailed, status); QMutableListIterator
    j(sections); while (j.hasNext()) { if (j.next().members.size() == 0) j.remove(); } if (sections.isEmpty()) - return QString(); - - int i; - QString title; - QString fileName; - - if (status == CodeMarker::Compat) { - title = "Qt 3 Support Members for " + inner->name(); - fileName = fileBase(inner) + "-qt3." + fileExtension(inner); - } - else { - title = "Obsolete Members for " + inner->name(); - fileName = fileBase(inner) + "-obsolete." + fileExtension(inner); - } - beginSubPage(inner->location(), fileName); - generateHeader(inner, title, true); - xmlWriter().writeStartElement("body"); - xmlWriter().writeStartElement("section"); - if (!title.isEmpty()) { - xmlWriter().writeStartElement("title"); - xmlWriter().writeAttribute("outputclass", "h1"); - xmlWriter().writeCharacters(protectEnc(title)); - xmlWriter().writeEndElement(); // - } - - xmlWriter().writeStartElement("p"); - if (status == CodeMarker::Compat) { - xmlWriter().writeStartElement("b"); - xmlWriter().writeCharacters("The following class members are part of the "); - xmlWriter().writeStartElement("xref"); - xmlWriter().writeAttribute("href","qt3support.html"); - xmlWriter().writeCharacters("Qt 3 support layer"); - xmlWriter().writeEndElement(); // - xmlWriter().writeCharacters(". "); - xmlWriter().writeEndElement(); // - xmlWriter().writeCharacters("They are provided to help you port old code to Qt 4. " - "We advise against using them in new code."); - } - else { - xmlWriter().writeStartElement("b"); - xmlWriter().writeCharacters("The following class members are obsolete. "); - xmlWriter().writeEndElement(); // - xmlWriter().writeCharacters("They are provided to keep old source code working. " - "We strongly advise against using them in new code."); - } - xmlWriter().writeEndElement(); //

    - xmlWriter().writeStartElement("p"); - xmlWriter().writeStartElement("ul"); - QString text = protectEnc(inner->name()) + " class reference"; - writeXrefListItem(linkForNode(inner,0),text); - xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); //

    - xmlWriter().writeEndElement(); //
    - - for (i = 0; i < sections.size(); ++i) { - xmlWriter().writeStartElement("section"); - xmlWriter().writeStartElement("title"); - xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc(sections.at(i).name)); - xmlWriter().writeEndElement(); // - generateSection(sections.at(i).members, inner, marker, CodeMarker::Summary); - generateSectionInheritedList(sections.at(i), inner, marker); - xmlWriter().writeEndElement(); //
    - } - - sections = marker->sections(inner, CodeMarker::Detailed, status); - for (i = 0; i < sections.size(); ++i) { - xmlWriter().writeStartElement("section"); - xmlWriter().writeStartElement("title"); - xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc(sections.at(i).name)); - xmlWriter().writeEndElement(); // + return; - NodeList::ConstIterator m = sections.at(i).members.begin(); - while (m != sections.at(i).members.end()) { - if ((*m)->access() != Node::Private) { - generateDetailedMember(*m, inner, marker); - } - ++m; + QList
    ::ConstIterator s = sections.begin(); + while (s != sections.end()) { + if ((*s).name == "Member Function Documentation") { + writeFunctions((*s),inner,marker,attribute); + } + else if ((*s).name == "Member Type Documentation") { + writeEnumerations((*s),marker,attribute); + writeTypedefs((*s),marker,attribute); + } + else if ((*s).name == "Member Variable Documentation") { + writeDataMembers((*s),marker,attribute); } - xmlWriter().writeEndElement(); //
    + else if ((*s).name == "Property Documentation") { + writeProperties((*s),marker,attribute); + } + else if ((*s).name == "Macro Documentation") { + writeMacros((*s),marker,attribute); + } + ++s; } - xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); // - endSubPage(); - return fileName; } -#endif /*! Write the XML for the class hierarchy to the current XML stream. @@ -3789,6 +3589,7 @@ QString DitaXmlGenerator::fileBase(const Node* node) const { QString result; result = PageGenerator::fileBase(node); +#if 0 if (!node->isInnerNode()) { switch (node->status()) { case Node::Compat: @@ -3801,6 +3602,7 @@ QString DitaXmlGenerator::fileBase(const Node* node) const ; } } +#endif return result; } @@ -3969,6 +3771,7 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode, actualNode = apparentNode; xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href",linkForNode(actualNode, relative)); +#if 0 if (true || relative == 0 || relative->status() != actualNode->status()) { switch (actualNode->status()) { case Node::Obsolete: @@ -3981,6 +3784,7 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode, break; } } +#endif xmlWriter().writeCharacters(protectEnc(fullName(apparentNode, relative, marker))); xmlWriter().writeEndElement(); // } @@ -4482,12 +4286,12 @@ void DitaXmlGenerator::beginLink(const QString& link, case Node::Obsolete: xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href",link); - xmlWriter().writeAttribute("outputclass","obsolete"); + //xmlWriter().writeAttribute("outputclass","obsolete"); break; case Node::Compat: xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href",link); - xmlWriter().writeAttribute("outputclass","compat"); + //xmlWriter().writeAttribute("outputclass","compat"); break; default: xmlWriter().writeStartElement("xref"); @@ -4880,7 +4684,8 @@ void DitaXmlGenerator::writeLocation(const Node* n) */ void DitaXmlGenerator::writeFunctions(const Section& s, const Node* n, - CodeMarker* marker) + CodeMarker* marker, + const QString& attribute) { NodeList::ConstIterator m = s.members.begin(); while (m != s.members.end()) { @@ -4888,6 +4693,8 @@ void DitaXmlGenerator::writeFunctions(const Section& s, FunctionNode* fn = const_cast(static_cast(*m)); xmlWriter().writeStartElement(CXXFUNCTION); xmlWriter().writeAttribute("id",fn->guid()); + if (!attribute.isEmpty()) + xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); if (fn->metaness() == FunctionNode::Signal) xmlWriter().writeAttribute("class","signal"); @@ -5049,7 +4856,8 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn) This function writes the enum types. */ void DitaXmlGenerator::writeEnumerations(const Section& s, - CodeMarker* marker) + CodeMarker* marker, + const QString& attribute) { NodeList::ConstIterator m = s.members.begin(); while (m != s.members.end()) { @@ -5057,6 +4865,8 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, const EnumNode* en = static_cast(*m); xmlWriter().writeStartElement(CXXENUMERATION); xmlWriter().writeAttribute("id",en->guid()); + if (!attribute.isEmpty()) + xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters(en->name()); xmlWriter().writeEndElement(); // @@ -5164,7 +4974,9 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, This function writes the output for the \typedef commands. */ void DitaXmlGenerator::writeTypedefs(const Section& s, - CodeMarker* marker) + CodeMarker* marker, + const QString& attribute) + { NodeList::ConstIterator m = s.members.begin(); while (m != s.members.end()) { @@ -5172,6 +4984,8 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, const TypedefNode* tn = static_cast(*m); xmlWriter().writeStartElement(CXXTYPEDEF); xmlWriter().writeAttribute("id",tn->guid()); + if (!attribute.isEmpty()) + xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters(tn->name()); xmlWriter().writeEndElement(); // @@ -5224,7 +5038,8 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, This is the Q_PROPERTYs. */ void DitaXmlGenerator::writeProperties(const Section& s, - CodeMarker* marker) + CodeMarker* marker, + const QString& attribute) { NodeList::ConstIterator m = s.members.begin(); while (m != s.members.end()) { @@ -5232,6 +5047,8 @@ void DitaXmlGenerator::writeProperties(const Section& s, const PropertyNode* pn = static_cast(*m); xmlWriter().writeStartElement(CXXVARIABLE); xmlWriter().writeAttribute("id",pn->guid()); + if (!attribute.isEmpty()) + xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters(pn->name()); xmlWriter().writeEndElement(); // @@ -5333,7 +5150,8 @@ void DitaXmlGenerator::writeProperties(const Section& s, This function outputs the nodes resulting from \variable commands. */ void DitaXmlGenerator::writeDataMembers(const Section& s, - CodeMarker* marker) + CodeMarker* marker, + const QString& attribute) { NodeList::ConstIterator m = s.members.begin(); while (m != s.members.end()) { @@ -5341,6 +5159,8 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, const VariableNode* vn = static_cast(*m); xmlWriter().writeStartElement(CXXVARIABLE); xmlWriter().writeAttribute("id",vn->guid()); + if (!attribute.isEmpty()) + xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters(vn->name()); xmlWriter().writeEndElement(); // @@ -5414,7 +5234,8 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, This function writes a \macro as a . */ void DitaXmlGenerator::writeMacros(const Section& s, - CodeMarker* marker) + CodeMarker* marker, + const QString& attribute) { NodeList::ConstIterator m = s.members.begin(); while (m != s.members.end()) { @@ -5423,6 +5244,8 @@ void DitaXmlGenerator::writeMacros(const Section& s, if (fn->isMacro()) { xmlWriter().writeStartElement(CXXDEFINE); xmlWriter().writeAttribute("id",fn->guid()); + if (!attribute.isEmpty()) + xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); xmlWriter().writeCharacters(fn->name()); xmlWriter().writeEndElement(); // diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index afa77bb..aa8ca77 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -116,14 +116,25 @@ class DitaXmlGenerator : public PageGenerator void writeLocation(const Node* n); void writeFunctions(const Section& s, const Node* n, - CodeMarker* marker); + CodeMarker* marker, + const QString& attribute = QString()); void writeNestedClasses(const Section& s, const Node* n); void writeParameters(const FunctionNode* fn); - void writeEnumerations(const Section& s, CodeMarker* marker); - void writeTypedefs(const Section& s, CodeMarker* marker); - void writeDataMembers(const Section& s, CodeMarker* marker); - void writeProperties(const Section& s, CodeMarker* marker); - void writeMacros(const Section& s, CodeMarker* marker); + void writeEnumerations(const Section& s, + CodeMarker* marker, + const QString& attribute = QString()); + void writeTypedefs(const Section& s, + CodeMarker* marker, + const QString& attribute = QString()); + void writeDataMembers(const Section& s, + CodeMarker* marker, + const QString& attribute = QString()); + void writeProperties(const Section& s, + CodeMarker* marker, + const QString& attribute = QString()); + void writeMacros(const Section& s, + CodeMarker* marker, + const QString& attribute = QString()); void writePropertyParameter(const QString& tag, const NodeList& nlist); private: @@ -153,6 +164,9 @@ class DitaXmlGenerator : public PageGenerator CodeMarker* marker, QList
    * sections = 0); QString generateListOfAllMemberFile(const InnerNode* inner, CodeMarker* marker); + void generateLowStatusMembers(const InnerNode* inner, + CodeMarker* marker, + CodeMarker::Status status); QString generateLowStatusMemberFile(const InnerNode* inner, CodeMarker* marker, CodeMarker::Status status); -- cgit v0.12 From 2f1726c4e10a6fbafb4953d68946d5501f5e0c8c Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 29 Oct 2010 11:40:39 +1000 Subject: Fix zooming in declarative webbrowser demo Task-number: Reviewed-by: Martin Jones --- demos/declarative/webbrowser/content/FlickableWebView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml index 6f4e09c..a82a151 100644 --- a/demos/declarative/webbrowser/content/FlickableWebView.qml +++ b/demos/declarative/webbrowser/content/FlickableWebView.qml @@ -128,7 +128,7 @@ Flickable { if (!heuristicZoom(clickX,clickY,2.5)) { var zf = flickable.width / contentsSize.width if (zf >= contentsScale) - zf = 2.0/zoomFactor // zoom in (else zooming out) + zf = 2.0*contentsScale // zoom in (else zooming out) doZoom(zf,clickX*zf,clickY*zf) } } -- cgit v0.12 From deea8d2b324ca98d48c931c6d3a14ec197388f50 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 29 Oct 2010 13:05:16 +1000 Subject: Suppress current item null warnings when running Browser.qml Task-number: Reviewed-by: Martin Jones --- tools/qml/browser/Browser.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qml/browser/Browser.qml b/tools/qml/browser/Browser.qml index ebed72f..b9573da 100644 --- a/tools/qml/browser/Browser.qml +++ b/tools/qml/browser/Browser.qml @@ -180,7 +180,7 @@ Rectangle { GradientStop { id: t1; position: 0.0; color: palette.highlight } GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) } } - width: view1.currentItem.width + width: view1.currentItem == null ? 0 : view1.currentItem.width } highlightMoveSpeed: 1000 pressDelay: 100 @@ -230,7 +230,7 @@ Rectangle { GradientStop { id: t1; position: 0.0; color: palette.highlight } GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) } } - width: view1.currentItem.width + width: view1.currentItem == null ? 0 : view1.currentItem.width } highlightMoveSpeed: 1000 pressDelay: 100 -- cgit v0.12 From 08ab82e447a0cac0a48daf900c57127c2ee534d2 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 29 Oct 2010 12:34:53 +0200 Subject: qdoc: Don't put classes that have empty doc in hierarchy. --- tools/qdoc3/ditaxmlgenerator.cpp | 17 +++-------------- tools/qdoc3/htmlgenerator.cpp | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index fa0aa43..a885f29 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2271,18 +2271,6 @@ void DitaXmlGenerator::generateTitle(const QString& title, void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) { Text brief = node->doc().briefText(true); // zzz - if (outFileName() == "requirements-x11.xml") { - if (brief.isEmpty()) - qDebug() << "EMPTY BRIEF"; - else { - qDebug() << "NON-EMPTY BRIEF"; - Atom* a = brief.firstAtom(); - while (a != 0) { - qDebug() << " " << a->type() << a->typeString() << a->string(); - a = a->next(); - } - } - } if (!brief.isEmpty()) { generateText(brief, node, marker); } @@ -2626,7 +2614,7 @@ void DitaXmlGenerator::generateClassHierarchy(const Node* relative, NodeMap newTop; foreach (const RelatedClass &d, child->derivedClasses()) { - if (d.access != Node::Private) + if (d.access != Node::Private && !d.node->doc().isEmpty()) newTop.insert(d.node->name(), d.node); } if (!newTop.isEmpty()) { @@ -4587,7 +4575,8 @@ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker) // not included: xmlWriter().writeStartElement(CXXCLASSBASECLASS); - xmlWriter().writeAttribute("href",(*r).node->ditaXmlHref()); + QString attr = fileName((*r).node) + "#" + (*r).node->guid(); + xmlWriter().writeAttribute("href",attr); xmlWriter().writeCharacters(marker->plainFullName((*r).node)); xmlWriter().writeEndElement(); // diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 19b86e0..9ce8522 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2424,7 +2424,7 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, NodeMap newTop; foreach (const RelatedClass &d, child->derivedClasses()) { - if (d.access != Node::Private) + if (d.access != Node::Private && !d.node->doc().isEmpty()) newTop.insert(d.node->name(), d.node); } if (!newTop.isEmpty()) { -- cgit v0.12 From 5fdbfcaa0ebda0b2062d962734546309c6d2247c Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 1 Nov 2010 08:25:03 +0100 Subject: doc: Corrections to linking errors detected by the DITA XML generator.. --- doc/src/examples/svgalib.qdoc | 5 ++--- doc/src/platforms/emb-accel.qdoc | 4 ++-- doc/src/porting/porting4-modifiedvirtual.qdocinc | 2 +- src/qt3support/network/q3dns.cpp | 27 ++++++++++++++++-------- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/doc/src/examples/svgalib.qdoc b/doc/src/examples/svgalib.qdoc index 3e3e4d5..f733058 100644 --- a/doc/src/examples/svgalib.qdoc +++ b/doc/src/examples/svgalib.qdoc @@ -322,9 +322,8 @@ \snippet examples/qws/svgalib/svgalibsurface.h 0 We can implement most of the pure virtual functions inherited from - QWSWindowSurface as trivial inline functions, except the - \l {QWindowSurface::}{scroll()} function that actually makes use - of some hardware acceleration: + QWSWindowSurface as trivial inline functions, except the scroll() + function that actually makes use of some hardware acceleration: \snippet examples/qws/svgalib/svgalibsurface.cpp 0 diff --git a/doc/src/platforms/emb-accel.qdoc b/doc/src/platforms/emb-accel.qdoc index c8854f7..77447de 100644 --- a/doc/src/platforms/emb-accel.qdoc +++ b/doc/src/platforms/emb-accel.qdoc @@ -117,8 +117,8 @@ \section1 Step 4: Make the Window Surface Aware of Your Paint Device - Derive from the QWSWindowSurface class and reimplement its \l - {QWSWindowSurface::}{paintDevice()} function. Make this function + Derive from the QWSWindowSurface class and reimplement its + paintDevice() function. Make this function return a pointer to your custom raster paint device. \section1 Step 5: Enable Creation of an Instance of Your Window Surface diff --git a/doc/src/porting/porting4-modifiedvirtual.qdocinc b/doc/src/porting/porting4-modifiedvirtual.qdocinc index 1164238..332543f 100644 --- a/doc/src/porting/porting4-modifiedvirtual.qdocinc +++ b/doc/src/porting/porting4-modifiedvirtual.qdocinc @@ -10,7 +10,7 @@ \row \o bool QMacMime::canConvert(const char *, int) \o bool QMacMime::canConvert(const QString &, int) \row \o QValueList QMacMime::convertFromMime(QByteArray, const char *, int) \o QList QMacMime::convertFromMime(QByteArray, const QString &, int) \row \o QByteArray QMacMime::convertToMime(QValueList data, const char *, int) \o QByteArray QMacMime::convertToMime(QList data, const QString &, int) -\row \o const char * QMacMime::convertorName() \o QString QMacMime::convertorName() +\row \o const char * QMacMime::convertorName( ) \o QString QMacMime::convertorName( ) \row \o int QMacMime::flavorFor(const char *) \o int QMacMime::flavorFor(const QString &) \row \o const char * QMacMime::mimeFor(int) \o QString QMacMime::mimeFor(int) \row \o QMetaObject * QObject::metaObject() const \o const QMetaObject * QObject::metaObject() const diff --git a/src/qt3support/network/q3dns.cpp b/src/qt3support/network/q3dns.cpp index e0e9909..cc39566 100644 --- a/src/qt3support/network/q3dns.cpp +++ b/src/qt3support/network/q3dns.cpp @@ -2009,15 +2009,20 @@ Q3ValueList Q3Dns::addresses() const \class Q3Dns::MailServer \brief The Q3Dns::MailServer class is described in Q3Dns::mailServers(). - \internal +*/ + + +/*! \fn Q3Dns::MailServer::MailServer(const QString& n, Q_UINT16 p) + The constructor sets the public data members name and priority. + \a n is the name and \a p is the priority. */ /*! Returns a list of mail servers if the record type is \c Mx. The class Q3Dns::MailServer contains the following public variables: \list - \i QString Q3Dns::MailServer::name - \i Q_UINT16 Q3Dns::MailServer::priority + \o QString Q3Dns::MailServer::name + \o Q_UINT16 Q3Dns::MailServer::priority \endlist Note that if you want to iterate over the list, you should iterate @@ -2048,22 +2053,26 @@ Q3ValueList Q3Dns::mailServers() const return result; } - /*! \class Q3Dns::Server \brief The Q3Dns::Server class is described in Q3Dns::servers(). - \internal +*/ + +/*! \fn Q3Dns::Server::Server(const QString& n, Q_UINT16 p, Q_UINT16 w, Q_UINT16 po) + The constructor sets the public data members name, priority, + weight, and port. \a n is the name, \a p is the priority, + \a w is the weight, and \a po is the port. */ /*! Returns a list of servers if the record type is \c Srv. The class Q3Dns::Server contains the following public variables: \list - \i QString Q3Dns::Server::name - \i Q_UINT16 Q3Dns::Server::priority - \i Q_UINT16 Q3Dns::Server::weight - \i Q_UINT16 Q3Dns::Server::port + \o QString Q3Dns::Server::name + \o Q_UINT16 Q3Dns::Server::priority + \o Q_UINT16 Q3Dns::Server::weight + \o Q_UINT16 Q3Dns::Server::port \endlist Note that if you want to iterate over the list, you should iterate -- cgit v0.12 From 56ae8da559b3d225698eb79b78eec44a8b62239d Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Mon, 1 Nov 2010 18:00:40 +1000 Subject: Increase cachebuffer in Flickr demo to quarantee expanded delegate is not deleted the during device orientation change Task-number: QT-3824 Reviewed-by: Martin Jones --- demos/declarative/flickr/flickr.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index 740ee35..9387948 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -62,7 +62,7 @@ Item { GridView { id: photoGridView; model: rssModel; delegate: Mobile.GridDelegate {} - cacheBuffer: 100 + cacheBuffer: 1000 cellWidth: (parent.width-2)/4; cellHeight: cellWidth; width: parent.width; height: parent.height } -- cgit v0.12 From d5d44eb800f1c0be15d49521cf991a1c9466cb78 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 1 Nov 2010 12:04:32 +0100 Subject: doc: Corrections to linking errors in the docs. --- src/gui/dialogs/qpagesetupdialog.cpp | 8 ++++---- src/qt3support/tools/q3memarray.qdoc | 4 ++-- src/qt3support/tools/q3ptrlist.qdoc | 3 ++- tools/qdoc3/ditaxmlgenerator.cpp | 15 +++++++++------ tools/qdoc3/htmlgenerator.cpp | 1 + tools/qdoc3/node.cpp | 15 +++++++++++++++ tools/qdoc3/node.h | 2 ++ 7 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/gui/dialogs/qpagesetupdialog.cpp b/src/gui/dialogs/qpagesetupdialog.cpp index 5d77de1..141a687 100644 --- a/src/gui/dialogs/qpagesetupdialog.cpp +++ b/src/gui/dialogs/qpagesetupdialog.cpp @@ -104,10 +104,10 @@ class QPageSetupDialogPrivate : public QAbstractPageSetupDialogPrivate This value is obsolete and does nothing since Qt 4.5: - \value DontUseSheet In previous versions of Qt, exec() the page setup dialog - would create a sheet by default if the dialog was given a parent. - This is no longer supported in Qt 4.5. If you want to use sheets, use - QPageSetupDialog::open() instead. + \value DontUseSheet In previous versions of QDialog::exec() the + page setup dialog would create a sheet by default if the dialog + was given a parent. This is no longer supported from Qt 4.5. If + you want to use sheets, use QPageSetupDialog::open() instead. \omitvalue None \omitvalue OwnsPrinter diff --git a/src/qt3support/tools/q3memarray.qdoc b/src/qt3support/tools/q3memarray.qdoc index 13b1c2f..fdf0411 100644 --- a/src/qt3support/tools/q3memarray.qdoc +++ b/src/qt3support/tools/q3memarray.qdoc @@ -221,8 +221,8 @@ New elements are not initialized. - \a optim is either Q3GArray::MemOptim (the default) or - Q3GArray::SpeedOptim. When optimizing for speed rather than memory + \a optim is either \c MemOptim (the default) or + \c SpeedOptim. When optimizing for speed rather than memory consumption, the array uses a smart grow and shrink algorithm that might allocate more memory than is actually needed for \a size elements. This speeds up subsequent resize operations, for example diff --git a/src/qt3support/tools/q3ptrlist.qdoc b/src/qt3support/tools/q3ptrlist.qdoc index 294e4ba..cbba1b7 100644 --- a/src/qt3support/tools/q3ptrlist.qdoc +++ b/src/qt3support/tools/q3ptrlist.qdoc @@ -93,7 +93,8 @@ also holds pointers to the next and previous list items. The functions currentNode(), removeNode(), and takeNode() operate directly on the Q3LNode, but they should be used with care. The - data component of the node is available through Q3LNode::getData(). + data component of the node is available through Q3LNode's getData() + function. The Q3StrList class is a list of \c char*. It reimplements newItem(), deleteItem() and compareItems(). (But diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index a885f29..4bc08a3 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2907,7 +2907,7 @@ void DitaXmlGenerator::generateFunctionIndex(const Node* relative, CodeMarker* marker) { xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","centerAlign functionIndex"); + xmlWriter().writeAttribute("outputclass","function-index"); xmlWriter().writeStartElement("b"); for (int i = 0; i < 26; i++) { QChar ch('a' + i); @@ -3980,6 +3980,7 @@ void DitaXmlGenerator::findAllFunctions(const InnerNode* node) else if ((*c)->type() == Node::Function) { const FunctionNode* func = static_cast(*c); if ((func->status() > Node::Obsolete) && + !func->isInternal() && (func->metaness() != FunctionNode::Ctor) && (func->metaness() != FunctionNode::Dtor)) { funcIndex[(*c)->name()].insert(myTree->fullDocumentName((*c)->parent()), *c); @@ -4776,12 +4777,14 @@ void DitaXmlGenerator::writeFunctions(const Section& s, xmlWriter().writeCharacters(fnl); xmlWriter().writeEndElement(); // - if (fn->isReimp() && fn->reimplementedFrom() != 0) { + if (!fn->isInternal() && fn->isReimp() && fn->reimplementedFrom() != 0) { FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom(); - xmlWriter().writeStartElement(CXXFUNCTIONREIMPLEMENTED); - xmlWriter().writeAttribute("href",rfn->ditaXmlHref()); - xmlWriter().writeCharacters(marker->plainFullName(rfn)); - xmlWriter().writeEndElement(); // + if (rfn && !rfn->isInternal()) { + xmlWriter().writeStartElement(CXXFUNCTIONREIMPLEMENTED); + xmlWriter().writeAttribute("href",rfn->ditaXmlHref()); + xmlWriter().writeCharacters(marker->plainFullName(rfn)); + xmlWriter().writeEndElement(); // + } } writeParameters(fn); writeLocation(fn); diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 9ce8522..c247be8 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -3807,6 +3807,7 @@ void HtmlGenerator::findAllFunctions(const InnerNode *node) else if ((*c)->type() == Node::Function) { const FunctionNode *func = static_cast(*c); if ((func->status() > Node::Obsolete) && + !func->isInternal() && (func->metaness() != FunctionNode::Ctor) && (func->metaness() != FunctionNode::Dtor)) { funcIndex[(*c)->name()].insert(myTree->fullDocumentName((*c)->parent()), *c); diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index f4736f3..d787bc9 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -1364,6 +1364,21 @@ QString FunctionNode::signature(bool values) const } /*! + Returns true if the node's status is Internal, or if its + parent is a class with internal status. + */ +bool FunctionNode::isInternal() const +{ + if (status() == Internal) + return true; + if (parent() && parent()->status() == Internal) + return true; + if (relates() && relates()->status() == Internal) + return true; + return false; +} + +/*! Print some debugging stuff. */ void FunctionNode::debug() const diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 0b493ee..69f3ba5 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -164,6 +164,7 @@ class Node virtual bool isReimp() const { return false; } virtual bool isFunction() const { return false; } virtual bool isQmlNode() const { return false; } + virtual bool isInternal() const { return false; } Type type() const { return typ; } virtual SubType subType() const { return NoSubType; } InnerNode* parent() const { return par; } @@ -636,6 +637,7 @@ class FunctionNode : public LeafNode virtual bool isQmlNode() const { return ((type() == QmlSignal) || (type() == QmlMethod)); } + virtual bool isInternal() const; void debug() const; -- cgit v0.12 From aa43c2150e48af27bbb623aae57c2d48bccbdde0 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Tue, 2 Nov 2010 11:37:38 +1000 Subject: Fix QML calculator demo being wrongly rotated for landscape devices Task-number: QTBUG-14909 Reviewed-by: Martin Jones --- demos/declarative/calculator/calculator.qml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 3e1c650..b3e4f2f 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -46,7 +46,7 @@ import "Core/calculator.js" as CalcEngine Rectangle { id: window - width: 480; height: 360 + width: 360; height: 480 color: "#282828" property string rotateLeft: "\u2939" @@ -63,7 +63,15 @@ Rectangle { id: main state: "orientation " + runtime.orientation - width: parent.width; height: parent.height; anchors.centerIn: parent + property bool landscapeWindow: window.width > window.height + property real baseWidth: landscapeWindow ? window.height : window.width + property real baseHeight: landscapeWindow ? window.width : window.height + property real rotationDelta: landscapeWindow ? -90 : 0 + + rotation: rotationDelta + width: main.baseWidth + height: main.baseHeight + anchors.centerIn: parent Column { id: box; spacing: 8 @@ -132,24 +140,20 @@ Rectangle { states: [ State { name: "orientation " + Orientation.Landscape - PropertyChanges { target: main; rotation: 90; width: window.height; height: window.width } - PropertyChanges { target: rotateButton; operation: rotateLeft } + PropertyChanges { target: main; rotation: 90 + rotationDelta; width: main.baseHeight; height: main.baseWidth } }, State { name: "orientation " + Orientation.PortraitInverted - PropertyChanges { target: main; rotation: 180; } - PropertyChanges { target: rotateButton; operation: rotateRight } + PropertyChanges { target: main; rotation: 180 + rotationDelta; } }, State { name: "orientation " + Orientation.LandscapeInverted - PropertyChanges { target: main; rotation: 270; width: window.height; height: window.width } - PropertyChanges { target: rotateButton; operation: rotateLeft } + PropertyChanges { target: main; rotation: 270 + rotationDelta; width: main.baseHeight; height: main.baseWidth } } ] transitions: Transition { SequentialAnimation { - PropertyAction { target: rotateButton; property: "operation" } RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint } NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint } } -- cgit v0.12 From 54ca4ebba8aa5c26516424a952f8e6d4ab919f6e Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Tue, 2 Nov 2010 19:44:06 +1000 Subject: Make it possible to add your own graphics scene to QDeclarativeView Task-number: QTBUG-14771 Reviewed-by: Martin Jones --- src/declarative/util/qdeclarativeview.cpp | 24 ++++++++++++---------- .../qdeclarativeview/tst_qdeclarativeview.cpp | 21 +++++++++++++++++++ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index 2381172..6864a8b 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -76,7 +76,7 @@ DEFINE_BOOL_CONFIG_OPTION(frameRateDebug, QML_SHOW_FRAMERATE) class QDeclarativeScene : public QGraphicsScene { public: - QDeclarativeScene(); + QDeclarativeScene(QObject *parent = 0); protected: virtual void keyPressEvent(QKeyEvent *); @@ -87,7 +87,7 @@ protected: virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *); }; -QDeclarativeScene::QDeclarativeScene() +QDeclarativeScene::QDeclarativeScene(QObject *parent) : QGraphicsScene(parent) { } @@ -131,7 +131,8 @@ class QDeclarativeViewPrivate : public QGraphicsViewPrivate, public QDeclarative Q_DECLARE_PUBLIC(QDeclarativeView) public: QDeclarativeViewPrivate() - : root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0), resizeMode(QDeclarativeView::SizeViewToRootObject), initialSize(0,0) {} + : root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0), + resizeMode(QDeclarativeView::SizeViewToRootObject), initialSize(0,0) {} ~QDeclarativeViewPrivate() { delete root; delete engine; } void execute(); void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry); @@ -154,8 +155,6 @@ public: QElapsedTimer frameTimer; void init(); - - QDeclarativeScene scene; }; void QDeclarativeViewPrivate::execute() @@ -233,6 +232,9 @@ void QDeclarativeViewPrivate::itemGeometryChanged(QDeclarativeItem *resizeItem, you can connect to the statusChanged() signal and monitor for QDeclarativeView::Error. The errors are available via QDeclarativeView::errors(). + If you're using your own QGraphicsScene-based scene with QDeclarativeView, remember to + enable scene's sticky focus mode and to set itemIndexMethod to QGraphicsScene::NoIndex. + \sa {Integrating QML with existing Qt UI code}, {Using QML in C++ Applications} */ @@ -276,7 +278,7 @@ void QDeclarativeViewPrivate::init() { Q_Q(QDeclarativeView); engine = new QDeclarativeEngine(); - q->setScene(&scene); + q->setScene(new QDeclarativeScene(q)); q->setOptimizationFlags(QGraphicsView::DontSavePainterState); q->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -285,11 +287,11 @@ void QDeclarativeViewPrivate::init() // These seem to give the best performance q->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); - scene.setItemIndexMethod(QGraphicsScene::NoIndex); + q->scene()->setItemIndexMethod(QGraphicsScene::NoIndex); q->viewport()->setFocusPolicy(Qt::NoFocus); q->setFocusPolicy(Qt::StrongFocus); - scene.setStickyFocus(true); //### needed for correct focus handling + q->scene()->setStickyFocus(true); //### needed for correct focus handling } /*! @@ -555,14 +557,14 @@ void QDeclarativeView::continueExecute() void QDeclarativeView::setRootObject(QObject *obj) { Q_D(QDeclarativeView); - if (d->root == obj) + if (d->root == obj || !scene()) return; if (QDeclarativeItem *declarativeItem = qobject_cast(obj)) { - d->scene.addItem(declarativeItem); + scene()->addItem(declarativeItem); d->root = declarativeItem; d->declarativeItemRoot = declarativeItem; } else if (QGraphicsObject *graphicsObject = qobject_cast(obj)) { - d->scene.addItem(graphicsObject); + scene()->addItem(graphicsObject); d->root = graphicsObject; if (graphicsObject->isWidget()) { d->graphicsWidgetRoot = static_cast(graphicsObject); diff --git a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp index 9ac79e4..efa5a9b 100644 --- a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp +++ b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp @@ -60,6 +60,7 @@ public: tst_QDeclarativeView(); private slots: + void scene(); void resizemodedeclarativeitem(); void resizemodegraphicswidget(); void errors(); @@ -74,6 +75,26 @@ tst_QDeclarativeView::tst_QDeclarativeView() { } +void tst_QDeclarativeView::scene() +{ + // QTBUG-14771 + QGraphicsScene scene; + scene.setItemIndexMethod(QGraphicsScene::NoIndex); + scene.setStickyFocus(true); + + QDeclarativeView *view = new QDeclarativeView(); + QVERIFY(view); + QVERIFY(view->scene()); + view->setScene(&scene); + QCOMPARE(view->scene(), &scene); + + view->setSource(QUrl::fromLocalFile(SRCDIR "/data/resizemodedeclarativeitem.qml")); + QDeclarativeItem* declarativeItem = qobject_cast(view->rootObject()); + QVERIFY(declarativeItem); + QVERIFY(scene.items().count() > 0); + QCOMPARE(scene.items().at(0), declarativeItem); +} + void tst_QDeclarativeView::resizemodedeclarativeitem() { QWidget window; -- cgit v0.12 From b2793a9b7f14508be5cf14bb19127e886b8f1492 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 4 Nov 2010 13:26:25 +0100 Subject: qdoc: Added the element to the This contains the next, previous, and start links for pages that have them. Task-number: QTBUG-14980 --- tools/qdoc3/ditaxmlgenerator.cpp | 59 ++++++++++++++++++++++++++++++++++++++-- tools/qdoc3/ditaxmlgenerator.h | 2 ++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 4bc08a3..b69e731 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2036,7 +2036,7 @@ void DitaXmlGenerator::writeXrefListItem(const QString& link, const QString& tex Generate the html page for a qdoc file that doesn't map to an underlying c++ file. */ -void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) +void DitaXmlGenerator::generateFakeNode(const FakeNode* fake, CodeMarker* marker) { SubTitleSize subTitleSize = LargeSubTitle; QList
    sections; @@ -2054,7 +2054,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker } generateHeader(fake, fullTitle); - generateBrief(fake, marker); // xmlWriter().writeStartElement("body"); if (fake->subType() == Node::Module) { @@ -2115,10 +2114,65 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker } } xmlWriter().writeEndElement(); // + writeRelatedLinks(fake, marker); xmlWriter().writeEndElement(); // } /*! + This function writes a \e{} element inside a + \e{} element. + + \sa writeRelatedLinks() + */ +void DitaXmlGenerator::writeLink(const Node* node, + const QString& text, + const QString& role) +{ + if (node) { + QString link = fileName(node) + "#" + node->guid(); + xmlWriter().writeStartElement("link"); + xmlWriter().writeAttribute("href", link); + xmlWriter().writeAttribute("role", role); + xmlWriter().writeStartElement("linktext"); + xmlWriter().writeCharacters(text); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + } +} + +/*! + This function writes a \e{} element, which + contains the \c{next}, \c{previous}, and \c{start} + links for topic pages that have them. Note that the + value of the \e role attribute is \c{parent} for the + \c{start} link. + */ +void DitaXmlGenerator::writeRelatedLinks(const FakeNode* node, CodeMarker* marker) +{ + const Node* linkNode = 0; + QPair linkPair; + if (node && !node->links().empty()) { + xmlWriter().writeStartElement("related-links"); + if (node->links().contains(Node::PreviousLink)) { + linkPair = node->links()[Node::PreviousLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + writeLink(linkNode, linkPair.second, "previous"); + } + if (node->links().contains(Node::NextLink)) { + linkPair = node->links()[Node::NextLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + writeLink(linkNode, linkPair.second, "next"); + } + if (node->links().contains(Node::StartLink)) { + linkPair = node->links()[Node::StartLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + writeLink(linkNode, linkPair.second, "parent"); + } + xmlWriter().writeEndElement(); // + } +} + +/*! Returns "xml" for this subclass of class Generator. */ QString DitaXmlGenerator::fileExtension(const Node * /* node */) const @@ -2231,6 +2285,7 @@ void DitaXmlGenerator::generateHeader(const Node* node, xmlWriter().writeStartElement(nameElement); // or <apiName> xmlWriter().writeCharacters(name); xmlWriter().writeEndElement(); // or + } /*! diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index aa8ca77..de949c2 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -136,6 +136,8 @@ class DitaXmlGenerator : public PageGenerator CodeMarker* marker, const QString& attribute = QString()); void writePropertyParameter(const QString& tag, const NodeList& nlist); + void writeRelatedLinks(const FakeNode* fake, CodeMarker* marker); + void writeLink(const Node* node, const QString& tex, const QString& role); private: enum SubTitleSize { SmallSubTitle, LargeSubTitle }; -- cgit v0.12 From e2cffa74190833621d82697325d5cbbbb2aaec85 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 5 Nov 2010 12:12:31 +0100 Subject: qdoc: First pass at generating a map. Some files are missing, and I don't know if the syntax is complete. But it's a start. Task-number: QTBUG-14981 --- tools/qdoc3/ditaxmlgenerator.cpp | 29 ++++++++++++++++++++++++++++- tools/qdoc3/ditaxmlgenerator.h | 1 + tools/qdoc3/pagegenerator.cpp | 7 +++---- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index b69e731..bf7bd07 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -574,6 +574,7 @@ void DitaXmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) findAllSince(tree->root()); PageGenerator::generateTree(tree, marker); + writeDitaMap(); } void DitaXmlGenerator::startText(const Node* /* relative */, @@ -2285,7 +2286,6 @@ void DitaXmlGenerator::generateHeader(const Node* node, xmlWriter().writeStartElement(nameElement); // or <apiName> xmlWriter().writeCharacters(name); xmlWriter().writeEndElement(); // or - } /*! @@ -5573,4 +5573,31 @@ bool DitaXmlGenerator::canHandleFormat(const QString& format) return (format == "HTML") || (format == this->format()); } +void DitaXmlGenerator::writeDitaMap() +{ + beginSubPage(Location(),"qt-dita-map.xml"); + + QString doctype; + doctype = ""; + + xmlWriter().writeDTD(doctype); + xmlWriter().writeStartElement("cxxAPIMap"); + xmlWriter().writeAttribute("id","Qt-DITA-Map"); + xmlWriter().writeAttribute("title","Qt DITA Map"); + xmlWriter().writeStartElement("topicmeta"); + xmlWriter().writeStartElement("shortdesc"); + xmlWriter().writeCharacters("The top level map for the Qt documentation"); + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // + GuidMaps::iterator i = guidMaps.begin(); + while (i != guidMaps.end()) { + xmlWriter().writeStartElement("topicref"); + xmlWriter().writeAttribute("href",i.key()); + xmlWriter().writeAttribute("type","topic"); + xmlWriter().writeEndElement(); // + ++i; + } + endSubPage(); +} + QT_END_NAMESPACE diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index de949c2..6324204 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -270,6 +270,7 @@ class DitaXmlGenerator : public PageGenerator bool apiDesc, const QString& title); void addLink(const QString& href, const QStringRef& text); + void writeDitaMap(); private: QMap refMap; diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index 6ba562c..ca98faa 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -289,11 +289,10 @@ QString PageGenerator::outFileName() void PageGenerator::beginSubPage(const Location& location, const QString& fileName) { - QFile *outFile = new QFile(outputDir() + "/" + fileName); + QFile* outFile = new QFile(outputDir() + "/" + fileName); if (!outFile->open(QFile::WriteOnly)) - location.fatal(tr("Cannot open output file '%1'") - .arg(outFile->fileName())); - QTextStream *out = new QTextStream(outFile); + location.fatal(tr("Cannot open output file '%1'").arg(outFile->fileName())); + QTextStream* out = new QTextStream(outFile); out->setCodec(outputCodec); outStreamStack.push(out); } -- cgit v0.12 From 8481135dfc7f19424ab9d94d5da986861e6f9c4f Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Sun, 7 Nov 2010 11:37:03 +0100 Subject: qdoc: Second pass at generating a map. All the files are there now. It outputs each element as a . We might want to output the entries for C++ classes, namespaces, and QML classes differently. But the validator is able to use this map to validate everything, and there are no errors. So until we get further instructions, this is it. Task-number: QTBUG-14981 --- tools/qdoc3/ditaxmlgenerator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index bf7bd07..d275af2 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -5404,6 +5404,7 @@ void DitaXmlGenerator::beginSubPage(const Location& location, const QString& fileName) { PageGenerator::beginSubPage(location,fileName); + (void) lookupGuidMap(fileName); QXmlStreamWriter* writer = new QXmlStreamWriter(out().device()); xmlWriterStack.push(writer); writer->setAutoFormatting(true); -- cgit v0.12 From 2e71fd324eaab8ba08fd748a3dd1c8025a38da2a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 9 Nov 2010 10:24:24 +0100 Subject: qdoc: Removed unused code. --- tools/qdoc3/ditaxmlgenerator.cpp | 113 --------------------------------------- tools/qdoc3/ditaxmlgenerator.h | 6 --- 2 files changed, 119 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index d275af2..e2b3ca1 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1977,49 +1977,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } -#if 0 - while (s != detailSections.end()) { - if ((*s).name == "Member Function Documentation") { - writeFunctions((*s),qcn,marker); - } - else if ((*s).name == "Member Type Documentation") { - writeEnumerations((*s),marker); - writeTypedefs((*s),marker); - } - else if ((*s).name == "Member Variable Documentation") { - writeDataMembers((*s),marker); - } - else if ((*s).name == "Property Documentation") { - writeProperties((*s),marker); - } - else if ((*s).name == "Macro Documentation") { - writeMacros((*s),marker); - } - ++s; - } -#endif -#if 0 - QString membersLink = generateListOfAllMemberFile(inner, marker); - QString obsoleteLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Obsolete); - QString compatLink = generateLowStatusMemberFile(inner, - marker, - CodeMarker::Compat); - if (!membersLink.isEmpty() || - !obsoleteLink.isEmpty() || - !compatLink.isEmpty()) { - xmlWriter().writeStartElement("ul"); - if (!membersLink.isEmpty()) - writeXrefListItem(membersLink,"List of all members, including inherited members"); - if (!obsoleteLink.isEmpty()) - writeXrefListItem(obsoleteLink,"Obsolete members"); - if (!compatLink.isEmpty()) - writeXrefListItem(compatLink,"Qt 3 support members"); - xmlWriter().writeEndElement(); // - } -#endif - /*! Write a list item for a \a link with the given \a text. */ @@ -2289,38 +2246,6 @@ void DitaXmlGenerator::generateHeader(const Node* node, } /*! - Writes a \a title as a

    element with an \c {outputclass} - attribute of "h1 title". - - Also generates and writes a \a subTitle as a

    element, - if one is provided, but this probably doesn't work right. - */ -void DitaXmlGenerator::generateTitle(const QString& title, - const Text& subTitle, - SubTitleSize subTitleSize, - const Node* relative, - CodeMarker* marker) -{ - if (!title.isEmpty()) { - xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass", "h1 title"); - xmlWriter().writeCharacters(protectEnc(title)); - xmlWriter().writeEndElement(); //

    - } - if (!subTitle.isEmpty()) { - xmlWriter().writeStartElement("p"); - if (subTitleSize == SmallSubTitle) { - xmlWriter().writeAttribute("outputclass", "small-subtitle"); - } - else { - xmlWriter().writeAttribute("outputclass", "subtitle"); - } - generateText(subTitle, relative, marker); - xmlWriter().writeEndElement(); //

    - } -} - -/*! Outputs the \e brief command as a element. */ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) @@ -2548,44 +2473,6 @@ void DitaXmlGenerator::generateTableOfContents(const Node* node, inLink = false; } -QString DitaXmlGenerator::generateListOfAllMemberFile(const InnerNode* inner, - CodeMarker* marker) -{ - QList
    sections; - QList
    ::ConstIterator s; - - sections = marker->sections(inner, - CodeMarker::SeparateList, - CodeMarker::Okay); - if (sections.isEmpty()) - return QString(); - - QString fileName = fileBase(inner) + "-members." + fileExtension(inner); - beginSubPage(inner->location(), fileName); - QString title = "List of All Members for " + inner->name(); - generateHeader(inner, title, true); - xmlWriter().writeStartElement("body"); - xmlWriter().writeStartElement("section"); - if (!title.isEmpty()) { - xmlWriter().writeStartElement("title"); - xmlWriter().writeAttribute("outputclass", "h1"); - xmlWriter().writeCharacters(protectEnc(title)); - xmlWriter().writeEndElement(); // - } - xmlWriter().writeStartElement("p"); - xmlWriter().writeCharacters("This is the complete list of members for "); - generateFullName(inner, 0, marker); - xmlWriter().writeCharacters(", including inherited members."); - xmlWriter().writeEndElement(); //

    - - Section section = sections.first(); - generateSection(section.members, 0, marker, CodeMarker::SeparateList); - xmlWriter().writeEndElement(); //
    - xmlWriter().writeEndElement(); // - endSubPage(); - return fileName; -} - void DitaXmlGenerator::generateLowStatusMembers(const InnerNode* inner, CodeMarker* marker, CodeMarker::Status status) diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 6324204..29ec546 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -150,11 +150,6 @@ class DitaXmlGenerator : public PageGenerator void generateHeader(const Node* node, const QString& name, bool subpage = false); - void generateTitle(const QString& title, - const Text& subTitle, - SubTitleSize subTitleSize, - const Node* relative, - CodeMarker* marker); void generateBrief(const Node* node, CodeMarker* marker); void generateIncludes(const InnerNode* inner, CodeMarker* marker); void generateTableOfContents(const Node* node, @@ -165,7 +160,6 @@ class DitaXmlGenerator : public PageGenerator void generateTableOfContents(const Node* node, CodeMarker* marker, QList
    * sections = 0); - QString generateListOfAllMemberFile(const InnerNode* inner, CodeMarker* marker); void generateLowStatusMembers(const InnerNode* inner, CodeMarker* marker, CodeMarker::Status status); -- cgit v0.12 From 2f5fe525c5d9ac142571c39c215386675ee79899 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 9 Nov 2010 13:47:56 +0100 Subject: Qt Commercial Edition Information about the license and features of the Commercial Edition.

    Information about the license and features of the Commercial Edition.

    Qt can be used to develop closed source software if you obtain a commercial license.

    If you want to develop Free or Open Source software for release using a recognized Open Source license, you can use the Open Source Versions of Qt.

    The table below summarizes the differences between the two commercial editions:

    Please see the list of supported platforms for up-to-date information about the various platforms and compilers that Qt supports.

    On the Qt web site, you can find a Qt Licensing Overview and information on Qt License Pricing for commercial editions of Qt and other Qt-related products.

    To purchase, please visit the online order form.

    For further information and assistance, please contact Qt sales.

    Web: http://qt.nokia.com/contact.

    Phone, U.S&#x2e; office (for North America): 1-650-813-1676.

    Phone, Norway office (for the rest of the world): +47 21 60 48 00.

    --- tools/qdoc3/ditaxmlgenerator.cpp | 64 +++++++--------------------------------- tools/qdoc3/ditaxmlgenerator.h | 5 +--- 2 files changed, 11 insertions(+), 58 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index e2b3ca1..00ec8fd 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -639,7 +639,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, const Node* node = 0; QString link = getLink(atom, relative, marker, &node); if (!link.isEmpty()) { - beginLink(link, node, relative, marker); + beginLink(link); generateLink(atom, relative, marker); endLink(); } @@ -1091,7 +1091,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, .arg(marker->plainFullName(relative))); } else if (!inSectionHeading) { - beginLink(myLink, node, relative, marker); + beginLink(myLink); } #if 0 else { @@ -1107,14 +1107,14 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, #if 0 qDebug() << "GUID LINK:" << atom->string() << outFileName(); #endif - beginLink(atom->string(), 0, relative, marker); + beginLink(atom->string()); skipAhead = 1; } break; case Atom::LinkNode: { const Node* node = CodeMarker::nodeForString(atom->string()); - beginLink(linkForNode(node, relative), node, relative, marker); + beginLink(linkForNode(node, relative)); skipAhead = 1; } break; @@ -1476,7 +1476,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::UnknownCommand: xmlWriter().writeStartElement("b"); - xmlWriter().writeAttribute("outputclass","redFont code"); + xmlWriter().writeAttribute("outputclass","error unknown-command"); xmlWriter().writeCharacters(protectEnc(atom->string())); xmlWriter().writeEndElement(); // break; @@ -3701,20 +3701,6 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode, actualNode = apparentNode; xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href",linkForNode(actualNode, relative)); -#if 0 - if (true || relative == 0 || relative->status() != actualNode->status()) { - switch (actualNode->status()) { - case Node::Obsolete: - xmlWriter().writeAttribute("outputclass","obsolete"); - break; - case Node::Compat: - xmlWriter().writeAttribute("outputclass","compat"); - break; - default: - break; - } - } -#endif xmlWriter().writeCharacters(protectEnc(fullName(apparentNode, relative, marker))); xmlWriter().writeEndElement(); // } @@ -4194,41 +4180,13 @@ void DitaXmlGenerator::generateStatus(const Node* node, CodeMarker* marker) } } -void DitaXmlGenerator::beginLink(const QString& link, - const Node* node, - const Node* relative, - CodeMarker* marker) +void DitaXmlGenerator::beginLink(const QString& link) { - Q_UNUSED(marker) - Q_UNUSED(relative) - this->link = link; - if (link.isEmpty()) { - if (showBrokenLinks) - xmlWriter().writeStartElement("i"); - } - else if (node == 0 || (relative != 0 && - node->status() == relative->status())) { - xmlWriter().writeStartElement("xref"); - xmlWriter().writeAttribute("href",link); - } - else { - switch (node->status()) { - case Node::Obsolete: - xmlWriter().writeStartElement("xref"); - xmlWriter().writeAttribute("href",link); - //xmlWriter().writeAttribute("outputclass","obsolete"); - break; - case Node::Compat: - xmlWriter().writeStartElement("xref"); - xmlWriter().writeAttribute("href",link); - //xmlWriter().writeAttribute("outputclass","compat"); - break; - default: - xmlWriter().writeStartElement("xref"); - xmlWriter().writeAttribute("href",link); - } - } + if (link.isEmpty()) + return; + xmlWriter().writeStartElement("xref"); + xmlWriter().writeAttribute("href",link); inLink = true; } @@ -4356,7 +4314,6 @@ void DitaXmlGenerator::generateQmlInherits(const QmlClassNode* cn, if (n && n->subType() == Node::QmlClass) { const QmlClassNode* qcn = static_cast(n); xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","centerAlign"); Text text; text << "[Inherits "; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4404,7 +4361,6 @@ void DitaXmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, const ClassNode* cn = qcn->classNode(); if (cn && (cn->status() != Node::Internal)) { xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","centerAlign"); Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 29ec546..427264c 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -245,10 +245,7 @@ class DitaXmlGenerator : public PageGenerator #ifdef GENERATE_MAC_REFS void generateMacRef(const Node* node, CodeMarker* marker); #endif - void beginLink(const QString& link, - const Node* node, - const Node* relative, - CodeMarker* marker); + void beginLink(const QString& link); void endLink(); QString writeGuidAttribute(QString text); void writeGuidAttribute(Node* node); -- cgit v0.12 From 6d111857f094e4c5f2ed3e297c5ec25c16a2a06c Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 10 Nov 2010 13:27:10 +0100 Subject: qdoc: Removed unused code. --- tools/qdoc3/ditaxmlgenerator.cpp | 75 ---------------------------------------- tools/qdoc3/ditaxmlgenerator.h | 3 -- 2 files changed, 78 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 00ec8fd..90f2997 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -3705,81 +3705,6 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode, xmlWriter().writeEndElement(); // } -void DitaXmlGenerator::generateDetailedMember(Node* node, - const InnerNode* relative, - CodeMarker* marker) -{ - QString marked; - const EnumNode* en; - - if ((node->type() == Node::Enum) && - (en = static_cast(node))->flagsType()) { - xmlWriter().writeStartElement("p"); - writeGuidAttribute(node); - xmlWriter().writeAttribute("outputclass","h3 flags"); - marked = getMarkedUpSynopsis(en, relative, marker, CodeMarker::Detailed); - writeText(marked, marker, relative); - xmlWriter().writeCharacters("\n"); - marked = getMarkedUpSynopsis(en->flagsType(),relative,marker,CodeMarker::Detailed); - writeText(marked,marker,relative); - xmlWriter().writeEndElement(); //

    - } - else { - xmlWriter().writeStartElement("p"); - writeGuidAttribute(node); - xmlWriter().writeAttribute("outputclass","h3 fn"); - marked = getMarkedUpSynopsis(node, relative, marker, CodeMarker::Detailed); - writeText(marked, marker, relative); - xmlWriter().writeEndElement(); //

    - } - - generateStatus(node, marker); - generateBody(node, marker); - generateThreadSafeness(node, marker); - generateSince(node, marker); - - if (node->type() == Node::Property) { - const PropertyNode *property = static_cast(node); - Section section; - - section.members += property->getters(); - section.members += property->setters(); - section.members += property->resetters(); - - if (!section.members.isEmpty()) { - xmlWriter().writeStartElement("p"); - xmlWriter().writeCharacters("Access functions:"); - xmlWriter().writeEndElement(); //

    - generateSection(section.members, node, marker, CodeMarker::Accessors); - } - - Section notifiers; - notifiers.members += property->notifiers(); - - if (!notifiers.members.isEmpty()) { - xmlWriter().writeStartElement("p"); - xmlWriter().writeCharacters("Notifier signal:"); - xmlWriter().writeEndElement(); //

    - generateSection(notifiers.members, node, marker, CodeMarker::Accessors); - } - } - else if (node->type() == Node::Enum) { - en = static_cast(node); - if (en->flagsType()) { - xmlWriter().writeStartElement("p"); - QString text = "The " + protectEnc(en->flagsType()->name()) + - " type is a typedef for " + - "QFlags<" + - protectEnc(en->name()) + - ">. It stores an OR combination of " + - protectEnc(en->name()) + " values."; - xmlWriter().writeCharacters(text); - xmlWriter().writeEndElement(); //

    - } - } - generateAlsoList(node, marker); -} - void DitaXmlGenerator::findAllClasses(const InnerNode* node) { NodeList::const_iterator c = node->childNodes().constBegin(); diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 427264c..b13fa49 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -217,9 +217,6 @@ class DitaXmlGenerator : public PageGenerator const Node* relative, CodeMarker* marker, const Node* actualNode = 0); - void generateDetailedMember(Node* node, - const InnerNode* relative, - CodeMarker* marker); void generateLink(const Atom* atom, const Node* relative, CodeMarker* marker); -- cgit v0.12 From 8256a4dfe14b214f517d35178e70f2613131ae99 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 10 Nov 2010 14:10:31 +0100 Subject: qdoc: Changed some outputclass attributes. --- tools/qdoc3/ditaxmlgenerator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 90f2997..aace05a 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -4239,6 +4239,7 @@ void DitaXmlGenerator::generateQmlInherits(const QmlClassNode* cn, if (n && n->subType() == Node::QmlClass) { const QmlClassNode* qcn = static_cast(n); xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","inherits"); Text text; text << "[Inherits "; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4286,6 +4287,7 @@ void DitaXmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, const ClassNode* cn = qcn->classNode(); if (cn && (cn->status() != Node::Internal)) { xmlWriter().writeStartElement("p"); + xmlWriter().writeAttribute("outputclass","instantiates"); Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4311,13 +4313,13 @@ void DitaXmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, is set to Node::Internal, do nothing. */ void DitaXmlGenerator::generateInstantiatedBy(const ClassNode* cn, - CodeMarker* marker) + CodeMarker* marker) { if (cn && cn->status() != Node::Internal && !cn->qmlElement().isEmpty()) { const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake); if (n && n->subType() == Node::QmlClass) { xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","centerAlign"); + xmlWriter().writeAttribute("outputclass","instantiated-by"); Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn)); -- cgit v0.12 From 466953c0504ec8d84115af4723d6039b21a98ed1 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 10 Nov 2010 14:14:35 +0100 Subject: Removed obsolete files. Apparently, these files are no longer used, being duplicates of those in doc/src/template. --- tools/qdoc3/test/scripts/functions.js | 60 -- tools/qdoc3/test/scripts/jquery.js | 152 ----- tools/qdoc3/test/style/style.css | 1051 --------------------------------- tools/qdoc3/test/style/style_ie6.css | 54 -- tools/qdoc3/test/style/style_ie7.css | 19 - tools/qdoc3/test/style/style_ie8.css | 0 6 files changed, 1336 deletions(-) delete mode 100644 tools/qdoc3/test/scripts/functions.js delete mode 100644 tools/qdoc3/test/scripts/jquery.js delete mode 100644 tools/qdoc3/test/style/style.css delete mode 100644 tools/qdoc3/test/style/style_ie6.css delete mode 100644 tools/qdoc3/test/style/style_ie7.css delete mode 100644 tools/qdoc3/test/style/style_ie8.css diff --git a/tools/qdoc3/test/scripts/functions.js b/tools/qdoc3/test/scripts/functions.js deleted file mode 100644 index 0135427..0000000 --- a/tools/qdoc3/test/scripts/functions.js +++ /dev/null @@ -1,60 +0,0 @@ - -/* START non link areas where cursor should change to pointing hand */ -$('.t_button').mouseover(function() { - $('.t_button').css('cursor','pointer'); - /*document.getElementById(this.id).style.cursor='pointer';*/ -}); - -/* END non link areas */ -$('#smallA').click(function() { - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','smaller'); - $('.t_button').removeClass('active') - $(this).addClass('active') -}); - -$('#medA').click(function() { - $('.content .heading').css('font','600 16px/1 Arial'); - $('.content h1').css('font','600 18px/1.2 Arial'); - $('.content h2').css('font','600 16px/1.2 Arial'); - $('.content h3').css('font','600 14px/1.2 Arial'); - $('.content p').css('font','13px/20px Verdana'); - $('.content li').css('font','400 13px/1 Verdana'); - $('.content li').css('line-height','14px'); - $('.content table').css('font','13px/1.2 Verdana'); - $('.content .heading').css('font','600 16px/1 Arial'); - $('.content .indexboxcont li').css('font','600 13px/1 Verdana'); - $('.t_button').removeClass('active') - $(this).addClass('active') -}); - -$('#bigA').click(function() { - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','large'); - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('line-height','25px'); - $('.t_button').removeClass('active') - $(this).addClass('active') -}); - -function doSearch(str){ - -if (str.length>3) - { - alert('start search'); - // document.getElementById("refWrapper").innerHTML=""; - return; - } - else - return; - -// var url="indexSearch.php"; -// url=url+"?q="+str; - // url=url+"&sid="+Math.random(); - // var url="http://localhost:8983/solr/select?"; - // url=url+"&q="+str; - // url=url+"&fq=&start=0&rows=10&fl=&qt=&wt=&explainOther=&hl.fl="; - - // $.get(url, function(data){ - // alert(data); - // document.getElementById("refWrapper").innerHTML=data; - //}); - -} \ No newline at end of file diff --git a/tools/qdoc3/test/scripts/jquery.js b/tools/qdoc3/test/scripts/jquery.js deleted file mode 100644 index 0c7294c..0000000 --- a/tools/qdoc3/test/scripts/jquery.js +++ /dev/null @@ -1,152 +0,0 @@ -/*! - * jQuery JavaScript Library v1.4.1 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Mon Jan 25 19:43:33 2010 -0500 - */ -(function(z,v){function la(){if(!c.isReady){try{r.documentElement.doScroll("left")}catch(a){setTimeout(la,1);return}c.ready()}}function Ma(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,i){var j=a.length;if(typeof b==="object"){for(var n in b)X(a,n,b[n],f,e,d);return a}if(d!==v){f=!i&&f&&c.isFunction(d);for(n=0;n-1){i=j.data;i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)}else delete x[o]}i=c(a.target).closest(f, -a.currentTarget);m=0;for(s=i.length;m)[^>]*$|^#([\w-]+)$/,Qa=/^.[^:#\[\.,]*$/,Ra=/\S/,Sa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Ta=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,O=navigator.userAgent, -va=false,P=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,Q=Array.prototype.slice,wa=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Pa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:r;if(a=Ta.exec(a))if(c.isPlainObject(b)){a=[r.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=ra([d[1]], -[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}}else{if(b=r.getElementById(d[2])){if(b.id!==d[2])return S.find(a);this.length=1;this[0]=b}this.context=r;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=r;a=r.getElementsByTagName(a)}else return!b||b.jquery?(b||S).find(a):c(b).find(a);else if(c.isFunction(a))return S.ready(a);if(a.selector!==v){this.selector=a.selector;this.context=a.context}return c.isArray(a)?this.setArray(a):c.makeArray(a, -this)},selector:"",jquery:"1.4.1",length:0,size:function(){return this.length},toArray:function(){return Q.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){a=c(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length=0;ba.apply(this,a);return this},each:function(a,b){return c.each(this, -a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(r,c);else P&&P.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(Q.apply(this,arguments),"slice",Q.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice}; -c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,n;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
    a";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support= -{leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55$/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:r.createElement("select").appendChild(r.createElement("option")).selected,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null}; -b.type="text/javascript";try{b.appendChild(r.createTextNode("window."+f+"=1;"))}catch(j){}a.insertBefore(b,a.firstChild);if(z[f]){c.support.scriptEval=true;delete z[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function n(){c.support.noCloneEvent=false;d.detachEvent("onclick",n)});d.cloneNode(true).fireEvent("onclick")}d=r.createElement("div");d.innerHTML="";a=r.createDocumentFragment();a.appendChild(d.firstChild); -c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var n=r.createElement("div");n.style.width=n.style.paddingLeft="1px";r.body.appendChild(n);c.boxModel=c.support.boxModel=n.offsetWidth===2;r.body.removeChild(n).style.display="none"});a=function(n){var o=r.createElement("div");n="on"+n;var m=n in o;if(!m){o.setAttribute(n,"return;");m=typeof o[n]==="function"}return m};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=i=null}})();c.props= -{"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ua=0,xa={},Va={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==z?xa:a;var f=a[G],e=c.cache;if(!b&&!f)return null;f||(f=++Ua);if(typeof b==="object"){a[G]=f;e=e[f]=c.extend(true, -{},b)}else e=e[f]?e[f]:typeof d==="undefined"?Va:(e[f]={});if(d!==v){a[G]=f;e[b]=d}return typeof b==="string"?e[b]:e}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==z?xa:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{try{delete a[G]}catch(i){a.removeAttribute&&a.removeAttribute(G)}delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this, -a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===v){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===v&&this.length)f=c.data(this[0],a);return f===v&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d); -return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===v)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]|| -a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var ya=/[\n\t]/g,ca=/\s+/,Wa=/\r/g,Xa=/href|src|style/,Ya=/(button|input)/i,Za=/(button|input|object|select|textarea)/i,$a=/^(a|area)$/i,za=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(o){var m= -c(this);m.addClass(a.call(this,o,m.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===v){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value|| -{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i=0;else if(c.nodeName(this,"select")){var x=c.makeArray(s);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),x)>=0});if(!x.length)this.selectedIndex=-1}else this.value=s}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return v;if(f&&b in c.attrFn)return c(a)[b](d); -f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==v;b=f&&c.props[b]||b;if(a.nodeType===1){var i=Xa.test(b);if(b in a&&f&&!i){if(e){b==="type"&&Ya.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Za.test(a.nodeName)||$a.test(a.nodeName)&&a.href?0:v;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText= -""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?v:a}return c.style(a,b,d)}});var ab=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==z&&!a.frameElement)a=z;if(!d.guid)d.guid=c.guid++;if(f!==v){d=c.proxy(d);d.data=f}var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;if(!i){j= -function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):v};i=c.data(a,"handle",j)}if(i){i.elem=a;b=b.split(/\s+/);for(var n,o=0;n=b[o++];){var m=n.split(".");n=m.shift();if(o>1){d=c.proxy(d);if(f!==v)d.data=f}d.type=m.slice(0).sort().join(".");var s=e[n],x=this.special[n]||{};if(!s){s=e[n]={};if(!x.setup||x.setup.call(a,f,m,d)===false)if(a.addEventListener)a.addEventListener(n,i,false);else a.attachEvent&&a.attachEvent("on"+n,i)}if(x.add)if((m=x.add.call(a, -d,f,m,s))&&c.isFunction(m)){m.guid=m.guid||d.guid;m.data=m.data||d.data;m.type=m.type||d.type;d=m}s[d.guid]=d;this.global[n]=true}a=null}}},global:{},remove:function(a,b,d){if(!(a.nodeType===3||a.nodeType===8)){var f=c.data(a,"events"),e,i,j;if(f){if(b===v||typeof b==="string"&&b.charAt(0)===".")for(i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}b=b.split(/\s+/);for(var n=0;i=b[n++];){var o=i.split(".");i=o.shift();var m=!o.length,s=c.map(o.slice(0).sort(),ab);s=new RegExp("(^|\\.)"+ -s.join("\\.(?:.*\\.)?")+"(\\.|$)");var x=this.special[i]||{};if(f[i]){if(d){j=f[i][d.guid];delete f[i][d.guid]}else for(var A in f[i])if(m||s.test(f[i][A].type))delete f[i][A];x.remove&&x.remove.call(a,o,j);for(e in f[i])break;if(!e){if(!x.teardown||x.teardown.call(a,o)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+i,c.data(a,"handle"));e=null;delete f[i]}}}}for(e in f)break;if(!e){if(A=c.data(a,"handle"))A.elem=null;c.removeData(a, -"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return v;a.result=v;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d, -b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(i){}if(!a.isPropagationStopped()&&f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){d=a.target;var j;if(!(c.nodeName(d,"a")&&e==="click")&&!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){try{if(d[e]){if(j=d["on"+e])d["on"+e]=null;this.triggered=true;d[e]()}}catch(n){}if(j)d["on"+e]=j;this.triggered=false}}},handle:function(a){var b, -d;a=arguments[0]=c.event.fix(a||z.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==v){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), -fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||r;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=r.documentElement;d=r.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| -d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==v)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a,b){c.extend(a,b||{});a.guid+=b.selector+b.live;b.liveProxy=a;c.event.add(this,b.live,na,b)},remove:function(a){if(a.length){var b= -0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],na)}},special:{}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true}; -c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};var Aa=function(a){for(var b= -a.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(d){break}if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}},Ba=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ba:Aa,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ba:Aa)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!== -"form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return ma("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return ma("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this, -"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var da=/textarea|input|select/i;function Ca(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d}function ea(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Ca(d);if(a.type!=="focusout"|| -d.type!=="radio")c.data(d,"_change_data",e);if(!(f===v||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}}c.event.special.change={filters:{focusout:ea,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ea.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ea.call(this,a)},beforeactivate:function(a){a= -a.target;a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Ca(a))}},setup:function(a,b,d){for(var f in T)c.event.add(this,f+".specialChange."+d.guid,T[f]);return da.test(this.nodeName)},remove:function(a,b){for(var d in T)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),T[d]);return da.test(this.nodeName)}};var T=c.event.special.change.filters}r.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this, -f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var i in d)this[b](i,f,d[i],e);return this}if(c.isFunction(f)){e=f;f=v}var j=b==="one"?c.proxy(e,function(n){c(this).unbind(n,j);return e.apply(this,arguments)}):e;return d==="unload"&&b!=="one"?this.one(d,f,e):this.each(function(){c.event.add(this,d,j,f)})}});c.fn.extend({unbind:function(a, -b){if(typeof a==="object"&&!a.preventDefault){for(var d in a)this.unbind(d,a[d]);return this}return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d0){y=t;break}}t=t[g]}l[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,i=Object.prototype.toString,j=false,n=true;[0,0].sort(function(){n=false;return 0});var o=function(g,h,k,l){k=k||[];var q=h=h||r;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g|| -typeof g!=="string")return k;for(var p=[],u,t,y,R,H=true,M=w(h),I=g;(f.exec(""),u=f.exec(I))!==null;){I=u[3];p.push(u[1]);if(u[2]){R=u[3];break}}if(p.length>1&&s.exec(g))if(p.length===2&&m.relative[p[0]])t=fa(p[0]+p[1],h);else for(t=m.relative[p[0]]?[h]:o(p.shift(),h);p.length;){g=p.shift();if(m.relative[g])g+=p.shift();t=fa(g,t)}else{if(!l&&p.length>1&&h.nodeType===9&&!M&&m.match.ID.test(p[0])&&!m.match.ID.test(p[p.length-1])){u=o.find(p.shift(),h,M);h=u.expr?o.filter(u.expr,u.set)[0]:u.set[0]}if(h){u= -l?{expr:p.pop(),set:A(l)}:o.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=u.expr?o.filter(u.expr,u.set):u.set;if(p.length>0)y=A(t);else H=false;for(;p.length;){var D=p.pop();u=D;if(m.relative[D])u=p.pop();else D="";if(u==null)u=h;m.relative[D](y,u,M)}}else y=[]}y||(y=t);y||o.error(D||g);if(i.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))k.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&& -y[g].nodeType===1&&k.push(t[g]);else k.push.apply(k,y);else A(y,k);if(R){o(R,q,k,l);o.uniqueSort(k)}return k};o.uniqueSort=function(g){if(C){j=n;g.sort(C);if(j)for(var h=1;h":function(g,h){var k=typeof h==="string";if(k&&!/\W/.test(h)){h=h.toLowerCase();for(var l=0,q=g.length;l=0))k||l.push(u);else if(k)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&& -"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,k,l,q,p){h=g[1].replace(/\\/g,"");if(!p&&m.attrMap[h])g[1]=m.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,k,l,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=o(g[3],null,null,h);else{g=o.filter(g[3],h,k,true^q);k||l.push.apply(l,g);return false}else if(m.match.POS.test(g[0])||m.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true); -return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!o(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"=== -g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,h){return h===0},last:function(g,h,k,l){return h===l.length-1},even:function(g,h){return h%2=== -0},odd:function(g,h){return h%2===1},lt:function(g,h,k){return hk[3]-0},nth:function(g,h,k){return k[3]-0===h},eq:function(g,h,k){return k[3]-0===h}},filter:{PSEUDO:function(g,h,k,l){var q=h[1],p=m.filters[q];if(p)return p(g,k,h,l);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=h[3];k=0;for(l=h.length;k= -0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var k=h[1];g=m.attrHandle[k]?m.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);k=g+"";var l=h[2];h=h[4];return g==null?l==="!=":l==="="?k===h:l==="*="?k.indexOf(h)>=0:l==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:l==="!="?k!==h:l==="^="? -k.indexOf(h)===0:l==="$="?k.substr(k.length-h.length)===h:l==="|="?k===h||k.substr(0,h.length+1)===h+"-":false},POS:function(g,h,k,l){var q=m.setFilters[h[2]];if(q)return q(g,k,h,l)}}},s=m.match.POS;for(var x in m.match){m.match[x]=new RegExp(m.match[x].source+/(?![^\[]*\])(?![^\(]*\))/.source);m.leftMatch[x]=new RegExp(/(^(?:.|\r|\n)*?)/.source+m.match[x].source.replace(/\\(\d+)/g,function(g,h){return"\\"+(h-0+1)}))}var A=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g}; -try{Array.prototype.slice.call(r.documentElement.childNodes,0)}catch(B){A=function(g,h){h=h||[];if(i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var k=0,l=g.length;k";var k=r.documentElement;k.insertBefore(g,k.firstChild);if(r.getElementById(h)){m.find.ID=function(l,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(l[1]))?q.id===l[1]||typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id").nodeValue===l[1]?[q]:v:[]};m.filter.ID=function(l,q){var p=typeof l.getAttributeNode!=="undefined"&&l.getAttributeNode("id"); -return l.nodeType===1&&p&&p.nodeValue===q}}k.removeChild(g);k=g=null})();(function(){var g=r.createElement("div");g.appendChild(r.createComment(""));if(g.getElementsByTagName("*").length>0)m.find.TAG=function(h,k){k=k.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var l=0;k[l];l++)k[l].nodeType===1&&h.push(k[l]);k=h}return k};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")m.attrHandle.href=function(h){return h.getAttribute("href", -2)};g=null})();r.querySelectorAll&&function(){var g=o,h=r.createElement("div");h.innerHTML="

    ";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){o=function(l,q,p,u){q=q||r;if(!u&&q.nodeType===9&&!w(q))try{return A(q.querySelectorAll(l),p)}catch(t){}return g(l,q,p,u)};for(var k in g)o[k]=g[k];h=null}}();(function(){var g=r.createElement("div");g.innerHTML="
    ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length=== -0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){m.order.splice(1,0,"CLASS");m.find.CLASS=function(h,k,l){if(typeof k.getElementsByClassName!=="undefined"&&!l)return k.getElementsByClassName(h[1])};g=null}}})();var E=r.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g,h){return g!==h&&(g.contains?g.contains(h):true)},w=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},fa=function(g,h){var k=[], -l="",q;for(h=h.nodeType?[h]:h;q=m.match.PSEUDO.exec(g);){l+=q[0];g=g.replace(m.match.PSEUDO,"")}g=m.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var i=d;i0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i={},j;if(f&&a.length){e=0;for(var n=a.length;e --1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var o=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(m,s){for(;s&&s.ownerDocument&&s!==b;){if(o?o.index(s)>-1:c(s).is(a))return s;s=s.parentNode}return null})},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(), -a);return this.pushStack(pa(a[0])||pa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")}, -nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);bb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e): -e;if((this.length>1||db.test(f))&&cb.test(a))e=e.reverse();return this.pushStack(e,a,Q.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===v||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!== -b&&d.push(a);return d}});var Fa=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ga=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/"},F={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "], -col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
    ","
    "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==v)return this.empty().append((this[0]&&this[0].ownerDocument||r).createTextNode(a));return c.getText(this)}, -wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length? -d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments, -false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&& -!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Fa,"").replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){qa(this,b);qa(this.find("*"),b.find("*"))}return b},html:function(a){if(a===v)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Fa,""):null;else if(typeof a==="string"&&!/\n"; - out() << " \n"; - - - // Adding syntax highlighter // future release - - // Setting some additional style sheet related details depending on configuration (e.g. Online/Creator) - - switch (application) { - case Online: - // Adding style and js for small windows - out() << " \n"; - out() << " "; - out() << " \n"; - out() << " \n"; - // Browser spec styles - out() << " \n"; - out() << "\n"; - out() << "\n"; - out() << "\n"; - - out() << "\n"; - // CheckEmptyAndLoadList activating search - out() << "\n"; - break; - case Creator: - out() << "\n"; - out() << "\n"; // offline narrow - break; - default: - out() << "\n"; - out() << "\n"; - break; - } + + // Include style sheet and script links. + out() << headerStyles; + out() << headerScripts; + out() << endHeader; #ifdef GENERATE_MAC_REFS if (mainPage) generateMacRef(node, marker); #endif - switch (application) { - case Online: - out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - generateBreadCrumbs(title,node,marker); - out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - break; - case Creator: - out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - generateBreadCrumbs(title,node,marker); - out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - break; - default: // default -- not used except if one forgets to set any of the above settings to true - out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - generateBreadCrumbs(title,node,marker); - out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - break; - } + out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + generateBreadCrumbs(title,node,marker); + out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - navigationLinks.clear(); + navigationLinks.clear(); if (node && !node->links().empty()) { QPair linkPair; @@ -1960,30 +1900,8 @@ void HtmlGenerator::generateFooter(const Node *node) out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version()) << QString(address).replace("\\" + COMMAND_VERSION, myTree->version()); - switch (application) { - case Online: - out() << " \n"; - out() << " \n"; - out() << "\n"; - break; - case Creator: - out() << "\n"; - break; - default: - out() << "\n"; - } - out() << "\n"; + out() << "\n"; + out() << "\n"; } void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index d885ada..1b3de9e 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -95,10 +95,6 @@ class HtmlGenerator : public PageGenerator LastSinceType }; - enum Application { - Online, - Creator}; - public: HtmlGenerator(); ~HtmlGenerator(); @@ -301,11 +297,13 @@ class HtmlGenerator : public PageGenerator bool inTableHeader; int numTableRows; bool threeColumnEnumValueTable; - Application application; QString link; QStringList sectionNumber; QRegExp funcLeftParen; QString style; + QString headerScripts; + QString headerStyles; + QString endHeader; QString postHeader; QString postPostHeader; QString creatorPostHeader; @@ -350,9 +348,6 @@ class HtmlGenerator : public PageGenerator #define HTMLGENERATOR_POSTPOSTHEADER "postpostheader" #define HTMLGENERATOR_CREATORPOSTHEADER "postheader" #define HTMLGENERATOR_CREATORPOSTPOSTHEADER "postpostheader" -#define HTMLGENERATOR_STYLE "style" -#define HTMLGENERATOR_STYLESHEETS "stylesheets" -#define HTMLGENERATOR_CUSTOMHEADELEMENTS "customheadelements" QT_END_NAMESPACE diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 2bfe38e..85b23e9 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -105,7 +105,6 @@ static bool showInternal = false; static bool obsoleteLinks = false; static QStringList defines; static QHash trees; -static QString appArg; // application /*! Find the Tree for language \a lang and return a pointer to it. @@ -193,24 +192,6 @@ static void processQdocconfFile(const QString &fileName) config.load(fileName); /* - Set the application to which qdoc will create the output. - The two applications are: - - creator: additional formatting for viewing in - the Creator application. - - online: full-featured online version with search and - links to Qt topics - */ - if (appArg.isEmpty()) { - qDebug() << "Warning: Application flag not specified on" - << "command line. Options are -creator (default)" - << "and -online."; - appArg = "creator"; - } - config.setStringList(CONFIG_APPLICATION, QStringList(appArg)); - - /* Add the defines to the configuration variables. */ QStringList defs = defines + config.getStringList(CONFIG_DEFINES); @@ -481,10 +462,6 @@ int main(int argc, char **argv) else if (opt == "-obsoletelinks") { obsoleteLinks = true; } - else if (opt == "-creator") - appArg = "creator"; - else if (opt == "-online") - appArg = "online"; else { qdocFiles.append(opt); } diff --git a/tools/qdoc3/test/qt-api-only.qdocconf b/tools/qdoc3/test/qt-api-only.qdocconf index cdd7a7c..36637d2 100644 --- a/tools/qdoc3/test/qt-api-only.qdocconf +++ b/tools/qdoc3/test/qt-api-only.qdocconf @@ -1,34 +1,2 @@ include(qt-build-docs.qdocconf) - -# Ensures that the generated index contains a URL that can be used by the -# tools documentation (assistant.qdocconf, designer.qdocconf, linguist.qdocconf, -# qmake.qdocconf). - -url = ./ - -# Ensures that the documentation for the tools is not included in the generated -# .qhp file. - -qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc \ - $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/taskmenuextension.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/containerextension.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/worldtimeclockbuilder.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/worldtimeclockplugin.qdoc \ - $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \ - $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc - -# Remove the QML documentation from the Qt-only documentation. - -excludedirs += $QT_SOURCE_TREE/src/imports - -outputdir = $QT_BUILD_TREE/doc-build/html-qt -tagfile = $QT_BUILD_TREE/doc-build/html-qt/qt.tags -base = file:$QT_BUILD_TREE/doc-build/html-qt +include(qt-project-api-only.qdocconf) diff --git a/tools/qdoc3/test/qt-build-docs-online.qdocconf b/tools/qdoc3/test/qt-build-docs-online.qdocconf new file mode 100644 index 0000000..2962845 --- /dev/null +++ b/tools/qdoc3/test/qt-build-docs-online.qdocconf @@ -0,0 +1,2 @@ +include(qt-project.qdocconf) +include(qt-html-templates-online.qdocconf) diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index dcabeb4..4dbe1cd 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -1,147 +1,2 @@ -include(compat.qdocconf) -include(macros.qdocconf) -include(qt-cpp-ignore.qdocconf) +include(qt-project.qdocconf) include(qt-html-templates.qdocconf) -include(qt-defines.qdocconf) - -project = Qt -description = Qt Reference Documentation -url = http://qt.nokia.com/doc/4.7 - -sourceencoding = UTF-8 -outputencoding = UTF-8 -naturallanguage = en_US - -qhp.projects = Qt - -qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.471 -qhp.Qt.virtualFolder = qdoc -qhp.Qt.indexTitle = Qt Reference Documentation -qhp.Qt.indexRoot = - -# Files not referenced in any qdoc file (last four are needed by qtdemo) -# See also extraimages.HTML -qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ul_blank.png \ - images/header_bg.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/arrow_down.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - scripts/narrow.js \ - scripts/superfish.js \ - style/narrow.css \ - style/superfish.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css - - - -qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.7.1 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 -qhp.Qt.subprojects = classes overviews examples -qhp.Qt.subprojects.classes.title = Classes -qhp.Qt.subprojects.classes.indexTitle = Qt's Classes -qhp.Qt.subprojects.classes.selectors = class fake:headerfile -qhp.Qt.subprojects.classes.sortPages = true -qhp.Qt.subprojects.overviews.title = Overviews -qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs -qhp.Qt.subprojects.overviews.selectors = fake:page,group,module -qhp.Qt.subprojects.examples.title = Tutorials and Examples -qhp.Qt.subprojects.examples.indexTitle = Qt Examples -qhp.Qt.subprojects.examples.selectors = fake:example - -language = Cpp - -headerdirs = $QT_SOURCE_TREE/src \ - $QT_SOURCE_TREE/extensions/activeqt \ - $QT_SOURCE_TREE/tools/assistant/lib \ - $QT_SOURCE_TREE/tools/assistant/compat/lib \ - $QT_SOURCE_TREE/tools/designer/src/uitools \ - $QT_SOURCE_TREE/tools/designer/src/lib/extension \ - $QT_SOURCE_TREE/tools/designer/src/lib/sdk \ - $QT_SOURCE_TREE/tools/designer/src/lib/uilib \ - $QT_SOURCE_TREE/tools/qtestlib/src \ - $QT_SOURCE_TREE/tools/qdbus/src -sourcedirs = $QT_SOURCE_TREE/src \ - $QT_SOURCE_TREE/doc/src \ - $QT_SOURCE_TREE/extensions/activeqt \ - $QT_SOURCE_TREE/tools/assistant/lib \ - $QT_SOURCE_TREE/tools/assistant/compat/lib \ - $QT_SOURCE_TREE/tools/designer/src/uitools \ - $QT_SOURCE_TREE/tools/designer/src/lib/extension \ - $QT_SOURCE_TREE/tools/designer/src/lib/sdk \ - $QT_SOURCE_TREE/tools/designer/src/lib/uilib \ - $QT_SOURCE_TREE/tools/qtestlib/src \ - $QT_SOURCE_TREE/tools/qdbus - -excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \ - $QT_SOURCE_TREE/src/3rdparty/des \ - $QT_SOURCE_TREE/src/3rdparty/freetype \ - $QT_SOURCE_TREE/src/3rdparty/harfbuzz \ - $QT_SOURCE_TREE/src/3rdparty/kdebase \ - $QT_SOURCE_TREE/src/3rdparty/libconninet \ - $QT_SOURCE_TREE/src/3rdparty/libjpeg \ - $QT_SOURCE_TREE/src/3rdparty/libmng \ - $QT_SOURCE_TREE/src/3rdparty/libpng \ - $QT_SOURCE_TREE/src/3rdparty/libtiff \ - $QT_SOURCE_TREE/src/3rdparty/md4 \ - $QT_SOURCE_TREE/src/3rdparty/md5 \ - $QT_SOURCE_TREE/src/3rdparty/patches \ - $QT_SOURCE_TREE/src/3rdparty/sha1 \ - $QT_SOURCE_TREE/src/3rdparty/sqlite \ - $QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore \ - $QT_SOURCE_TREE/src/3rdparty/webkit/WebCore \ - $QT_SOURCE_TREE/src/3rdparty/wintab \ - $QT_SOURCE_TREE/src/3rdparty/zlib \ - $QT_SOURCE_TREE/src/3rdparty/phonon/gstreamer \ - $QT_SOURCE_TREE/src/3rdparty/phonon/ds9 \ - $QT_SOURCE_TREE/src/3rdparty/phonon/qt7 \ - $QT_SOURCE_TREE/src/3rdparty/phonon/mmf \ - $QT_SOURCE_TREE/src/3rdparty/phonon/waveout \ - $QT_SOURCE_TREE/doc/src/snippets \ - $QT_SOURCE_TREE/doc/src/ja_JP \ - $QT_SOURCE_TREE/doc/src/zh_CN - -sources.fileextensions = "*.cpp *.qdoc *.mm" -examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml" -examples.imageextensions = "*.png" - -exampledirs = $QT_SOURCE_TREE/doc/src \ - $QT_SOURCE_TREE/examples \ - $QT_SOURCE_TREE/examples/tutorials \ - $QT_SOURCE_TREE \ - $QT_SOURCE_TREE/qmake/examples \ - $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs -imagedirs = $QT_SOURCE_TREE/doc/src/images \ - $QT_SOURCE_TREE/examples \ - $QT_SOURCE_TREE/doc/src/declarative/pics \ - $QT_SOURCE_TREE/doc/src/template/images -outputdir = $QT_BUILD_TREE/doc/html -tagfile = $QT_BUILD_TREE/doc/html/qt.tags -base = file:$QT_BUILD_TREE/doc/html - -HTML.generatemacrefs = "true" diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf index 51ee0d3..bf7fd08 100644 --- a/tools/qdoc3/test/qt-defines.qdocconf +++ b/tools/qdoc3/test/qt-defines.qdocconf @@ -15,48 +15,3 @@ defines = Q_QDOC \ versionsym = QT_VERSION_STR codeindent = 1 - -# Files not referenced in any qdoc file (last four needed by qtdemo) -# See also qhp.Qt.extraFiles -extraimages.HTML = qt-logo \ - trolltech-logo \ - bg_l.png \ - bg_l_blank.png \ - bg_ll_blank.png \ - bg_ul_blank.png \ - header_bg.png \ - bg_r.png \ - box_bg.png \ - breadcrumb.png \ - bullet_gt.png \ - bullet_dn.png \ - bullet_sq.png \ - bullet_up.png \ - arrow_down.png \ - feedbackground.png \ - horBar.png \ - page.png \ - page_bg.png \ - sprites-combined.png \ - spinner.gif \ - stylesheet-coffee-plastique.png \ - taskmenuextension-example.png \ - coloreditorfactoryimage.png \ - dynamiclayouts-example.png - -# This stuff is used by the new doc format. -scriptdirs = $QT_SOURCE_TREE/doc/src/template/scripts -styledirs = $QT_SOURCE_TREE/doc/src/template/style - -scripts.HTML = functions.js \ - narrow.js \ - superfish.js \ - jquery.js - -styles.HTML = style.css \ - narrow.css \ - superfish.css \ - superfish_skin.css \ - style_ie6.css \ - style_ie7.css \ - style_ie8.css diff --git a/tools/qdoc3/test/qt-html-default-styles.qdocconf b/tools/qdoc3/test/qt-html-default-styles.qdocconf new file mode 100644 index 0000000..103f1e0 --- /dev/null +++ b/tools/qdoc3/test/qt-html-default-styles.qdocconf @@ -0,0 +1,51 @@ +# Define the location of the templates to use. Style sheets and scripts are +# specified relative to the template directory and will be copied into +# subdirectories of the output directory. + +HTML.templatedir = $QT_SOURCE_TREE/doc/src/template + +HTML.stylesheets = style/style.css + +HTML.scripts = scripts/functions.js \ + scripts/narrow.js \ + + +# Files not referenced in any qdoc file (last four needed by qtdemo) +# See also qhp.Qt.extraFiles +extraimages.HTML = qt-logo \ + trolltech-logo \ + bg_l.png \ + bg_l_blank.png \ + bg_ll_blank.png \ + bg_ul_blank.png \ + header_bg.png \ + bg_r.png \ + box_bg.png \ + breadcrumb.png \ + bullet_gt.png \ + bullet_dn.png \ + bullet_sq.png \ + bullet_up.png \ + arrow_down.png \ + feedbackground.png \ + horBar.png \ + page.png \ + page_bg.png \ + sprites-combined.png \ + spinner.gif \ + stylesheet-coffee-plastique.png \ + taskmenuextension-example.png \ + coloreditorfactoryimage.png \ + dynamiclayouts-example.png + +# Include the style sheets and scripts used. + +HTML.headerstyles = \ + " \n" \ + " \n" + +HTML.headerscripts = + +HTML.endheader = \ + "\n" \ + "\n" diff --git a/tools/qdoc3/test/qt-html-online-styles.qdocconf b/tools/qdoc3/test/qt-html-online-styles.qdocconf new file mode 100644 index 0000000..06f8964 --- /dev/null +++ b/tools/qdoc3/test/qt-html-online-styles.qdocconf @@ -0,0 +1,77 @@ +# Define the location of the templates to use. Style sheets and scripts are +# specified relative to the template directory and will be copied into +# subdirectories of the output directory. + +HTML.templatedir = $QT_SOURCE_TREE/doc/src/template + +HTML.stylesheets = style/narrow.css \ + style/style.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/superfish.css + +# Adding jquery and functions - providing online tools and search features +HTML.scripts = scripts/functions.js \ + scripts/narrow.js \ + scripts/superfish.js \ + scripts/jquery.js + + +# Files not referenced in any qdoc file (last four needed by qtdemo) +# See also qhp.Qt.extraFiles +extraimages.HTML = qt-logo \ + trolltech-logo \ + bg_l.png \ + bg_l_blank.png \ + bg_ll_blank.png \ + bg_ul_blank.png \ + header_bg.png \ + bg_r.png \ + box_bg.png \ + breadcrumb.png \ + bullet_gt.png \ + bullet_dn.png \ + bullet_sq.png \ + bullet_up.png \ + arrow_down.png \ + feedbackground.png \ + horBar.png \ + page.png \ + page_bg.png \ + sprites-combined.png \ + spinner.gif \ + stylesheet-coffee-plastique.png \ + taskmenuextension-example.png \ + coloreditorfactoryimage.png \ + dynamiclayouts-example.png + +# Include the style sheets and scripts used. + +HTML.headerstyles = \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + "\n\n" + +HTML.headerscripts = \ + "\n" \ + "\n\n" + +HTML.endheader = \ + "\n" \ + "\n" diff --git a/tools/qdoc3/test/qt-html-templates-online.qdocconf b/tools/qdoc3/test/qt-html-templates-online.qdocconf new file mode 100644 index 0000000..64f99ad --- /dev/null +++ b/tools/qdoc3/test/qt-html-templates-online.qdocconf @@ -0,0 +1,198 @@ +include(qt-html-online-styles.qdocconf) + +HTML.postheader = \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " Home
    \n" \ + " Qt Reference Documentation\n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " Search index:
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + " Close \n" \ + "

    All | API | Articles | Examples

    \n" \ + "

     results:

    \n" \ + "
      \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " API Lookup

    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " Qt Topics

    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " Examples

    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
      \n" \ + "
    • Home
    • \n" \ + " \n" + +HTML.postpostheader = \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" + +HTML.footer = \ + "
    \n" \ + " [+] Documentation Feedback
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " © 2008-2010 Nokia Corporation and/or its\n" \ + " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ + " in Finland and/or other countries worldwide.

    \n" \ + "

    \n" \ + " All other trademarks are property of their respective owners. Privacy Policy

    \n" \ + "
    \n" \ + "

    \n" \ + " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ + " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ + " with the terms contained in a written agreement between you and Nokia.

    \n" \ + "

    \n" \ + " Alternatively, this document may be used under the terms of the GNU\n" \ + " Free Documentation License version 1.3\n" \ + " as published by the Free Software Foundation.

    \n" \ + "
    \n" \ + "
    \n" \ + "
    X
    \n" \ + "
    \n" \ + "

    Thank you for giving your feedback.

    Make sure it is related to this specific page. For more general bugs and \n" \ + " requests, please use the Qt Bug Tracker.

    \n" \ + "

    \n" \ + "

    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "\n" \ + " \n" \ + " \n" diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 698164d..5a2058a 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -1,186 +1,48 @@ -HTML.stylesheets = style/style.css \ - style/OfflineStyle.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style_ie6.css +include(qt-html-default-styles.qdocconf) -HTML.postheader = "
    \n" \ - "
    \n" \ - "
    \n" \ - " Home
    \n" \ - " Qt Reference Documentation\n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " Search index:
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - " Close \n" \ - "

    All | API | Articles | Examples

    \n" \ - "

     results:

    \n" \ - "
      \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " API Lookup

    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " Qt Topics

    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " Examples

    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
      \n" \ - "
    • Home
    • \n" \ - " \n" +HTML.postheader = \ + "
      \n" \ + "
      \n" \ + "
      \n" \ + " Home\n" \ + "
      \n" \ + " Qt Reference Documentation\n" \ + "
      \n" \ + "
      \n" \ + "
      \n" \ + "
      \n" \ + "
        \n" \ + "
      • Home
      • \n" \ + " \n" -HTML.postpostheader = "
      \n" \ - "
      \n" \ - "
      \n" \ - " \n" \ - "
      \n" \ - "
      \n" \ - "
      \n" +HTML.postpostheader = \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" -HTML.footer = "" \ - "
    \n" \ - " [+] Documentation Feedback
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "

    \n" \ - " © 2008-2010 Nokia Corporation and/or its\n" \ - " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ - " in Finland and/or other countries worldwide.

    \n" \ - "

    \n" \ - " All other trademarks are property of their respective owners. Privacy Policy

    \n" \ - "
    \n" \ - "

    \n" \ - " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ - " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ - " with the terms contained in a written agreement between you and Nokia.

    \n" \ - "

    \n" \ - " Alternatively, this document may be used under the terms of the GNU\n" \ - " Free Documentation License version 1.3\n" \ - " as published by the Free Software Foundation.

    \n" \ - "
    \n" \ - "
    \n" \ - "
    X
    \n" \ - "
    \n" \ - "

    Thank you for giving your feedback.

    Make sure it is related to this specific page. For more general bugs and \n" \ - " requests, please use the Qt Bug Tracker.

    \n" \ - "

    \n" \ - "

    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ No newline at end of file +HTML.footer = \ + "
    \n" \ + " \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "

    \n" \ + " © 2008-2010 Nokia Corporation and/or its\n" \ + " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ + " in Finland and/or other countries worldwide.

    \n" \ + "

    \n" \ + " All other trademarks are property of their respective owners. Privacy Policy

    \n" \ + "
    \n" \ + "

    \n" \ + " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ + " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ + " with the terms contained in a written agreement between you and Nokia.

    \n" \ + "

    \n" \ + " Alternatively, this document may be used under the terms of the GNU\n" \ + " Free Documentation License version 1.3\n" \ + " as published by the Free Software Foundation.

    \n" \ + "
    \n" \ diff --git a/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf b/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf new file mode 100644 index 0000000..fa15d90 --- /dev/null +++ b/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf @@ -0,0 +1,176 @@ +include(qt-html-online-styles.qdocconf) + +HTML.postheader = \ +"
    \n" \ + "
    \n" \ + "
    \n" \ + " Home
    \n" \ + " Qt Reference Documentation\n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " Search index:
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " API Lookup

    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " Qt Topics

    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " Examples

    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
      \n" \ + "
    • Home
    • \n" \ + " \n" + +HTML.postpostheader = \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" + +HTML.footer = \ + " \n" \ + "
    \n" \ + " [+] Documentation Feedback
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " © 2008-2010 Nokia Corporation and/or its\n" \ + " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ + " in Finland and/or other countries worldwide.

    \n" \ + "

    \n" \ + " All other trademarks are property of their respective owners. Privacy Policy

    \n" \ + "
    \n" \ + "

    \n" \ + " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ + " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ + " with the terms contained in a written agreement between you and Nokia.

    \n" \ + "

    \n" \ + " Alternatively, this document may be used under the terms of the GNU\n" \ + " Free Documentation License version 1.3\n" \ + " as published by the Free Software Foundation.

    \n" \ + "
    \n" \ + "
    \n" \ + "
    X
    \n" \ + "
    \n" \ + "

    \n" \ + "

    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" diff --git a/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf b/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf index da20766..18ed5c1 100644 --- a/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf +++ b/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf @@ -1,177 +1,63 @@ -HTML.stylesheets = style/style.css \ - style/OfflineStyle.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style_ie6.css - -HTML.postheader = "
    \n" \ - "
    \n" \ - "
    \n" \ - " Home
    \n" \ - " Qt Reference Documentation\n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " Search index:
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " API Lookup

    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " Qt Topics

    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " Examples

    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
      \n" \ - "
    • Home
    • \n" \ - " \n" +include(qt-html-default-styles.qdocconf) -HTML.postpostheader = "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" +HTML.postheader = \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
      \n" \ + "
    • Home
    • \n" \ + " \n" -HTML.footer = " \n" \ - "
      \n" \ - " [+] Documentation Feedback
      \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " © 2008-2010 Nokia Corporation and/or its\n" \ - " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ - " in Finland and/or other countries worldwide.

    \n" \ - "

    \n" \ - " All other trademarks are property of their respective owners. Privacy Policy

    \n" \ - "
    \n" \ - "

    \n" \ - " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ - " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ - " with the terms contained in a written agreement between you and Nokia.

    \n" \ - "

    \n" \ - " Alternatively, this document may be used under the terms of the GNU\n" \ - " Free Documentation License version 1.3\n" \ - " as published by the Free Software Foundation.

    \n" \ - "
    \n" \ - "
    \n" \ - "
    X
    \n" \ - "
    \n" \ - "

    \n" \ - "

    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" +HTML.postpostheader = \ + " \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" + +HTML.footer = \ + " \n" \ + "
    \n" \ + " [+] Documentation Feedback
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " © 2008-2010 Nokia Corporation and/or its\n" \ + " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ + " in Finland and/or other countries worldwide.

    \n" \ + "

    \n" \ + " All other trademarks are property of their respective owners. Privacy Policy

    \n" \ + "
    \n" \ + "

    \n" \ + " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ + " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ + " with the terms contained in a written agreement between you and Nokia.

    \n" \ + "

    \n" \ + " Alternatively, this document may be used under the terms of the GNU\n" \ + " Free Documentation License version 1.3\n" \ + " as published by the Free Software Foundation.

    \n" \ + "
    \n" \ + "
    \n" \ + "
    X
    \n" \ + "
    \n" \ + "

    \n" \ + "

    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" diff --git a/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf b/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf new file mode 100644 index 0000000..285ec27 --- /dev/null +++ b/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf @@ -0,0 +1,176 @@ +include(qt-html-online-styles.qdocconf) + +HTML.postheader = \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " Home
    \n" \ + " Qt Reference Documentation\n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " Search index:
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " API Lookup

    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " Qt Topics

    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " Examples

    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
      \n" \ + "
    • Home
    • \n" \ + " \n" + +HTML.postpostheader = \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" + +HTML.footer = \ + " \n" \ + "
    \n" \ + " [+] Documentation Feedback
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " © 2008-2010 Nokia Corporation and/or its\n" \ + " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ + " in Finland and/or other countries worldwide.

    \n" \ + "

    \n" \ + " All other trademarks are property of their respective owners. Privacy Policy

    \n" \ + "
    \n" \ + "

    \n" \ + " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ + " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ + " with the terms contained in a written agreement between you and Nokia.

    \n" \ + "

    \n" \ + " Alternatively, this document may be used under the terms of the GNU\n" \ + " Free Documentation License version 1.3\n" \ + " as published by the Free Software Foundation.

    \n" \ + "
    \n" \ + "
    \n" \ + "
    X
    \n" \ + "
    \n" \ + "

    \n" \ + "

    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" diff --git a/tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf b/tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf index 5c4bfa9..7773aa6 100644 --- a/tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf @@ -1,177 +1,176 @@ -HTML.stylesheets = style/style.css \ - style/OfflineStyle.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style_ie6.css +include(qt-html-default-styles.qdocconf) -HTML.postheader = "
    \n" \ - "
    \n" \ - "
    \n" \ - " Home
    \n" \ - " Qt Reference Documentation\n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " Search index:
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " API Lookup

    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " Qt Topics

    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " Examples

    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" -HTML.footer = " \n" \ - "
    \n" \ - " [+] Documentation Feedback
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - " \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "

    \n" \ - " © 2008-2010 Nokia Corporation and/or its\n" \ - " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ - " in Finland and/or other countries worldwide.

    \n" \ - "

    \n" \ - " All other trademarks are property of their respective owners. Privacy Policy

    \n" \ - "
    \n" \ - "

    \n" \ - " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ - " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ - " with the terms contained in a written agreement between you and Nokia.

    \n" \ - "

    \n" \ - " Alternatively, this document may be used under the terms of the GNU\n" \ - " Free Documentation License version 1.3\n" \ - " as published by the Free Software Foundation.

    \n" \ - "
    \n" \ - "
    \n" \ - "
    X
    \n" \ - "
    \n" \ - "

    \n" \ - "

    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" +HTML.footer = \ + " \n" \ + "
    \n" \ + " [+] Documentation Feedback
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + " \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "

    \n" \ + " © 2008-2010 Nokia Corporation and/or its\n" \ + " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ + " in Finland and/or other countries worldwide.

    \n" \ + "

    \n" \ + " All other trademarks are property of their respective owners. Privacy Policy

    \n" \ + "
    \n" \ + "

    \n" \ + " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ + " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ + " with the terms contained in a written agreement between you and Nokia.

    \n" \ + "

    \n" \ + " Alternatively, this document may be used under the terms of the GNU\n" \ + " Free Documentation License version 1.3\n" \ + " as published by the Free Software Foundation.

    \n" \ + "
    \n" \ + "
    \n" \ + "
    X
    \n" \ + "
    \n" \ + "

    \n" \ + "

    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" \ + "
    \n" diff --git a/tools/qdoc3/test/qt-project-api-only.qdocconf b/tools/qdoc3/test/qt-project-api-only.qdocconf new file mode 100644 index 0000000..4a91601 --- /dev/null +++ b/tools/qdoc3/test/qt-project-api-only.qdocconf @@ -0,0 +1,32 @@ +# Ensures that the generated index contains a URL that can be used by the +# tools documentation (assistant.qdocconf, designer.qdocconf, linguist.qdocconf, +# qmake.qdocconf). + +url = ./ + +# Ensures that the documentation for the tools is not included in the generated +# .qhp file. + +qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc \ + $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/taskmenuextension.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/containerextension.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/worldtimeclockbuilder.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/worldtimeclockplugin.qdoc \ + $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \ + $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc + +# Remove the QML documentation from the Qt-only documentation. + +excludedirs += $QT_SOURCE_TREE/src/imports + +outputdir = $QT_BUILD_TREE/doc-build/html-qt +tagfile = $QT_BUILD_TREE/doc-build/html-qt/qt.tags +base = file:$QT_BUILD_TREE/doc-build/html-qt diff --git a/tools/qdoc3/test/qt-project.qdocconf b/tools/qdoc3/test/qt-project.qdocconf new file mode 100644 index 0000000..7531b76 --- /dev/null +++ b/tools/qdoc3/test/qt-project.qdocconf @@ -0,0 +1,146 @@ +include(compat.qdocconf) +include(macros.qdocconf) +include(qt-cpp-ignore.qdocconf) +include(qt-defines.qdocconf) + +project = Qt +description = Qt Reference Documentation +url = http://qt.nokia.com/doc/4.7 + +sourceencoding = UTF-8 +outputencoding = UTF-8 +naturallanguage = en_US + +qhp.projects = Qt + +qhp.Qt.file = qt.qhp +qhp.Qt.namespace = com.trolltech.qt.471 +qhp.Qt.virtualFolder = qdoc +qhp.Qt.indexTitle = Qt Reference Documentation +qhp.Qt.indexRoot = + +# Files not referenced in any qdoc file (last four are needed by qtdemo) +# See also extraimages.HTML +qhp.Qt.extraFiles = index.html \ + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ul_blank.png \ + images/header_bg.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/arrow_down.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/narrow.css \ + style/superfish.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css + + + +qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.7.1 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 +qhp.Qt.subprojects = classes overviews examples +qhp.Qt.subprojects.classes.title = Classes +qhp.Qt.subprojects.classes.indexTitle = Qt's Classes +qhp.Qt.subprojects.classes.selectors = class fake:headerfile +qhp.Qt.subprojects.classes.sortPages = true +qhp.Qt.subprojects.overviews.title = Overviews +qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs +qhp.Qt.subprojects.overviews.selectors = fake:page,group,module +qhp.Qt.subprojects.examples.title = Tutorials and Examples +qhp.Qt.subprojects.examples.indexTitle = Qt Examples +qhp.Qt.subprojects.examples.selectors = fake:example + +language = Cpp + +headerdirs = $QT_SOURCE_TREE/src \ + $QT_SOURCE_TREE/extensions/activeqt \ + $QT_SOURCE_TREE/tools/assistant/lib \ + $QT_SOURCE_TREE/tools/assistant/compat/lib \ + $QT_SOURCE_TREE/tools/designer/src/uitools \ + $QT_SOURCE_TREE/tools/designer/src/lib/extension \ + $QT_SOURCE_TREE/tools/designer/src/lib/sdk \ + $QT_SOURCE_TREE/tools/designer/src/lib/uilib \ + $QT_SOURCE_TREE/tools/qtestlib/src \ + $QT_SOURCE_TREE/tools/qdbus/src +sourcedirs = $QT_SOURCE_TREE/src \ + $QT_SOURCE_TREE/doc/src \ + $QT_SOURCE_TREE/extensions/activeqt \ + $QT_SOURCE_TREE/tools/assistant/lib \ + $QT_SOURCE_TREE/tools/assistant/compat/lib \ + $QT_SOURCE_TREE/tools/designer/src/uitools \ + $QT_SOURCE_TREE/tools/designer/src/lib/extension \ + $QT_SOURCE_TREE/tools/designer/src/lib/sdk \ + $QT_SOURCE_TREE/tools/designer/src/lib/uilib \ + $QT_SOURCE_TREE/tools/qtestlib/src \ + $QT_SOURCE_TREE/tools/qdbus + +excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \ + $QT_SOURCE_TREE/src/3rdparty/des \ + $QT_SOURCE_TREE/src/3rdparty/freetype \ + $QT_SOURCE_TREE/src/3rdparty/harfbuzz \ + $QT_SOURCE_TREE/src/3rdparty/kdebase \ + $QT_SOURCE_TREE/src/3rdparty/libconninet \ + $QT_SOURCE_TREE/src/3rdparty/libjpeg \ + $QT_SOURCE_TREE/src/3rdparty/libmng \ + $QT_SOURCE_TREE/src/3rdparty/libpng \ + $QT_SOURCE_TREE/src/3rdparty/libtiff \ + $QT_SOURCE_TREE/src/3rdparty/md4 \ + $QT_SOURCE_TREE/src/3rdparty/md5 \ + $QT_SOURCE_TREE/src/3rdparty/patches \ + $QT_SOURCE_TREE/src/3rdparty/sha1 \ + $QT_SOURCE_TREE/src/3rdparty/sqlite \ + $QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore \ + $QT_SOURCE_TREE/src/3rdparty/webkit/WebCore \ + $QT_SOURCE_TREE/src/3rdparty/wintab \ + $QT_SOURCE_TREE/src/3rdparty/zlib \ + $QT_SOURCE_TREE/src/3rdparty/phonon/gstreamer \ + $QT_SOURCE_TREE/src/3rdparty/phonon/ds9 \ + $QT_SOURCE_TREE/src/3rdparty/phonon/qt7 \ + $QT_SOURCE_TREE/src/3rdparty/phonon/mmf \ + $QT_SOURCE_TREE/src/3rdparty/phonon/waveout \ + $QT_SOURCE_TREE/doc/src/snippets \ + $QT_SOURCE_TREE/doc/src/ja_JP \ + $QT_SOURCE_TREE/doc/src/zh_CN + +sources.fileextensions = "*.cpp *.qdoc *.mm" +examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml" +examples.imageextensions = "*.png" + +exampledirs = $QT_SOURCE_TREE/doc/src \ + $QT_SOURCE_TREE/examples \ + $QT_SOURCE_TREE/examples/tutorials \ + $QT_SOURCE_TREE \ + $QT_SOURCE_TREE/qmake/examples \ + $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs +imagedirs = $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/examples \ + $QT_SOURCE_TREE/doc/src/declarative/pics \ + $QT_SOURCE_TREE/doc/src/template/images +outputdir = $QT_BUILD_TREE/doc/html +tagfile = $QT_BUILD_TREE/doc/html/qt.tags +base = file:$QT_BUILD_TREE/doc/html + +HTML.generatemacrefs = "true" diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf deleted file mode 100644 index ea97205..0000000 --- a/tools/qdoc3/test/qt.qdocconf +++ /dev/null @@ -1,147 +0,0 @@ -include(compat.qdocconf) -include(macros.qdocconf) -include(qt-cpp-ignore.qdocconf) -include(qt-html-templates.qdocconf) -include(qt-defines.qdocconf) - -project = Qt -versionsym = -version = %VERSION% -description = Qt Reference Documentation -url = http://qt.nokia.com/doc/4.7 - -sourceencoding = UTF-8 -outputencoding = UTF-8 -naturallanguage = en_US - -qhp.projects = Qt - -qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.471 -qhp.Qt.virtualFolder = qdoc -qhp.Qt.indexTitle = Qt Reference Documentation -qhp.Qt.indexRoot = - -# Files not referenced in any qdoc file (last four are needed by qtdemo) -# See also extraimages.HTML -qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ul_blank.png \ - images/header_bg.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/arrow_down.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - scripts/narrow.js \ - scripts/superfish.js \ - style/narrow.css \ - style/superfish.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css - -qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.7.1 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 -qhp.Qt.subprojects = classes overviews examples -qhp.Qt.subprojects.classes.title = Classes -qhp.Qt.subprojects.classes.indexTitle = Qt's Classes -qhp.Qt.subprojects.classes.selectors = class fake:headerfile -qhp.Qt.subprojects.classes.sortPages = true -qhp.Qt.subprojects.overviews.title = Overviews -qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs -qhp.Qt.subprojects.overviews.selectors = fake:page,group,module -qhp.Qt.subprojects.examples.title = Tutorials and Examples -qhp.Qt.subprojects.examples.indexTitle = Qt Examples -qhp.Qt.subprojects.examples.selectors = fake:example - -language = Cpp - -headerdirs = $QTDIR/src \ - $QTDIR/extensions/activeqt \ - $QTDIR/tools/assistant/lib \ - $QTDIR/tools/assistant/compat/lib \ - $QTDIR/tools/designer/src/uitools \ - $QTDIR/tools/designer/src/lib/extension \ - $QTDIR/tools/designer/src/lib/sdk \ - $QTDIR/tools/designer/src/lib/uilib \ - $QTDIR/tools/qtestlib/src \ - $QTDIR/tools/qdbus/src -sourcedirs = $QTDIR/src \ - $QTDIR/doc/src \ - $QTDIR/extensions/activeqt \ - $QTDIR/tools/assistant/lib \ - $QTDIR/tools/assistant/compat/lib \ - $QTDIR/tools/designer/src/uitools \ - $QTDIR/tools/designer/src/lib/extension \ - $QTDIR/tools/designer/src/lib/sdk \ - $QTDIR/tools/designer/src/lib/uilib \ - $QTDIR/tools/qtestlib/src \ - $QTDIR/tools/qdbus - -excludedirs = $QTDIR/src/3rdparty/clucene \ - $QTDIR/src/3rdparty/des \ - $QTDIR/src/3rdparty/freetype \ - $QTDIR/src/3rdparty/harfbuzz \ - $QTDIR/src/3rdparty/kdebase \ - $QTDIR/src/3rdparty/libconninet \ - $QTDIR/src/3rdparty/libjpeg \ - $QTDIR/src/3rdparty/libmng \ - $QTDIR/src/3rdparty/libpng \ - $QTDIR/src/3rdparty/libtiff \ - $QTDIR/src/3rdparty/md4 \ - $QTDIR/src/3rdparty/md5 \ - $QTDIR/src/3rdparty/patches \ - $QTDIR/src/3rdparty/sha1 \ - $QTDIR/src/3rdparty/sqlite \ - $QTDIR/src/3rdparty/webkit/JavaScriptCore \ - $QTDIR/src/3rdparty/webkit/WebCore \ - $QTDIR/src/3rdparty/wintab \ - $QTDIR/src/3rdparty/zlib \ - $QTDIR/src/3rdparty/phonon/gstreamer \ - $QTDIR/src/3rdparty/phonon/ds9 \ - $QTDIR/src/3rdparty/phonon/qt7 \ - $QTDIR/src/3rdparty/phonon/mmf \ - $QTDIR/src/3rdparty/phonon/waveout \ - $QTDIR/doc/src/snippets \ - $QTDIR/doc/src/ja_JP \ - $QTDIR/doc/src/zh_CN - -sources.fileextensions = "*.cpp *.qdoc *.mm" -examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml" -examples.imageextensions = "*.png" - -exampledirs = $QTDIR/doc/src \ - $QTDIR/examples \ - $QTDIR/examples/tutorials \ - $QTDIR \ - $QTDIR/qmake/examples \ - $QTDIR/src/3rdparty/webkit/WebKit/qt/docs -imagedirs = $QTDIR/doc/src/images \ - $QTDIR/examples \ - $QTDIR/doc/src/declarative/pics \ - $QTDIR/doc/src/template/images -outputdir = $QTDIR/doc/html -tagfile = $QTDIR/doc/html/qt.tags -base = file:$QTDIR/doc/html - -HTML.generatemacrefs = "true" diff --git a/tools/qdoc3/test/qt_ja_JP.qdocconf b/tools/qdoc3/test/qt_ja_JP.qdocconf deleted file mode 100644 index 32bba06..0000000 --- a/tools/qdoc3/test/qt_ja_JP.qdocconf +++ /dev/null @@ -1,118 +0,0 @@ -include(compat.qdocconf) -include(macros.qdocconf) -include(qt-cpp-ignore.qdocconf) -include(qt-html-templates_ja_JP.qdocconf) -include(qt-defines.qdocconf) - -project = Qt -versionsym = -version = %VERSION% -description = Qt リファレンスドキュメント -url = http://qt.nokia.com/doc/ja_JP/4.7 - -sourceencoding = UTF-8 -outputencoding = UTF-8 -naturallanguage = ja - -indexes = $QTDIR/doc/html/qt.index - -qhp.projects = Qt - -qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.471 -qhp.Qt.virtualFolder = qdoc -qhp.Qt.title = Qt -qhp.Qt.indexTitle = Qt -qhp.Qt.selectors = fake:example - -qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc ja_JP -qhp.Qt.customFilters.Qt.name = Qt 4.7.1 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 - -# Files not referenced in any qdoc file (last four are needed by qtdemo) -# See also extraimages.HTML -qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ul_blank.png \ - images/header_bg.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/arrow_down.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - scripts/narrow.js \ - scripts/superfish.js \ - style/narrow.css \ - style/superfish.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css - -language = Cpp - -sourcedirs = $QTDIR/doc/src/ja_JP - -excludedirs = $QTDIR/src/3rdparty/clucene \ - $QTDIR/src/3rdparty/des \ - $QTDIR/src/3rdparty/freetype \ - $QTDIR/src/3rdparty/harfbuzz \ - $QTDIR/src/3rdparty/kdebase \ - $QTDIR/src/3rdparty/libjpeg \ - $QTDIR/src/3rdparty/libmng \ - $QTDIR/src/3rdparty/libpng \ - $QTDIR/src/3rdparty/libtiff \ - $QTDIR/src/3rdparty/md4 \ - $QTDIR/src/3rdparty/md5 \ - $QTDIR/src/3rdparty/patches \ - $QTDIR/src/3rdparty/sha1 \ - $QTDIR/src/3rdparty/sqlite \ - $QTDIR/src/3rdparty/webkit/JavaScriptCore \ - $QTDIR/src/3rdparty/webkit/WebCore \ - $QTDIR/src/3rdparty/wintab \ - $QTDIR/src/3rdparty/zlib \ - $QTDIR/doc/src/snippets \ - $QTDIR/doc/src/zh_CN \ - $QTDIR/src/3rdparty/phonon/gstreamer \ - $QTDIR/src/3rdparty/phonon/ds9 \ - $QTDIR/src/3rdparty/phonon/qt7 \ - $QTDIR/src/3rdparty/phonon/mmf \ - $QTDIR/src/3rdparty/phonon/waveout - -sources.fileextensions = "*.cpp *.qdoc *.mm" -examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp" -examples.imageextensions = "*.png" - -exampledirs = $QTDIR/doc/src \ - $QTDIR/examples/ja_JP \ - $QTDIR/examples \ - $QTDIR/examples/tutorials \ - $QTDIR \ - $QTDIR/qmake/examples \ - $QTDIR/src/3rdparty/webkit/WebKit/qt/docs -imagedirs = $QTDIR/doc/src/ja_JP/images \ - $QTDIR/doc/src/images \ - $QTDIR/examples \ - $QTDIR/doc/src/template/images -outputdir = $QTDIR/doc/html_ja_JP -tagfile = $QTDIR/doc/html_ja_JP/qt.tags -base = file:$QTDIR/doc/html_ja_JP - -HTML.generatemacrefs = "true" diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf deleted file mode 100644 index 40d3d5a..0000000 --- a/tools/qdoc3/test/qt_zh_CN.qdocconf +++ /dev/null @@ -1,116 +0,0 @@ -include(compat.qdocconf) -include(macros.qdocconf) -include(qt-cpp-ignore.qdocconf) -include(qt-html-templates_zh_CN.qdocconf) -include(qt-defines.qdocconf) - -project = Qt -versionsym = -version = %VERSION% -description = Qt Reference Documentation -url = http://qt.nokia.com/doc/zh_CN/4.7 - -sourceencoding = UTF-8 -outputencoding = UTF-8 -naturallanguage = zh-Hans - -indexes = $QTDIR/doc/html/qt.index - -qhp.projects = Qt - -qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.471 -qhp.Qt.virtualFolder = qdoc -qhp.Qt.title = 教程 -qhp.Qt.indexTitle = 教程 -qhp.Qt.selectors = fake:example - -qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc zh_CN -qhp.Qt.customFilters.Qt.name = Qt 4.7.1 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 - -# Files not referenced in any qdoc file (last four are needed by qtdemo) -# See also extraimages.HTML -qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ul_blank.png \ - images/header_bg.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/arrow_down.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - scripts/narrow.js \ - scripts/superfish.js \ - style/narrow.css \ - style/superfish.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css - -language = Cpp - -sourcedirs = $QTDIR/doc/src/zh_CN - -excludedirs = $QTDIR/src/3rdparty/clucene \ - $QTDIR/src/3rdparty/des \ - $QTDIR/src/3rdparty/freetype \ - $QTDIR/src/3rdparty/harfbuzz \ - $QTDIR/src/3rdparty/kdebase \ - $QTDIR/src/3rdparty/libjpeg \ - $QTDIR/src/3rdparty/libmng \ - $QTDIR/src/3rdparty/libpng \ - $QTDIR/src/3rdparty/libtiff \ - $QTDIR/src/3rdparty/md4 \ - $QTDIR/src/3rdparty/md5 \ - $QTDIR/src/3rdparty/patches \ - $QTDIR/src/3rdparty/sha1 \ - $QTDIR/src/3rdparty/sqlite \ - $QTDIR/src/3rdparty/webkit/JavaScriptCore \ - $QTDIR/src/3rdparty/webkit/WebCore \ - $QTDIR/src/3rdparty/wintab \ - $QTDIR/src/3rdparty/zlib \ - $QTDIR/doc/src/snippets \ - $QTDIR/doc/src/ja_JP \ - $QTDIR/src/3rdparty/phonon/gstreamer \ - $QTDIR/src/3rdparty/phonon/ds9 \ - $QTDIR/src/3rdparty/phonon/qt7 \ - $QTDIR/src/3rdparty/phonon/mmf \ - $QTDIR/src/3rdparty/phonon/waveout - -sources.fileextensions = "*.cpp *.qdoc *.mm" -examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp" -examples.imageextensions = "*.png" - -exampledirs = $QTDIR/doc/src \ - $QTDIR/examples \ - $QTDIR/examples/tutorials \ - $QTDIR \ - $QTDIR/qmake/examples \ - $QTDIR/src/3rdparty/webkit/WebKit/qt/docs -imagedirs = $QTDIR/doc/src/images \ - $QTDIR/examples \ - $QTDIR/doc/src/template/images -outputdir = $QTDIR/doc/html_zh_CN -tagfile = $QTDIR/doc/html_zh_CN/qt.tags -base = file:$QTDIR/doc/html_zh_CN - -HTML.generatemacrefs = "true" -- cgit v0.12 From af60542fc4214cc716ffb1bdc46e2e7f6b5a6b8a Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 12 Nov 2010 13:02:58 +1000 Subject: Add 'cached' property to Image element Setting cached to false is useful when dealing with large images, to make sure that they aren't cached at the expense of small 'ui element' images. Task-number: QTBUG-7300 Reviewed-by: Aaron Kennedy --- .../photoviewer/PhotoViewerCore/PhotoDelegate.qml | 4 +-- .../graphicsitems/qdeclarativeborderimage.cpp | 14 +++++++++-- .../graphicsitems/qdeclarativeimage.cpp | 9 +++++++ .../graphicsitems/qdeclarativeimagebase.cpp | 25 ++++++++++++++++++- .../graphicsitems/qdeclarativeimagebase_p.h | 5 ++++ .../graphicsitems/qdeclarativeimagebase_p_p.h | 4 ++- src/declarative/util/qdeclarativepixmapcache.cpp | 22 ++++++++-------- src/declarative/util/qdeclarativepixmapcache_p.h | 12 +++++++-- .../qdeclarativeimage/tst_qdeclarativeimage.cpp | 29 +++++++++++++++------- 9 files changed, 97 insertions(+), 27 deletions(-) diff --git a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml index 5948b5d..856a2c7 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml @@ -88,11 +88,11 @@ Package { } BusyIndicator { anchors.centerIn: parent; on: originalImage.status != Image.Ready } Image { - id: originalImage; smooth: true; source: "http://" + Script.getImagePath(content) + id: originalImage; smooth: true; source: "http://" + Script.getImagePath(content); cached: false fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height } Image { - id: hqImage; smooth: true; source: ""; visible: false + id: hqImage; smooth: true; source: ""; visible: false; cached: false fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height } Binding { diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index 649c8fb..4e35f87 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -290,7 +290,12 @@ void QDeclarativeBorderImage::load() } } else { - d->pix.load(qmlEngine(this), d->url, d->async); + QDeclarativePixmap::Options options; + if (d->async) + options |= QDeclarativePixmap::Asynchronous; + if (d->cached) + options |= QDeclarativePixmap::Cached; + d->pix.load(qmlEngine(this), d->url, options); if (d->pix.isLoading()) { d->pix.connectFinished(this, SLOT(requestFinished())); @@ -413,7 +418,12 @@ void QDeclarativeBorderImage::setGridScaledImage(const QDeclarativeGridScaledIma d->sciurl = d->url.resolved(QUrl(sci.pixmapUrl())); - d->pix.load(qmlEngine(this), d->sciurl, d->async); + QDeclarativePixmap::Options options; + if (d->async) + options |= QDeclarativePixmap::Asynchronous; + if (d->cached) + options |= QDeclarativePixmap::Cached; + d->pix.load(qmlEngine(this), d->sciurl, options); if (d->pix.isLoading()) { static int thisRequestProgress = -1; diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index 3b08a9b..c9eb258 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -458,6 +458,15 @@ QRectF QDeclarativeImage::boundingRect() const are always loaded asynchonously. */ +/*! + \qmlproperty bool Image::cached + \since Quick 1.1 + + Specifies that the image should be cached. The default value is + true. Setting \a cached to false is useful when dealing with large images, + to make sure that they aren't cached at the expense of small 'ui element' images. +*/ + void QDeclarativeImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) { Q_D(QDeclarativeImage); diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp index c3bac2d..37b0734 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp @@ -128,6 +128,24 @@ QSize QDeclarativeImageBase::sourceSize() const return QSize(width != -1 ? width : implicitWidth(), height != -1 ? height : implicitHeight()); } +bool QDeclarativeImageBase::cached() const +{ + Q_D(const QDeclarativeImageBase); + return d->cached; +} + +void QDeclarativeImageBase::setCached(bool cached) +{ + Q_D(QDeclarativeImageBase); + if (d->cached == cached) + return; + + d->cached = cached; + emit cachedChanged(); + if (isComponentComplete()) + load(); +} + void QDeclarativeImageBase::load() { Q_D(QDeclarativeImageBase); @@ -143,7 +161,12 @@ void QDeclarativeImageBase::load() pixmapChange(); update(); } else { - d->pix.load(qmlEngine(this), d->url, d->explicitSourceSize ? sourceSize() : QSize(), d->async); + QDeclarativePixmap::Options options; + if (d->async) + options |= QDeclarativePixmap::Asynchronous; + if (d->cached) + options |= QDeclarativePixmap::Cached; + d->pix.load(qmlEngine(this), d->url, d->explicitSourceSize ? sourceSize() : QSize(), options); if (d->pix.isLoading()) { d->progress = 0.0; diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h index 68eb8d0..d25f7c3 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h +++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h @@ -58,6 +58,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeImageBase : public QDeclarativeItem Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged) + Q_PROPERTY(bool cached READ cached WRITE setCached NOTIFY cachedChanged) // ### VERSIONING: Only in QtQuick 1.1 Q_PROPERTY(QSize sourceSize READ sourceSize WRITE setSourceSize NOTIFY sourceSizeChanged) public: @@ -72,6 +73,9 @@ public: bool asynchronous() const; void setAsynchronous(bool); + bool cached() const; + void setCached(bool); + virtual void setSourceSize(const QSize&); QSize sourceSize() const; @@ -81,6 +85,7 @@ Q_SIGNALS: void statusChanged(QDeclarativeImageBase::Status); void progressChanged(qreal progress); void asynchronousChanged(); + void cachedChanged(); protected: virtual void load(); diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h index 3d23ba9..a539649 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h @@ -70,7 +70,8 @@ public: : status(QDeclarativeImageBase::Null), progress(0.0), explicitSourceSize(false), - async(false) + async(false), + cached(true) { QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents; } @@ -82,6 +83,7 @@ public: QSize sourcesize; bool explicitSourceSize : 1; bool async : 1; + bool cached : 1; }; QT_END_NAMESPACE diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index a07b1bb..5ef568f 100644 --- a/src/declarative/util/qdeclarativepixmapcache.cpp +++ b/src/declarative/util/qdeclarativepixmapcache.cpp @@ -959,20 +959,20 @@ QRect QDeclarativePixmap::rect() const void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url) { - load(engine, url, QSize(), false); + load(engine, url, QSize(), QDeclarativePixmap::Cached); } -void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, bool async) +void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, QDeclarativePixmap::Options options) { - load(engine, url, QSize(), async); + load(engine, url, QSize(), options); } void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QSize &size) { - load(engine, url, size, false); + load(engine, url, size, QDeclarativePixmap::Cached); } -void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QSize &requestSize, bool async) +void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QSize &requestSize, QDeclarativePixmap::Options options) { if (d) { d->release(); d = 0; } @@ -982,19 +982,20 @@ void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QHash::Iterator iter = store->m_cache.find(key); if (iter == store->m_cache.end()) { - if (async) { + if (options & QDeclarativePixmap::Asynchronous) { // pixmaps can only be loaded synchronously if (url.scheme() == QLatin1String("image") && QDeclarativeEnginePrivate::get(engine)->getImageProviderType(url) == QDeclarativeImageProvider::Pixmap) { - async = false; + options &= ~QDeclarativePixmap::Asynchronous; } } - if (!async) { + if (!(options & QDeclarativePixmap::Asynchronous)) { bool ok = false; d = createPixmapDataSync(engine, url, requestSize, &ok); if (ok) { - d->addToCache(); + if (options & QDeclarativePixmap::Cached) + d->addToCache(); return; } if (d) // loadable, but encountered error while loading @@ -1007,7 +1008,8 @@ void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QDeclarativePixmapReader *reader = QDeclarativePixmapReader::instance(engine); d = new QDeclarativePixmapData(url, requestSize); - d->addToCache(); + if (options & QDeclarativePixmap::Cached) + d->addToCache(); d->reply = reader->getImage(d); } else { diff --git a/src/declarative/util/qdeclarativepixmapcache_p.h b/src/declarative/util/qdeclarativepixmapcache_p.h index 2e83cc4..9e1016f 100644 --- a/src/declarative/util/qdeclarativepixmapcache_p.h +++ b/src/declarative/util/qdeclarativepixmapcache_p.h @@ -66,6 +66,12 @@ public: enum Status { Null, Ready, Error, Loading }; + enum Option { + Asynchronous = 0x00000001, + Cached = 0x00000002 + }; + Q_DECLARE_FLAGS(Options, Option) + bool isNull() const; bool isReady() const; bool isError() const; @@ -85,9 +91,9 @@ public: inline operator const QPixmap &() const; void load(QDeclarativeEngine *, const QUrl &); - void load(QDeclarativeEngine *, const QUrl &, bool); + void load(QDeclarativeEngine *, const QUrl &, QDeclarativePixmap::Options options); void load(QDeclarativeEngine *, const QUrl &, const QSize &); - void load(QDeclarativeEngine *, const QUrl &, const QSize &, bool); + void load(QDeclarativeEngine *, const QUrl &, const QSize &, QDeclarativePixmap::Options options); void clear(); void clear(QObject *); @@ -107,6 +113,8 @@ inline QDeclarativePixmap::operator const QPixmap &() const return pixmap(); } +Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePixmap::Options) + QT_END_NAMESPACE QT_END_HEADER diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index bf779ad..3cee976 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -123,19 +123,21 @@ void tst_qdeclarativeimage::imageSource_data() QTest::addColumn("height"); QTest::addColumn("remote"); QTest::addColumn("async"); + QTest::addColumn("cached"); QTest::addColumn("error"); - QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << 120.0 << 120.0 << false << false << ""; - QTest::newRow("local async") << QUrl::fromLocalFile(SRCDIR "/data/colors1.png").toString() << 120.0 << 120.0 << false << true << ""; + QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << 120.0 << 120.0 << false << false << true << ""; + QTest::newRow("local no cache") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << 120.0 << 120.0 << false << false << false << ""; + QTest::newRow("local async") << QUrl::fromLocalFile(SRCDIR "/data/colors1.png").toString() << 120.0 << 120.0 << false << true << true << ""; QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() << 0.0 << 0.0 << false - << false << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString(); + << false << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString(); QTest::newRow("local async not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString() << 0.0 << 0.0 << false - << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString(); - QTest::newRow("remote") << SERVER_ADDR "/colors.png" << 120.0 << 120.0 << true << false << ""; - QTest::newRow("remote redirected") << SERVER_ADDR "/oldcolors.png" << 120.0 << 120.0 << true << false << ""; - QTest::newRow("remote svg") << SERVER_ADDR "/heart.svg" << 550.0 << 500.0 << true << false << ""; + << true << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString(); + QTest::newRow("remote") << SERVER_ADDR "/colors.png" << 120.0 << 120.0 << true << false << true << ""; + QTest::newRow("remote redirected") << SERVER_ADDR "/oldcolors.png" << 120.0 << 120.0 << true << false << false << ""; + QTest::newRow("remote svg") << SERVER_ADDR "/heart.svg" << 550.0 << 500.0 << true << false << false << ""; QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << 0.0 << 0.0 << true - << false << "file::2:1: QML Image: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; + << false << true << "file::2:1: QML Image: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; } @@ -146,6 +148,7 @@ void tst_qdeclarativeimage::imageSource() QFETCH(double, height); QFETCH(bool, remote); QFETCH(bool, async); + QFETCH(bool, cached); QFETCH(QString, error); TestHTTPServer server(SERVER_PORT); @@ -159,7 +162,8 @@ void tst_qdeclarativeimage::imageSource() QTest::ignoreMessage(QtWarningMsg, error.toUtf8()); QString componentStr = "import QtQuick 1.0\nImage { source: \"" + source + "\"; asynchronous: " - + (async ? QLatin1String("true") : QLatin1String("false")) + " }"; + + (async ? QLatin1String("true") : QLatin1String("false")) + "; cached: " + + (cached ? QLatin1String("true") : QLatin1String("false")) + " }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativeImage *obj = qobject_cast(component.create()); @@ -167,6 +171,13 @@ void tst_qdeclarativeimage::imageSource() if (async) QVERIFY(obj->asynchronous() == true); + else + QVERIFY(obj->asynchronous() == false); + + if (cached) + QVERIFY(obj->cached() == true); + else + QVERIFY(obj->cached() == false); if (remote || async) QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading); -- cgit v0.12 From f809dc1b16d6a56c1a2d57997748bddb313f7f4c Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 12 Nov 2010 13:44:06 +1000 Subject: Small optimization of enum detection in script. Reviewed-by: Martin Jones --- src/declarative/qml/qdeclarativetypenamescriptclass.cpp | 5 ++--- src/script/bridge/qscriptdeclarativeclass.cpp | 8 ++++++++ src/script/bridge/qscriptdeclarativeclass_p.h | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp index cba7b4a..e93aae2 100644 --- a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp +++ b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp @@ -109,9 +109,8 @@ QDeclarativeTypeNameScriptClass::queryProperty(Object *obj, const Identifier &na } else if (data->type) { - QString strName = toString(name); - - if (strName.at(0).isUpper()) { + if (startsWithUpper(name)) { + QString strName = toString(name); // Must be an enum if (data->mode == IncludeEnums) { // ### Optimize diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp index 8080b9f..92248a0 100644 --- a/src/script/bridge/qscriptdeclarativeclass.cpp +++ b/src/script/bridge/qscriptdeclarativeclass.cpp @@ -468,6 +468,14 @@ QString QScriptDeclarativeClass::toString(const Identifier &identifier) return QString((QChar *)r->data(), r->size()); } +bool QScriptDeclarativeClass::startsWithUpper(const Identifier &identifier) +{ + JSC::UString::Rep *r = (JSC::UString::Rep *)identifier; + if (r->size() < 1) + return false; + return QChar::category(r->data()[0]) == QChar::Letter_Uppercase; +} + quint32 QScriptDeclarativeClass::toArrayIndex(const Identifier &identifier, bool *ok) { JSC::UString::Rep *r = (JSC::UString::Rep *)identifier; diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h index 420b133..fe38eeb 100644 --- a/src/script/bridge/qscriptdeclarativeclass_p.h +++ b/src/script/bridge/qscriptdeclarativeclass_p.h @@ -126,6 +126,7 @@ public: PersistentIdentifier createPersistentIdentifier(const Identifier &); QString toString(const Identifier &); + bool startsWithUpper(const Identifier &); quint32 toArrayIndex(const Identifier &, bool *ok); virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, -- cgit v0.12 From f2cd51abd592a4da45892e42f0d38803e7c1620e Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 16 Nov 2010 10:15:05 +1000 Subject: Treat easing.type: Easing.InOutQuad as a literal assignment, not binding This was already being done for most enum assignments, but wasn't being done for value types. This patch extends the optimization for enums in a value type. Reviewed-by: Martin Jones --- src/declarative/qml/qdeclarativecompiler.cpp | 34 ++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index b2740b8..b371f52 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -1836,14 +1836,22 @@ bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type, COMPILE_EXCEPTION(prop, tr("Unexpected object assignment")); } else if (value->value.isScript()) { // ### Check for writability - BindingReference reference; - reference.expression = value->value; - reference.property = prop; - reference.value = value; - reference.bindingContext = ctxt; - reference.bindingContext.owner++; - addBindingReference(reference); - value->type = Value::PropertyBinding; + + //optimization for . enum assignments + bool isEnumAssignment = false; + COMPILE_CHECK(testQualifiedEnumAssignment(p, obj, value, &isEnumAssignment)); + if (isEnumAssignment) { + value->type = Value::Literal; + } else { + BindingReference reference; + reference.expression = value->value; + reference.property = prop; + reference.value = value; + reference.bindingContext = ctxt; + reference.bindingContext.owner++; + addBindingReference(reference); + value->type = Value::PropertyBinding; + } } else { COMPILE_CHECK(testLiteralAssignment(p, value)); value->type = Value::Literal; @@ -2138,7 +2146,15 @@ bool QDeclarativeCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop QDeclarativeType *type = 0; unit->imports().resolveType(typeName.toUtf8(), &type, 0, 0, 0, 0); - if (!type || obj->typeName != type->qmlTypeName()) + //handle enums on value types (where obj->typeName is empty) + QByteArray objTypeName = obj->typeName; + if (objTypeName.isEmpty()) { + QDeclarativeType *objType = toQmlType(obj); + if (objType) + objTypeName = objType->qmlTypeName(); + } + + if (!type || objTypeName != type->qmlTypeName()) return true; QString enumValue = parts.at(1); -- cgit v0.12 From 463786121871c7b0934949f4fcb8ef8b4d64712f Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 16 Nov 2010 15:44:11 +1000 Subject: Optimize string->color conversion in QML. Reviewed-by: Martin Jones --- src/declarative/qml/qdeclarativestringconverters.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/qdeclarativestringconverters.cpp b/src/declarative/qml/qdeclarativestringconverters.cpp index 7534a2c..55fae87 100644 --- a/src/declarative/qml/qdeclarativestringconverters.cpp +++ b/src/declarative/qml/qdeclarativestringconverters.cpp @@ -136,7 +136,7 @@ QVariant QDeclarativeStringConverters::variantFromString(const QString &s, int p QColor QDeclarativeStringConverters::colorFromString(const QString &s, bool *ok) { - if (s.startsWith(QLatin1Char('#')) && s.length() == 9) { + if (s.length() == 9 && s.startsWith(QLatin1Char('#'))) { uchar a = fromHex(s, 1); uchar r = fromHex(s, 3); uchar g = fromHex(s, 5); @@ -144,9 +144,7 @@ QColor QDeclarativeStringConverters::colorFromString(const QString &s, bool *ok) if (ok) *ok = true; return QColor(r, g, b, a); } else { - QColor rv; - if (s.startsWith(QLatin1Char('#')) || QColor::colorNames().contains(s.toLower())) - rv = QColor(s); + QColor rv(s); if (ok) *ok = rv.isValid(); return rv; } -- cgit v0.12 From e8e28735046d419463e235a58a7c4c88d04163db Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 16 Nov 2010 15:46:39 +1000 Subject: Optimize test for sharable bindings. Reviewed-by: Martin Jones --- src/declarative/qml/qdeclarativecompiler.cpp | 7 ++----- src/declarative/qml/qdeclarativerewrite.cpp | 13 +++++++++++-- src/declarative/qml/qdeclarativerewrite_p.h | 3 ++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index b371f52..3e63bb1 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -2800,13 +2800,10 @@ bool QDeclarativeCompiler::completeComponentBuild() // Pre-rewrite the expression QString expression = binding.expression.asScript(); - // ### Optimize - QDeclarativeRewrite::SharedBindingTester sharableTest; - bool isSharable = sharableTest.isSharable(expression); - QDeclarativeRewrite::RewriteBinding rewriteBinding; rewriteBinding.setName('$'+binding.property->name); - expression = rewriteBinding(expression); + bool isSharable = false; + expression = rewriteBinding(expression,0,&isSharable); quint32 length = expression.length(); quint32 pc; diff --git a/src/declarative/qml/qdeclarativerewrite.cpp b/src/declarative/qml/qdeclarativerewrite.cpp index bc9a114..80b9ab2 100644 --- a/src/declarative/qml/qdeclarativerewrite.cpp +++ b/src/declarative/qml/qdeclarativerewrite.cpp @@ -62,12 +62,17 @@ bool SharedBindingTester::isSharable(const QString &code) if (!parser.statement()) return false; + return isSharable(parser.statement()); +} + +bool SharedBindingTester::isSharable(AST::Statement *statement) +{ _sharable = true; - AST::Node::acceptChild(parser.statement(), this); + AST::Node::acceptChild(statement, this); return _sharable; } -QString RewriteBinding::operator()(const QString &code, bool *ok) +QString RewriteBinding::operator()(const QString &code, bool *ok, bool *sharable) { Engine engine; NodePool pool(QString(), &engine); @@ -80,6 +85,10 @@ QString RewriteBinding::operator()(const QString &code, bool *ok) return QString(); } else { if (ok) *ok = true; + if (sharable) { + SharedBindingTester tester; + *sharable = tester.isSharable(parser.statement()); + } } return rewrite(code, 0, parser.statement()); } diff --git a/src/declarative/qml/qdeclarativerewrite_p.h b/src/declarative/qml/qdeclarativerewrite_p.h index 6f3c46e..40c8321 100644 --- a/src/declarative/qml/qdeclarativerewrite_p.h +++ b/src/declarative/qml/qdeclarativerewrite_p.h @@ -68,6 +68,7 @@ class SharedBindingTester : protected AST::Visitor bool _sharable; public: bool isSharable(const QString &code); + bool isSharable(AST::Statement *statement); virtual bool visit(AST::FunctionDeclaration *) { _sharable = false; return false; } virtual bool visit(AST::FunctionExpression *) { _sharable = false; return false; } @@ -81,7 +82,7 @@ class RewriteBinding: protected AST::Visitor QByteArray _name; public: - QString operator()(const QString &code, bool *ok = 0); + QString operator()(const QString &code, bool *ok = 0, bool *sharable = 0); //name of the function: used for the debugger void setName(const QByteArray &name) { _name = name; } -- cgit v0.12 From 8657a92378ebf878c394944956af38905decbd0a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 18 Nov 2010 19:26:01 +0100 Subject: Moved style-specific declarations. Removed script declarations. --- tools/qdoc3/test/qt-html-default-styles.qdocconf | 7 ++-- tools/qdoc3/test/qt-html-templates-online.qdocconf | 38 +++++++++++++++++++++ tools/qdoc3/test/qt-html-templates.qdocconf | 29 ++++++++++++++++ tools/qdoc3/test/qt-project.qdocconf | 39 ---------------------- 4 files changed, 70 insertions(+), 43 deletions(-) diff --git a/tools/qdoc3/test/qt-html-default-styles.qdocconf b/tools/qdoc3/test/qt-html-default-styles.qdocconf index 103f1e0..30c28cb 100644 --- a/tools/qdoc3/test/qt-html-default-styles.qdocconf +++ b/tools/qdoc3/test/qt-html-default-styles.qdocconf @@ -4,11 +4,10 @@ HTML.templatedir = $QT_SOURCE_TREE/doc/src/template -HTML.stylesheets = style/style.css - -HTML.scripts = scripts/functions.js \ - scripts/narrow.js \ +HTML.stylesheets = style/style.css \ + style/narrow.css +HTML.scripts = # Files not referenced in any qdoc file (last four needed by qtdemo) # See also qhp.Qt.extraFiles diff --git a/tools/qdoc3/test/qt-html-templates-online.qdocconf b/tools/qdoc3/test/qt-html-templates-online.qdocconf index 64f99ad..7ed8c90 100644 --- a/tools/qdoc3/test/qt-html-templates-online.qdocconf +++ b/tools/qdoc3/test/qt-html-templates-online.qdocconf @@ -196,3 +196,41 @@ HTML.footer = \ " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n" \ " })();\n" \ " \n" + + +# Files not referenced in any qdoc file (last four are needed by qtdemo) +# See also extraimages.HTML +qhp.Qt.extraFiles = index.html \ + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ul_blank.png \ + images/header_bg.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/arrow_down.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/narrow.css \ + style/superfish.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 5a2058a..bbd1b21 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -46,3 +46,32 @@ HTML.footer = \ " Free Documentation License version 1.3\n" \ " as published by the Free Software Foundation.

    \n" \ "
    \n" \ + +# Files not referenced in any qdoc file (last four are needed by qtdemo) +# See also extraimages.HTML +qhp.Qt.extraFiles = index.html \ + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ul_blank.png \ + images/header_bg.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/arrow_down.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + style/narrow.css \ + style/style.css diff --git a/tools/qdoc3/test/qt-project.qdocconf b/tools/qdoc3/test/qt-project.qdocconf index 7531b76..be2a227 100644 --- a/tools/qdoc3/test/qt-project.qdocconf +++ b/tools/qdoc3/test/qt-project.qdocconf @@ -19,45 +19,6 @@ qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = -# Files not referenced in any qdoc file (last four are needed by qtdemo) -# See also extraimages.HTML -qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ul_blank.png \ - images/header_bg.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/arrow_down.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - scripts/narrow.js \ - scripts/superfish.js \ - style/narrow.css \ - style/superfish.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css - - - qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc qhp.Qt.customFilters.Qt.name = Qt 4.7.1 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 -- cgit v0.12 From 03c671e557a59a2c908cb8241c7ad5c31536841d Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 18 Nov 2010 14:26:33 +1000 Subject: Optimize binding rewrites. Use the existing AST rather than recreating it. Task-number: QTBUG-15331 Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarativecompiler.cpp | 2 +- src/declarative/qml/qdeclarativerewrite.cpp | 53 ++++++++++++++++++++++++++-- src/declarative/qml/qdeclarativerewrite_p.h | 3 +- 3 files changed, 54 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 3e63bb1..d590d11 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -2803,7 +2803,7 @@ bool QDeclarativeCompiler::completeComponentBuild() QDeclarativeRewrite::RewriteBinding rewriteBinding; rewriteBinding.setName('$'+binding.property->name); bool isSharable = false; - expression = rewriteBinding(expression,0,&isSharable); + expression = rewriteBinding(binding.expression.asAST(), expression, &isSharable); quint32 length = expression.length(); quint32 pc; diff --git a/src/declarative/qml/qdeclarativerewrite.cpp b/src/declarative/qml/qdeclarativerewrite.cpp index 80b9ab2..219674f 100644 --- a/src/declarative/qml/qdeclarativerewrite.cpp +++ b/src/declarative/qml/qdeclarativerewrite.cpp @@ -65,10 +65,10 @@ bool SharedBindingTester::isSharable(const QString &code) return isSharable(parser.statement()); } -bool SharedBindingTester::isSharable(AST::Statement *statement) +bool SharedBindingTester::isSharable(AST::Node *node) { _sharable = true; - AST::Node::acceptChild(statement, this); + AST::Node::acceptChild(node, this); return _sharable; } @@ -93,6 +93,55 @@ QString RewriteBinding::operator()(const QString &code, bool *ok, bool *sharable return rewrite(code, 0, parser.statement()); } +QString RewriteBinding::operator()(QDeclarativeJS::AST::Node *node, const QString &code, bool *sharable) +{ + if (!node) + return code; + + if (sharable) { + SharedBindingTester tester; + *sharable = tester.isSharable(node); + } + + QDeclarativeJS::AST::ExpressionNode *expression = node->expressionCast(); + QDeclarativeJS::AST::Statement *statement = node->statementCast(); + if(!expression && !statement) + return code; + + TextWriter w; + _writer = &w; + _position = expression ? expression->firstSourceLocation().begin() : statement->firstSourceLocation().begin(); + _inLoop = 0; + + accept(node); + + unsigned startOfStatement = 0; + unsigned endOfStatement = (expression ? expression->lastSourceLocation().end() : statement->lastSourceLocation().end()) - _position; + + QString startString = QLatin1String("(function ") + QString::fromUtf8(_name) + QLatin1String("() { "); + if (expression) + startString += QLatin1String("return "); + _writer->replace(startOfStatement, 0, startString); + _writer->replace(endOfStatement, 0, QLatin1String(" })")); + + if (rewriteDump()) { + qWarning() << "============================================================="; + qWarning() << "Rewrote:"; + qWarning() << qPrintable(code); + } + + QString codeCopy = code; + w.write(&codeCopy); + + if (rewriteDump()) { + qWarning() << "To:"; + qWarning() << qPrintable(code); + qWarning() << "============================================================="; + } + + return codeCopy; +} + void RewriteBinding::accept(AST::Node *node) { AST::Node::acceptChild(node, this); diff --git a/src/declarative/qml/qdeclarativerewrite_p.h b/src/declarative/qml/qdeclarativerewrite_p.h index 40c8321..310ef3c 100644 --- a/src/declarative/qml/qdeclarativerewrite_p.h +++ b/src/declarative/qml/qdeclarativerewrite_p.h @@ -68,7 +68,7 @@ class SharedBindingTester : protected AST::Visitor bool _sharable; public: bool isSharable(const QString &code); - bool isSharable(AST::Statement *statement); + bool isSharable(AST::Node *Node); virtual bool visit(AST::FunctionDeclaration *) { _sharable = false; return false; } virtual bool visit(AST::FunctionExpression *) { _sharable = false; return false; } @@ -83,6 +83,7 @@ class RewriteBinding: protected AST::Visitor public: QString operator()(const QString &code, bool *ok = 0, bool *sharable = 0); + QString operator()(QDeclarativeJS::AST::Node *node, const QString &code, bool *sharable = 0); //name of the function: used for the debugger void setName(const QByteArray &name) { _name = name; } -- cgit v0.12 From 3d100ab29820b4dcf14afbcadb05d0bf40fdacbc Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 29 Oct 2010 15:44:21 +1000 Subject: Add a private high-performance timer for profiling. --- src/declarative/qml/qml.pri | 9 +- src/declarative/qml/qperformancetimer.cpp | 226 +++++++++++++++++++++ src/declarative/qml/qperformancetimer_p.h | 79 +++++++ .../qperformancetimer/qperformancetimer.pro | 7 + .../qperformancetimer/tst_qperformancetimer.cpp | 68 +++++++ .../qperformancetimer/qperformancetimer.pro | 8 + .../qperformancetimer/tst_qperformancetimer.cpp | 89 ++++++++ 7 files changed, 484 insertions(+), 2 deletions(-) create mode 100644 src/declarative/qml/qperformancetimer.cpp create mode 100644 src/declarative/qml/qperformancetimer_p.h create mode 100644 tests/auto/declarative/qperformancetimer/qperformancetimer.pro create mode 100644 tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp create mode 100644 tests/benchmarks/declarative/qperformancetimer/qperformancetimer.pro create mode 100644 tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index 66b69f9..bf9e54a 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -55,7 +55,8 @@ SOURCES += \ $$PWD/qdeclarativedirparser.cpp \ $$PWD/qdeclarativeextensionplugin.cpp \ $$PWD/qdeclarativeimport.cpp \ - $$PWD/qdeclarativelist.cpp + $$PWD/qdeclarativelist.cpp \ + $$PWD/qperformancetimer.cpp HEADERS += \ $$PWD/qdeclarativeparser_p.h \ @@ -129,8 +130,12 @@ HEADERS += \ $$PWD/qdeclarativedirparser_p.h \ $$PWD/qdeclarativeextensioninterface.h \ $$PWD/qdeclarativeimport_p.h \ - $$PWD/qdeclarativeextensionplugin.h + $$PWD/qdeclarativeextensionplugin.h \ + $$PWD/qperformancetimer_p.h QT += sql include(parser/parser.pri) include(rewriter/rewriter.pri) + +# mirrors logic in corelib/kernel/kernel.pri +unix:!symbian: contains(QT_CONFIG, clock-gettime):include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri) diff --git a/src/declarative/qml/qperformancetimer.cpp b/src/declarative/qml/qperformancetimer.cpp new file mode 100644 index 0000000..1d7ca80 --- /dev/null +++ b/src/declarative/qml/qperformancetimer.cpp @@ -0,0 +1,226 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qperformancetimer_p.h" + +#if defined(Q_OS_MAC) +#include +#include +#include +#elif defined(Q_OS_UNIX) +#include +#include +#include +#elif defined(Q_OS_SYMBIAN) +#include +#include +#include +#elif defined(Q_OS_WIN) +#include +#endif + +// mac/unix code heavily copied from QElapsedTimer + +QT_BEGIN_NAMESPACE + +////////////////////////////// Mac ////////////////////////////// +#if defined(Q_OS_MAC) + +static mach_timebase_info_data_t info = {0,0}; +static qint64 absoluteToNSecs(qint64 cpuTime) +{ + if (info.denom == 0) + mach_timebase_info(&info); + qint64 nsecs = cpuTime * info.numer / info.denom; + return nsecs; +} + +void QPerformanceTimer::start() +{ + t1 = mach_absolute_time(); +} + +qint64 QPerformanceTimer::elapsed() const +{ + uint64_t cpu_time = mach_absolute_time(); + return absoluteToNSecs(cpu_time - t1); +} + +////////////////////////////// Unix ////////////////////////////// +#elif defined(Q_OS_UNIX) + +#if defined(QT_NO_CLOCK_MONOTONIC) || defined(QT_BOOTSTRAPPED) +// turn off the monotonic clock +# ifdef _POSIX_MONOTONIC_CLOCK +# undef _POSIX_MONOTONIC_CLOCK +# endif +# define _POSIX_MONOTONIC_CLOCK -1 +#endif + +#if (_POSIX_MONOTONIC_CLOCK-0 != 0) +static const bool monotonicClockChecked = true; +static const bool monotonicClockAvailable = _POSIX_MONOTONIC_CLOCK > 0; +#else +static int monotonicClockChecked = false; +static int monotonicClockAvailable = false; +#endif + +#ifdef Q_CC_GNU +# define is_likely(x) __builtin_expect((x), 1) +#else +# define is_likely(x) (x) +#endif +#define load_acquire(x) ((volatile const int&)(x)) +#define store_release(x,v) ((volatile int&)(x) = (v)) + +static void unixCheckClockType() +{ +#if (_POSIX_MONOTONIC_CLOCK-0 == 0) + if (is_likely(load_acquire(monotonicClockChecked))) + return; + +# if defined(_SC_MONOTONIC_CLOCK) + // detect if the system support monotonic timers + long x = sysconf(_SC_MONOTONIC_CLOCK); + store_release(monotonicClockAvailable, x >= 200112L); +# endif + + store_release(monotonicClockChecked, true); +#endif +} + +static inline void do_gettime(qint64 *sec, qint64 *frac) +{ +#if (_POSIX_MONOTONIC_CLOCK-0 >= 0) + unixCheckClockType(); + if (is_likely(monotonicClockAvailable)) { + timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + *sec = ts.tv_sec; + *frac = ts.tv_nsec; + return; + } +#endif + *sec = 0; + *frac = 0; +} + +void QPerformanceTimer::start() +{ + do_gettime(&t1, &t2); +} + +qint64 QPerformanceTimer::elapsed() const +{ + qint64 sec, frac; + do_gettime(&sec, &frac); + sec = sec - t1; + frac = frac - t2; + + return sec * Q_INT64_C(1000000000) + frac; +} + +////////////////////////////// Symbian ////////////////////////////// +#elif defined(Q_OS_SYMBIAN) + +static qint64 getTimeFromTick(quint64 elapsed) +{ + static TInt freq; + if (!freq) + HAL::Get(HALData::EFastCounterFrequency, freq); + + // ### not sure on units + return elapsed / freq; +} + +void QPerformanceTimer::start() +{ + t1 = User::FastCounter(); +} + +qint64 QPerformanceTimer::elapsed() const +{ + return getTimeFromTick(User::FastCounter() - t1); +} + +////////////////////////////// Windows ////////////////////////////// +#elif defined(Q_OS_WIN) + +static qint64 getTimeFromTick(quint64 elapsed) +{ + static LARGE_INTEGER freq; + if (!freq.QuadPart) + QueryPerformanceFrequency(&freq); + return 1000000000 * elapsed / freq.QuadPart; +} + +void QPerformanceTimer::start() +{ + LARGE_INTEGER li; + QueryPerformanceCounter(&li); + t1 = li.QuadPart; +} + +qint64 QPerformanceTimer::elapsed() const +{ + LARGE_INTEGER li; + QueryPerformanceCounter(&li); + return getTimeFromTick(li.QuadPart - t1); +} + +////////////////////////////// Default ////////////////////////////// +#else + +// default implementation (no hi-perf timer) does nothing +void QPerformanceTimer::start() +{ +} + +qint64 QPerformanceTimer::elapsed() const +{ + return 0; +} + +#endif + +QT_END_NAMESPACE + + diff --git a/src/declarative/qml/qperformancetimer_p.h b/src/declarative/qml/qperformancetimer_p.h new file mode 100644 index 0000000..14310bf --- /dev/null +++ b/src/declarative/qml/qperformancetimer_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPERFORMANCETIMER_P_H +#define QPERFORMANCETIMER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of moc. This header file may change from version to version without notice, +// or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class Q_AUTOTEST_EXPORT QPerformanceTimer +{ +public: + void start(); + qint64 elapsed() const; + +private: + qint64 t1; + qint64 t2; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPERFORMANCETIMER_P_H diff --git a/tests/auto/declarative/qperformancetimer/qperformancetimer.pro b/tests/auto/declarative/qperformancetimer/qperformancetimer.pro new file mode 100644 index 0000000..656bf68 --- /dev/null +++ b/tests/auto/declarative/qperformancetimer/qperformancetimer.pro @@ -0,0 +1,7 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +SOURCES += tst_qperformancetimer.cpp +macx:CONFIG -= app_bundle + +CONFIG += parallel_test + diff --git a/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp b/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp new file mode 100644 index 0000000..2029c8a --- /dev/null +++ b/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +class tst_qperformancetimer : public QObject +{ + Q_OBJECT + +public: + tst_qperformancetimer() {} + +private slots: + void units(); +}; + +void tst_qperformancetimer::units() +{ + QPerformanceTimer timer; + timer.start(); + QTest::qWait(300); + qint64 elapsed = timer.elapsed(); + QVERIFY(elapsed > 300000000 && elapsed < 310000000); +} + +QTEST_MAIN(tst_qperformancetimer) + +#include "tst_qperformancetimer.moc" diff --git a/tests/benchmarks/declarative/qperformancetimer/qperformancetimer.pro b/tests/benchmarks/declarative/qperformancetimer/qperformancetimer.pro new file mode 100644 index 0000000..a39cd3d --- /dev/null +++ b/tests/benchmarks/declarative/qperformancetimer/qperformancetimer.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +QT += declarative +TEMPLATE = app +TARGET = tst_qperformancetimer +macx:CONFIG -= app_bundle + +SOURCES += tst_qperformancetimer.cpp + diff --git a/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp b/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp new file mode 100644 index 0000000..04737e7 --- /dev/null +++ b/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +class tst_qperformancetimer : public QObject +{ + Q_OBJECT + +public: + tst_qperformancetimer() {} + +private slots: + void all(); + void startElapsed(); + void doubleElapsed(); +}; + +void tst_qperformancetimer::all() +{ + QBENCHMARK { + QPerformanceTimer t; + t.start(); + t.elapsed(); + } +} + +void tst_qperformancetimer::startElapsed() +{ + QPerformanceTimer t; + QBENCHMARK { + t.start(); + t.elapsed(); + } +} + +void tst_qperformancetimer::doubleElapsed() +{ + QPerformanceTimer t; + t.start(); + QBENCHMARK { + t.elapsed(); + t.elapsed(); + } +} + +QTEST_MAIN(tst_qperformancetimer) + +#include "tst_qperformancetimer.moc" -- cgit v0.12 From 458c237ea807330de8b15cb2b6e99f564bb7fd66 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 3 Nov 2010 10:24:29 +1000 Subject: Use high performance timer for profiling. Add binding profile info. --- src/declarative/debugger/qdeclarativedebugtrace_p.h | 5 +++-- src/declarative/qml/qdeclarativebinding.cpp | 15 +++++++++++++++ src/declarative/qml/qdeclarativecompiledbindings.cpp | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebugtrace_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h index 704c49a..d6fe0b0 100644 --- a/src/declarative/debugger/qdeclarativedebugtrace_p.h +++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h @@ -43,7 +43,7 @@ #define QDECLARATIVEDEBUGTRACE_P_H #include -#include +#include QT_BEGIN_HEADER @@ -74,6 +74,7 @@ public: Painting, Compiling, Creating, + Binding, MaximumRangeType }; @@ -90,7 +91,7 @@ private: void startRangeImpl(RangeType); void rangeDataImpl(RangeType, const QUrl &); void endRangeImpl(RangeType); - QElapsedTimer m_timer; + QPerformanceTimer m_timer; }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index cb6ad8c..2a1abd0 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -49,6 +49,7 @@ #include "private/qdeclarativedata_p.h" #include "private/qdeclarativestringconverters_p.h" #include "private/qdeclarativestate_p_p.h" +#include "private/qdeclarativedebugtrace_p.h" #include #include @@ -114,6 +115,19 @@ QDeclarativeProperty QDeclarativeBinding::property() const return d->property; } +class QDeclarativeBindingProfiler { +public: + QDeclarativeBindingProfiler() + { + QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding); + } + + ~QDeclarativeBindingProfiler() + { + QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Binding); + } +}; + void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) { Q_D(QDeclarativeBinding); @@ -122,6 +136,7 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) return; if (!d->updating) { + QDeclarativeBindingProfiler prof; d->updating = true; bool wasDeleted = false; d->deleted = &wasDeleted; diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp index 5f0fd56..77fb48e 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings.cpp +++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp @@ -54,6 +54,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -316,7 +317,9 @@ int QDeclarativeCompiledBindingsPrivate::Binding::propertyIndex() void QDeclarativeCompiledBindingsPrivate::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags) { + QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding); parent->run(this, flags); + QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Binding); } void QDeclarativeCompiledBindingsPrivate::Binding::destroy() -- cgit v0.12 From 1a8bf28261facf1e97cecf842fcbfff48b383984 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 3 Nov 2010 12:53:41 +1000 Subject: Add support for a record-then-send debug process. --- .../debugger/qdeclarativedebugtrace.cpp | 55 ++++++++++++++++++---- .../debugger/qdeclarativedebugtrace_p.h | 7 +++ 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebugtrace.cpp b/src/declarative/debugger/qdeclarativedebugtrace.cpp index 03e2d56..5edc3b6 100644 --- a/src/declarative/debugger/qdeclarativedebugtrace.cpp +++ b/src/declarative/debugger/qdeclarativedebugtrace.cpp @@ -43,11 +43,13 @@ #include #include +#include Q_GLOBAL_STATIC(QDeclarativeDebugTrace, traceInstance); QDeclarativeDebugTrace::QDeclarativeDebugTrace() -: QDeclarativeDebugService(QLatin1String("CanvasFrameRate")) +: QDeclarativeDebugService(QLatin1String("CanvasFrameRate")), + m_enabled(false), m_deferredSend(true) { m_timer.start(); } @@ -78,45 +80,80 @@ void QDeclarativeDebugTrace::endRange(RangeType t) void QDeclarativeDebugTrace::addEventImpl(EventType event) { - if (status() != Enabled) + if (status() != Enabled || !m_enabled) return; QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); ds << m_timer.elapsed() << (int)Event << (int)event; - sendMessage(data); + processMessage(data); } void QDeclarativeDebugTrace::startRangeImpl(RangeType range) { - if (status() != Enabled) + if (status() != Enabled || !m_enabled) return; QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); ds << m_timer.elapsed() << (int)RangeStart << (int)range; - sendMessage(data); + processMessage(data); } void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QUrl &u) { - if (status() != Enabled) + if (status() != Enabled || !m_enabled) return; QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); ds << m_timer.elapsed() << (int)RangeData << (int)range << (QString)u.toString(); - sendMessage(data); + processMessage(data); } void QDeclarativeDebugTrace::endRangeImpl(RangeType range) { - if (status() != Enabled) + if (status() != Enabled || !m_enabled) return; QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); ds << m_timer.elapsed() << (int)RangeEnd << (int)range; - sendMessage(data); + processMessage(data); } +/* + Either send the message directly, or queue up + a list of messages to send later (via sendMessages) +*/ +void QDeclarativeDebugTrace::processMessage(const QByteArray &message) +{ + if (m_deferredSend) + m_data.append(message); + else + sendMessage(message); +} + +/* + Send the messages queued up by processMessage +*/ +void QDeclarativeDebugTrace::sendMessages() +{ + if (m_deferredSend) { + //### this is a suboptimal way to send batched messages + for (int i = 0; i < m_data.count(); ++i) + sendMessage(m_data.at(i)); + m_data.clear(); + } +} + +void QDeclarativeDebugTrace::messageReceived(const QByteArray &message) +{ + QByteArray rwData = message; + QDataStream stream(&rwData, QIODevice::ReadOnly); + + stream >> m_enabled; + + if (!m_enabled) + sendMessages(); +} diff --git a/src/declarative/debugger/qdeclarativedebugtrace_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h index d6fe0b0..c7c61bd 100644 --- a/src/declarative/debugger/qdeclarativedebugtrace_p.h +++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h @@ -86,12 +86,19 @@ public: static void endRange(RangeType); QDeclarativeDebugTrace(); +protected: + virtual void messageReceived(const QByteArray &); private: void addEventImpl(EventType); void startRangeImpl(RangeType); void rangeDataImpl(RangeType, const QUrl &); void endRangeImpl(RangeType); + void processMessage(const QByteArray &); + void sendMessages(); QPerformanceTimer m_timer; + bool m_enabled; + bool m_deferredSend; + QList m_data; }; QT_END_NAMESPACE -- cgit v0.12 From 530b052bed6fd74699fead438035dc4684d83335 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 3 Nov 2010 15:12:16 +1000 Subject: Add additional tracing. Tracing for compile time, signal handlers, and deferred creation. --- src/declarative/debugger/qdeclarativedebugtrace_p.h | 3 ++- src/declarative/qml/qdeclarativeboundsignal.cpp | 3 +++ src/declarative/qml/qdeclarativeengine.cpp | 4 +++- src/declarative/qml/qdeclarativetypeloader.cpp | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebugtrace_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h index c7c61bd..d0e776e 100644 --- a/src/declarative/debugger/qdeclarativedebugtrace_p.h +++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h @@ -74,7 +74,8 @@ public: Painting, Compiling, Creating, - Binding, + Binding, //running a binding + HandlingSignal, //running a signal handler MaximumRangeType }; diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 6af3e05..1bb92dd 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -49,6 +49,7 @@ #include "qdeclarative.h" #include "qdeclarativecontext.h" #include "private/qdeclarativeglobal_p.h" +#include "private/qdeclarativedebugtrace_p.h" #include @@ -165,6 +166,7 @@ QDeclarativeBoundSignal *QDeclarativeBoundSignal::cast(QObject *o) int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) { if (c == QMetaObject::InvokeMetaMethod && id == evaluateIdx) { + QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::HandlingSignal); m_isEvaluating = true; if (!m_paramsValid) { if (!m_signal.parameterTypes().isEmpty()) @@ -180,6 +182,7 @@ int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) } if (m_params) m_params->clearValues(); m_isEvaluating = false; + QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::HandlingSignal); return -1; } else { return QObject::qt_metacall(c, id, a); diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 808ba68..dac40b0 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -69,6 +69,7 @@ #include "private/qdeclarativetypenamecache_p.h" #include "private/qdeclarativeinclude_p.h" #include "private/qdeclarativenotifier_p.h" +#include "private/qdeclarativedebugtrace_p.h" #include #include @@ -927,7 +928,7 @@ Q_AUTOTEST_EXPORT void qmlExecuteDeferred(QObject *object) QDeclarativeData *data = QDeclarativeData::get(object); if (data && data->deferredComponent) { - + QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Creating); QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(data->context->engine); QDeclarativeComponentPrivate::ConstructionState state; @@ -937,6 +938,7 @@ Q_AUTOTEST_EXPORT void qmlExecuteDeferred(QObject *object) data->deferredComponent = 0; QDeclarativeComponentPrivate::complete(ep, &state); + QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Creating); } } diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/declarative/qml/qdeclarativetypeloader.cpp index c015519..d9b4c54 100644 --- a/src/declarative/qml/qdeclarativetypeloader.cpp +++ b/src/declarative/qml/qdeclarativetypeloader.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -895,6 +896,7 @@ void QDeclarativeTypeData::downloadProgressChanged(qreal p) void QDeclarativeTypeData::compile() { Q_ASSERT(m_compiledData == 0); + QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Compiling); m_compiledData = new QDeclarativeCompiledData(typeLoader()->engine()); m_compiledData->url = m_imports.baseUrl(); @@ -906,6 +908,7 @@ void QDeclarativeTypeData::compile() m_compiledData->release(); m_compiledData = 0; } + QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Compiling); } void QDeclarativeTypeData::resolveTypes() -- cgit v0.12 From 3c05109ce609574f1525c465f68817d3af39397e Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 4 Nov 2010 15:34:17 +1000 Subject: Support directly setting string range data. --- src/declarative/debugger/qdeclarativedebugtrace.cpp | 8 ++++---- src/declarative/debugger/qdeclarativedebugtrace_p.h | 4 ++-- src/declarative/qml/qdeclarativebinding.cpp | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebugtrace.cpp b/src/declarative/debugger/qdeclarativedebugtrace.cpp index 5edc3b6..cd4306b 100644 --- a/src/declarative/debugger/qdeclarativedebugtrace.cpp +++ b/src/declarative/debugger/qdeclarativedebugtrace.cpp @@ -66,10 +66,10 @@ void QDeclarativeDebugTrace::startRange(RangeType t) traceInstance()->startRangeImpl(t); } -void QDeclarativeDebugTrace::rangeData(RangeType t, const QUrl &url) +void QDeclarativeDebugTrace::rangeData(RangeType t, const QString &data) { if (QDeclarativeDebugService::isDebuggingEnabled()) - traceInstance()->rangeDataImpl(t, url); + traceInstance()->rangeDataImpl(t, data); } void QDeclarativeDebugTrace::endRange(RangeType t) @@ -100,14 +100,14 @@ void QDeclarativeDebugTrace::startRangeImpl(RangeType range) processMessage(data); } -void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QUrl &u) +void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QString &rData) { if (status() != Enabled || !m_enabled) return; QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); - ds << m_timer.elapsed() << (int)RangeData << (int)range << (QString)u.toString(); + ds << m_timer.elapsed() << (int)RangeData << (int)range << rData; processMessage(data); } diff --git a/src/declarative/debugger/qdeclarativedebugtrace_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h index d0e776e..b935fbe 100644 --- a/src/declarative/debugger/qdeclarativedebugtrace_p.h +++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h @@ -83,7 +83,7 @@ public: static void addEvent(EventType); static void startRange(RangeType); - static void rangeData(RangeType, const QUrl &); + static void rangeData(RangeType, const QString &); static void endRange(RangeType); QDeclarativeDebugTrace(); @@ -92,7 +92,7 @@ protected: private: void addEventImpl(EventType); void startRangeImpl(RangeType); - void rangeDataImpl(RangeType, const QUrl &); + void rangeDataImpl(RangeType, const QString &); void endRangeImpl(RangeType); void processMessage(const QByteArray &); void sendMessages(); diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index 2a1abd0..055d009 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -117,9 +117,10 @@ QDeclarativeProperty QDeclarativeBinding::property() const class QDeclarativeBindingProfiler { public: - QDeclarativeBindingProfiler() + QDeclarativeBindingProfiler(QDeclarativeBinding *bind) { QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding); + //QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Binding, bind->expression()); } ~QDeclarativeBindingProfiler() @@ -136,7 +137,7 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) return; if (!d->updating) { - QDeclarativeBindingProfiler prof; + QDeclarativeBindingProfiler prof(this); d->updating = true; bool wasDeleted = false; d->deleted = &wasDeleted; -- cgit v0.12 From 7aebf28291288ea6e8c1d9d28f4ed752b00dca97 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 5 Nov 2010 13:27:30 +1000 Subject: Make deferred tracing less expensive (real-time cost is the same) --- .../debugger/qdeclarativedebugtrace.cpp | 44 ++++++++++++---------- .../debugger/qdeclarativedebugtrace_p.h | 32 +++++++++++----- src/declarative/qml/qdeclarativebinding.cpp | 2 +- .../qperformancetimer/tst_qperformancetimer.cpp | 11 ++++++ 4 files changed, 59 insertions(+), 30 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebugtrace.cpp b/src/declarative/debugger/qdeclarativedebugtrace.cpp index cd4306b..7f970bf 100644 --- a/src/declarative/debugger/qdeclarativedebugtrace.cpp +++ b/src/declarative/debugger/qdeclarativedebugtrace.cpp @@ -47,6 +47,20 @@ Q_GLOBAL_STATIC(QDeclarativeDebugTrace, traceInstance); +// convert to a QByteArray that can be sent to the debug client +// use of QDataStream can skew results if m_deferredSend == false +// (see tst_qperformancetimer::trace() benchmark) +QByteArray QDeclarativeDebugData::toByteArray() const +{ + QByteArray data; + //### using QDataStream is relatively expensive + QDataStream ds(&data, QIODevice::WriteOnly); + ds << time << messageType << detailType; + if (messageType == (int)QDeclarativeDebugTrace::RangeData) + ds << detailData; + return data; +} + QDeclarativeDebugTrace::QDeclarativeDebugTrace() : QDeclarativeDebugService(QLatin1String("CanvasFrameRate")), m_enabled(false), m_deferredSend(true) @@ -83,10 +97,8 @@ void QDeclarativeDebugTrace::addEventImpl(EventType event) if (status() != Enabled || !m_enabled) return; - QByteArray data; - QDataStream ds(&data, QIODevice::WriteOnly); - ds << m_timer.elapsed() << (int)Event << (int)event; - processMessage(data); + QDeclarativeDebugData ed = {m_timer.elapsed(), (int)Event, (int)event, QString()}; + processMessage(ed); } void QDeclarativeDebugTrace::startRangeImpl(RangeType range) @@ -94,10 +106,8 @@ void QDeclarativeDebugTrace::startRangeImpl(RangeType range) if (status() != Enabled || !m_enabled) return; - QByteArray data; - QDataStream ds(&data, QIODevice::WriteOnly); - ds << m_timer.elapsed() << (int)RangeStart << (int)range; - processMessage(data); + QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeStart, (int)range, QString()}; + processMessage(rd); } void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QString &rData) @@ -105,10 +115,8 @@ void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QString &rData if (status() != Enabled || !m_enabled) return; - QByteArray data; - QDataStream ds(&data, QIODevice::WriteOnly); - ds << m_timer.elapsed() << (int)RangeData << (int)range << rData; - processMessage(data); + QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeData, (int)range, rData}; + processMessage(rd); } void QDeclarativeDebugTrace::endRangeImpl(RangeType range) @@ -116,22 +124,20 @@ void QDeclarativeDebugTrace::endRangeImpl(RangeType range) if (status() != Enabled || !m_enabled) return; - QByteArray data; - QDataStream ds(&data, QIODevice::WriteOnly); - ds << m_timer.elapsed() << (int)RangeEnd << (int)range; - processMessage(data); + QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeEnd, (int)range, QString()}; + processMessage(rd); } /* Either send the message directly, or queue up a list of messages to send later (via sendMessages) */ -void QDeclarativeDebugTrace::processMessage(const QByteArray &message) +void QDeclarativeDebugTrace::processMessage(const QDeclarativeDebugData &message) { if (m_deferredSend) m_data.append(message); else - sendMessage(message); + sendMessage(message.toByteArray()); } /* @@ -142,7 +148,7 @@ void QDeclarativeDebugTrace::sendMessages() if (m_deferredSend) { //### this is a suboptimal way to send batched messages for (int i = 0; i < m_data.count(); ++i) - sendMessage(m_data.at(i)); + sendMessage(m_data.at(i).toByteArray()); m_data.clear(); } } diff --git a/src/declarative/debugger/qdeclarativedebugtrace_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h index b935fbe..86c0987 100644 --- a/src/declarative/debugger/qdeclarativedebugtrace_p.h +++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h @@ -49,18 +49,22 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE +struct QDeclarativeDebugData +{ + qint64 time; + int messageType; + int detailType; + QString detailData; + + QByteArray toByteArray() const; +}; + +Q_DECLARE_TYPEINFO(QDeclarativeDebugData,Q_PRIMITIVE_TYPE); + class QUrl; class Q_AUTOTEST_EXPORT QDeclarativeDebugTrace : public QDeclarativeDebugService { public: - enum EventType { - FramePaint, - Mouse, - Key, - - MaximumEventType - }; - enum Message { Event, RangeStart, @@ -70,6 +74,14 @@ public: MaximumMessage }; + enum EventType { + FramePaint, + Mouse, + Key, + + MaximumEventType + }; + enum RangeType { Painting, Compiling, @@ -94,12 +106,12 @@ private: void startRangeImpl(RangeType); void rangeDataImpl(RangeType, const QString &); void endRangeImpl(RangeType); - void processMessage(const QByteArray &); + void processMessage(const QDeclarativeDebugData &); void sendMessages(); QPerformanceTimer m_timer; bool m_enabled; bool m_deferredSend; - QList m_data; + QList m_data; }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index 055d009..c8b4c7d 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -120,7 +120,7 @@ public: QDeclarativeBindingProfiler(QDeclarativeBinding *bind) { QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding); - //QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Binding, bind->expression()); + QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Binding, bind->expression()); } ~QDeclarativeBindingProfiler() diff --git a/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp b/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp index 04737e7..497a556 100644 --- a/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp +++ b/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp @@ -54,6 +54,7 @@ private slots: void all(); void startElapsed(); void doubleElapsed(); + void trace(); }; void tst_qperformancetimer::all() @@ -84,6 +85,16 @@ void tst_qperformancetimer::doubleElapsed() } } +void tst_qperformancetimer::trace() +{ + QString s("A decent sized string of text here."); + QBENCHMARK { + QByteArray data; + QDataStream ds(&data, QIODevice::WriteOnly); + ds << (qint64)100 << (int)5 << (int)5 << s; + } +} + QTEST_MAIN(tst_qperformancetimer) #include "tst_qperformancetimer.moc" -- cgit v0.12 From 280f67d16430ce0dcfcc31a0c88ce7156126066c Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 5 Nov 2010 15:05:53 +1000 Subject: Add additional trace range data. --- src/declarative/debugger/qdeclarativedebugtrace.cpp | 15 +++++++++++++++ src/declarative/debugger/qdeclarativedebugtrace_p.h | 2 ++ src/declarative/qml/qdeclarativeboundsignal.cpp | 1 + src/declarative/qml/qdeclarativecomponent.cpp | 4 +++- src/declarative/qml/qdeclarativeengine.cpp | 1 + src/declarative/qml/qdeclarativetypeloader.cpp | 1 + 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/declarative/debugger/qdeclarativedebugtrace.cpp b/src/declarative/debugger/qdeclarativedebugtrace.cpp index 7f970bf..314db70 100644 --- a/src/declarative/debugger/qdeclarativedebugtrace.cpp +++ b/src/declarative/debugger/qdeclarativedebugtrace.cpp @@ -86,6 +86,12 @@ void QDeclarativeDebugTrace::rangeData(RangeType t, const QString &data) traceInstance()->rangeDataImpl(t, data); } +void QDeclarativeDebugTrace::rangeData(RangeType t, const QUrl &data) +{ + if (QDeclarativeDebugService::isDebuggingEnabled()) + traceInstance()->rangeDataImpl(t, data); +} + void QDeclarativeDebugTrace::endRange(RangeType t) { if (QDeclarativeDebugService::isDebuggingEnabled()) @@ -119,6 +125,15 @@ void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QString &rData processMessage(rd); } +void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QUrl &rData) +{ + if (status() != Enabled || !m_enabled) + return; + + QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeData, (int)range, rData.toEncoded(QUrl::FormattingOption(0x100))}; + processMessage(rd); +} + void QDeclarativeDebugTrace::endRangeImpl(RangeType range) { if (status() != Enabled || !m_enabled) diff --git a/src/declarative/debugger/qdeclarativedebugtrace_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h index 86c0987..3f9b904 100644 --- a/src/declarative/debugger/qdeclarativedebugtrace_p.h +++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h @@ -96,6 +96,7 @@ public: static void startRange(RangeType); static void rangeData(RangeType, const QString &); + static void rangeData(RangeType, const QUrl &); static void endRange(RangeType); QDeclarativeDebugTrace(); @@ -105,6 +106,7 @@ private: void addEventImpl(EventType); void startRangeImpl(RangeType); void rangeDataImpl(RangeType, const QString &); + void rangeDataImpl(RangeType, const QUrl &); void endRangeImpl(RangeType); void processMessage(const QDeclarativeDebugData &); void sendMessages(); diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 1bb92dd..030fb2c 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -167,6 +167,7 @@ int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) { if (c == QMetaObject::InvokeMetaMethod && id == evaluateIdx) { QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::HandlingSignal); + QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::HandlingSignal, QLatin1String(m_signal.signature()) + QLatin1String(": ") + (m_expression ? m_expression->expression() : "")); m_isEvaluating = true; if (!m_paramsValid) { if (!m_signal.parameterTypes().isEmpty()) diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index 2686ce3..5be41ab 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -785,8 +785,10 @@ QObject * QDeclarativeComponentPrivate::begin(QDeclarativeContextData *parentCon Q_ASSERT(!isRoot || state); // Either this isn't a root component, or a state data must be provided Q_ASSERT((state != 0) ^ (errors != 0)); // One of state or errors (but not both) must be provided - if (isRoot) + if (isRoot) { QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Creating); + QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Creating, component->url); + } QDeclarativeContextData *ctxt = new QDeclarativeContextData; ctxt->isInternal = true; diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index dac40b0..5122bdf 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -929,6 +929,7 @@ Q_AUTOTEST_EXPORT void qmlExecuteDeferred(QObject *object) if (data && data->deferredComponent) { QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Creating); + QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Creating, QLatin1String("Deferred Creation:") + object->metaObject()->className()); QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(data->context->engine); QDeclarativeComponentPrivate::ConstructionState state; diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/declarative/qml/qdeclarativetypeloader.cpp index d9b4c54..f42e8a7 100644 --- a/src/declarative/qml/qdeclarativetypeloader.cpp +++ b/src/declarative/qml/qdeclarativetypeloader.cpp @@ -901,6 +901,7 @@ void QDeclarativeTypeData::compile() m_compiledData = new QDeclarativeCompiledData(typeLoader()->engine()); m_compiledData->url = m_imports.baseUrl(); m_compiledData->name = m_compiledData->url.toString(); + QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Compiling, m_compiledData->name); QDeclarativeCompiler compiler; if (!compiler.compile(typeLoader()->engine(), this, m_compiledData)) { -- cgit v0.12 From c5d942a039b924b0179a9845cce2e4660905f2f8 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 19 Nov 2010 13:22:11 +0100 Subject: qdoc: Replaced all "#location" with "file.xml#location" --- tools/qdoc3/ditaxmlgenerator.cpp | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index aace05a..d4285a8 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -976,8 +976,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, s = sections.constBegin(); while (s != sections.constEnd()) { if (!(*s).members.isEmpty()) { - writeXrefListItem(QString("#" + Doc::canonicalTitle((*s).name)), - (*s).name); + QString li = outFileName() + "#" + Doc::canonicalTitle((*s).name); + writeXrefListItem(li, (*s).name); } ++s; } @@ -2762,7 +2762,8 @@ void DitaXmlGenerator::generateCompactList(const Node* relative, if (usedParagraphNames.contains(char('a' + i))) { xmlWriter().writeStartElement("xref"); QString guid = lookupGuid(outFileName(),QString(ch)); - xmlWriter().writeAttribute("href",QString("#%1").arg(guid)); + QString attr = outFileName() + QString("#%1").arg(guid); + xmlWriter().writeAttribute("href", attr); xmlWriter().writeCharacters(QString(ch.toUpper())); xmlWriter().writeEndElement(); // } @@ -2849,16 +2850,17 @@ void DitaXmlGenerator::generateFunctionIndex(const Node* relative, CodeMarker* marker) { xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","function-index"); - xmlWriter().writeStartElement("b"); + xmlWriter().writeAttribute("outputclass","alphabet"); for (int i = 0; i < 26; i++) { QChar ch('a' + i); xmlWriter().writeStartElement("xref"); - xmlWriter().writeAttribute("href",QString("#%1").arg(ch)); + QString guid = lookupGuid(outFileName(),QString(ch)); + QString attr = outFileName() + QString("#%1").arg(guid); + xmlWriter().writeAttribute("href", attr); xmlWriter().writeCharacters(QString(ch.toUpper())); xmlWriter().writeEndElement(); // + } - xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); //

    char nextLetter = 'a'; @@ -3700,7 +3702,8 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode, if (actualNode == 0) actualNode = apparentNode; xmlWriter().writeStartElement("xref"); - xmlWriter().writeAttribute("href",linkForNode(actualNode, relative)); + QString href = linkForNode(actualNode, relative); + xmlWriter().writeAttribute("href",href); xmlWriter().writeCharacters(protectEnc(fullName(apparentNode, relative, marker))); xmlWriter().writeEndElement(); // } @@ -4042,10 +4045,26 @@ QString DitaXmlGenerator::getLink(const Atom* atom, link = linkForNode(*node, relative); if (*node && (*node)->subType() == Node::Image) link = "images/used-in-examples/" + link; - if (targetAtom) - link += "#" + refForAtom(targetAtom, *node); + if (targetAtom) { + if (link.isEmpty()) + link = outFileName(); + QString guid = lookupGuid(link,refForAtom(targetAtom,*node)); + link += "#" + guid; + } +#if 0 + else if (link.isEmpty() && *node) { + link = outFileName() + "#" + (*node)->guid(); + } +#endif + else if (!link.isEmpty() && *node && link.endsWith(".xml")) { + link += "#" + (*node)->guid(); + } } } + if (!link.isEmpty() && link[0] == '#') { + link.prepend(outFileName()); + qDebug() << "LOCAL LINK:" << link; + } return link; } -- cgit v0.12 From 771337bb2c286343ac912a32101fc7d418ef8a7c Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 19 Nov 2010 15:40:40 +0100 Subject: Removed unused files and functionality from qdoc3. Many of the generators were unused. The old QSA and Qt Script parsers were unused. We no longer use DCF files for Qt Assistant. We no longer generate Qt Jambi documentation, and qdoc3 was not used for much of that process, making some of the relevant files obsolete. --- tools/qdoc3/bookgenerator.cpp | 64 --- tools/qdoc3/bookgenerator.h | 64 --- tools/qdoc3/cpptoqsconverter.cpp | 415 ----------------- tools/qdoc3/cpptoqsconverter.h | 88 ---- tools/qdoc3/dcfsection.cpp | 111 ----- tools/qdoc3/dcfsection.h | 94 ---- tools/qdoc3/htmlgenerator.cpp | 132 +----- tools/qdoc3/htmlgenerator.h | 11 - tools/qdoc3/jambiapiparser.cpp | 546 ---------------------- tools/qdoc3/jambiapiparser.h | 99 ---- tools/qdoc3/javacodemarker.cpp | 203 -------- tools/qdoc3/javacodemarker.h | 83 ---- tools/qdoc3/javadocgenerator.cpp | 454 ------------------ tools/qdoc3/javadocgenerator.h | 95 ---- tools/qdoc3/linguistgenerator.cpp | 245 ---------- tools/qdoc3/linguistgenerator.h | 85 ---- tools/qdoc3/loutgenerator.cpp | 63 --- tools/qdoc3/loutgenerator.h | 67 --- tools/qdoc3/main.cpp | 26 +- tools/qdoc3/mangenerator.cpp | 228 --------- tools/qdoc3/mangenerator.h | 79 ---- tools/qdoc3/qdoc3.pro | 26 -- tools/qdoc3/qsakernelparser.cpp | 186 -------- tools/qdoc3/qsakernelparser.h | 77 ---- tools/qdoc3/qscodemarker.cpp | 378 --------------- tools/qdoc3/qscodemarker.h | 79 ---- tools/qdoc3/qscodeparser.cpp | 944 -------------------------------------- tools/qdoc3/qscodeparser.h | 128 ------ tools/qdoc3/sgmlgenerator.cpp | 63 --- tools/qdoc3/sgmlgenerator.h | 67 --- 30 files changed, 3 insertions(+), 5197 deletions(-) delete mode 100644 tools/qdoc3/bookgenerator.cpp delete mode 100644 tools/qdoc3/bookgenerator.h delete mode 100644 tools/qdoc3/cpptoqsconverter.cpp delete mode 100644 tools/qdoc3/cpptoqsconverter.h delete mode 100644 tools/qdoc3/dcfsection.cpp delete mode 100644 tools/qdoc3/dcfsection.h delete mode 100644 tools/qdoc3/jambiapiparser.cpp delete mode 100644 tools/qdoc3/jambiapiparser.h delete mode 100644 tools/qdoc3/javacodemarker.cpp delete mode 100644 tools/qdoc3/javacodemarker.h delete mode 100644 tools/qdoc3/javadocgenerator.cpp delete mode 100644 tools/qdoc3/javadocgenerator.h delete mode 100644 tools/qdoc3/linguistgenerator.cpp delete mode 100644 tools/qdoc3/linguistgenerator.h delete mode 100644 tools/qdoc3/loutgenerator.cpp delete mode 100644 tools/qdoc3/loutgenerator.h delete mode 100644 tools/qdoc3/mangenerator.cpp delete mode 100644 tools/qdoc3/mangenerator.h delete mode 100644 tools/qdoc3/qsakernelparser.cpp delete mode 100644 tools/qdoc3/qsakernelparser.h delete mode 100644 tools/qdoc3/qscodemarker.cpp delete mode 100644 tools/qdoc3/qscodemarker.h delete mode 100644 tools/qdoc3/qscodeparser.cpp delete mode 100644 tools/qdoc3/qscodeparser.h delete mode 100644 tools/qdoc3/sgmlgenerator.cpp delete mode 100644 tools/qdoc3/sgmlgenerator.h diff --git a/tools/qdoc3/bookgenerator.cpp b/tools/qdoc3/bookgenerator.cpp deleted file mode 100644 index bbcdd11..0000000 --- a/tools/qdoc3/bookgenerator.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - bookgenerator.cpp -*/ - -#include "bookgenerator.h" - -QT_BEGIN_NAMESPACE - -BookGenerator::BookGenerator() -{ -} - -BookGenerator::~BookGenerator() -{ -} - -void BookGenerator::generateTree( const Tree *tree, CodeMarker *marker ) -{ - Q_UNUSED( tree ) - Q_UNUSED( marker ) -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/bookgenerator.h b/tools/qdoc3/bookgenerator.h deleted file mode 100644 index 69b65fc..0000000 --- a/tools/qdoc3/bookgenerator.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - bookgenerator.h -*/ - -#ifndef BOOKGENERATOR_H -#define BOOKGENERATOR_H - -#include "generator.h" - -QT_BEGIN_NAMESPACE - -class BookGenerator : public Generator -{ -public: - BookGenerator(); - ~BookGenerator(); - - virtual void generateTree( const Tree *tree, CodeMarker *marker ); -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/cpptoqsconverter.cpp b/tools/qdoc3/cpptoqsconverter.cpp deleted file mode 100644 index 1a44c16..0000000 --- a/tools/qdoc3/cpptoqsconverter.cpp +++ /dev/null @@ -1,415 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - cpptoqsconverter.cpp -*/ - -#include "config.h" -#include "cpptoqsconverter.h" - -QT_BEGIN_NAMESPACE - -#define CONFIG_QUICK "quick" -#define CONFIG_INDENTSIZE "indentsize" - -void setTabSize( int size ); -void setIndentSize( int size ); -int columnForIndex( const QString& t, int index ); -int indentForBottomLine( const QStringList& program, QChar typedIn ); - -static QString balancedParens = "(?:[^()]+|\\([^()]*\\))*"; - -QRegExp CppToQsConverter::qClassRegExp; -QRegExp CppToQsConverter::addressOperatorRegExp; -QRegExp CppToQsConverter::gulbrandsenRegExp; -int CppToQsConverter::tabSize; - -ClassNode *CppToQsConverter::findClassNode( Tree *qsTree, - const QString& qtName ) -{ - ClassNode *classe = (ClassNode *) qsTree->findNode( QStringList(qtName), Node::Class ); - if ( classe == 0 ) - classe = (ClassNode *) qsTree->findNode( QStringList(qtName.mid(1)), Node::Class ); - return classe; -} - -QString CppToQsConverter::convertedDataType( Tree *qsTree, - const QString& leftType, - const QString& /* rightType */ ) -{ - QString s = leftType; - - if ( s.startsWith("const ") ) - s = s.mid( 6 ); - while ( s.endsWith("*") || s.endsWith("&") || s.endsWith(" ") ) - s.truncate( s.length() - 1 ); - - switch ( s[0].unicode() ) { - case 'Q': - if ( s == "QCString" ) { - return "String"; - } else { - Node *node = findClassNode( qsTree, s ); - if ( node == 0 ) { - return ""; - } else { - return node->name(); - } - } - break; - case 'b': - if ( s == "bool" ) - return "Boolean"; - break; - case 'c': - if ( s == "char" ) { - if ( leftType == "const char *" ) { - return "String"; - } else { - return "Number"; - } - } - break; - case 'd': - if ( s == "double" ) - return "Number"; - break; - case 'f': - if ( s == "float" ) - return "Number"; - case 'i': - if ( s == "int" ) - return "Number"; - break; - case 'l': - if ( s == "long" || s == "long int" || s == "long long" || - s == "long long int" || s == "long double" ) - return "Number"; - break; - case 's': - if ( s == "short" || s == "short int" || s == "signed char" || - s == "signed short" || s == "signed short int" || s == "signed" || - s == "signed int" || s == "signed long" || s == "signed long int" ) - return "Number"; - break; - case 'u': - if ( s == "uchar" || s == "unsigned" || s == "unsigned char" || - s == "ushort" || s == "unsigned short" || - s == "unsigned short int" || s == "uint" || s == "unsigned int" || - s == "ulong" || s == "unsigned long" || s == "unsigned long int" ) - return "Number"; - break; - case 'v': - if ( s == "void" ) - return ""; - } - return s; -} - -QString CppToQsConverter::convertedCode( Tree *qsTree, const QString& code, - const QSet& classesWithNoQ ) -{ - QString result; - QStringList program; - QStringList comments; - int programWidth = 0; - - QStringList originalLines = code.split("\n"); - QStringList::ConstIterator ol = originalLines.begin(); - while ( ol != originalLines.end() ) { - QString code = (*ol).trimmed(); - QString comment; - - int slashSlash = code.indexOf( "//" ); - if ( slashSlash != -1 ) { - comment = code.mid( slashSlash ); - code.truncate( slashSlash ); - code = code.trimmed(); - } - - code = convertCodeLine( qsTree, program, code, classesWithNoQ ); - program.append( code ); - - comment = convertComment( qsTree, comment, classesWithNoQ ); - comments.append( comment ); - - int n = indentForBottomLine( program, QChar::Null ); - for ( int i = 0; i < n; i++ ) - program.last().prepend( " " ); - - int width = columnForIndex( program.last(), program.last().length() ); - if ( !comment.isEmpty() && width > programWidth ) - programWidth = width; - ++ol; - } - - programWidth = ( (programWidth + (tabSize - 1) + 2) / tabSize ) * tabSize; - - QStringList::ConstIterator p = program.begin(); - QStringList::ConstIterator c = comments.begin(); - while ( c != comments.end() ) { - if ( c != comments.begin() ) - result += "\n"; - - if ( (*p).trimmed().isEmpty() ) { - if ( !(*c).isEmpty() ) - result += *p; - } else { - result += *p; - if ( !(*c).isEmpty() ) { - int i = columnForIndex( *p, (*p).length() ); - while ( i++ < programWidth ) - result += " "; - } - } - result += *c; - ++p; - ++c; - } - return result; -} - -void CppToQsConverter::initialize( const Config& config ) -{ - qClassRegExp.setPattern( "\\bQ([A-Z][A-Za-z]+)\\b" ); - addressOperatorRegExp.setPattern( "([(\\s])[*&]([a-zA-Z])" ); - gulbrandsenRegExp.setPattern( "\\b::\\b|->" ); - - tabSize = config.getInt( CONFIG_TABSIZE ); - setTabSize( tabSize ); - - int size = config.getInt( CONFIG_QUICK + Config::dot + CONFIG_INDENTSIZE ); - if ( size > 0 ) - setIndentSize( size ); -} - -void CppToQsConverter::terminate() -{ -} - -QString CppToQsConverter::convertCodeLine( Tree *qsTree, - const QStringList& program, - const QString& code, - const QSet& classesWithNoQ ) -{ - static QString dataTypeFmt = - "(?!return)(?:const\\b\\s*)?[A-Za-z_]+(?:\\s*[*&])?"; - static QRegExp funcPrototypeRegExp( - "(" + dataTypeFmt + ")\\s*\\b([A-Z][a-zA-Z_0-9]*::)?" - "([a-z][a-zA-Z_0-9]*)\\(([^);]*)(\\)?)(?:\\s*const)?" ); - static QRegExp paramRegExp( - "^\\s*(" + dataTypeFmt + ")\\s*\\b([a-z][a-zA-Z_0-9]*)\\s*(,)?\\s*" ); - static QRegExp uninitVarRegExp( - "(" + dataTypeFmt + ")\\s*\\b([a-z][a-zA-Z_0-9]*);" ); - static QRegExp eqVarRegExp( - dataTypeFmt + "\\s*\\b([a-z][a-zA-Z_0-9]*)\\s*=(\\s*)(.*)" ); - static QRegExp ctorVarRegExp( - "(" + dataTypeFmt + ")\\s*\\b([a-z][a-zA-Z_0-9]*)\\((.*)\\);" ); - static QRegExp qdebugRegExp( - "q(?:Debug|Warning|Fatal)\\(\\s*(\"(?:\\\\.|[^\"])*\")\\s*" - "(?:,\\s*(\\S(?:[^,]*\\S)?))?\\s*\\);" ); - static QRegExp coutRegExp( "c(?:out|err)\\b(.*);" ); - static QRegExp lshiftRegExp( "\\s*<<\\s*" ); - static QRegExp endlRegExp( "^endl$" ); - - if ( code.isEmpty() || code == "{" || code == "}" ) - return code; - - QString result; - - if ( funcPrototypeRegExp.exactMatch(code) ) { - QString returnType = funcPrototypeRegExp.cap( 1 ); - QString className = funcPrototypeRegExp.cap( 2 ); - QString funcName = funcPrototypeRegExp.cap( 3 ); - QString params = funcPrototypeRegExp.cap( 4 ).trimmed(); - bool toBeContinued = funcPrototypeRegExp.cap( 5 ).isEmpty(); - // ### unused - Q_UNUSED(toBeContinued); - - className.replace( "::", "." ); - - result = "function " + className + funcName + "("; - - if ( !params.isEmpty() && params != "void" ) { - result += " "; - int i = funcPrototypeRegExp.pos( 4 ); - while ( (i = paramRegExp.indexIn(code, i, - QRegExp::CaretAtOffset)) != -1 ) { - QString dataType = paramRegExp.cap( 1 ); - QString paramName = paramRegExp.cap( 2 ); - QString comma = paramRegExp.cap( 3 ); - - result += paramName + " : " + - convertedDataType( qsTree, dataType ); - if ( comma.isEmpty() ) - break; - result += ", "; - i += paramRegExp.matchedLength(); - } - result += " "; - } - - result += ")"; - returnType = convertedDataType( qsTree, returnType ); - if ( !returnType.isEmpty() ) - result += " : " + returnType; - } else if ( uninitVarRegExp.exactMatch(code) ) { - QString dataType = uninitVarRegExp.cap( 1 ); - QString varName = uninitVarRegExp.cap( 2 ); - - result = "var " + varName; - dataType = convertedDataType( qsTree, dataType ); - if ( !dataType.isEmpty() ) - result += " : " + dataType; - result += ";"; - } else if ( eqVarRegExp.exactMatch(code) ) { - QString varName = eqVarRegExp.cap( 1 ); - QString value = eqVarRegExp.cap( 3 ); - - value = convertExpr( qsTree, value, classesWithNoQ ); - result += "var " + varName + " = " + value; - } else if ( ctorVarRegExp.exactMatch(code) ) { - QString dataType = ctorVarRegExp.cap( 1 ); - QString varName = ctorVarRegExp.cap( 2 ); - QString value = ctorVarRegExp.cap( 3 ).trimmed(); - - result += "var " + varName + " = "; - - dataType = convertedDataType( qsTree, dataType ); - value = convertExpr( qsTree, value, classesWithNoQ ); - - if ( dataType.isEmpty() || dataType == "String" ) { - if ( value.contains(",") ) { - result += "..."; - } else { - result += value; - } - } else { - result += "new " + dataType; - if ( !value.isEmpty() ) - result += "( " + value + " )"; - } - result += ";"; - } else if ( qdebugRegExp.exactMatch(code) ) { - QString fmt = qdebugRegExp.cap( 1 ); - QString arg1 = qdebugRegExp.cap( 2 ); - - result += "println "; - int i = 0; - while ( i < (int) fmt.length() ) { - if ( fmt[i] == '%' ) { - int percent = i; - i++; - while ( i < (int) fmt.length() && - QString("diouxXeEfFgGaAcsCSpn%\"").indexOf(fmt[i]) == -1 ) - i++; - if ( fmt[i] == '%' ) { - result += fmt[i++]; - } else if ( fmt[i] != '"' ) { - if ( percent == 1 ) { - result.truncate( result.length() - 1 ); - } else { - result += "\" + "; - } - i++; - if ( arg1.endsWith(".latin1()") ) - arg1.truncate( arg1.length() - 9 ); - result += arg1; - if ( i == (int) fmt.length() - 1 ) { - i++; - } else { - result += " + \""; - } - } - } else { - result += fmt[i++]; - } - } - result += ";"; - } else if ( coutRegExp.exactMatch(code) && - program.filter("var cout").isEmpty() ) { - QStringList args = coutRegExp.cap(1).split(lshiftRegExp); - args.replaceInStrings( endlRegExp, "\"\\n\"" ); - if ( args.last() == "\"\\n\"" ) { - args.erase( args.end() - 1 ); - if ( args.isEmpty() ) - args << "\"\""; - result += "println "; - } else { - result += "print "; - } - result += args.join( " + " ) + ";"; - } else { - result = convertExpr( qsTree, code, classesWithNoQ ); - } - return result; -} - -QString CppToQsConverter::convertComment( Tree * /* qsTree */, - const QString& comment, - const QSet& classesWithNoQ ) - -{ - QString result = comment; - - result.replace( "TRUE", "true" ); - result.replace( "FALSE", "false" ); - result.replace( addressOperatorRegExp, "\\1\\2" ); - result.replace( gulbrandsenRegExp, "." ); - - int i = 0; - while ( (i = result.indexOf(qClassRegExp, i)) != -1 ) { - if ( classesWithNoQ.contains(qClassRegExp.cap(1)) ) - result.remove( i, 1 ); - i++; - } - return result; -} - -QString CppToQsConverter::convertExpr( Tree *qsTree, const QString& expr, - const QSet& classesWithNoQ ) -{ - // suboptimal - return convertComment( qsTree, expr, classesWithNoQ ); -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/cpptoqsconverter.h b/tools/qdoc3/cpptoqsconverter.h deleted file mode 100644 index 001091b..0000000 --- a/tools/qdoc3/cpptoqsconverter.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - cpptoqsconverter.h -*/ - -#ifndef CPPTOQSCONVERTER_H -#define CPPTOQSCONVERTER_H - -#include - -#include "tree.h" - -QT_BEGIN_NAMESPACE - -class CppToQsConverter -{ -public: - CppToQsConverter() { } - - ClassNode *findClassNode( Tree *qsTree, const QString& qtName ); - QString convertedDataType( Tree *qsTree, const QString& leftType, - const QString& rightType = "" ); - QString convertedCode( Tree *qsTree, const QString& code, - const QSet& classesWithNoQ ); - - static void initialize( const Config& config ); - static void terminate(); - -private: - void clearState(); - QString convertCodeLine( Tree *qsTree, const QStringList& program, - const QString& code, - const QSet& classesWithNoQ ); - QString convertComment( Tree *qsTree, const QString& comment, - const QSet& classesWithNoQ ); - QString convertExpr( Tree *qsTree, const QString& expr, - const QSet& classesWithNoQ ); - void updateDelimDepths( const QString& code ); - - static QRegExp qClassRegExp; - static QRegExp addressOperatorRegExp; - static QRegExp gulbrandsenRegExp; - static int tabSize; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/dcfsection.cpp b/tools/qdoc3/dcfsection.cpp deleted file mode 100644 index ea10dbf..0000000 --- a/tools/qdoc3/dcfsection.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include - -#include "dcfsection.h" -#include "htmlgenerator.h" - -QT_BEGIN_NAMESPACE - -void appendDcfSubSection( DcfSection *dcfSect, const DcfSection& sub ) -{ - dcfSect->subsections.append( sub ); -} - -void appendDcfSubSections( DcfSection *dcfSect, const QList& subs ) -{ - dcfSect->subsections += subs; -} - -void generateDcfSubSections( QString indent, QTextStream& out, const DcfSection& sect ) -{ - QList::const_iterator ss = sect.subsections.constBegin(); - while ( ss != sect.subsections.constEnd() ) { - out << indent << "
    \n"; - } else { - out << ">\n"; - QString indentIndent = indent + " "; - QList >::const_iterator k = (*ss).keywords.constBegin(); - while ( k != (*ss).keywords.constEnd() ) { - out << indentIndent << "" - << HtmlGenerator::protect((*k).first) << "\n"; - ++k; - } - - generateDcfSubSections( indentIndent, out, *ss ); - out << indent << "
    \n"; - } - ++ss; - } - out.flush(); -} - -void generateDcfSections( const DcfSection& rootSect, const QString& fileName, - const QString& /* category */ ) -{ - QFile file(fileName); - if (!file.open(QFile::WriteOnly | QFile::Text)) - return ; - - QTextStream out(&file); - - QString icon = QFileInfo(fileName).baseName() + ".png"; - - out << "\n"; - out << "\n"; - - generateDcfSubSections( "", out, rootSect ); - - out << "\n"; - out.flush(); -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/dcfsection.h b/tools/qdoc3/dcfsection.h deleted file mode 100644 index 0318511..0000000 --- a/tools/qdoc3/dcfsection.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DCFSECTION_H -#define DCFSECTION_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QTextStream; - -struct DcfSection -{ - QString title; - QString ref; - QList > keywords; - QList subsections; -}; - -inline bool operator<( const DcfSection& s1, const DcfSection& s2 ) { - QString title1 = s1.title; - QString title2 = s2.title; - - // cheat with Q3 classes - if (title1.startsWith("Q3")) - title1.insert(1, '~'); - if (title2.startsWith("Q3")) - title2.insert(1, '~'); - - int delta = title1.toLower().compare( title2.toLower() ); - if ( delta == 0 ) { - delta = title1.compare( title2 ); - if ( delta == 0 ) - delta = s1.ref.localeAwareCompare( s2.ref ); - } - return delta < 0; -} - -inline bool operator>( const DcfSection& s1, const DcfSection& s2 ) { return s2 < s1; } -inline bool operator<=( const DcfSection& s1, const DcfSection& s2 ) { return !( s2 < s1 ); } -inline bool operator>=( const DcfSection& s1, const DcfSection& s2 ) { return !( s1 < s2 ); } -inline bool operator==( const DcfSection& s1, const DcfSection& s2 ) { return &s1 == &s2; } -inline bool operator!=( const DcfSection& s1, const DcfSection& s2 ) { return !( s1 == s2 ); } - -void appendDcfSubSection(DcfSection *dcfSect, const DcfSection &sub); -void appendDcfSubSections(DcfSection *dcfSect, const QList &subs); -void generateDcfSubSections(QString indent, QTextStream &out, const DcfSection §); -void generateDcfSections(const DcfSection &rootSect, const QString& fileName, - const QString& category ); - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 3f35f76..0cd534e 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -355,7 +355,7 @@ QString HtmlGenerator::format() } /*! - This is where the HTML and DCF files are written. + This is where the HTML files are written. \note The HTML file generation is done in the base class, PageGenerator::generateTree(). */ @@ -380,43 +380,6 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) PageGenerator::generateTree(tree, marker); - dcfClassesRoot.ref = "classes.html"; - dcfClassesRoot.title = "Classes"; - qSort(dcfClassesRoot.subsections); - - dcfOverviewsRoot.ref = "overviews.html"; - dcfOverviewsRoot.title = "Overviews"; - qSort(dcfOverviewsRoot.subsections); - - dcfExamplesRoot.ref = "examples.html"; - dcfExamplesRoot.title = "Tutorial & Examples"; - qSort(dcfExamplesRoot.subsections); - - DcfSection qtRoot; - appendDcfSubSection(&qtRoot, dcfClassesRoot); - appendDcfSubSection(&qtRoot, dcfOverviewsRoot); - appendDcfSubSection(&qtRoot, dcfExamplesRoot); - - generateDcf(project.toLower().simplified().replace(" ", "-"), - "index.html", - projectDescription, qtRoot); - generateDcf("designer", - "designer-manual.html", - "Qt Designer Manual", - dcfDesignerRoot); - generateDcf("linguist", - "linguist-manual.html", - "Qt Linguist Manual", - dcfLinguistRoot); - generateDcf("assistant", - "assistant-manual.html", - "Qt Assistant Manual", - dcfAssistantRoot); - generateDcf("qmake", - "qmake-manual.html", - "qmake Manual", - dcfQmakeRoot); - QString fileBase = project.toLower().simplified().replace(" ", "-"); generateIndex(fileBase, projectUrl, projectDescription); generatePageIndex(outputDir() + "/" + fileBase + ".pageindex", marker); @@ -1253,11 +1216,6 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, title = rawTitle + " Class Reference"; } - DcfSection classSection; - classSection.title = title; - classSection.ref = linkForNode(inner, 0); - classSection.keywords += qMakePair(inner->name(), classSection.ref); - Text subtitleText; if (rawTitle != fullTitle) subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")" @@ -1420,8 +1378,6 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, names << plainCode(marker->markedUpEnumValue(enumName, enume)); } - foreach (const QString &name, names) - classSection.keywords += qMakePair(name,linkForNode(*m,0)); } ++m; } @@ -1430,27 +1386,6 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, ++s; } generateFooter(inner); - - if (!membersLink.isEmpty()) { - DcfSection membersSection; - membersSection.title = "List of all members"; - membersSection.ref = membersLink; - appendDcfSubSection(&classSection, membersSection); - } - if (!obsoleteLink.isEmpty()) { - DcfSection obsoleteSection; - obsoleteSection.title = "Obsolete members"; - obsoleteSection.ref = obsoleteLink; - appendDcfSubSection(&classSection, obsoleteSection); - } - if (!compatLink.isEmpty()) { - DcfSection compatSection; - compatSection.title = "Qt 3 support members"; - compatSection.ref = compatLink; - appendDcfSubSection(&classSection, compatSection); - } - - appendDcfSubSection(&dcfClassesRoot, classSection); } /*! @@ -1460,9 +1395,6 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) { SubTitleSize subTitleSize = LargeSubTitle; - DcfSection fakeSection; - fakeSection.title = fake->fullTitle(); - fakeSection.ref = linkForNode(fake, 0); QList
    sections; QList
    ::const_iterator s; @@ -1542,25 +1474,6 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) << "Qt 3 support members\n"; out() << "\n"; - - if (!membersLink.isEmpty()) { - DcfSection membersSection; - membersSection.title = "List of all members"; - membersSection.ref = membersLink; - appendDcfSubSection(&fakeSection, membersSection); - } - if (!obsoleteLink.isEmpty()) { - DcfSection obsoleteSection; - obsoleteSection.title = "Obsolete members"; - obsoleteSection.ref = obsoleteLink; - appendDcfSubSection(&fakeSection, obsoleteSection); - } - if (!compatLink.isEmpty()) { - DcfSection compatSection; - compatSection.title = "Qt 3 support members"; - compatSection.ref = compatLink; - appendDcfSubSection(&fakeSection, compatSection); - } } #ifdef QDOC_QML else if (fake->subType() == Node::QmlClass) { @@ -1603,8 +1516,6 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) while (m != (*s).members.end()) { generateDetailedQmlMember(*m, fake, marker); out() << "
    \n"; - fakeSection.keywords += qMakePair((*m)->name(), - linkForNode(*m,0)); ++m; } ++s; @@ -1649,8 +1560,6 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) generateAnnotatedList(fake, marker, groupMembersMap); } - fakeSection.keywords += qMakePair(fakeSection.title, fakeSection.ref); - sections = marker->sections(fake, CodeMarker::Detailed, CodeMarker::Okay); s = sections.begin(); while (s != sections.end()) { @@ -1660,35 +1569,11 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) NodeList::ConstIterator m = (*s).members.begin(); while (m != (*s).members.end()) { generateDetailedMember(*m, fake, marker); - fakeSection.keywords += qMakePair((*m)->name(), linkForNode(*m, 0)); ++m; } ++s; } generateFooter(fake); - - if (fake->subType() == Node::Example) { - appendDcfSubSection(&dcfExamplesRoot, fakeSection); - } - else if (fake->subType() != Node::File) { - QString contentsPage = fake->links().value(Node::ContentsLink).first; - - if (contentsPage == "Qt Designer Manual") { - appendDcfSubSection(&dcfDesignerRoot, fakeSection); - } - else if (contentsPage == "Qt Linguist Manual") { - appendDcfSubSection(&dcfLinguistRoot, fakeSection); - } - else if (contentsPage == "Qt Assistant Manual") { - appendDcfSubSection(&dcfAssistantRoot, fakeSection); - } - else if (contentsPage == "qmake Manual") { - appendDcfSubSection(&dcfQmakeRoot, fakeSection); - } - else { - appendDcfSubSection(&dcfOverviewsRoot, fakeSection); - } - } } /*! @@ -3464,10 +3349,7 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative) fn = fileName(node); /* if (!node->url().isEmpty()) return fn;*/ -#if 0 - // ### reintroduce this test, without breaking .dcf files - if (fn != outFileName()) -#endif + link += fn; if (!node->isInnerNode() || node->subType() == Node::QmlPropertyGroup) { @@ -3959,16 +3841,6 @@ QString HtmlGenerator::getLink(const Atom *atom, return link; } -void HtmlGenerator::generateDcf(const QString &fileBase, - const QString &startPage, - const QString &title, - DcfSection &dcfRoot) -{ - dcfRoot.ref = startPage; - dcfRoot.title = title; - generateDcfSections(dcfRoot, outputDir() + "/" + fileBase + ".dcf", fileBase + "/reference"); -} - void HtmlGenerator::generateIndex(const QString &fileBase, const QString &url, const QString &title) diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 1b3de9e..c0a4ce8 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -52,7 +52,6 @@ #include "codemarker.h" #include "config.h" -#include "dcfsection.h" #include "pagegenerator.h" QT_BEGIN_NAMESPACE @@ -253,9 +252,6 @@ class HtmlGenerator : public PageGenerator const Node *relative, CodeMarker *marker, const Node** node); - virtual void generateDcf(const QString &fileBase, - const QString &startPage, - const QString &title, DcfSection &dcfRoot); virtual void generateIndex(const QString &fileBase, const QString &url, const QString &title); @@ -282,13 +278,6 @@ class HtmlGenerator : public PageGenerator #endif QMap refMap; int codeIndent; - DcfSection dcfClassesRoot; - DcfSection dcfOverviewsRoot; - DcfSection dcfExamplesRoot; - DcfSection dcfDesignerRoot; - DcfSection dcfLinguistRoot; - DcfSection dcfAssistantRoot; - DcfSection dcfQmakeRoot; HelpProjectWriter *helpProjectWriter; bool inLink; bool inObsoleteLink; diff --git a/tools/qdoc3/jambiapiparser.cpp b/tools/qdoc3/jambiapiparser.cpp deleted file mode 100644 index 23f2716..0000000 --- a/tools/qdoc3/jambiapiparser.cpp +++ /dev/null @@ -1,546 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - jambiapiparser.cpp -*/ - -#include "cppcodeparser.h" -#include "jambiapiparser.h" -#include "node.h" -#include "tree.h" - -QT_BEGIN_NAMESPACE - -static const char USED_INTERNALLY[] = ""; - -static Text textWithFixedBrief(const Text &text, const Text &beforeBrief, - const Text &afterBrief) -{ - Text result; - - const Atom *atom = text.firstAtom(); - while (atom) { - if (atom->type() == Atom::BriefLeft) { - result << Atom::ParaLeft << beforeBrief; - } else if (atom->type() == Atom::BriefRight) { - result << afterBrief << Atom::ParaRight; - } else { - result << *atom; - } - atom = atom->next(); - } - - return result; -} - -static void setPass1JambifiedDoc(Node *javaNode, const Node *cppNode, const QString &qName = "") -{ - Doc newDoc(cppNode->doc()); - - if (javaNode->type() == Node::Function) { - const FunctionNode *javaFunc = static_cast(javaNode); - if (cppNode->type() == Node::Function) { - const FunctionNode *cppFunc = static_cast(cppNode); - if (const PropertyNode *property = cppFunc->associatedProperty()) { - newDoc = property->doc(); - Text text(newDoc.body()); - - Node *mutableCppNode = const_cast(cppNode); - if (property->getters().contains(mutableCppNode)) { - text = textWithFixedBrief(text, Text("Returns "), Text(".")); - } else if (property->setters().contains(mutableCppNode)) { - Text afterBrief; - if (javaFunc->parameterNames().count() == 1 - && !javaFunc->parameterNames().first().isEmpty()) { - afterBrief << " to " - << Atom(Atom::FormattingLeft, ATOM_FORMATTING_PARAMETER) - << javaFunc->parameterNames().first() - << Atom(Atom::FormattingRight, ATOM_FORMATTING_PARAMETER); - } - afterBrief << "."; - text = textWithFixedBrief(text, Text("Sets "), afterBrief); - } else if (property->resetters().contains(mutableCppNode)) { - text = textWithFixedBrief(text, Text("Resets "), Text(".")); - } - - newDoc.setBody(text); - } else { - QStringList javaParams = javaFunc->parameterNames(); - QStringList cppParams = cppFunc->parameterNames(); - newDoc.renameParameters(cppParams, javaParams); - - if (cppNode->access() == Node::Private) { - Text text; - text << Atom::ParaLeft; - if (cppFunc->reimplementedFrom()) { - text << "This function is reimplemented for internal reasons."; - } else { - text << USED_INTERNALLY; - } - text << Atom::ParaRight; - newDoc.setBody(text); - } - } - } else if (cppNode->type() == Node::Variable) { - Text text(newDoc.body()); - - if (qName == "variablegetter") { - text = textWithFixedBrief(text, Text("Returns "), Text(".")); - } else if (qName == "variablesetter") { - Text afterBrief; - if (javaFunc->parameterNames().count() == 1 - && !javaFunc->parameterNames().first().isEmpty()) { - afterBrief << " to " - << Atom(Atom::FormattingLeft, ATOM_FORMATTING_PARAMETER) - << javaFunc->parameterNames().first() - << Atom(Atom::FormattingRight, ATOM_FORMATTING_PARAMETER); - } - afterBrief << "."; - text = textWithFixedBrief(text, Text("Sets "), afterBrief); - } - - newDoc.setBody(text); - } - } else { // ### enum value names? - - } - - javaNode->setDoc(newDoc, true); -} - -static void setStatus(Node *javaNode, const Node *cppNode) -{ - if (cppNode->status() == Node::Compat) { - javaNode->setStatus(Node::Obsolete); - } else { - javaNode->setStatus(cppNode->status()); - } -} - -static Text findEnumText(Node *javaEnum, const QString &enumItemName) -{ - const Text &body = javaEnum->doc().body(); - const Atom *atom = body.firstAtom(); - while (atom) { - if (atom->type() == Atom::ListTagLeft && atom->string() == ATOM_LIST_VALUE) { - atom = atom->next(); - if (atom) { - // ### paras? - if (atom->string() == enumItemName) - return body.subText(Atom::ListItemLeft, Atom::ListItemRight, atom); - } - } else { - atom = atom->next(); - } - } - return Text(); -} - -JambiApiParser::JambiApiParser(Tree *cppTree) - : cppTre(cppTree), javaTre(0), metJapiTag(false) -{ -} - -JambiApiParser::~JambiApiParser() -{ -} - -void JambiApiParser::initializeParser(const Config &config) -{ - CodeParser::initializeParser(config); -} - -void JambiApiParser::terminateParser() -{ - CodeParser::terminateParser(); -} - -QString JambiApiParser::language() -{ - return "Java"; -} - -QString JambiApiParser::sourceFileNameFilter() -{ - return "*.japi"; -} - -void JambiApiParser::parseSourceFile(const Location &location, const QString &filePath, Tree *tree) -{ - javaTre = tree; - metJapiTag = false; - - QXmlSimpleReader reader; - reader.setContentHandler(this); - reader.setErrorHandler(this); - - QFile file(filePath); - if (!file.open(QFile::ReadOnly)) { - location.warning(tr("Cannot open JAPI file '%1'").arg(filePath)); - return; - } - - japiLocation = Location(filePath); - QXmlInputSource xmlSource(&file); - reader.parse(xmlSource); -} - -void JambiApiParser::doneParsingSourceFiles(Tree * /* tree */) -{ - /* - Also import the overview documents. - */ - foreach (Node *cppNode, cppTre->root()->childNodes()) { - if (cppNode->type() == Node::Fake) { - FakeNode *cppFake = static_cast(cppNode); - if (cppFake->subType() == Node::Page) { - FakeNode *javaFake = new FakeNode(javaTre->root(), - cppFake->name(), - cppFake->subType()); - javaFake->setModuleName("com.trolltech.qt"); // ### hard-coded - javaFake->setTitle(cppFake->title()); - javaFake->setSubTitle(cppFake->subTitle()); - setStatus(javaFake, cppFake); - setPass1JambifiedDoc(javaFake, cppFake); - } - } - } - - /* - Fix the docs. - */ - if (javaTre) { - javaTre->resolveInheritance(); - jambifyDocsPass2(javaTre->root()); - javaTre = 0; - } -} - -bool JambiApiParser::startElement(const QString & /* namespaceURI */, - const QString & /* localName */, - const QString &qName, - const QXmlAttributes &attributes) -{ - if (!metJapiTag && qName != "japi") { - // ### The file is not a JAPI file. - return true; - } - metJapiTag = true; - - EnumNode *javaEnum = 0; - EnumNode *cppEnum = 0; - InnerNode *javaParent = javaTre->root(); - InnerNode *cppParent = cppTre->root(); - - for (int i = 0; i < classAndEnumStack.count(); ++i) { - const ClassOrEnumInfo &info = classAndEnumStack.at(i); - if (info.cppNode) { - if (info.cppNode->type() == Node::Enum) { - Q_ASSERT(info.javaNode->type() == Node::Enum); - javaEnum = static_cast(info.javaNode); - cppEnum = static_cast(info.cppNode); - } else { - Q_ASSERT(info.javaNode->type() == Node::Class - || info.javaNode->type() == Node::Namespace); - javaParent = static_cast(info.javaNode); - cppParent = static_cast(info.cppNode); - } - } - } - - if (qName == "class" || qName == "enum") { - Node::Type type = (qName == "class") ? Node::Class : Node::Enum; - - QString javaExtends = attributes.value("java-extends"); - QString javaImplements = attributes.value("javaimplements"); - - ClassOrEnumInfo info; - info.tag = qName; - info.javaName = attributes.value("java"); - info.cppName = attributes.value("cpp"); - info.cppNode = cppTre->findNode(info.cppName.split("::"), type, cppParent); - if (!info.cppNode && type == Node::Class) { - type = Node::Namespace; - info.cppNode = cppTre->findNode(info.cppName.split("::"), type, cppParent); - } - - if (!info.cppNode) { - japiLocation.warning(tr("Cannot find C++ class or enum '%1'").arg(info.cppName)); - } else { - if (qName == "class") { - ClassNode *javaClass = new ClassNode(javaParent, info.javaName); - javaClass->setModuleName(attributes.value("package")); - if (!javaExtends.isEmpty()) - javaTre->addBaseClass(javaClass, Node::Public, javaExtends.split('.'), - javaExtends); - if (!javaImplements.isEmpty()) - javaTre->addBaseClass(javaClass, Node::Public, javaImplements.split('.'), - javaExtends); - - info.javaNode = javaClass; - } else { - info.javaNode = new EnumNode(javaParent, info.javaName); - } - info.javaNode->setLocation(japiLocation); - setStatus(info.javaNode, info.cppNode); - - setPass1JambifiedDoc(info.javaNode, info.cppNode); - } - classAndEnumStack.push(info); - } else if (qName == "method" || qName == "signal") { - QString javaSignature = attributes.value("java"); - if (javaSignature.startsWith("private")) - return true; - - QString cppSignature = attributes.value("cpp"); - - CppCodeParser cppParser; - const FunctionNode *cppNode = cppParser.findFunctionNode(cppSignature, cppTre, - cppParent, - true /* fuzzy */); - if (!cppNode) { - bool quiet = false; - - /* - Default constructors sometimes don't exist in C++. - */ - if (!quiet && javaSignature == "public " + javaParent->name() + "()") - quiet = true; - - if (!quiet) - japiLocation.warning(tr("Cannot find C++ function '%1' ('%2')") - .arg(cppSignature).arg(cppParent->name())); - } - - FunctionNode *javaNode; - if (makeFunctionNode(javaParent, javaSignature, &javaNode)) { - javaNode->setLocation(japiLocation); - if (qName == "signal") - javaNode->setMetaness(FunctionNode::Signal); - - if (cppNode) { - setStatus(javaNode, cppNode); - - int overloadNo = cppNode->parameters().count() - javaNode->parameters().count() + 1; - if (overloadNo == 1) { - setPass1JambifiedDoc(javaNode, cppNode); - } else { - Text text; - - text << Atom::ParaLeft << "Equivalent to " - << Atom(Atom::Link, javaNode->name() + "()") - << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK) - << javaNode->name() - << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK) - << "("; - - for (int i = 0; i < cppNode->parameters().count(); ++i) { - if (i > 0) - text << ", "; - if (i < javaNode->parameters().count()) { - text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_PARAMETER) - << javaNode->parameters().at(i).name() - << Atom(Atom::FormattingRight, ATOM_FORMATTING_PARAMETER); - } else { - // ### convert to Java - text << cppNode->parameters().at(i).defaultValue(); - } - } - - text << ")."; - - Doc doc; - doc.setBody(text); - javaNode->setDoc(doc, true); - } - javaNode->setOverload(overloadNo > 1); - } - } - } else if (qName == "variablesetter" || qName == "variablegetter") { - QString javaSignature = attributes.value("java"); - if (javaSignature.startsWith("private")) - return true; - - QString cppVariable = attributes.value("cpp"); - - VariableNode *cppNode = static_cast(cppParent->findNode(cppVariable, - Node::Variable)); - FunctionNode *javaNode; - if (makeFunctionNode(javaParent, javaSignature, &javaNode)) { - javaNode->setLocation(japiLocation); - - if (!cppNode) { -#if 0 - japiLocation.warning(tr("Cannot find C++ variable '%1' ('%2')") - .arg(cppVariable).arg(cppParent->name())); -#endif - javaNode->setDoc(Doc(japiLocation, japiLocation, - USED_INTERNALLY, - QSet()), true); - } else { - setPass1JambifiedDoc(javaNode, cppNode, qName); - setStatus(javaNode, cppNode); - } - } - } else if (qName == "enum-value") { - QString javaName = attributes.value("java"); - QString cppName = attributes.value("cpp"); - QString value = attributes.value("value"); - - if (javaEnum) { - EnumItem item(javaName, value, findEnumText(javaEnum, javaName)); - javaEnum->addItem(item); - } - } - - return true; -} - -bool JambiApiParser::endElement(const QString & /* namespaceURI */, - const QString & /* localName */, - const QString &qName) -{ - if (qName == "class" || qName == "enum") - classAndEnumStack.pop(); - return true; -} - -bool JambiApiParser::fatalError(const QXmlParseException &exception) -{ - japiLocation.setLineNo(exception.lineNumber()); - japiLocation.setColumnNo(exception.columnNumber()); - japiLocation.warning(tr("Syntax error in JAPI file (%1)").arg(exception.message())); - return true; -} - -void JambiApiParser::jambifyDocsPass2(Node *node) -{ - const Doc &doc = node->doc(); - if (!doc.isEmpty()) { - if (node->type() == Node::Enum) { - Doc newDoc(doc); - newDoc.simplifyEnumDoc(); - node->setDoc(newDoc, true); - } - } - - if (node->isInnerNode()) { - InnerNode *innerNode = static_cast(node); - foreach (Node *child, innerNode->childNodes()) - jambifyDocsPass2(child); - } -} - -bool JambiApiParser::makeFunctionNode(InnerNode *parent, const QString &synopsis, - FunctionNode **funcPtr) -{ - Node::Access access = Node::Public; - FunctionNode::Metaness metaness = FunctionNode::Plain; - bool final = false; - bool statique = false; - - QString mySynopsis = synopsis.simplified(); - int oldLen; - do { - oldLen = mySynopsis.length(); - - if (mySynopsis.startsWith("public ")) { - mySynopsis.remove(0, 7); - access = Node::Public; - } - if (mySynopsis.startsWith("protected ")) { - mySynopsis.remove(0, 10); - access = Node::Protected; - } - if (mySynopsis.startsWith("private ")) { - mySynopsis.remove(0, 8); - access = Node::Private; - } - if (mySynopsis.startsWith("native ")) { - mySynopsis.remove(0, 7); - metaness = FunctionNode::Native; - } - if (mySynopsis.startsWith("final ")) { - mySynopsis.remove(0, 6); - final = true; - } - if (mySynopsis.startsWith("static ")) { - mySynopsis.remove(0, 7); - statique = true; - } - } while (oldLen != mySynopsis.length()); - - // method or constructor - QRegExp funcRegExp("(?:(.*) )?([A-Za-z_0-9]+)\\((.*)\\)"); - if (!funcRegExp.exactMatch(mySynopsis)) - return false; - - QString retType = funcRegExp.cap(1); - QString funcName = funcRegExp.cap(2); - QStringList params = funcRegExp.cap(3).split(","); - - FunctionNode *func = new FunctionNode(parent, funcName); - func->setReturnType(retType); - func->setAccess(access); - func->setStatic(statique); - func->setConst(final); - func->setMetaness(metaness); - - QRegExp paramRegExp(" ?([^ ].*) ([A-Za-z_0-9]+) ?"); - - foreach (const QString ¶m, params) { - if (paramRegExp.exactMatch(param)) { - func->addParameter(Parameter(paramRegExp.cap(1), "", paramRegExp.cap(2))); - } else { - // problem - } - } - - if (funcPtr) { - *funcPtr = func; - } else if (!parent) { - delete func; - } - return true; -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/jambiapiparser.h b/tools/qdoc3/jambiapiparser.h deleted file mode 100644 index ecfaab5..0000000 --- a/tools/qdoc3/jambiapiparser.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - jambiapiparser.h -*/ - -#ifndef JAMBIAPIPARSER_H -#define JAMBIAPIPARSER_H - -#include -#include - -#include "codeparser.h" - -QT_BEGIN_NAMESPACE - -struct ClassOrEnumInfo -{ - QString tag; - QString javaName; - QString cppName; - Node *javaNode; - Node *cppNode; - - ClassOrEnumInfo() : javaNode(0), cppNode(0) {} -}; - -class JambiApiParser : public CodeParser, private QXmlDefaultHandler -{ -public: - JambiApiParser(Tree *cppTree); - ~JambiApiParser(); - - void initializeParser(const Config &config); - void terminateParser(); - QString language(); - QString sourceFileNameFilter(); - void parseSourceFile(const Location &location, const QString &filePath, Tree *tree); - virtual void doneParsingSourceFiles(Tree *tree); - -private: - bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &attributes); - bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - bool fatalError(const QXmlParseException &exception); - void jambifyDocsPass2(Node *node); - bool makeFunctionNode(InnerNode *parent, const QString &synopsis, FunctionNode **funcPtr); - - Tree *cppTre; - Tree *javaTre; - - bool metJapiTag; - Location japiLocation; - QStack classAndEnumStack; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/javacodemarker.cpp b/tools/qdoc3/javacodemarker.cpp deleted file mode 100644 index c9a8f60..0000000 --- a/tools/qdoc3/javacodemarker.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - javacodemarker.cpp -*/ - -#include "javacodemarker.h" -#include "node.h" -#include "text.h" -#include "tree.h" - -QT_BEGIN_NAMESPACE - -JavaCodeMarker::JavaCodeMarker() -{ -} - -JavaCodeMarker::~JavaCodeMarker() -{ -} - -bool JavaCodeMarker::recognizeCode( const QString& /* code */ ) -{ - return true; -} - -bool JavaCodeMarker::recognizeExtension( const QString& ext ) -{ - return ext == "java"; -} - -bool JavaCodeMarker::recognizeLanguage( const QString& lang ) -{ - return lang == "Java"; -} - -QString JavaCodeMarker::plainName( const Node *node ) -{ - return node->name(); -} - -QString JavaCodeMarker::plainFullName( const Node *node, const Node * /* relative */ ) -{ - if (!node) - return QString(); - - QString fullName; - for ( ;; ) { - fullName.prepend( plainName(node) ); - if ( node->parent() && node->parent()->name().isEmpty() ) - break; - node = node->parent(); - if (!node) - break; - fullName.prepend("."); - } - return fullName; -} - -QString JavaCodeMarker::markedUpCode( const QString& code, - const Node * /* relative */, - const QString& /* dirPath */ ) -{ - return protect( code ); -} - -QString JavaCodeMarker::markedUpSynopsis(const Node * /* node */, - const Node * /* relative */, - SynopsisStyle /* style */) -{ - return QString(); -} - -QString JavaCodeMarker::markedUpName( const Node *node ) -{ - return linkTag(node, taggedNode(node)); -} - -QString JavaCodeMarker::markedUpFullName(const Node *node, const Node * /* relative */ ) -{ - QString fullName; - for ( ;; ) { - fullName.prepend( markedUpName(node) ); - if ( node->parent()->name().isEmpty() ) - break; - node = node->parent(); - fullName.prepend( "." ); - } - return fullName; -} - -QString JavaCodeMarker::markedUpEnumValue(const QString &enumValue, - const Node * /* relative */) -{ - return protect(enumValue); -} - -QString JavaCodeMarker::markedUpIncludes( const QStringList& /* includes */ ) -{ - return QString(); -} - -QString JavaCodeMarker::functionBeginRegExp( const QString& /* funcName */) -{ - return "^x$"; // ### invalid regexp -} - -QString JavaCodeMarker::functionEndRegExp( const QString& /* funcName */ ) -{ - return "^}"; -} - -QList
    JavaCodeMarker::sections(const InnerNode * /* inner */, SynopsisStyle /* style */, - Status /* status */) -{ - return QList
    (); -} - -const Node *JavaCodeMarker::resolveTarget(const QString &target, - const Tree *tree, - const Node *relative, - const Node* /* self */) -{ - if (target.endsWith("()")) { - const FunctionNode *func; - QString funcName = target; - funcName.chop(2); - - QStringList path = funcName.split('.'); - if ((func = tree->findFunctionNode(path, relative, Tree::SearchBaseClasses))) - return func; - } else if (target.contains("#")) { - int hashAt = target.indexOf("#"); - QString link = target.left(hashAt); - QString ref = target.mid(hashAt + 1); - const Node *node; - if (link.isEmpty()) { - node = relative; - } else { - QStringList path(link); - node = tree->findNode(path, tree->root(), Tree::SearchBaseClasses); - } - if (node && node->isInnerNode()) { - const Atom *atom = node->doc().body().firstAtom(); - while (atom) { - if (atom->type() == Atom::Target && atom->string() == ref) { - Node *parentNode = const_cast(node); - return new TargetNode(static_cast(parentNode), - ref); - } - atom = atom->next(); - } - } - } else { - QStringList path = target.split('.'); - const Node *node; - if ((node = tree->findNode(path, relative, - Tree::SearchBaseClasses | Tree::SearchEnumValues))) - return node; - } - return 0; -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/javacodemarker.h b/tools/qdoc3/javacodemarker.h deleted file mode 100644 index c2aabc0..0000000 --- a/tools/qdoc3/javacodemarker.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - javacodemarker.h -*/ - -#ifndef JAVACODEMARKER_H -#define JAVACODEMARKER_H - -#include "codemarker.h" - -QT_BEGIN_NAMESPACE - -class JavaCodeMarker : public CodeMarker -{ -public: - JavaCodeMarker(); - ~JavaCodeMarker(); - - bool recognizeCode( const QString& code ); - bool recognizeExtension( const QString& ext ); - bool recognizeLanguage( const QString& lang ); - QString plainName(const Node *node); - QString plainFullName(const Node *node, const Node *relative); - QString markedUpCode( const QString& code, const Node *relative, - const QString& dirPath ); - QString markedUpSynopsis( const Node *node, const Node *relative, - SynopsisStyle style ); - QString markedUpName( const Node *node ); - QString markedUpFullName( const Node *node, const Node *relative ); - QString markedUpEnumValue(const QString &enumValue, const Node *relative); - QString markedUpIncludes( const QStringList& includes ); - QList
    sections(const InnerNode *innerNode, SynopsisStyle style, Status status); - QString functionBeginRegExp( const QString& funcName ); - QString functionEndRegExp( const QString& funcName ); - const Node* resolveTarget( const QString& target, - const Tree* tree, - const Node* relative, - const Node* self = 0 ); -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/javadocgenerator.cpp b/tools/qdoc3/javadocgenerator.cpp deleted file mode 100644 index eb9c1c9..0000000 --- a/tools/qdoc3/javadocgenerator.cpp +++ /dev/null @@ -1,454 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "javadocgenerator.h" - -QT_BEGIN_NAMESPACE - -enum JavaSignatureSyntax { - GeneratedJdocFile, - JavadocRef, - SlotSignature -}; - -static QString javaSignature(const FunctionNode *func, JavaSignatureSyntax syntax, - int maxParams = 65535) -{ - maxParams = qMin(maxParams, func->parameters().count()); - - QString result; - - if (syntax == GeneratedJdocFile) { - if (func->access() == Node::Public) { - result += "public "; - } else if (func->access() == Node::Protected) { - result += "protected "; - } else { - result += "private "; - } - - if (func->metaness() == FunctionNode::Native) - result += "native "; - - if (func->isConst()) - result += "final "; - - // ### func->metaness() == FunctionNode::Abstract - - if (func->isStatic()) - result += "static "; - - if (!func->returnType().isEmpty()) { - result += func->returnType(); - result += ' '; - } - } - - if (syntax == SlotSignature) { - result += "void mySlot"; - } else { - result += func->name(); - } - result += '('; - for (int i = 0; i < maxParams; ++i) { - if (i != 0) - result += ", "; - result += func->parameters().at(i).leftType(); - if (syntax != JavadocRef) { - result += ' '; - result += func->parameters().at(i).name(); - } - } - result += ')'; - - return result; -} - -static QString packageName(const Node *node) -{ - while (node && node->type() != Node::Class && node->type() != Node::Fake) - node = node->parent(); - if (!node) - return QString(); - return node->moduleName(); -} - -JavadocGenerator::JavadocGenerator() - : oldDevice(0), currentDepth(0) -{ -} - -JavadocGenerator::~JavadocGenerator() -{ -} - -void JavadocGenerator::initializeGenerator(const Config &config) -{ - HtmlGenerator::initializeGenerator(config); - - formattingLeftMap().insert(ATOM_FORMATTING_PARAMETER, - formattingLeftMap().value(ATOM_FORMATTING_TELETYPE)); - formattingRightMap().insert(ATOM_FORMATTING_PARAMETER, - formattingRightMap().value(ATOM_FORMATTING_TELETYPE)); -} - -void JavadocGenerator::terminateGenerator() -{ - HtmlGenerator::terminateGenerator(); -} - -QString JavadocGenerator::format() -{ - return "javadoc"; -} - -void JavadocGenerator::generateTree(const Tree *tree, CodeMarker *marker) -{ - HtmlGenerator::generateTree(tree, marker); -} - -QString JavadocGenerator::fileExtension(const Node *node) const -{ - if (node->type() == Node::Fake) { - return "html"; - } else { - return "jdoc"; - } -} - -QString JavadocGenerator::typeString(const Node *node) -{ - if (node->type() == Node::Function) { - const FunctionNode *func = static_cast(node); - return func->metaness() == FunctionNode::Signal ? "signal" : "method"; - } else { - return HtmlGenerator::typeString(node); - } -} - -QString JavadocGenerator::imageFileName(const Node *relative, const QString& fileBase) -{ - QString result = HtmlGenerator::imageFileName(relative, fileBase); - if (!result.isEmpty()) { - QString package = packageName(relative); - int numSubPackages = package.count('.') - 2; - while (numSubPackages > 0) { - result.prepend("%2E%2E/"); // javadoc 1.5.0_06 chokes on '../' - --numSubPackages; - } - } - return result; -} - -static int textDepth = 0; - -void JavadocGenerator::startText(const Node *relative, CodeMarker *marker) -{ - if (textDepth++ == 0 && relative->type() != Node::Fake) { - Q_ASSERT(!oldDevice); - oldDevice = out().device(); - Q_ASSERT(oldDevice); - out().setString(&buffer); - } - HtmlGenerator::startText(relative, marker); -} - -void JavadocGenerator::endText(const Node *relative, CodeMarker *marker) -{ - HtmlGenerator::endText(relative, marker); - if (--textDepth == 0 && relative->type() != Node::Fake) { - Q_ASSERT(oldDevice); - out().setDevice(oldDevice); - oldDevice = 0; - - /* - Need to escape XML metacharacters in .jdoc files. - */ - buffer.replace("*/", "*<!-- noop -->/"); - buffer.replace("&", "&"); - buffer.replace("\"", """); - buffer.replace("<", "<"); - buffer.replace(">", ">"); - out() << buffer; - buffer.clear(); - } -} - -int JavadocGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker) -{ - return HtmlGenerator::generateAtom(atom, relative, marker); -} - -void JavadocGenerator::generateClassLikeNode(const InnerNode *inner, CodeMarker *marker) -{ - generateIndent(); - out() << "name()) << "\""; - generateDoc(inner, marker); - out() << ">\n"; - - ++currentDepth; - foreach (Node *node, inner->childNodes()) { - if (node->isInnerNode()) { - generateClassLikeNode(static_cast(node), marker); - } else { - if (node->type() == Node::Enum) { - EnumNode *enume = static_cast(node); - - generateIndent(); - out() << "name()) << "\""; - generateDoc(node, marker); - out() << ">\n"; - - ++currentDepth; - const QList &items = enume->items(); - for (int i = 0; i < items.count(); ++i) { - const EnumItem &item = items.at(i); - generateIndent(); - out() << "\n"; - } - --currentDepth; - - out() << "\n"; - } else if (node->type() == Node::Function) { - FunctionNode *func = static_cast(node); - generateIndent(); - out() << (func->metaness() == FunctionNode::Signal ? "\n"; - } - } - } - --currentDepth; - - generateIndent(); - out() << "\n"; -} - -void JavadocGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) -{ - HtmlGenerator::generateFakeNode(fake, marker); -} - -bool JavadocGenerator::generateText(const Text& text, const Node *relative, CodeMarker *marker) -{ - HtmlGenerator::generateText(text, relative, marker); - return true; -} - -void JavadocGenerator::generateBody(const Node *node, CodeMarker *marker) -{ - generateText(node->doc().body(), node, marker); -} - -void JavadocGenerator::generateAlsoList( const Node *node, CodeMarker *marker ) -{ - QList alsoList = node->doc().alsoList(); - supplementAlsoList(node, alsoList); - - if (node->type() == Node::Fake - || (node->type() == Node::Function - && static_cast(node)->metaness() == FunctionNode::Signal)) { - Text text; - - if (!alsoList.isEmpty()) { - text << Atom(Atom::ListLeft, ATOM_LIST_TAG) - << Atom(Atom::ListTagLeft, ATOM_LIST_TAG) - << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD) - << "See Also:" - << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) - << Atom(Atom::ListTagRight, ATOM_LIST_TAG) - << Atom(Atom::ListItemLeft, ATOM_LIST_TAG); - - for (int i = 0; i < alsoList.count(); ++i) { - if (i != 0) - text << ", "; - text << alsoList.at(i); - } - text << Atom(Atom::ListItemRight, ATOM_LIST_TAG) - << Atom(Atom::ListRight, ATOM_LIST_TAG); - } - - generateText(text, node, marker); - } else { - foreach (const Text &text, alsoList) { - out() << "\n@see "; - generateText(text, node, marker); - } - } -} - -QString JavadocGenerator::refForNode( const Node *node ) -{ - if (node->type() == Node::Function) - return javaSignature(static_cast(node), JavadocRef); - - return HtmlGenerator::refForNode(node); -} - -QString JavadocGenerator::linkForNode( const Node *node, const Node *relative ) -{ - // ### EVIL, relative should never be null - if (!relative) - relative = node; - - if (packageName(node).isEmpty()) { - // ### jasmin: Fixme - return QString(); - } - - QString result; - if (node->type() == Node::Fake) { - result = node->name(); - } else { - if (!node->isInnerNode()) { - result = linkForNode(node->parent(), relative) + "#" + refForNode(node); - } else { - result = node->name() + ".html"; - } - } - - QStringList nodePackage = packageName(node).split("."); - QStringList relativePackage = packageName(relative).split("."); - if (nodePackage == QStringList(QString()) || relativePackage == QStringList(QString())) { - qWarning("I'm in trouble [%s][%s]", qPrintable(node->name()), qPrintable(relative->name())); - return QString(); - } - - int i = nodePackage.count() - 1; - while (nodePackage.value(i) != relativePackage.value(i)) { - result.prepend(nodePackage.at(i) + "/"); - --i; - } - - ++i; - while (i < relativePackage.count()) { - result.prepend("%2E%2E/"); // javadoc 1.5.0_06 chokes on '../' - ++i; - } - - return result; -} - -QString JavadocGenerator::refForAtom(Atom *atom, const Node *node) -{ - return HtmlGenerator::refForAtom(atom, node); -} - -/* - Neutralize dumb functions called from HtmlGenerator. -*/ -void JavadocGenerator::generateDcf(const QString & /* fileBase */, const QString & /* startPage */, - const QString & /* title */, DcfSection & /* dcfRoot */) -{ -} - -void JavadocGenerator::generateIndex(const QString & /* fileBase */, const QString & /* url */, - const QString & /* title */) -{ -} - -void JavadocGenerator::generateIndent() -{ - for (int i = 0; i < currentDepth; ++i) - out() << " "; -} - -void JavadocGenerator::generateDoc(const Node *node, CodeMarker *marker) -{ - const Text &text = node->doc().body(); - if (!text.isEmpty()) { - out() << " doc=\"/**\n"; - Generator::generateStatus(node, marker); - generateText(text, node, marker); - if (node && node->type() == Node::Function) { - const FunctionNode *func = static_cast(node); - if (func->metaness() == FunctionNode::Signal) { - QStringList slotSignatures; - for (int i = func->parameters().count(); i >= 0; --i) - slotSignatures += javaSignature(func, SlotSignature, i); - - Text text; - - text << Atom(Atom::ListLeft, ATOM_LIST_TAG) - << Atom(Atom::ListTagLeft, ATOM_LIST_TAG) - << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD); - - if (slotSignatures.count() == 1) { - text << "Compatible Slot Signature:"; - } else { - text << "Compatible Slot Signatures:"; - } - - text << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) - << Atom(Atom::ListTagRight, ATOM_LIST_TAG); - - for (int i = 0; i < slotSignatures.count(); ++i) { - text << Atom(Atom::ListItemLeft, ATOM_LIST_TAG) - << Atom(Atom::C, marker->markedUpCode(slotSignatures.at(i), 0, "")) - << Atom(Atom::ListItemRight, ATOM_LIST_TAG); - } - text << Atom(Atom::ListRight, ATOM_LIST_TAG); - generateText(text, node, marker); - } - } - if (node) - generateAlsoList(node, marker); - out() << " */\""; - } -} - -void JavadocGenerator::generateEnumItemDoc(const Text &text, const Node *node, CodeMarker *marker) -{ - out() << " doc=\"/**\n"; - if (text.isEmpty()) { - out() << "Internal."; - } else { - generateText(text, node, marker); - } - out() << " */\""; -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/javadocgenerator.h b/tools/qdoc3/javadocgenerator.h deleted file mode 100644 index b485502..0000000 --- a/tools/qdoc3/javadocgenerator.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef JAVADOCGENERATOR_H -#define JAVADOCGENERATOR_H - -#include "htmlgenerator.h" - -QT_BEGIN_NAMESPACE - -class JavadocGenerator : public HtmlGenerator -{ -public: - JavadocGenerator(); - ~JavadocGenerator(); - - void initializeGenerator(const Config &config); - void terminateGenerator(); - QString format(); - bool canHandleFormat(const QString &format) { return format == "HTML" || format == "javadoc"; } - void generateTree(const Tree *tree, CodeMarker *marker); - QString typeString(const Node *node); - QString imageFileName(const Node *relative, const QString &fileBase); - -protected: - QString fileExtension(const Node *node) const; - void startText( const Node *relative, CodeMarker *marker ); - void endText( const Node *relative, CodeMarker *marker ); - int generateAtom( const Atom *atom, const Node *relative, CodeMarker *marker ); - void generateClassLikeNode(const InnerNode *inner, CodeMarker *marker); - void generateFakeNode( const FakeNode *fake, CodeMarker *marker ); - - bool generateText( const Text& text, const Node *relative, CodeMarker *marker ); - void generateBody( const Node *node, CodeMarker *marker ); - void generateAlsoList( const Node *node, CodeMarker *marker ); - - QString refForNode( const Node *node ); - QString linkForNode( const Node *node, const Node *relative ); - QString refForAtom(Atom *atom, const Node *node); - -private: - void generateDcf(const QString &fileBase, const QString &startPage, - const QString &title, DcfSection &dcfRoot); - void generateIndex(const QString &fileBase, const QString &url, - const QString &title); - void generateIndent(); - void generateDoc(const Node *node, CodeMarker *marker); - void generateEnumItemDoc(const Text &text, const Node *node, CodeMarker *marker); - - QString buffer; - QIODevice *oldDevice; - int currentDepth; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/linguistgenerator.cpp b/tools/qdoc3/linguistgenerator.cpp deleted file mode 100644 index 702f0fb..0000000 --- a/tools/qdoc3/linguistgenerator.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - linguistgenerator.cpp -*/ - -#include "codemarker.h" -#include "pagegenerator.h" -#include "linguistgenerator.h" -#include "node.h" -#include "separator.h" -#include "tree.h" -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -#define COMMAND_VERSION Doc::alias("version") - -LinguistGenerator::LinguistGenerator() - : PageGenerator() -{ -} - -LinguistGenerator::~LinguistGenerator() -{ -} - -void LinguistGenerator::initializeGenerator(const Config &config) -{ - Generator::initializeGenerator(config); -} - -void LinguistGenerator::terminateGenerator() -{ - PageGenerator::terminateGenerator(); -} - -QString LinguistGenerator::format() -{ - return "Linguist"; -} - -QString LinguistGenerator::fileExtension(const Node * /* node */) const -{ - return "ts"; -} - -void LinguistGenerator::generateClassLikeNode(const InnerNode *inner, CodeMarker *marker) -{ - out().setCodec("UTF-8"); - - QDomDocument document("TS"); - QDomElement documentElement = document.createElement("TS"); - documentElement.setAttribute("version", "1.1"); - - QList contextElements = generateIndexSections(document, inner, marker); - foreach (const QDomElement &element, contextElements) - documentElement.appendChild(element); - - QDomProcessingInstruction process = document.createProcessingInstruction( - "xml", QString("version=\"1.0\" encoding=\"%1\"").arg("UTF-8")); - document.appendChild(process); - document.appendChild(documentElement); - - out() << document; - out().flush(); -} - -void LinguistGenerator::generateFakeNode( const FakeNode *fake, CodeMarker *marker ) -{ - out().setCodec("utf-8"); - - QDomDocument document("TS"); - QDomElement documentElement = document.createElement("TS"); - documentElement.setAttribute("version", "1.1"); - - QList contextElements = generateIndexSections(document, fake, marker); - foreach (const QDomElement &element, contextElements) - documentElement.appendChild(element); - - QDomProcessingInstruction process = document.createProcessingInstruction( - "xml", QString("version=\"1.0\" encoding=\"%1\"").arg("utf-8")); - document.appendChild(process); - document.appendChild(documentElement); - - out() << document; - out().flush(); -} - -QList LinguistGenerator::generateIndexSections( - QDomDocument &document, const Node *node, CodeMarker *marker) -{ - QList contexts; - - if (node->isInnerNode()) { - const InnerNode *inner = static_cast(node); - - foreach (const Node *child, inner->childNodes()) { - // Recurse to generate a DOM element for this child node and all - // its children. - contexts += generateIndexSections(document, child, marker); - } -/* - foreach (const Node *child, inner->relatedNodes()) { - QDomElement childElement = generateIndexSections(document, child, marker); - element.appendChild(childElement); - } -*/ - } - - // Add documentation to this node if it exists. - if (!node->doc().isEmpty()) { - - QString nodeName = fullName(node); - QString signature; - - if (node->type() == Node::Function) { - QStringList pieces; - const FunctionNode *functionNode = static_cast(node); - foreach (const Parameter ¶meter, functionNode->parameters()) { - QString typeString = parameter.leftType() + parameter.rightType(); - if (typeString.split(" ").size() > 1) - pieces.append(typeString + parameter.name()); - else - pieces.append(typeString + " " + parameter.name()); - } - signature = "(" + pieces.join(", ") + ")"; - } - - QDomElement contextElement = document.createElement("context"); - QDomElement nameElement = document.createElement("name"); - nameElement.appendChild(document.createTextNode(nodeName + signature)); - contextElement.appendChild(nameElement); - - QDomElement messageElement = document.createElement("message"); - contextElement.appendChild(messageElement); - - QDomElement sourceElement = document.createElement("source"); - QString sourceText = simplified(node->doc().source()); - if (!signature.isEmpty() && signature != "()" && !sourceText.contains("\\fn")) - sourceText.prepend(QString("\\fn %1%2\n").arg(nodeName).arg(signature)); - sourceElement.appendChild(document.createTextNode(sourceText)); - messageElement.appendChild(sourceElement); - - QDomElement translationElement = document.createElement("translation"); - translationElement.setAttribute("type", "unfinished"); - messageElement.appendChild(translationElement); - - QDomElement locationElement = document.createElement("location"); - locationElement.setAttribute("filename", node->doc().location().filePath()); - locationElement.setAttribute("line", node->doc().location().lineNo()); - messageElement.appendChild(locationElement); - - contexts.append(contextElement); - } - - return contexts; -} - -QString LinguistGenerator::fullName(const Node *node) const -{ - if (!node) - return ""; - else if (node->parent() && !node->parent()->name().isEmpty()) - return fullName(node->parent()) + "::" + node->name(); - else - return node->name(); -} - -QString LinguistGenerator::simplified(const QString &text) const -{ - QStringList lines = text.split("\n"); - - while (lines.size() > 0 && lines.first().trimmed().isEmpty()) - lines.pop_front(); - - while (lines.size() > 0 && lines.last().trimmed().isEmpty()) - lines.pop_back(); - - int min = 0; - bool set = false; - foreach (const QString &line, lines) { - int j = 0; - while (j < line.length()) { - if (line[j] != ' ') - break; - ++j; - } - if (j < line.length()) { - if (!set) { - min = j; - set = true; - } else - min = qMin(min, j); - } - } - for (int i = 0; i < lines.size(); ++i) - lines[i] = lines[i].mid(min); - - return lines.join("\n"); -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/linguistgenerator.h b/tools/qdoc3/linguistgenerator.h deleted file mode 100644 index 979db02..0000000 --- a/tools/qdoc3/linguistgenerator.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - LinguistGenerator.h -*/ - -#ifndef LINGUISTGENERATOR_H -#define LINGUISTGENERATOR_H - -#include -#include -#include - -#include "codemarker.h" -#include "config.h" -#include "pagegenerator.h" - -QT_BEGIN_NAMESPACE - -class LinguistGenerator : public PageGenerator -{ -public: - LinguistGenerator(); - ~LinguistGenerator(); - - virtual void initializeGenerator( const Config& config ); - virtual void terminateGenerator(); - virtual QString format(); - -protected: - virtual void generateClassLikeNode(const InnerNode *inner, - CodeMarker *marker); - virtual void generateFakeNode( const FakeNode *fake, CodeMarker *marker ); - virtual QString fileExtension(const Node *node) const; - - QList generateIndexSections(QDomDocument &document, - const Node *node, CodeMarker *marker); - virtual QString fullName(const Node *node) const; - -private: - QString simplified(const QString &text) const; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/loutgenerator.cpp b/tools/qdoc3/loutgenerator.cpp deleted file mode 100644 index caf98e8..0000000 --- a/tools/qdoc3/loutgenerator.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - loutgenerator.cpp -*/ - -#include "loutgenerator.h" - -QT_BEGIN_NAMESPACE - -LoutGenerator::LoutGenerator() -{ -} - -LoutGenerator::~LoutGenerator() -{ -} - -QString LoutGenerator::format() -{ - return "lout"; -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/loutgenerator.h b/tools/qdoc3/loutgenerator.h deleted file mode 100644 index 484d38f..0000000 --- a/tools/qdoc3/loutgenerator.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - loutgenerator.h -*/ - -#ifndef LOUTGENERATOR_H -#define LOUTGENERATOR_H - -#include "bookgenerator.h" - -QT_BEGIN_NAMESPACE - -class LoutGenerator : public BookGenerator -{ -public: - LoutGenerator(); - ~LoutGenerator(); - - virtual QString format(); - -protected: - // ### -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 85b23e9..7459e40 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -51,22 +51,11 @@ #include "config.h" #include "cppcodemarker.h" #include "cppcodeparser.h" -#include "cpptoqsconverter.h" #include "doc.h" #include "htmlgenerator.h" -#include "jambiapiparser.h" -#include "javacodemarker.h" -#include "javadocgenerator.h" -#include "linguistgenerator.h" -#include "loutgenerator.h" -#include "mangenerator.h" #include "plaincodemarker.h" #include "polyarchiveextractor.h" #include "polyuncompressor.h" -#include "qsakernelparser.h" -#include "qscodemarker.h" -#include "qscodeparser.h" -#include "sgmlgenerator.h" #include "webxmlgenerator.h" #include "ditaxmlgenerator.h" #include "tokenizer.h" @@ -210,7 +199,6 @@ static void processQdocconfFile(const QString &fileName) Location::initialize(config); Tokenizer::initialize(config); Doc::initialize(config); - CppToQsConverter::initialize(config); CodeMarker::initialize(config); CodeParser::initialize(config); Generator::initialize(config); @@ -355,7 +343,6 @@ static void processQdocconfFile(const QString &fileName) Generator::terminate(); CodeParser::terminate(); CodeMarker::terminate(); - CppToQsConverter::terminate(); Doc::terminate(); Tokenizer::terminate(); Location::terminate(); @@ -408,25 +395,14 @@ int main(int argc, char **argv) CppCodeParser cppParser; Tree *cppTree = treeForLanguage(cppParser.language()); - QsCodeParser qsParser(cppTree); - QsaKernelParser qsaKernelParser(cppTree); - JambiApiParser jambiParser(cppTree); - /* - Create code markers for plain text, C++, Java, and qs. + Create code markers for plain text and C++. */ PlainCodeMarker plainMarker; CppCodeMarker cppMarker; - JavaCodeMarker javaMarker; - QsCodeMarker qsMarker; ApiGenerator apiGenerator; HtmlGenerator htmlGenerator; - JavadocGenerator javadocGenerator; - LinguistGenerator linguistGenerator; - LoutGenerator loutGenerator; - ManGenerator manGenerator; - SgmlGenerator smglGenerator; WebXMLGenerator webxmlGenerator; DitaXmlGenerator ditaxmlGenerator; diff --git a/tools/qdoc3/mangenerator.cpp b/tools/qdoc3/mangenerator.cpp deleted file mode 100644 index 1e85b73..0000000 --- a/tools/qdoc3/mangenerator.cpp +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - mangenerator.cpp -*/ - -#include -#include - -#include "mangenerator.h" -#include "node.h" -#include "tree.h" - -QT_BEGIN_NAMESPACE - -ManGenerator::ManGenerator() -{ - date = QDate::currentDate().toString( "d MMMM yyyy" ); -} - -ManGenerator::~ManGenerator() -{ -} - -QString ManGenerator::format() -{ - return "man"; -} - -int ManGenerator::generateAtom( const Atom *atom, const Node * /* relative */, - CodeMarker * /* marker */ ) -{ -#if 0 - switch ( atom->type() ) { - case Atom::AbstractBegin: - break; - case Atom::AbstractEnd: - break; - case Atom::Alias: - break; - case Atom::AliasArg: - break; - case Atom::BaseName: - break; - case Atom::BriefBegin: - break; - case Atom::BriefEnd: - break; - case Atom::C: - break; - case Atom::CaptionBegin: - break; - case Atom::CaptionEnd: - break; - case Atom::CitationBegin: - break; - case Atom::CitationEnd: - break; - case Atom::Code: - break; - case Atom::FootnoteBegin: - break; - case Atom::FootnoteEnd: - break; - case Atom::FormatBegin: - break; - case Atom::FormatEnd: - break; - case Atom::GeneratedList: - break; - case Atom::Image: - break; - case Atom::ImageText: - break; - case Atom::Link: - break; - case Atom::LinkNode: - break; - case Atom::ListBegin: - break; - case Atom::ListItemNumber: - break; - case Atom::ListItemBegin: - out() << ".IP " << atom->string() << ".\n"; - break; - case Atom::ListItemEnd: - break; - case Atom::ListEnd: - break; - case Atom::Nop: - break; - case Atom::ParaBegin: - out() << ".PP\n"; - break; - case Atom::ParaEnd: - out() << "\n"; - break; - case Atom::RawFormat: - break; - case Atom::RawString: - break; - case Atom::SectionBegin: - break; - case Atom::SectionEnd: - break; - case Atom::SectionHeadingBegin: - break; - case Atom::SectionHeadingEnd: - break; - case Atom::SidebarBegin: - break; - case Atom::SidebarEnd: - break; - case Atom::String: - out() << protectTextLine( atom->string() ); - break; - case Atom::TableBegin: - break; - case Atom::TableEnd: - break; - case Atom::TableOfContents: - break; - case Atom::Target: - break; - case Atom::UnknownCommand: - ; - } -#endif - unknownAtom( atom ); - return 0; -} - -void ManGenerator::generateClassLikeNode( const InnerNode *classe, - CodeMarker *marker ) -{ - generateHeader( classe->name() ); - out() << ".SH NAME\n" - << classe->name() << "\n" - << ".SH SYNOPSYS\n"; - generateBody( classe, marker ); - generateFooter(); -} - -void ManGenerator::generateFakeNode( const FakeNode *fake, CodeMarker *marker ) -{ - generateHeader( "foo" ); - generateBody( fake, marker ); - generateFooter(); -} - -QString ManGenerator::fileExtension(const Node * /* node */) const -{ - return "3qt"; -} - -void ManGenerator::generateHeader( const QString& name ) -{ - out() << ".TH " << protectArg( name ) - << " " << protectArg( "3qt" ) - << " " << protectArg( date ) - << " " << protectArg( "Nokia Corporation and/or its subsidiary(-ies)" ) - << " " << protectArg( "Qt Toolkit" ) << "\n"; -} - -void ManGenerator::generateFooter() -{ -} - -QString ManGenerator::protectArg( const QString& str ) -{ - for ( int i = 0; i < (int) str.length(); i++ ) { - if ( str[i] == ' ' || str[i].isSpace() ) { - QString quoted = str; - quoted.replace( "\"", "\"\"" ); - return "\"" + quoted + "\""; - } - } - return str; -} - -QString ManGenerator::protectTextLine( const QString& str ) -{ - QString t = str; - if ( t.startsWith(".") || t.startsWith("'") ) - t.prepend( "\\&" ); - return t; -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/mangenerator.h b/tools/qdoc3/mangenerator.h deleted file mode 100644 index 0fca342..0000000 --- a/tools/qdoc3/mangenerator.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - mangenerator.h -*/ - -#ifndef MANGENERATOR_H -#define MANGENERATOR_H - -#include "pagegenerator.h" - -QT_BEGIN_NAMESPACE - -class ManGenerator : public PageGenerator -{ -public: - ManGenerator(); - ~ManGenerator(); - - virtual QString format(); - -protected: - virtual int generateAtom( const Atom *atom, const Node *relative, - CodeMarker *marker ); - virtual void generateClassLikeNode(const InnerNode *node, CodeMarker *marker); - virtual void generateFakeNode( const FakeNode *fake, CodeMarker *marker ); - virtual QString fileExtension(const Node *node) const; - -private: - void generateHeader( const QString& name ); - void generateFooter(); - QString protectArg( const QString& str ); - QString protectTextLine( const QString& str ); - - QString date; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index d47e066..9b76d97 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -27,7 +27,6 @@ CONFIG -= app_bundle HEADERS += apigenerator.h \ archiveextractor.h \ atom.h \ - bookgenerator.h \ ccodeparser.h \ codechunk.h \ codemarker.h \ @@ -36,33 +35,21 @@ HEADERS += apigenerator.h \ config.h \ cppcodemarker.h \ cppcodeparser.h \ - cpptoqsconverter.h \ - dcfsection.h \ ditaxmlgenerator.h \ doc.h \ editdistance.h \ generator.h \ helpprojectwriter.h \ htmlgenerator.h \ - jambiapiparser.h \ - javacodemarker.h \ - javadocgenerator.h \ - linguistgenerator.h \ location.h \ - loutgenerator.h \ - mangenerator.h \ node.h \ openedlist.h \ pagegenerator.h \ plaincodemarker.h \ polyarchiveextractor.h \ polyuncompressor.h \ - qsakernelparser.h \ - qscodemarker.h \ - qscodeparser.h \ quoter.h \ separator.h \ - sgmlgenerator.h \ text.h \ tokenizer.h \ tr.h \ @@ -72,7 +59,6 @@ HEADERS += apigenerator.h \ SOURCES += apigenerator.cpp \ archiveextractor.cpp \ atom.cpp \ - bookgenerator.cpp \ ccodeparser.cpp \ codechunk.cpp \ codemarker.cpp \ @@ -81,21 +67,13 @@ SOURCES += apigenerator.cpp \ config.cpp \ cppcodemarker.cpp \ cppcodeparser.cpp \ - cpptoqsconverter.cpp \ - dcfsection.cpp \ ditaxmlgenerator.cpp \ doc.cpp \ editdistance.cpp \ generator.cpp \ helpprojectwriter.cpp \ htmlgenerator.cpp \ - jambiapiparser.cpp \ - javacodemarker.cpp \ - javadocgenerator.cpp \ - linguistgenerator.cpp \ location.cpp \ - loutgenerator.cpp \ - mangenerator.cpp \ main.cpp \ node.cpp \ openedlist.cpp \ @@ -103,12 +81,8 @@ SOURCES += apigenerator.cpp \ plaincodemarker.cpp \ polyarchiveextractor.cpp \ polyuncompressor.cpp \ - qsakernelparser.cpp \ - qscodemarker.cpp \ - qscodeparser.cpp \ quoter.cpp \ separator.cpp \ - sgmlgenerator.cpp \ text.cpp \ tokenizer.cpp \ tree.cpp \ diff --git a/tools/qdoc3/qsakernelparser.cpp b/tools/qdoc3/qsakernelparser.cpp deleted file mode 100644 index 8f12eda..0000000 --- a/tools/qdoc3/qsakernelparser.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "qsakernelparser.h" -#include "tokenizer.h" -#include "tree.h" - -QT_BEGIN_NAMESPACE - -QsaKernelParser::QsaKernelParser( Tree *cppTree ) - : cppTre( cppTree ) -{ -} - -QsaKernelParser::~QsaKernelParser() -{ -} - -QString QsaKernelParser::language() -{ - return "QSA Kernel C++"; -} - -QString QsaKernelParser::sourceFileNameFilter() -{ - return "*.cpp"; -} - -void QsaKernelParser::parseSourceFile( const Location& location, - const QString& filePath, - Tree * /* tree */ ) -{ - QFile in(filePath); - if (!in.open(QIODevice::ReadOnly)) { - location.error( tr("Cannot open QSA kernel file '%1'").arg(filePath) ); - return; - } - - Location fileLocation( filePath ); - Tokenizer fileTokenizer( fileLocation, in ); - tokenizer = &fileTokenizer; - readToken(); - - QString ident; - QString className; - int delimDepth = 0; - - while ( tok != Tok_Eoi ) { - if ( tok == Tok_Ident ) { - ident = tokenizer->lexeme(); - readToken(); - if ( tok == Tok_Gulbrandsen && tokenizer->braceDepth() == 0 && - tokenizer->parenDepth() == 0 ) { - className = ident; - } else if ( ident.startsWith("add") && ident.endsWith("Member") && - tok == Tok_LeftParen ) { - bool isProperty = ident.endsWith( "VariableMember" ); - bool isStatic = ident.startsWith( "addStatic" ); - bool isWritable = !isStatic; - - readToken(); - if ( tok == Tok_String ) { - QString member = tokenizer->lexeme(); - member = member.mid( 1, member.length() - 2 ); - - readToken(); - if ( tok == Tok_Comma ) - readToken(); - if ( tok == Tok_Ident && tokenizer->lexeme() == "QSMember" ) - readToken(); - if ( tok == Tok_LeftParen ) { - delimDepth++; - readToken(); - } - - while ( tok != Tok_Eoi && tok != Tok_RightParen && - tok != Tok_Semicolon ) { - if ( tok == Tok_Ident ) { - ident = tokenizer->lexeme(); - if ( ident == "Custom" ) { - isProperty = true; - } else if ( ident == "AttributeNonWritable" ) { - isWritable = false; - } else if ( ident == "AttributeStatic" ) { - isStatic = true; - } - } - readToken(); - } - - ClassNode *classe = - (ClassNode *) cppTre->findNode( QStringList(className), - Node::Class ); - if ( classe == 0 ) { - classe = new ClassNode( cppTre->root(), className ); - classe->setLocation( tokenizer->location() ); - } - - if ( isProperty ) { - PropertyNode *property = new PropertyNode(classe, member); - property->setLocation( tokenizer->location() ); - property->setDataType( "Object" ); -#if 0 - property->setGetter( member ); - if ( isWritable ) { - QString setter = member; - setter[0] = setter[0].toUpper(); - setter.prepend( "set" ); - property->setSetter( setter ); - } -#endif - } else { - FunctionNode *func = new FunctionNode( classe, member ); - func->setLocation( tokenizer->location() ); - func->setAccess( FunctionNode::Public ); - func->setMetaness( FunctionNode::Slot ); - if ( member == "toLocaleString" || - member == "toString" ) { - func->setReturnType( "QString" ); - } else if ( member == "valueOf" ) { - func->setReturnType( "Object" ); - } else { - func->setReturnType( "Object" ); - func->addParameter( Parameter("...") ); - } - func->setStatic( false ); // ### - } - } - } - } else { - readToken(); - } - } - in.close(); -} - -void QsaKernelParser::doneParsingSourceFiles( Tree * /* tree */ ) -{ -} - -void QsaKernelParser::readToken() -{ - tok = tokenizer->getToken(); -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/qsakernelparser.h b/tools/qdoc3/qsakernelparser.h deleted file mode 100644 index 9ac84fb..0000000 --- a/tools/qdoc3/qsakernelparser.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - qsakernelparser.h -*/ - -#ifndef QSAKERNELPARSER_H -#define QSAKERNELPARSER_H - -#include "codeparser.h" - -QT_BEGIN_NAMESPACE - -class Tokenizer; - -class QsaKernelParser : public CodeParser -{ -public: - QsaKernelParser( Tree *cppTree ); - ~QsaKernelParser(); - - virtual QString language(); - virtual QString sourceFileNameFilter(); - virtual void parseSourceFile( const Location& location, - const QString& filePath, Tree *tree ); - virtual void doneParsingSourceFiles( Tree *tree ); - -private: - void readToken(); - - Tree *cppTre; - Tokenizer *tokenizer; - int tok; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/qscodemarker.cpp b/tools/qdoc3/qscodemarker.cpp deleted file mode 100644 index 2ee5d99..0000000 --- a/tools/qdoc3/qscodemarker.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - qscodemarker.cpp -*/ - -#include "node.h" -#include "qscodemarker.h" - -QT_BEGIN_NAMESPACE - -QsCodeMarker::QsCodeMarker() -{ -} - -QsCodeMarker::~QsCodeMarker() -{ -} - -bool QsCodeMarker::recognizeCode( const QString& /* code */ ) -{ - return true; -} - -bool QsCodeMarker::recognizeExtension( const QString& ext ) -{ - return ext == "js" || ext == "qs"; -} - -bool QsCodeMarker::recognizeLanguage( const QString& lang ) -{ - return lang == "JavaScript" || lang == "Qt Script"; -} - -QString QsCodeMarker::plainName( const Node *node ) -{ - QString name = node->name(); - if ( node->type() == Node::Function ) - name += "()"; - return name; -} - -QString QsCodeMarker::plainFullName( const Node *node, const Node * /* relative */ ) -{ - QString fullName; - for ( ;; ) { - fullName.prepend( plainName(node) ); - if ( node->parent()->name().isEmpty() ) - break; - node = node->parent(); - fullName.prepend("."); - } - return fullName; -} - -QString QsCodeMarker::markedUpCode( const QString& code, - const Node * /* relative */, - const QString& /* dirPath */ ) -{ - return protect( code ); -} - -QString QsCodeMarker::markedUpSynopsis( const Node *node, - const Node * /* relative */, - SynopsisStyle style ) -{ - QString synopsis; - QStringList extras; - QString name; - - name = taggedNode( node ); - if ( style != Detailed ) - name = linkTag( node, name ); - name = "<@name>" + name + ""; - - if ( style == Detailed && !node->parent()->name().isEmpty() && - node->type() != Node::Enum ) - name.prepend( taggedNode(node->parent()) + "." ); - - switch ( node->type() ) { - case Node::Class: - synopsis = "class " + name; - break; - case Node::Function: - { - const FunctionNode *func = (const FunctionNode *) node; - - synopsis = name; - - if ( style == SeparateList ) { - synopsis += "()"; - } else { - synopsis += " ("; - if ( !func->parameters().isEmpty() ) { - synopsis += " "; - int numOptional = 0; - QList::ConstIterator p = func->parameters().begin(); - while ( p != func->parameters().end() ) { - if ( !(*p).defaultValue().isEmpty() ) { - if ( p == func->parameters().begin() ) { - synopsis += "[ "; - } else { - synopsis += " [ , "; - } - numOptional++; - } else { - if ( p != func->parameters().begin() ) - synopsis += ", "; - } - if ( !(*p).name().isEmpty() ) - synopsis += "<@param>" + protect( (*p).name() ) + - " : "; - synopsis += protect( (*p).leftType() ); - ++p; - } - for ( int i = 0; i < numOptional; i++ ) - synopsis += " ]"; - synopsis += " "; - } - synopsis += ")"; - } - - if ( style != SeparateList && !func->returnType().isEmpty() ) - synopsis += " : " + protect( func->returnType() ); - - if ( style == Detailed && func->metaness() == FunctionNode::Signal ) - extras << "[signal]"; - } - break; - case Node::Property: - { - const PropertyNode *property = (const PropertyNode *) node; - - synopsis = name; - if ( style != SeparateList ) - synopsis += " : " + property->dataType(); - if ( style == Detailed && property->setters().isEmpty() ) - extras << "[read only]"; - } - break; - case Node::Enum: - { - /* - The letters A to F and X (upper- and lower-case) can - appear in a hexadecimal constant (e.g. 0x3F). - */ - QRegExp letterRegExp( "[G-WYZg-wyz_]" ); - const EnumNode *enume = (const EnumNode *) node; - - synopsis = name; - if ( style == Summary && !enume->items().isEmpty() ) { - synopsis += " : "; - QString comma; - QList::ConstIterator it = enume->items().begin(); - while ( it != enume->items().end() ) { - if ( enume->itemAccess((*it).name()) == Node::Public ) { - synopsis += comma; - synopsis += (*it).name(); - if ( (*it).value().indexOf(letterRegExp) != -1 ) - synopsis += " = " + (*it).value(); - comma = ", "; - } - ++it; - } - } - } - break; - case Node::Namespace: - case Node::Typedef: - default: - synopsis = name; - } - - if ( style == Summary ) { - if ( node->status() == Node::Preliminary ) { - extras << "(preliminary)"; - } else if ( node->status() == Node::Deprecated ) { - extras << "(deprecated)"; - } else if ( node->status() == Node::Obsolete ) { - extras << "(obsolete)"; - } - } - - QString extra; - if ( !extras.isEmpty() ) - extra = "<@extra>" + extras.join(" ") + ""; - return synopsis + extra; -} - -QString QsCodeMarker::markedUpName( const Node *node ) -{ - QString name = linkTag( node, taggedNode(node) ); - if ( node->type() == Node::Function ) - name += "()"; - return name; -} - -QString QsCodeMarker::markedUpFullName( const Node *node, - const Node * /* relative */ ) -{ - QString fullName; - for ( ;; ) { - fullName.prepend( markedUpName(node) ); - if ( node->parent()->name().isEmpty() ) - break; - node = node->parent(); - fullName.prepend( "<@op>." ); - } - return fullName; -} - -QString QsCodeMarker::markedUpEnumValue(const QString & /* enumValue */, - const Node * /* relative */) -{ - return QString(); -} - -QString QsCodeMarker::markedUpIncludes( const QStringList& /* includes */ ) -{ - return QString(); -} - -QString QsCodeMarker::functionBeginRegExp( const QString& funcName ) -{ - return "^function[ \t].*\\b" + QRegExp::escape( funcName ); -} - -QString QsCodeMarker::functionEndRegExp( const QString& /* funcName */ ) -{ - return "^}"; -} - -QList
    QsCodeMarker::sections( const InnerNode *inner, SynopsisStyle style, Status status ) -{ - QList
    sections; - - if (inner->type() != Node::Class) - return sections; - - const ClassNode *classe = static_cast(inner); - - if ( style == Summary ) { - FastSection enums(classe, "Enums", "", "enum", "enums"); - FastSection functions(classe, "Functions", "", "function", "functions"); - FastSection readOnlyProperties(classe, "", "Read-Only Properties", "property", "properties"); - FastSection signalz(classe, "Signals", "", "signal", "signals"); - FastSection writableProperties(classe, "", "Writable Properties", "property", "properties"); - - QStack stack; - stack.push( classe ); - - while ( !stack.isEmpty() ) { - const ClassNode *ancestorClass = stack.pop(); - - NodeList::ConstIterator c = ancestorClass->childNodes().begin(); - while ( c != ancestorClass->childNodes().end() ) { - if ( (*c)->access() == Node::Public ) { - if ( (*c)->type() == Node::Enum ) { - insert( enums, *c, style, status ); - } else if ( (*c)->type() == Node::Function ) { - const FunctionNode *func = (const FunctionNode *) *c; - if ( func->metaness() == FunctionNode::Signal ) { - insert( signalz, *c, style, status ); - } else { - insert( functions, *c, style, status ); - } - } else if ( (*c)->type() == Node::Property ) { - const PropertyNode *property = - (const PropertyNode *) *c; - if ( property->setters().isEmpty() ) { - insert( readOnlyProperties, *c, style, status ); - } else { - insert( writableProperties, *c, style, status ); - } - } - } - ++c; - } - - QList::ConstIterator r = ancestorClass->baseClasses().begin(); - while ( r != ancestorClass->baseClasses().end() ) { - stack.prepend( (*r).node ); - ++r; - } - } - append( sections, enums ); - append( sections, writableProperties ); - append( sections, readOnlyProperties ); - append( sections, functions ); - append( sections, signalz ); - } else if ( style == Detailed ) { - FastSection enums( classe, "Enum Documentation", "", "member", "members"); - FastSection functionsAndSignals( classe, "Function and Signal Documentation", "", "member", "members"); - FastSection properties( classe, "Property Documentation", "", "member", "members"); - - NodeList::ConstIterator c = classe->childNodes().begin(); - while ( c != classe->childNodes().end() ) { - if ( (*c)->access() == Node::Public ) { - if ( (*c)->type() == Node::Enum ) { - insert( enums, *c, style, status ); - } else if ( (*c)->type() == Node::Function ) { - insert( functionsAndSignals, *c, style, status ); - } else if ( (*c)->type() == Node::Property ) { - insert( properties, *c, style, status ); - } - } - ++c; - } - append( sections, enums ); - append( sections, properties ); - append( sections, functionsAndSignals ); - } else { // ( style == SeparateList ) - FastSection all(classe, "", "", "member", "members"); - - QStack stack; - stack.push( classe ); - - while ( !stack.isEmpty() ) { - const ClassNode *ancestorClass = stack.pop(); - - NodeList::ConstIterator c = ancestorClass->childNodes().begin(); - while ( c != ancestorClass->childNodes().end() ) { - if ( (*c)->access() == Node::Public ) - insert( all, *c, style, status ); - ++c; - } - - QList::ConstIterator r = ancestorClass->baseClasses().begin(); - while ( r != ancestorClass->baseClasses().end() ) { - stack.prepend( (*r).node ); - ++r; - } - } - append( sections, all ); - } - return sections; -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/qscodemarker.h b/tools/qdoc3/qscodemarker.h deleted file mode 100644 index c6a177f..0000000 --- a/tools/qdoc3/qscodemarker.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - qscodemarker.h -*/ - -#ifndef QSCODEMARKER_H -#define QSCODEMARKER_H - -#include "codemarker.h" - -QT_BEGIN_NAMESPACE - -class QsCodeMarker : public CodeMarker -{ -public: - QsCodeMarker(); - ~QsCodeMarker(); - - bool recognizeCode( const QString& code ); - bool recognizeExtension( const QString& ext ); - bool recognizeLanguage( const QString& lang ); - QString plainName(const Node *node); - QString plainFullName(const Node *node, const Node *relative); - QString markedUpCode( const QString& code, const Node *relative, - const QString& dirPath ); - QString markedUpSynopsis( const Node *node, const Node *relative, - SynopsisStyle style ); - QString markedUpName( const Node *node ); - QString markedUpFullName( const Node *node, const Node *relative ); - QString markedUpEnumValue(const QString &enumValue, const Node *relative); - QString markedUpIncludes( const QStringList& includes ); - QList
    sections(const InnerNode *innerNode, SynopsisStyle style, Status status); - QString functionBeginRegExp( const QString& funcName ); - QString functionEndRegExp( const QString& funcName ); -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/qscodeparser.cpp b/tools/qdoc3/qscodeparser.cpp deleted file mode 100644 index 3b8bc1a..0000000 --- a/tools/qdoc3/qscodeparser.cpp +++ /dev/null @@ -1,944 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - qscodeparser.cpp -*/ - -#include -#include - -#include "config.h" -#include "qscodeparser.h" -#include "text.h" -#include "tokenizer.h" -#include "tree.h" - -QT_BEGIN_NAMESPACE - -#define CONFIG_QUICK "quick" -#define CONFIG_REPLACES "replaces" - -#define COMMAND_BRIEF Doc::alias( "brief") -#define COMMAND_CODE Doc::alias( "code") -#define COMMAND_ENDCODE Doc::alias( "endcode") -#define COMMAND_ENDQUICKCODE Doc::alias( "endquickcode") -#define COMMAND_FILE Doc::alias( "file") -#define COMMAND_GROUP Doc::alias( "group") -#define COMMAND_MODULE Doc::alias( "module") -#define COMMAND_PAGE Doc::alias( "page") -#define COMMAND_QUICKCLASS Doc::alias( "quickclass") -#define COMMAND_QUICKCODE Doc::alias( "quickcode") -#define COMMAND_QUICKENUM Doc::alias( "quickenum") -#define COMMAND_QUICKFN Doc::alias( "quickfn") -#define COMMAND_QUICKIFY Doc::alias( "quickify") -#define COMMAND_QUICKPROPERTY Doc::alias( "quickproperty") -#define COMMAND_PROTECTED Doc::alias( "protected") -#define COMMAND_REPLACE Doc::alias( "replace") - -static QString balancedParens = "(?:[^()]+|\\([^()]*\\))*"; - -QsCodeParser::QsCodeParser(Tree *cppTree) - : cppTre(cppTree), qsTre(0), replaceRegExp("/(.+)/([^/]*)/") -{ -} - -QsCodeParser::~QsCodeParser() -{ -} - -void QsCodeParser::initializeParser(const Config& config) -{ - CppCodeParser::initializeParser(config); - - nodeTypeMap.insert(COMMAND_QUICKCLASS, Node::Class); - nodeTypeMap.insert(COMMAND_QUICKENUM, Node::Enum); - nodeTypeMap.insert(COMMAND_QUICKPROPERTY, Node::Property); - nodeTypeMap.insert(COMMAND_QUICKFN, Node::Function); - - QString quickDotReplaces = CONFIG_QUICK + Config::dot + CONFIG_REPLACES; - QStringList replaces = config.getStringList(quickDotReplaces); - QStringList::ConstIterator r = replaces.begin(); - while (r != replaces.end()) { - if (replaceRegExp.exactMatch(*r)) { - QRegExp before(replaceRegExp.cap(1)); - before.setMinimal(true); - QString after = replaceRegExp.cap(2); - - if (before.isValid()) { - replaceBefores << before; - replaceAfters << after; - } - else { - config.lastLocation().warning( - tr("Invalid regular expression '%1'") - .arg(before.pattern())); - } - } - else { - config.lastLocation().warning(tr("Bad syntax in '%1'") - .arg(quickDotReplaces)); - } - ++r; - } -} - -void QsCodeParser::terminateParser() -{ - nodeTypeMap.clear(); - classesWithNoQuickDoc.clear(); - replaceBefores.clear(); - replaceAfters.clear(); - CppCodeParser::terminateParser(); -} - -QString QsCodeParser::language() -{ - return "Qt Script"; -} - -QString QsCodeParser::headerFileNameFilter() -{ - return "*"; -} - -QString QsCodeParser::sourceFileNameFilter() -{ - return "*.qs *.qsd"; -} - -void QsCodeParser::parseHeaderFile(const Location& location, - const QString& filePath, - Tree *tree) -{ - qsTre = tree; - - QFile in(filePath); - if (!in.open(QIODevice::ReadOnly)) { - location.error(tr("Cannot open Qt Script class list '%1'") - .arg(filePath)); - return; - } - - Location fileLocation(filePath); - Tokenizer fileTokenizer(fileLocation, in); - int tok = fileTokenizer.getToken(); - while (tok != Tok_Eoi) { - if (tok == Tok_Ident) { - ClassNode *quickClass = new ClassNode(qsTre->root(), - fileTokenizer.lexeme()); - quickClass->setLocation(fileTokenizer.location()); - } - else { - fileTokenizer.location().error(tr("Unexpected token '%1' in Qt" - " Script class list") - .arg(fileTokenizer.lexeme())); - break; - } - tok = fileTokenizer.getToken(); - } - in.close(); -} - -void QsCodeParser::parseSourceFile(const Location& location, - const QString& filePath, - Tree *tree) -{ - qsTre = tree; - CppCodeParser::parseSourceFile(location, filePath, tree); -} - -void QsCodeParser::doneParsingHeaderFiles(Tree *tree) -{ - NodeList::ConstIterator c = tree->root()->childNodes().begin(); - while (c != tree->root()->childNodes().end()) { - if ((*c)->type() == Node::Class) - quickifyClass((ClassNode *) *c); - ++c; - } - cppTre->root()->deleteChildren(); // save memory - tree->resolveInheritance(); - tree->resolveProperties(); -} - -void QsCodeParser::doneParsingSourceFiles(Tree *tree) -{ - tree->root()->normalizeOverloads(); - - NodeList::ConstIterator c = tree->root()->childNodes().begin(); - while (c != tree->root()->childNodes().end()) { - if ((*c)->type() == Node::Class) { - QMap::ConstIterator cwnqd = - classesWithNoQuickDoc.find((*c)->name()); - if (cwnqd != classesWithNoQuickDoc.end()) { - (*cwnqd)->location().warning(tr("No '\\%1' documentation for" - " class '%2'") - .arg(COMMAND_QUICKCLASS) - .arg(cwnqd.key())); - (*cwnqd)->setDoc(Doc(), true); - } - } - ++c; - } - - // ### check which enum types are used -} - -FunctionNode *QsCodeParser::findFunctionNode(const QString& synopsis, - Tree *tree) -{ - QStringList parentPath; - FunctionNode *clone; - FunctionNode *func = 0; - - if (makeFunctionNode(synopsis, &parentPath, &clone)) { - func = tree->findFunctionNode(parentPath, clone); - delete clone; - } - return func; -} - -QSet QsCodeParser::topicCommands() -{ - return QSet() << COMMAND_FILE << COMMAND_GROUP << COMMAND_MODULE - << COMMAND_PAGE << COMMAND_QUICKCLASS - << COMMAND_QUICKENUM << COMMAND_QUICKFN - << COMMAND_QUICKPROPERTY; -} - -Node *QsCodeParser::processTopicCommand(const Doc& doc, - const QString& command, - const QString& arg) -{ - if (command == COMMAND_QUICKFN) { - QStringList parentPath; - FunctionNode *quickFunc = 0; - FunctionNode *clone; - - if (makeFunctionNode(arg, &parentPath, &clone)) { - FunctionNode *kernelFunc = findKernelFunction(parentPath, - clone->name()); - if (kernelFunc != 0) - kernelFunc->setAccess(Node::Private); - - quickFunc = qsTre->findFunctionNode(parentPath, clone); - if (quickFunc == 0 && kernelFunc != 0) { - quickFunc = new FunctionNode(kernelFunc->parent(), - kernelFunc->name()); - quickFunc->setLocation(kernelFunc->location()); - quickFunc->setReturnType(clone->returnType()); - quickFunc->setParameters(clone->parameters()); - } - - if (quickFunc == 0) { - doc.location().warning(tr("Cannot find '%1' specified with '\\%2'") - .arg(arg).arg(command)); - } - else { - quickFunc->setAccess(Node::Public); - QStringList qtParams = quickFunc->parameterNames(); - quickFunc->borrowParameterNames(clone); - QStringList quickParams = quickFunc->parameterNames(); - setQuickDoc(quickFunc, doc, qtParams, quickParams); - } - delete clone; - } - else { - doc.location().warning(tr("Cannot find '%1' specified with '\\%2'") - .arg(arg).arg(command)); - } - return 0; - } - else if (nodeTypeMap.contains(command)) { - QStringList subArgs = arg.split(" "); - QString dataType; - - if (subArgs.count() == 3 && subArgs[1] == ":") { - dataType = subArgs[2]; - } - else if (subArgs.count() != 1) { - doc.location().warning(tr("Invalid syntax in '\\%1'") - .arg(command)); - } - - QStringList path = subArgs[0].split("."); - Node *quickNode = qsTre->findNode(path, nodeTypeMap[command]); - if (quickNode == 0) { - doc.location().warning(tr("Cannot find '%1' specified with '\\%2'") - .arg(arg).arg(command)); - } - else { - setQuickDoc(quickNode, doc); - if (quickNode->type() == Node::Class) { - classesWithNoQuickDoc.remove(quickNode->name()); - if (doc.briefText().isEmpty()) - doc.location().warning(tr("Missing '\\%1' for class '%2'") - .arg(COMMAND_BRIEF) - .arg(quickNode->name())); - } - else if (quickNode->type() == Node::Property) { - PropertyNode *quickProperty = (PropertyNode *) quickNode; - if (quickProperty->dataType() == "Object") { - if (dataType.isEmpty()) { - doc.location().warning(tr("Missing data type in '\\%1'" - " (assuming 'Object')") - .arg(command)); - } - else { - quickProperty->setDataType(dataType); - } - } - else if (dataType != quickProperty->dataType()) { - doc.location().warning(tr("Ignored contradictory data type" - " in '\\%1'") - .arg(command)); - } - } - } - return 0; - } - else { - return CppCodeParser::processTopicCommand(doc, command, arg); - } -} - -QSet QsCodeParser::otherMetaCommands() -{ - return commonMetaCommands() << COMMAND_ENDQUICKCODE << COMMAND_QUICKCODE - << COMMAND_QUICKIFY << COMMAND_REPLACE; -} - -void QsCodeParser::processOtherMetaCommand(const Doc& doc, - const QString& command, - const QString& arg, - Node *node) -{ - if (command == COMMAND_PROTECTED) { - doc.location().warning(tr("Cannot use '\\%1' in %2") - .arg(COMMAND_PROTECTED).arg(language())); - } - else { - CppCodeParser::processOtherMetaCommand(doc,command,arg,node); - } -} - -ClassNode *QsCodeParser::tryClass(const QString& className) -{ - return (ClassNode*) cppTre->findNode(QStringList(className),Node::Class); -} - -FunctionNode *QsCodeParser::findKernelFunction(const QStringList& parentPath, - const QString& name) -{ - FunctionNode clone(0, name); - clone.setReturnType("Object"); - clone.addParameter(Parameter("...")); - return qsTre->findFunctionNode(parentPath, &clone); -} - -void QsCodeParser::extractRegExp(const QRegExp& regExp, - QString& source, - const Doc& doc) -{ - QRegExp blankLineRegExp( - "[ \t]*(?:\n(?:[ \t]*\n)+[ \t]*|[ \n\t]*\\\\code|" - "\\\\endcode[ \n\t]*)"); - QStringList paras = source.trimmed().split(blankLineRegExp); - paras = paras.filter(regExp); - if (paras.count() == 0) { - doc.location().warning(tr("Cannot find regular expression '%1'") - .arg(regExp.pattern())); - } - else if (paras.count() > 1) { - doc.location().warning(tr("Regular rexpression '%1' matches multiple" - "times").arg(regExp.pattern())); - } - else { - source = paras.first() + "\n\n"; - } -} - -void QsCodeParser::extractTarget(const QString& target, - QString& source, - const Doc& doc) -{ - QRegExp targetRegExp( - "(\\\\target\\s+(\\S+)[^\n]*\n" - "(?:(?!\\s*\\\\code)[^\n]+\n|\\s*\\\\code.*\\\\endcode\\s*\n)*)" - "(?:\\s*\n|[^\n]*$)"); - targetRegExp.setMinimal(true); - - int pos = 0; - while ((pos = source.indexOf(targetRegExp, pos)) != -1) { - if (targetRegExp.cap(2) == target) { - source = targetRegExp.cap(1) + "\n\n"; - return; - } - pos += targetRegExp.matchedLength(); - } - doc.location().warning(tr("Cannot find target '%1'").arg(target)); -} - -void QsCodeParser::renameParameters(QString& source, - const Doc& /* doc */, - const QStringList& qtParams, - const QStringList& quickParams) -{ - QRegExp paramRegExp("(\\\\a\\s*\\{?\\s*)([A-Za-z0-9_]+)"); - - int pos = 0; - while ((pos = paramRegExp.indexIn(source, pos)) != -1) { - pos += paramRegExp.cap(1).length(); - QString before = paramRegExp.cap(2); - int index = qtParams.indexOf(before); - if (index != -1) { - QString after = quickParams[index]; - source.replace(pos, before.size(), after); - } - } -} - -void QsCodeParser::applyReplacementList(QString& source, const Doc& doc) -{ - QStringList args = doc.metaCommandArgs(COMMAND_REPLACE); - QStringList::ConstIterator a = args.begin(); - while (a != args.end()) { - if (replaceRegExp.exactMatch(*a)) { - QRegExp before(replaceRegExp.cap(1)); - before.setMinimal(true); - QString after = replaceRegExp.cap(2); - - if (before.isValid()) { - int oldLen = source.size(); - source.replace(before, after); - - // this condition is sufficient but not necessary - if (oldLen == source.size() && !source.contains(after)) - doc.location().warning( - tr("Regular expression '%1' did not match anything") - .arg(before.pattern())); - } - else { - doc.location().warning( - tr("Invalid regular expression '%1'") - .arg(before.pattern())); - } - } - else { - doc.location().warning(tr("Bad syntax in '\\%1'") - .arg(COMMAND_REPLACE)); - } - ++a; - } - - QRegExp codeRegExp("\\\\" + COMMAND_CODE + "(.*)\\\\" + COMMAND_ENDCODE); - codeRegExp.setMinimal(true); - - QRegExp quickcodeRegExp( - "\\\\" + COMMAND_QUICKCODE + "(.*)\\\\" + COMMAND_ENDQUICKCODE); - quickcodeRegExp.setMinimal(true); - - int quickcodePos = doc.source().indexOf(quickcodeRegExp); - if (quickcodePos != -1) { - int codePos = source.indexOf(codeRegExp); - if (codePos == -1) { - doc.location().warning( - tr("Cannot find any '\\%1' snippet corresponding to '\\%2'") - .arg(COMMAND_CODE).arg(COMMAND_QUICKCODE)); - } - else { - source.replace(codeRegExp.pos(1), codeRegExp.cap(1).length(), - quickcodeRegExp.cap(1)); - codePos = codeRegExp.pos(1) + quickcodeRegExp.cap(1).length(); - - if (doc.source().indexOf(quickcodeRegExp, quickcodePos + 1) != -1) { - doc.location().warning( - tr("Cannot use '\\%1' twice in a row") - .arg(COMMAND_QUICKCODE)); - } - else if (source.indexOf(codeRegExp, codePos + 1) != -1) { - doc.location().warning(tr("Ambiguous '\\%1'") - .arg(COMMAND_QUICKCODE)); - } - } - } -} - -void QsCodeParser::quickifyClass(ClassNode *quickClass) -{ - QString qtClassName = quickClass->name(); - QString bare = quickClass->name(); - if (bare != "Qt" && bare != "Object") { - if (bare.startsWith("Q")) { - bare = bare.mid(1); - } - else { - qtClassName.prepend("Q"); - classesWithNoQ.insert(bare); - } - } - - ClassNode *qtClass = 0; - ClassNode *wrapperClass = 0; - - if ((wrapperClass = tryClass("Quick" + bare)) != 0 || - (wrapperClass = tryClass("QS" + bare + "Class")) != 0) { - qtClass = tryClass(qtClassName); - if (qtClass == 0) { - qtClass = wrapperClass; - wrapperClass = 0; - } - } - else if ((wrapperClass = tryClass("Quick" + bare + "Ptr")) != 0) { - QRegExp ptrToQtType("(Q[A-Za-z0-9_]+)\\s*\\*"); - FunctionNode *ctor = - wrapperClass->findFunctionNode(wrapperClass->name()); - if (ctor != 0 && !ctor->parameters().isEmpty() && - ptrToQtType.exactMatch(ctor->parameters().first().leftType())) - qtClassName = ptrToQtType.cap(1); - qtClass = tryClass(qtClassName); - } - else { - wrapperClass = tryClass("Q" + bare + "Ptr"); - if (wrapperClass == 0) - wrapperClass = tryClass("Quick" + bare + "Interface"); - qtClass = tryClass(qtClassName); - } - - if (qtClass == 0) { - if (wrapperClass == 0) { - quickClass->location().warning(tr("Cannot find Qt class '%1'") - .arg(qtClassName)); - } - else { - quickClass->location().warning(tr("Cannot find Qt class '%1'" - " wrapped by '%2'") - .arg(qtClassName) - .arg(wrapperClass->name())); - } - return; - } - - QList::ConstIterator r = qtClass->baseClasses().begin(); - while (r != qtClass->baseClasses().end()) { - ClassNode *quickBaseClass = cpp2qs.findClassNode(qsTre, - (*r).node->name()); - if (quickBaseClass) - quickClass->addBaseClass((*r).access, quickBaseClass); - ++r; - } - if (quickClass->baseClasses().isEmpty() && quickClass->name() != "Object") - quickClass->addBaseClass(Node::Public, - cpp2qs.findClassNode(qsTre,"Object")); - - QSet funcBlackList; - QSet propertyBlackList; - - NodeList children; - if (wrapperClass != 0) { - children = wrapperClass->childNodes(); - - funcBlackList.insert(wrapperClass->name()); - funcBlackList.insert("~" + wrapperClass->name()); - } - children += qtClass->childNodes(); - - for (int pass = 0; pass < 2; pass++) { - NodeList::ConstIterator c = children.begin(); - while (c != children.end()) { - if ((*c)->access() != Node::Private && - (*c)->status() == Node::Commendable) { - if (pass == 0) { - if ((*c)->type() == Node::Enum) { - EnumNode *enume = (EnumNode *) *c; - quickifyEnum(quickClass, enume); - } - else if ((*c)->type() == Node::Property) { - if (!propertyBlackList.contains((*c)->name())) { - PropertyNode *property = (PropertyNode *) *c; - quickifyProperty(quickClass, qtClass, property); - if (!property->getters().isEmpty()) - funcBlackList.insert(property->getters().first()->name()); - if (!property->setters().isEmpty()) - funcBlackList.insert(property->setters().first()->name()); - if (!property->resetters().isEmpty()) - funcBlackList.insert(property->resetters().first()->name()); - propertyBlackList.insert(property->name()); - } - } - } - else if ((*c)->type() == Node::Function) { - FunctionNode *func = (FunctionNode *) *c; - quickifyFunction(quickClass, qtClass, func, - funcBlackList.contains((*c)->name()) && - func->parameters().count() < 2); - } - } - ++c; - } - } - setQtDoc(quickClass, qtClass->doc()); - classesWithNoQuickDoc.insert(quickClass->name(), quickClass); -} - -void QsCodeParser::quickifyEnum(ClassNode *quickClass, EnumNode *enume) -{ - EnumNode *quickEnum = new EnumNode(quickClass, enume->name()); - quickEnum->setLocation(enume->location()); -#if 0 // ### not yet - quickEnum->setAccess(Node::Protected); -#endif - - QList::ConstIterator it = enume->items().begin(); - while (it != enume->items().end()) { - QString name = (*it).name(); - QString value = (*it).value(); - quickEnum->addItem(EnumItem(name, value)); - ++it; - } - setQtDoc(quickEnum, enume->doc()); -} - -void QsCodeParser::quickifyFunction(ClassNode *quickClass, ClassNode *qtClass, - FunctionNode *func, bool onBlackList) -{ - if (func->metaness() == FunctionNode::Dtor) - return; - - FunctionNode *kernelFunc = findKernelFunction( - QStringList() << quickClass->name(), func->name()); - - QString quickName = func->name(); - if (func->metaness() == FunctionNode::Ctor) - quickName = quickClass->name(); - FunctionNode *quickFunc = new FunctionNode(quickClass, quickName); - quickFunc->setLocation(func->location()); - - if (onBlackList) { - quickFunc->setAccess(Node::Protected); - } - else { - if (kernelFunc != 0 && func->numOverloads() == 1 && - (func->parameters().count() == 0 || - func->parameters().last().defaultValue().isEmpty())) { - kernelFunc->setAccess(Node::Private); - } - else { - if (func->metaness() == FunctionNode::Plain) - quickFunc->setAccess(Node::Protected); - } - } - - quickFunc->setReturnType(cpp2qs.convertedDataType(qsTre, - func->returnType())); - if (func->metaness() != FunctionNode::Slot) - quickFunc->setMetaness(func->metaness()); - quickFunc->setVirtualness(FunctionNode::ImpureVirtual); - quickFunc->setOverload(func->isOverload()); - - QList::ConstIterator q = func->parameters().begin(); - while (q != func->parameters().end()) { - QString dataType = cpp2qs.convertedDataType(qsTre, (*q).leftType(), - (*q).rightType()); - if (dataType.isEmpty()) { - dataType = "UNKNOWN"; - quickFunc->setAccess(Node::Private); - } - Parameter param(dataType, "", (*q).name(), - (*q).defaultValue().isEmpty() ? "" : "undefined"); - quickFunc->addParameter(param); - ++q; - } - - if (func->doc().isEmpty()) { - if (func->parent() != (InnerNode *) qtClass) { - func = qtClass->findFunctionNode(func); - if (func != 0) - setQtDoc(quickFunc, func->doc()); - } - } - else { - setQtDoc(quickFunc, func->doc()); - } -} - -void QsCodeParser::quickifyProperty(ClassNode *quickClass, - ClassNode * /* qtClass */, - PropertyNode *property) -{ - PropertyNode *quickProperty = new PropertyNode(quickClass, - property->name()); - quickProperty->setLocation(property->location()); - quickProperty->setDataType(cpp2qs.convertedDataType(qsTre, - property->dataType())); -#if 0 - quickProperty->setGetter(property->getter()); - quickProperty->setSetter(property->setter()); - quickProperty->setResetter(property->resetter()); -#endif - quickProperty->setStored(property->isStored()); - quickProperty->setDesignable(property->isDesignable()); - - setQtDoc(quickProperty, property->doc()); -} - -QString QsCodeParser::quickifiedDoc(const QString& source) -{ - QString result; - int i = 0; - - while (i < (int) source.length()) { - if (leftWordBoundary(source, i)) { - if (source[i] == 'Q') { - if (source[i + 1] == 'C' && source.mid(i, 8) == "QCString") { - i += 2; - } - else { - int end = i + 1; - while (isWord(source[end])) - ++end; - if (!classesWithNoQ.contains( - source.mid(i + 1, end - (i + 1)))) - result += "Q"; - i++; - } - } - else if (source[i] == 'T' && source.mid(i, 4) == "TRUE" && - rightWordBoundary(source, i + 4)) { - result += "\\c{true}"; - i += 4; - } - else if (source[i] == 'F' && source.mid(i, 5) == "FALSE" && - rightWordBoundary(source, i + 5)) { - result += "\\c{false}"; - i += 5; - } - else if (source[i] == 'c' && source.mid(i, 6) == "const ") { - i += 6; - } - else { - result += source[i++]; - } - } - else if ((source[i] == ':' && source[i + 1] == ':') || - (source[i] == '-' && source[i + 1] == '>')) { - result += '.'; - i += 2; - } - else if (source[i] == '\\') { - // ### make independent of the command name - if (source.mid(i, 5) == "\\code") { - do { - result += source[i++]; - } while (source[i - 1] != '\n'); - - int begin = i; - int end = source.indexOf("\\endcode", i); - if (end != -1) { - QString code = source.mid(begin, end - begin); - result += cpp2qs.convertedCode(qsTre, code, - classesWithNoQ); - i = end; - } - } - else { - result += source[i++]; - } - } - else { - result += source[i++]; - } - } - - QList::ConstIterator b = replaceBefores.begin(); - QStringList::ConstIterator a = replaceAfters.begin(); - while (a != replaceAfters.end()) { - result.replace(*b, *a); - ++b; - ++a; - } - return result; -} - -void QsCodeParser::setQtDoc(Node *quickNode, const Doc& doc) -{ - if (!doc.isEmpty()) { - Doc quickDoc(doc.location(), doc.location(), - quickifiedDoc(doc.source()), - CppCodeParser::topicCommands() + - CppCodeParser::otherMetaCommands()); - quickNode->setDoc(quickDoc, true); - } -} - -void QsCodeParser::setQuickDoc(Node *quickNode, - const Doc& doc, - const QStringList& qtParams, - const QStringList& quickParams) -{ - QRegExp quickifyCommand("\\\\" + COMMAND_QUICKIFY + "([^\n]*)(?:\n|$)"); - - if (quickNode->type() == Node::Function) { - FunctionNode *quickFunc = (FunctionNode *) quickNode; - quickFunc->setOverload(false); - } - - if (doc.metaCommandsUsed().contains(COMMAND_QUICKIFY)) { - QString source = doc.source(); - int pos = source.indexOf(quickifyCommand); - if (pos != -1) { - QString quickifiedSource = quickNode->doc().source(); - if (!qtParams.isEmpty() && qtParams != quickParams) - renameParameters(quickifiedSource, doc, qtParams, - quickParams); - applyReplacementList(quickifiedSource, doc); - - do { - QString extract = quickifiedSource; - QString arg = quickifyCommand.cap(1).simplified(); - if (!arg.isEmpty()) { - if (arg.startsWith("/") && arg.endsWith("/") && - arg.length() > 2) { - QString pattern = arg.mid(1, arg.length() - 2); - extractRegExp(QRegExp(pattern), extract, doc); - } - else { - extractTarget(arg, extract, doc); - } - } - source.replace(pos, quickifyCommand.matchedLength(), extract); - pos += extract.length(); - } while ((pos = source.indexOf(quickifyCommand, pos)) != -1); - - QRegExp quickcodeRegExp( - "\\\\" + COMMAND_QUICKCODE + "(.*)\\\\" + - COMMAND_ENDQUICKCODE); - quickcodeRegExp.setMinimal(true); - source.replace(quickcodeRegExp, ""); - } - - Doc quickDoc(doc.location(), - doc.location(), - source, - (CppCodeParser::topicCommands() + topicCommands() + - CppCodeParser::otherMetaCommands()) << COMMAND_REPLACE); - quickNode->setDoc(quickDoc, true); - processOtherMetaCommands(quickDoc, quickNode); - } - else { - quickNode->setDoc(doc, true); - processOtherMetaCommands(doc, quickNode); - } -} - -bool QsCodeParser::makeFunctionNode(const QString& synopsis, - QStringList *parentPathPtr, - FunctionNode **funcPtr) -{ - QRegExp funcRegExp( - "\\s*([A-Za-z0-9_]+)\\.([A-Za-z0-9_]+)\\s*\\((" + - balancedParens + - ")\\)(?:\\s*:\\s*([A-Za-z0-9_]+))?\\s*"); - QRegExp paramRegExp( - "\\s*(\\[)?\\s*(?:([A-Za-z0-9_]+)\\s*:\\s*)?" - "([A-Za-z0-9_]+|\\.\\.\\.)\\s*(\\[)?[\\s\\]]*"); - - if (!funcRegExp.exactMatch(synopsis)) - return false; - - ClassNode *classe = (ClassNode*) - qsTre->findNode(QStringList(funcRegExp.cap(1)),Node::Class); - if (classe == 0) - return false; - - FunctionNode *clone = new FunctionNode(0, funcRegExp.cap(2)); - bool optional = false; - - QString paramStr = funcRegExp.cap(3); - QStringList params = paramStr.split(","); - QStringList::ConstIterator p = params.begin(); - while (p != params.end()) { - if (paramRegExp.exactMatch(*p)) { - if (!paramRegExp.cap(1).isEmpty()) - optional = true; - clone->addParameter(Parameter(paramRegExp.cap(3), - "", - paramRegExp.cap(2), - optional ? "undefined" : "")); - if (!paramRegExp.cap(4).isEmpty()) - optional = true; - } - else { - delete clone; - return false; - } - ++p; - } - QString returnType = funcRegExp.cap(4); - if (!returnType.isEmpty()) - clone->setReturnType(returnType); - if (parentPathPtr != 0) - *parentPathPtr = QStringList() << classe->name(); - if (funcPtr != 0) { - *funcPtr = clone; - } - else { - delete clone; - } - return true; -} - -bool QsCodeParser::isWord(QChar ch) -{ - return ch.isLetterOrNumber() || ch == QChar('_'); -} - -bool QsCodeParser::leftWordBoundary(const QString& str, int pos) -{ - return !isWord(str[pos - 1]) && isWord(str[pos]); -} - -bool QsCodeParser::rightWordBoundary(const QString& str, int pos) -{ - return isWord(str[pos - 1]) && !isWord(str[pos]); -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/qscodeparser.h b/tools/qdoc3/qscodeparser.h deleted file mode 100644 index 28924d7..0000000 --- a/tools/qdoc3/qscodeparser.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - qscodeparser.h -*/ - -#ifndef QSCODEPARSER_H -#define QSCODEPARSER_H - -#include "cppcodeparser.h" -#include "cpptoqsconverter.h" - -QT_BEGIN_NAMESPACE - -class QsCodeParser : public CppCodeParser -{ - public: - QsCodeParser(Tree *cppTree); - ~QsCodeParser(); - - virtual void initializeParser(const Config& config); - virtual void terminateParser(); - virtual QString language(); - virtual QString headerFileNameFilter(); - virtual QString sourceFileNameFilter(); - virtual void parseHeaderFile(const Location& location, - const QString& filePath, Tree *tree); - virtual void parseSourceFile(const Location& location, - const QString& filePath, Tree *tree); - virtual void doneParsingHeaderFiles(Tree *tree); - virtual void doneParsingSourceFiles(Tree *tree); - - FunctionNode *findFunctionNode(const QString& synopsis, Tree *tree); - - protected: - virtual QSet topicCommands(); - virtual Node *processTopicCommand(const Doc& doc, const QString& command, - const QString& arg); - virtual QSet otherMetaCommands(); - virtual void processOtherMetaCommand(const Doc& doc, - const QString& command, - const QString& arg, Node *node); - - private: - ClassNode *tryClass(const QString& className); - FunctionNode *findKernelFunction(const QStringList& parentPath, - const QString& name); - void extractRegExp(const QRegExp& regExp, QString& source, - const Doc& doc); - void extractTarget(const QString& target, QString& source, - const Doc& doc); - void renameParameters(QString& source, const Doc& doc, - const QStringList& qtNames, - const QStringList& quickNames); - void applyReplacementList(QString& source, const Doc& doc); - void quickifyClass(ClassNode *quickClass); - void quickifyEnum(ClassNode *quickClass, EnumNode *enume); - void quickifyFunction(ClassNode *quickClass, ClassNode *qtClass, - FunctionNode *func, bool onBlackList); - void quickifyProperty(ClassNode *quickClass, ClassNode *qtClass, - PropertyNode *property); - QString quickifiedDoc(const QString& source); - void setQtDoc(Node *quickNode, const Doc& doc); - void setQuickDoc(Node *quickNode, const Doc& doc, - const QStringList& qtParams = QStringList(), - const QStringList& quickParams = QStringList()); - bool makeFunctionNode(const QString& synopsis, QStringList *parentPathPtr, - FunctionNode **funcPtr); - - static bool isWord(QChar ch); - static bool leftWordBoundary(const QString& str, int pos); - static bool rightWordBoundary(const QString& str, int pos); - - QMap nodeTypeMap; - QMap classesWithNoQuickDoc; - QList replaceBefores; - QStringList replaceAfters; - QSet classesWithNoQ; - Tree* cppTre; - Tree* qsTre; - QRegExp replaceRegExp; - CppToQsConverter cpp2qs; - - static int tabSize; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/sgmlgenerator.cpp b/tools/qdoc3/sgmlgenerator.cpp deleted file mode 100644 index 1858028..0000000 --- a/tools/qdoc3/sgmlgenerator.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - sgmlgenerator.cpp -*/ - -#include "sgmlgenerator.h" - -QT_BEGIN_NAMESPACE - -SgmlGenerator::SgmlGenerator() -{ -} - -SgmlGenerator::~SgmlGenerator() -{ -} - -QString SgmlGenerator::format() -{ - return "SGML"; -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/sgmlgenerator.h b/tools/qdoc3/sgmlgenerator.h deleted file mode 100644 index ef1f07f..0000000 --- a/tools/qdoc3/sgmlgenerator.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - sgmlgenerator.h -*/ - -#ifndef SGMLGENERATOR_H -#define SGMLGENERATOR_H - -#include "bookgenerator.h" - -QT_BEGIN_NAMESPACE - -class SgmlGenerator : public BookGenerator -{ -public: - SgmlGenerator(); - ~SgmlGenerator(); - - virtual QString format(); - -protected: - // ### -}; - -QT_END_NAMESPACE - -#endif -- cgit v0.12 From 5d2eaa50cb1a95f370d7db7413c112e85c83c66d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 19 Nov 2010 19:01:29 +0100 Subject: Further simplifications to qdoc3. Removed the unused ApiGenerator class. Removed archive and uncompression support not used in Qt. Removed the unused WebXML generator used to dump documentation as XML for an ancient documentation Web project. --- tools/qdoc3/JAVATODO.txt | 28 - tools/qdoc3/TODO.txt | 9 - tools/qdoc3/apigenerator.cpp | 150 ----- tools/qdoc3/apigenerator.h | 65 -- tools/qdoc3/archiveextractor.cpp | 108 --- tools/qdoc3/archiveextractor.h | 78 --- tools/qdoc3/config.cpp | 72 +- tools/qdoc3/generator.cpp | 29 - tools/qdoc3/main.cpp | 24 - tools/qdoc3/polyarchiveextractor.cpp | 94 --- tools/qdoc3/polyarchiveextractor.h | 70 -- tools/qdoc3/polyuncompressor.cpp | 109 ---- tools/qdoc3/polyuncompressor.h | 71 -- tools/qdoc3/qdoc3.pro | 18 +- tools/qdoc3/uncompressor.cpp | 108 --- tools/qdoc3/uncompressor.h | 79 --- tools/qdoc3/webxmlgenerator.cpp | 1195 ---------------------------------- tools/qdoc3/webxmlgenerator.h | 127 ---- 18 files changed, 5 insertions(+), 2429 deletions(-) delete mode 100644 tools/qdoc3/JAVATODO.txt delete mode 100644 tools/qdoc3/apigenerator.cpp delete mode 100644 tools/qdoc3/apigenerator.h delete mode 100644 tools/qdoc3/archiveextractor.cpp delete mode 100644 tools/qdoc3/archiveextractor.h delete mode 100644 tools/qdoc3/polyarchiveextractor.cpp delete mode 100644 tools/qdoc3/polyarchiveextractor.h delete mode 100644 tools/qdoc3/polyuncompressor.cpp delete mode 100644 tools/qdoc3/polyuncompressor.h delete mode 100644 tools/qdoc3/uncompressor.cpp delete mode 100644 tools/qdoc3/uncompressor.h delete mode 100644 tools/qdoc3/webxmlgenerator.cpp delete mode 100644 tools/qdoc3/webxmlgenerator.h diff --git a/tools/qdoc3/JAVATODO.txt b/tools/qdoc3/JAVATODO.txt deleted file mode 100644 index 911b7a5..0000000 --- a/tools/qdoc3/JAVATODO.txt +++ /dev/null @@ -1,28 +0,0 @@ - * index page on "O" and downwards? - * flag types, e.g. QTextStream::NumberFlags - * example references qt.nokia.com/doc etc. - - * fix enum value table (e.g. QCoreApplication.Encoding.html) - * check reimplementation of interface functions (e.g. QWidget::widthMM()) - * handle '::' in doc, e.g. in QAbstractEventDispatcher's detailed desc - * make sure default constructor logic doesn't interfere with default params (e.g. QAbstractEventDispatcher ctors) - * document default constructor provided for Java (e.g.?) - * document "protected QAbstractEventDispatcher(QtObject.QPrivateConstructor p)" and the like - * memory-managed, type - - * replace QString with String, etc. - * nested classes - * enum_1 - - * fix stylesheet - * no link to class itself - * support \ifjava - * add // C++ - * support Java-only /*! ... */ comments - - * links to property names have to be fixed - * example: version 1 in QStyleOptionFrame - * example: foo -> isFoo() - - * lowercase, and remove final stop, in \brief texts for variables and properties - * omit "see alsos" that don't work instead of showing them as broken links diff --git a/tools/qdoc3/TODO.txt b/tools/qdoc3/TODO.txt index 6deeb06..9bf4a28 100644 --- a/tools/qdoc3/TODO.txt +++ b/tools/qdoc3/TODO.txt @@ -10,8 +10,6 @@ * Don't turn X11 and similar names into links. * Added automatic links from getters to setters and vice versa. * Support \module and show which module each class is from. - * Use bullet list for the list of all functions, now that - Assistant handles these gracefully. * Fix occasional crash caused by misuse of const_cast(). * Provide clearer error messages when resolves fail. @@ -55,12 +53,9 @@ MUST HAVES: * Provide a "List of all properties" page. * expand QObjectList -> QList - * make \macro work (?) * warning for unnamed parameters in property access functions * \center...\endcenter - * warning for undocumented enum values - LINKS: * explanation following nonstandard wording warning @@ -74,8 +69,6 @@ LINKS: * implement \sidebar - * implement qbook - * implement \legalesefile * show in which module each class is @@ -92,5 +85,3 @@ NICE FEATURES: OTHER: * make qdoc run faster * make sure \headerfile works even if specified after \relates - - * use qtstyle.css instead of inline style for each page diff --git a/tools/qdoc3/apigenerator.cpp b/tools/qdoc3/apigenerator.cpp deleted file mode 100644 index 41c89c7..0000000 --- a/tools/qdoc3/apigenerator.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "apigenerator.h" -#include "codemarker.h" -#include "tree.h" - -QT_BEGIN_NAMESPACE - -static QString indentStr(int indent) -{ - QString str; - str.fill(QLatin1Char(' '), indent * 4); - return str; -} - -static bool lessThanName(Node *node1, Node *node2) -{ - return node1->name() < node2->name(); -} - -QString ApiGenerator::format() -{ - return QLatin1String("API"); -} - -void ApiGenerator::generateTree(const Tree *tree, CodeMarker *marker) -{ - QFile outFile(QLatin1String("api")); - outFile.open(QIODevice::WriteOnly); - - out.setDevice(&outFile); - generateNode(tree->root(), marker); - out.flush(); -} - -void ApiGenerator::generateNode(const Node *node, CodeMarker *marker, int indent) -{ - if (node->access() == Node::Private) - return; - - switch (node->type()) { - case Node::Namespace: - if (!node->name().isEmpty()) { - out << indentStr(indent) << "Namespace: " << node->name() << "\n"; - ++indent; - } - break; - case Node::Class: - { - const ClassNode *classe = static_cast(node); - out << indentStr(indent) << "Class: " << node->name(); - foreach (const RelatedClass &baseClass, classe->baseClasses()) { - if (baseClass.access == Node::Public) - out << " inherits " << baseClass.dataTypeWithTemplateArgs; - } - out << "\n"; - ++indent; - } - break; - case Node::Enum: - { - const EnumNode *enume = static_cast(node); - out << indentStr(indent) << "Enum: " << node->name() << "\n"; - ++indent; - - QStringList enumNames; - foreach (const EnumItem &item, enume->items()) - enumNames << item.name(); - qSort(enumNames); - - foreach (const QString &name, enumNames) - out << indentStr(indent) << "Enum value: " << name << "\n"; - } - break; - case Node::Typedef: - out << indentStr(indent) << "Typedef: " << node->name() << "\n"; - ++indent; - break; - case Node::Function: - { - out << indentStr(indent) << "Function: " - << plainCode(marker->markedUpSynopsis(node, 0, CodeMarker::Detailed)) << "\n"; - ++indent; - } - break; - case Node::Property: - { - const PropertyNode *property = static_cast(node); - out << indentStr(indent) << "Property: " << property->name() - << " type " << property->dataType() << "\n"; - ++indent; - } - break; - default: - ; - } - - if (node->isInnerNode()) { - const InnerNode *inner = static_cast(node); - NodeList nodes = inner->childNodes(); - qSort(nodes.begin(), nodes.end(), lessThanName); - foreach (const Node *child, nodes) - generateNode(child, marker, indent); - } - - out.flush(); -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/apigenerator.h b/tools/qdoc3/apigenerator.h deleted file mode 100644 index fefef5d..0000000 --- a/tools/qdoc3/apigenerator.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef APIGENERATOR_H -#define APIGENERATOR_H - -#include - -#include "generator.h" - -QT_BEGIN_NAMESPACE - -class ApiGenerator : public Generator -{ -public: - QString format(); - void generateTree(const Tree *tree, CodeMarker *marker); - -private: - void generateNode(const Node *node, CodeMarker *marker, int indent = 0); - - QTextStream out; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/archiveextractor.cpp b/tools/qdoc3/archiveextractor.cpp deleted file mode 100644 index 6d3d736..0000000 --- a/tools/qdoc3/archiveextractor.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - archiveextractor.cpp -*/ - -#include "archiveextractor.h" - -QT_BEGIN_NAMESPACE - -QList ArchiveExtractor::extractors; - -/*! - \class ArchiveExtractor - - \brief The ArchiveExtractor class is a base class for classes that - know how to unpack a certain kind of archive file. - - The archive extractor contains a list of the filename extensions - of the files that the archive extractor knows how to unpack. - - It maintains a static list of all the instances of ArchiveExtractor - that have been created. It also has a static function for searching - that list to find the archive extracter for a file with a certain - extension. - */ - -/*! - The constructor takes a list of filename extensions, which it - copies and saves internally. This archive extractor is prepended - to the static list. - */ -ArchiveExtractor::ArchiveExtractor( const QStringList& extensions ) - : fileExts( extensions ) -{ - extractors.prepend( this ); -} - -/*! - The destructor deletes all the filename extensions. - */ -ArchiveExtractor::~ArchiveExtractor() -{ - extractors.removeAll( this ); -} - -/*! - This function searches the static list of archive extractors - to find the first one that can handle \a fileName. If it finds - an acceptable extractor, it returns a pointer to it. Otherwise - it returns null. - */ -ArchiveExtractor* -ArchiveExtractor::extractorForFileName( const QString& fileName ) -{ - int dot = -1; - while ( (dot = fileName.indexOf(QLatin1Char('.'), dot + 1)) != -1 ) { - QString ext = fileName.mid( dot + 1 ); - QList::ConstIterator e = extractors.begin(); - while ( e != extractors.end() ) { - if ( (*e)->fileExtensions().contains(ext) ) - return *e; - ++e; - } - } - return 0; -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/archiveextractor.h b/tools/qdoc3/archiveextractor.h deleted file mode 100644 index 678945a..0000000 --- a/tools/qdoc3/archiveextractor.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - archiveextractor.h -*/ - -#ifndef ARCHIVEEXTRACTOR_H -#define ARCHIVEEXTRACTOR_H - -#include - -#include "location.h" - -QT_BEGIN_NAMESPACE - -class ArchiveExtractor -{ -public: - ArchiveExtractor( const QStringList& extensions ); - virtual ~ArchiveExtractor(); - - virtual void extractArchive( const Location& location, - const QString& filePath, - const QString& outputDir ) = 0; - - static ArchiveExtractor *extractorForFileName( const QString& fileName ); - -protected: - const QStringList& fileExtensions() { return fileExts; } - -private: - QStringList fileExts; - - static QList extractors; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/config.cpp b/tools/qdoc3/config.cpp index 4d1c378..0146a26 100644 --- a/tools/qdoc3/config.cpp +++ b/tools/qdoc3/config.cpp @@ -49,9 +49,7 @@ #include #include -#include "archiveextractor.h" #include "config.h" -#include "uncompressor.h" #include QT_BEGIN_NAMESPACE @@ -150,7 +148,6 @@ QStringList MetaStack::getExpanded(const Location& location) } QT_STATIC_CONST_IMPL QString Config::dot = QLatin1String("."); -QMap Config::uncompressedFiles; QMap Config::extractedDirs; int Config::numInstances; @@ -178,30 +175,9 @@ Config::Config(const QString& programName) } /*! - The destructor deletes all the temporary files and - directories it built. */ Config::~Config() { - if (--numInstances == 0) { - QMap::ConstIterator f = uncompressedFiles.begin(); - while (f != uncompressedFiles.end()) { - QDir().remove(*f); - ++f; - } - uncompressedFiles.clear(); - - QMap::ConstIterator d = extractedDirs.begin(); - while (d != extractedDirs.end()) { - removeDirContents(*d); - QDir dir(*d); - QString name = dir.dirName(); - dir.cdUp(); - dir.rmdir(name); - ++d; - } - extractedDirs.clear(); - } } /*! @@ -456,62 +432,18 @@ QString Config::findFile(const Location& location, QStringList::ConstIterator c = components.begin(); for (;;) { bool isArchive = (c != components.end() - 1); - ArchiveExtractor *extractor = 0; QString userFriendly = *c; - if (isArchive) { - extractor = ArchiveExtractor::extractorForFileName(userFriendly); - } - - if (extractor == 0) { - Uncompressor *uncompressor = - Uncompressor::uncompressorForFileName(userFriendly); - if (uncompressor != 0) { - QString fileNameWithCorrectExtension = - uncompressor->uncompressedFilePath( - fileInfo.filePath()); - QString uncompressed = uncompressedFiles[fileInfo.filePath()]; - if (uncompressed.isEmpty()) { - uncompressed = - QTemporaryFile(fileInfo.filePath()).fileName(); - uncompressor->uncompressFile(location, - fileInfo.filePath(), - uncompressed); - uncompressedFiles[fileInfo.filePath()] = uncompressed; - } - fileInfo.setFile(uncompressed); - - if (isArchive) { - extractor = ArchiveExtractor::extractorForFileName( - fileNameWithCorrectExtension); - } - else { - userFriendly = fileNameWithCorrectExtension; - } - } - } userFriendlyFilePath += userFriendly; if (isArchive) { - if (extractor == 0) - location.fatal(tr("Unknown archive type '%1'") - .arg(userFriendlyFilePath)); QString extracted = extractedDirs[fileInfo.filePath()]; - if (extracted.isEmpty()) { - extracted = QTemporaryFile(fileInfo.filePath()).fileName(); - if (!QDir().mkdir(extracted)) - location.fatal(tr("Cannot create temporary directory '%1'") - .arg(extracted)); - extractor->extractArchive(location, fileInfo.filePath(), - extracted); - extractedDirs[fileInfo.filePath()] = extracted; - } ++c; fileInfo.setFile(QDir(extracted), *c); } - else { + else break; - } + userFriendlyFilePath += "?"; } return fileInfo.filePath(); diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index c0efd76..74e966a 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -674,35 +674,6 @@ void Generator::generateExampleFiles(const FakeNode *fake, CodeMarker *marker) generateFileList(fake, marker, Node::Image, QString("Images:")); } -#if 0 - QList::ConstIterator g = generators.begin(); - while (g != generators.end()) { - if (outputFormats.contains((*g)->format())) { - (*g)->initializeGenerator(config); - QStringList extraImages = - config.getStringList(CONFIG_EXTRAIMAGES+Config::dot+(*g)->format()); - QStringList::ConstIterator e = extraImages.begin(); - while (e != extraImages.end()) { - QString userFriendlyFilePath; - QString filePath = Config::findFile(config.lastLocation(), - imageFiles, - imageDirs, - *e, - imgFileExts[(*g)->format()], - userFriendlyFilePath); - if (!filePath.isEmpty()) - Config::copyFile(config.lastLocation(), - filePath, - userFriendlyFilePath, - (*g)->outputDir() + - "/images"); - ++e; - } - } - ++g; - } -#endif - QString Generator::indent(int level, const QString& markedCode) { if (level == 0) diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 7459e40..768c5eb 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -45,7 +45,6 @@ #include #include -#include "apigenerator.h" #include "codemarker.h" #include "codeparser.h" #include "config.h" @@ -54,9 +53,6 @@ #include "doc.h" #include "htmlgenerator.h" #include "plaincodemarker.h" -#include "polyarchiveextractor.h" -#include "polyuncompressor.h" -#include "webxmlgenerator.h" #include "ditaxmlgenerator.h" #include "tokenizer.h" #include "tree.h" @@ -369,24 +365,6 @@ int main(int argc, char **argv) #ifndef QT_BOOTSTRAPPED QCoreApplication app(argc, argv); #endif - QString cf = "qsauncompress \1 \2"; - PolyArchiveExtractor qsaExtractor(QStringList() << "qsa",cf); - cf = "tar -C \2 -xf \1"; - PolyArchiveExtractor tarExtractor(QStringList() << "tar",cf); - cf = "tar -C \2 -Zxf \1"; - PolyArchiveExtractor tazExtractor(QStringList() << "taz",cf); - cf = "tar -C \2 -jxf \1"; - PolyArchiveExtractor tbz2Extractor(QStringList() << "tbz" << "tbz2",cf); - cf = "tar -C \2 -zxf \1"; - PolyArchiveExtractor tgzExtractor(QStringList() << "tgz",cf); - cf = "unzip \1 -d \2"; - PolyArchiveExtractor zipExtractor(QStringList() << "zip",cf); - cf = "bunzip2 -c \1 > \2"; - PolyUncompressor bz2Uncompressor(QStringList() << "bz" << "bz2",cf); - cf = "gunzip -c \1 > \2"; - PolyUncompressor gzAndZUncompressor(QStringList() << "gz" << "z" << "Z",cf); - cf = "unzip -c \1 > \2"; - PolyUncompressor zipUncompressor(QStringList() << "zip",cf); /* Create code parsers for the languages to be parsed, @@ -401,9 +379,7 @@ int main(int argc, char **argv) PlainCodeMarker plainMarker; CppCodeMarker cppMarker; - ApiGenerator apiGenerator; HtmlGenerator htmlGenerator; - WebXMLGenerator webxmlGenerator; DitaXmlGenerator ditaxmlGenerator; QStringList qdocFiles; diff --git a/tools/qdoc3/polyarchiveextractor.cpp b/tools/qdoc3/polyarchiveextractor.cpp deleted file mode 100644 index b2574ab..0000000 --- a/tools/qdoc3/polyarchiveextractor.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - polyarchiveextractor.cpp -*/ - -#include "command.h" -#include "polyarchiveextractor.h" - -QT_BEGIN_NAMESPACE - -/*! - \class PolyArchiveExtractor - - \brief The PolyArchiveExtractor class is a class for unpacking - archive files. - - This subclass of ArchiveExtractor contains a parameterized - command for doing the archive extraction. - - It has an extractArchive() function you call to do the - actual archive extraction. - */ - -/*! - The constructor takes the list of filename \a extensions, - which it passes to the base class, and the \a commandFormat, - which it stores locally. The \a commandFormat is a command - template string. - */ -PolyArchiveExtractor::PolyArchiveExtractor( const QStringList& extensions, - const QString& commandFormat ) - : ArchiveExtractor( extensions ), cmd( commandFormat ) -{ -} - -/*! - The destructor doesn't have to do anything. - */ -PolyArchiveExtractor::~PolyArchiveExtractor() -{ -} - -/*! - Call this function to do the actual archive extraction. It calls - the executeCommand() function to do the work. That's all it does. - */ -void PolyArchiveExtractor::extractArchive( const Location& location, - const QString& filePath, - const QString& outputDir ) -{ - executeCommand( location, cmd, QStringList() << filePath << outputDir ); -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/polyarchiveextractor.h b/tools/qdoc3/polyarchiveextractor.h deleted file mode 100644 index 7ed0f62..0000000 --- a/tools/qdoc3/polyarchiveextractor.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - polyarchiveextractor.h -*/ - -#ifndef POLYARCHIVEEXTRACTOR_H -#define POLYARCHIVEEXTRACTOR_H - -#include "archiveextractor.h" - -QT_BEGIN_NAMESPACE - -class PolyArchiveExtractor : public ArchiveExtractor -{ - public: - PolyArchiveExtractor(const QStringList& extensions, - const QString& commandFormat); - ~PolyArchiveExtractor(); - - virtual void extractArchive(const Location& location, - const QString& filePath, - const QString& outputDir); - - private: - QString cmd; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/polyuncompressor.cpp b/tools/qdoc3/polyuncompressor.cpp deleted file mode 100644 index 97b5e0d..0000000 --- a/tools/qdoc3/polyuncompressor.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "command.h" -#include "polyuncompressor.h" - -QT_BEGIN_NAMESPACE - -/*! - \class PolyUncompressor - - \brief The PolyUncompressor class is a class for uncompressing - compressed files. - - This subclass of Uncompressor contains a parameterized - command for doing the uncompression - - It has an uncompressFile() function you call to do the - actual uncompression. - */ - -/*! - The constructor takes the list of filename \a extensions, - which it passes to the base class, and the \a commandFormat, - which it stores locally. The \a commandFormat is a command - template string. - */ -PolyUncompressor::PolyUncompressor( const QStringList& extensions, - const QString& commandFormat ) - : Uncompressor( extensions ), cmd( commandFormat ) -{ -} - -/*! - The destructor doesn't have to do anything. - */ -PolyUncompressor::~PolyUncompressor() -{ -} - -/*! - From \a filePath, derive a file path for the uncompressed - file and return it. If it can't figure out what the file - path should be, it just concatenates ".out" to the - \a filePath and returns that. - */ -QString PolyUncompressor::uncompressedFilePath( const QString& filePath ) -{ - QStringList::ConstIterator e = fileExtensions().begin(); - while ( e != fileExtensions().end() ) { - QString dotExt = "." + *e; - if ( filePath.endsWith(dotExt) ) - return filePath.left( filePath.length() - dotExt.length() ); - ++e; - } - return filePath + ".out"; // doesn't really matter -} - -/*! - Call this function to do the actual uncompressing. It calls - the executeCommand() function to do the work. That's all it does. - */ -void PolyUncompressor::uncompressFile( const Location& location, - const QString& filePath, - const QString& outputFilePath ) -{ - executeCommand( location, cmd, - QStringList() << filePath << outputFilePath ); -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/polyuncompressor.h b/tools/qdoc3/polyuncompressor.h deleted file mode 100644 index e12f475..0000000 --- a/tools/qdoc3/polyuncompressor.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - polyuncompressor.h -*/ - -#ifndef POLYUNCOMPRESSOR_H -#define POLYUNCOMPRESSOR_H - -#include "uncompressor.h" - -QT_BEGIN_NAMESPACE - -class PolyUncompressor : public Uncompressor -{ - public: - PolyUncompressor(const QStringList& extensions, - const QString& commandFormat); - ~PolyUncompressor(); - - virtual QString uncompressedFilePath(const QString& filePath); - virtual void uncompressFile(const Location& location, - const QString& filePath, - const QString& outputFilePath); - - private: - QString cmd; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 9b76d97..77c95f8 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -24,9 +24,7 @@ build_all:!build_pass { } CONFIG -= app_bundle -HEADERS += apigenerator.h \ - archiveextractor.h \ - atom.h \ +HEADERS += atom.h \ ccodeparser.h \ codechunk.h \ codemarker.h \ @@ -46,19 +44,13 @@ HEADERS += apigenerator.h \ openedlist.h \ pagegenerator.h \ plaincodemarker.h \ - polyarchiveextractor.h \ - polyuncompressor.h \ quoter.h \ separator.h \ text.h \ tokenizer.h \ tr.h \ - tree.h \ - uncompressor.h \ - webxmlgenerator.h -SOURCES += apigenerator.cpp \ - archiveextractor.cpp \ - atom.cpp \ + tree.h +SOURCES += atom.cpp \ ccodeparser.cpp \ codechunk.cpp \ codemarker.cpp \ @@ -79,15 +71,11 @@ SOURCES += apigenerator.cpp \ openedlist.cpp \ pagegenerator.cpp \ plaincodemarker.cpp \ - polyarchiveextractor.cpp \ - polyuncompressor.cpp \ quoter.cpp \ separator.cpp \ text.cpp \ tokenizer.cpp \ tree.cpp \ - uncompressor.cpp \ - webxmlgenerator.cpp \ yyindent.cpp ### Documentation for qdoc3 ### diff --git a/tools/qdoc3/uncompressor.cpp b/tools/qdoc3/uncompressor.cpp deleted file mode 100644 index afb88e6..0000000 --- a/tools/qdoc3/uncompressor.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - uncompressor.cpp -*/ - -#include "uncompressor.h" - -QT_BEGIN_NAMESPACE - -QList Uncompressor::uncompressors; - - -/*! - \class Uncompressor - - \brief The Uncompressor class is a base class for classes that - know how to uncompress a certain kind of compressed file. - - The uncompressor contains a list of the filename extensions - of the file types that the uncompressor knows how to uncompress. - - It maintains a static list of all the instances of Uncompressor - that have been created. It also has a static function for searching - that list to find the uncompressor to use for uncompressing a file - with a certain extension. - */ - -/*! - The constructor takes a list of filename extensions, which it - copies and saves internally. This uncompressor is prepended - to the stack list. - */ -Uncompressor::Uncompressor( const QStringList& extensions ) - : fileExts( extensions ) -{ - uncompressors.prepend( this ); -} - -/*! - The destructor deletes all the filename extensions. - */ -Uncompressor::~Uncompressor() -{ - uncompressors.removeAll( this ); -} - -/*! - This function searches the static list of uncompressors to find the - first one that can handle \a fileName. If it finds an acceptable - uncompressor, it returns a pointer to it. Otherwise it returns null. -*/ -Uncompressor* -Uncompressor::uncompressorForFileName( const QString& fileName ) -{ - int dot = -1; - while ( (dot = fileName.indexOf(".", dot + 1)) != -1 ) { - QString ext = fileName.mid( dot + 1 ); - QList::ConstIterator u = uncompressors.begin(); - while ( u != uncompressors.end() ) { - if ( (*u)->fileExtensions().contains(ext) ) - return *u; - ++u; - } - } - return 0; -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/uncompressor.h b/tools/qdoc3/uncompressor.h deleted file mode 100644 index cae675f..0000000 --- a/tools/qdoc3/uncompressor.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - uncompressor.h -*/ - -#ifndef UNCOMPRESSOR_H -#define UNCOMPRESSOR_H - -#include - -#include "location.h" - -QT_BEGIN_NAMESPACE - -class Uncompressor -{ -public: - Uncompressor( const QStringList& extensions ); - virtual ~Uncompressor(); - - virtual QString uncompressedFilePath( const QString& filePath ) = 0; - virtual void uncompressFile( const Location& location, - const QString& filePath, - const QString& outputFilePath ) = 0; - - static Uncompressor *uncompressorForFileName( const QString& fileName ); - -protected: - const QStringList& fileExtensions() const { return fileExts; } - -private: - QStringList fileExts; - - static QList uncompressors; -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/webxmlgenerator.cpp b/tools/qdoc3/webxmlgenerator.cpp deleted file mode 100644 index 6020b1b..0000000 --- a/tools/qdoc3/webxmlgenerator.cpp +++ /dev/null @@ -1,1195 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - webxmlgenerator.cpp -*/ - -#include "codemarker.h" -#include "pagegenerator.h" -#include "webxmlgenerator.h" -#include "node.h" -#include "separator.h" -#include "tree.h" - -#include - -QT_BEGIN_NAMESPACE - -#define COMMAND_VERSION Doc::alias("version") - -WebXMLGenerator::WebXMLGenerator() - : PageGenerator() -{ -} - -WebXMLGenerator::~WebXMLGenerator() -{ -} - -void WebXMLGenerator::initializeGenerator(const Config &config) -{ - Generator::initializeGenerator(config); - - project = config.getString(CONFIG_PROJECT); - - projectDescription = config.getString(CONFIG_DESCRIPTION); - if (projectDescription.isEmpty() && !project.isEmpty()) - projectDescription = project + " Reference Documentation"; - - projectUrl = config.getString(CONFIG_URL); - - generateIndex = config.getBool(CONFIG_GENERATEINDEX); -} - -void WebXMLGenerator::terminateGenerator() -{ - PageGenerator::terminateGenerator(); -} - -QString WebXMLGenerator::format() -{ - return "WebXML"; -} - -QString WebXMLGenerator::fileExtension(const Node * /* node */) const -{ - return "xml"; -} - -void WebXMLGenerator::generateTree(const Tree *tree, CodeMarker *marker) -{ - tre = tree; - moduleClassMap.clear(); - moduleNamespaceMap.clear(); - serviceClasses.clear(); - findAllClasses(tree->root()); - findAllNamespaces(tree->root()); - - PageGenerator::generateTree(tree, marker); - - if (generateIndex) - tre->generateIndex(outputDir() + "/" + project.toLower() + ".index", - projectUrl, projectDescription, false); -} - -void WebXMLGenerator::startText(const Node *relative, CodeMarker *marker) -{ - inLink = false; - inContents = false; - inSectionHeading = false; - numTableRows = 0; - sectionNumber.clear(); - PageGenerator::startText(relative, marker); -} - -int WebXMLGenerator::generateAtom(QXmlStreamWriter &writer, const Atom *atom, - const Node *relative, CodeMarker *marker) -{ - Q_UNUSED(writer); - - int skipAhead = 0; - - switch (atom->type()) { - default: - PageGenerator::generateAtom(atom, relative, marker); - } - return skipAhead; -} - -void WebXMLGenerator::generateClassLikeNode(const InnerNode *inner, - CodeMarker *marker) -{ - QByteArray data; - QXmlStreamWriter writer(&data); - writer.setAutoFormatting(true); - writer.writeStartDocument(); - writer.writeStartElement("WebXML"); - writer.writeStartElement("document"); - - generateIndexSections(writer, inner, marker); - - writer.writeEndElement(); // document - writer.writeEndElement(); // WebXML - writer.writeEndDocument(); - - out() << data; - out().flush(); -} - -void WebXMLGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) -{ - QByteArray data; - QXmlStreamWriter writer(&data); - writer.setAutoFormatting(true); - writer.writeStartDocument(); - writer.writeStartElement("WebXML"); - writer.writeStartElement("document"); - - generateIndexSections(writer, fake, marker); - - writer.writeEndElement(); // document - writer.writeEndElement(); // WebXML - writer.writeEndDocument(); - - out() << data; - out().flush(); -} - -void WebXMLGenerator::generateIndexSections(QXmlStreamWriter &writer, - const Node *node, CodeMarker *marker) -{ - if (tre->generateIndexSection(writer, node, true)) { - - // Add documentation to this node if it exists. - writer.writeStartElement("description"); - writer.writeAttribute("path", node->doc().location().filePath()); - writer.writeAttribute("line", QString::number(node->doc().location().lineNo())); - writer.writeAttribute("column", QString::number(node->doc().location().columnNo())); - - if (node->type() == Node::Fake) { - - const FakeNode *fake = static_cast(node); - - generateRelations(writer, node, marker); - - if (fake->subType() == Node::Module) { - writer.writeStartElement("generatedlist"); - writer.writeAttribute("contents", "classesbymodule"); - - if (moduleNamespaceMap.contains(fake->name())) { - writer.writeStartElement("section"); - writer.writeStartElement("heading"); - writer.writeAttribute("level", "1"); - writer.writeCharacters("Namespaces"); - writer.writeEndElement(); // heading - generateAnnotatedList(writer, fake, marker, moduleNamespaceMap[fake->name()]); - writer.writeEndElement(); // section - } - if (moduleClassMap.contains(fake->name())) { - writer.writeStartElement("section"); - writer.writeStartElement("heading"); - writer.writeAttribute("level", "1"); - writer.writeCharacters("Classes"); - writer.writeEndElement(); // heading - generateAnnotatedList(writer, fake, marker, moduleClassMap[fake->name()]); - writer.writeEndElement(); // section - } - - writer.writeEndElement(); // generatedlist - } - } - - startText(node, marker); - - const Atom *atom = node->doc().body().firstAtom(); - while (atom) - atom = addAtomElements(writer, atom, node, marker); - - QList alsoList = node->doc().alsoList(); - supplementAlsoList(node, alsoList); - - if (!alsoList.isEmpty()) { - writer.writeStartElement("see-also"); - for (int i = 0; i < alsoList.size(); ++i) { - const Atom *atom = alsoList.at(i).firstAtom(); - while (atom) - atom = addAtomElements(writer, atom, node, marker); - } - writer.writeEndElement(); // see-also - } - - writer.writeEndElement(); // description - - if (node->isInnerNode()) { - const InnerNode *inner = static_cast(node); - - // Recurse to generate an element for this child node and all its children. - foreach (const Node *child, inner->childNodes()) - generateIndexSections(writer, child, marker); - - writer.writeStartElement("related"); - if (inner->relatedNodes().size() > 0) { - foreach (const Node *child, inner->relatedNodes()) - generateIndexSections(writer, child, marker); - } - writer.writeEndElement(); // related - } - writer.writeEndElement(); - } -} - -void WebXMLGenerator::generateInnerNode(const InnerNode *node, CodeMarker *marker) -{ - if (!node->url().isNull()) - return; - - if (node->type() == Node::Fake) { - const FakeNode *fakeNode = static_cast(node); - if (fakeNode->subType() == Node::ExternalPage) - return; - } - - if ( node->parent() != 0 ) { - beginSubPage( node->location(), fileName(node) ); - if ( node->type() == Node::Namespace || node->type() == Node::Class) { - generateClassLikeNode(node, marker); - } else if ( node->type() == Node::Fake ) { - generateFakeNode(static_cast(node), marker); - } - endSubPage(); - } - - NodeList::ConstIterator c = node->childNodes().begin(); - while ( c != node->childNodes().end() ) { - if ((*c)->isInnerNode() && ( - (*c)->access() != Node::Private || (*c)->status() == Node::Internal)) - generateInnerNode( (const InnerNode *) *c, marker ); - ++c; - } -} - -const Atom *WebXMLGenerator::addAtomElements(QXmlStreamWriter &writer, - const Atom *atom, const Node *relative, CodeMarker *marker) -{ - switch (atom->type()) { - case Atom::AbstractLeft: - case Atom::AbstractRight: - break; - case Atom::AutoLink: - if (!inLink && !inSectionHeading) { - const Node *node = findNode(atom, relative, marker); - if (node) { - startLink(writer, atom, node, relative); - if (inLink) { - writer.writeCharacters(atom->string()); - writer.writeEndElement(); // link - inLink = false; - } - } else - writer.writeCharacters(atom->string()); - } else - writer.writeCharacters(atom->string()); - break; - case Atom::BaseName: - break; - case Atom::BriefLeft: - - writer.writeStartElement("brief"); - switch (relative->type()) { - case Node::Property: - writer.writeCharacters("This property"); - break; - case Node::Variable: - writer.writeCharacters("This variable"); - break; - default: - break; - } - if (relative->type() == Node::Property || relative->type() == Node::Variable) { - QString str; - const Atom *a = atom->next(); - while (a != 0 && a->type() != Atom::BriefRight) { - if (a->type() == Atom::String || a->type() == Atom::AutoLink) - str += a->string(); - a = a->next(); - } - str[0] = str[0].toLower(); - if (str.right(1) == ".") - str.chop(1); - - QStringList words = str.split(" "); - if (!(words.first() == "contains" || words.first() == "specifies" - || words.first() == "describes" || words.first() == "defines" - || words.first() == "holds" || words.first() == "determines")) - writer.writeCharacters(" holds "); - else - writer.writeCharacters(" "); - } - break; - - case Atom::BriefRight: - if (relative->type() == Node::Property || relative->type() == Node::Variable) - writer.writeCharacters("."); - - writer.writeEndElement(); // brief - break; - - case Atom::C: - writer.writeStartElement("teletype"); - if (inLink) - writer.writeAttribute("type", "normal"); - else - writer.writeAttribute("type", "highlighted"); - - writer.writeCharacters(plainCode(atom->string())); - writer.writeEndElement(); // teletype - break; - - case Atom::Code: - writer.writeTextElement("code", trimmedTrailing(plainCode(atom->string()))); - break; - -#ifdef QDOC_QML - case Atom::Qml: - writer.writeTextElement("qml", trimmedTrailing(plainCode(atom->string()))); -#endif - - case Atom::CodeBad: - writer.writeTextElement("badcode", trimmedTrailing(plainCode(atom->string()))); - break; - - case Atom::CodeNew: - writer.writeTextElement("para", "you can rewrite it as"); - writer.writeTextElement("newcode", trimmedTrailing(plainCode(atom->string()))); - break; - - case Atom::CodeOld: - writer.writeTextElement("para", "For example, if you have code like"); - writer.writeTextElement("oldcode", trimmedTrailing(plainCode(atom->string()))); - break; - - case Atom::CodeQuoteArgument: - if (quoteCommand == "dots") { - writer.writeAttribute("indent", atom->string()); - writer.writeCharacters("..."); - } else - writer.writeCharacters(atom->string()); - writer.writeEndElement(); // code - break; - - case Atom::CodeQuoteCommand: - quoteCommand = atom->string(); - writer.writeStartElement(quoteCommand); - break; - - case Atom::FootnoteLeft: - writer.writeStartElement("footnote"); - break; - - case Atom::FootnoteRight: - writer.writeEndElement(); // footnote - break; -/* - case Atom::FormatElse: - writer.writeStartElement("else"); - writer.writeEndElement(); // else - break; -*/ - case Atom::FormatEndif: - writer.writeEndElement(); // raw - break; - case Atom::FormatIf: - writer.writeStartElement("raw"); - writer.writeAttribute("format", atom->string()); - break; - case Atom::FormattingLeft: - { - if (atom->string() == ATOM_FORMATTING_BOLD) - writer.writeStartElement("bold"); - else if (atom->string() == ATOM_FORMATTING_ITALIC) - writer.writeStartElement("italic"); - else if (atom->string() == ATOM_FORMATTING_UNDERLINE) - writer.writeStartElement("underline"); - else if (atom->string() == ATOM_FORMATTING_SUBSCRIPT) - writer.writeStartElement("subscript"); - else if (atom->string() == ATOM_FORMATTING_SUPERSCRIPT) - writer.writeStartElement("superscript"); - else if (atom->string() == ATOM_FORMATTING_TELETYPE) - writer.writeStartElement("teletype"); - else if (atom->string() == ATOM_FORMATTING_PARAMETER) - writer.writeStartElement("argument"); - else if (atom->string() == ATOM_FORMATTING_INDEX) - writer.writeStartElement("index"); - } - break; -/* out() << formattingLeftMap()[atom->string()]; - if ( atom->string() == ATOM_FORMATTING_PARAMETER ) { - if ( atom->next() != 0 && atom->next()->type() == Atom::String ) { - QRegExp subscriptRegExp( "([a-z]+)_([0-9n])" ); - if ( subscriptRegExp.exactMatch(atom->next()->string()) ) { - out() << subscriptRegExp.cap( 1 ) << "" - << subscriptRegExp.cap( 2 ) << ""; - skipAhead = 1; - } - } - }*/ - case Atom::FormattingRight: - { - if (atom->string() == ATOM_FORMATTING_BOLD) - writer.writeEndElement(); - else if (atom->string() == ATOM_FORMATTING_ITALIC) - writer.writeEndElement(); - else if (atom->string() == ATOM_FORMATTING_UNDERLINE) - writer.writeEndElement(); - else if (atom->string() == ATOM_FORMATTING_SUBSCRIPT) - writer.writeEndElement(); - else if (atom->string() == ATOM_FORMATTING_SUPERSCRIPT) - writer.writeEndElement(); - else if (atom->string() == ATOM_FORMATTING_TELETYPE) - writer.writeEndElement(); - else if (atom->string() == ATOM_FORMATTING_PARAMETER) - writer.writeEndElement(); - else if (atom->string() == ATOM_FORMATTING_INDEX) - writer.writeEndElement(); - } - if (inLink) { - writer.writeEndElement(); // link - inLink = false; - } - break; -/* if ( atom->string() == ATOM_FORMATTING_LINK ) { - if (inLink) { - if ( link.isEmpty() ) { - if (showBrokenLinks) - out() << ""; - } else { - out() << ""; - } - } - inLink = false; - } else { - out() << formattingRightMap()[atom->string()]; - }*/ - case Atom::GeneratedList: - writer.writeStartElement("generatedlist"); - writer.writeAttribute("contents", atom->string()); - writer.writeEndElement(); // generatedlist -/* - if (atom->string() == "annotatedclasses") { - generateAnnotatedList(relative, marker, nonCompatClasses); - } else if (atom->string() == "classes") { - generateCompactList(relative, marker, nonCompatClasses); - } else if (atom->string().contains("classesbymodule")) { - QString arg = atom->string().trimmed(); - QString moduleName = atom->string().mid(atom->string().indexOf( - "classesbymodule") + 15).trimmed(); - if (moduleClassMap.contains(moduleName)) - generateAnnotatedList(relative, marker, moduleClassMap[moduleName]); - } else if (atom->string().contains("classesbyedition")) { - QString arg = atom->string().trimmed(); - QString editionName = atom->string().mid(atom->string().indexOf( - "classesbyedition") + 16).trimmed(); - if (editionModuleMap.contains(editionName)) { - QMap editionClasses; - foreach (const QString &moduleName, editionModuleMap[editionName]) { - if (moduleClassMap.contains(moduleName)) - editionClasses.unite(moduleClassMap[moduleName]); - } - generateAnnotatedList(relative, marker, editionClasses); - } - } else if (atom->string() == "classhierarchy") { - generateClassHierarchy(relative, marker, nonCompatClasses); - } else if (atom->string() == "compatclasses") { - generateCompactList(relative, marker, compatClasses); - } else if (atom->string() == "functionindex") { - generateFunctionIndex(relative, marker); - } else if (atom->string() == "legalese") { - generateLegaleseList(relative, marker); - } else if (atom->string() == "mainclasses") { - generateCompactList(relative, marker, mainClasses); - } else if (atom->string() == "services") { - generateCompactList(relative, marker, serviceClasses); - } else if (atom->string() == "overviews") { - generateOverviewList(relative, marker); - } else if (atom->string() == "namespaces") { - generateAnnotatedList(relative, marker, namespaceIndex); - } else if (atom->string() == "related") { - const FakeNode *fake = static_cast(relative); - if (fake && !fake->groupMembers().isEmpty()) { - QMap groupMembersMap; - foreach (Node *node, fake->groupMembers()) { - if (node->type() == Node::Fake) - groupMembersMap[fullName(node, relative, marker)] = node; - } - generateAnnotatedList(fake, marker, groupMembersMap); - } - } else if (atom->string() == "relatedinline") { - const FakeNode *fake = static_cast(relative); - if (fake && !fake->groupMembers().isEmpty()) { - // Reverse the list into the original scan order. - // Should be sorted. But on what? It may not be a - // regular class or page definition. - QList list; - foreach (const Node *node, fake->groupMembers()) - list.prepend(node); - foreach (const Node *node, list) - generateBody(node, marker ); - } - } - break; -*/ - break; - case Atom::Image: - writer.writeStartElement("image"); - writer.writeAttribute("href", imageFileName(relative, atom->string())); - writer.writeEndElement(); // image - break; - - case Atom::InlineImage: - writer.writeStartElement("inlineimage"); - writer.writeAttribute("href", imageFileName(relative, atom->string())); - writer.writeEndElement(); // inlineimage - break; - - case Atom::ImageText: - break; - - case Atom::LegaleseLeft: - writer.writeStartElement("legalese"); - break; - - case Atom::LegaleseRight: - writer.writeEndElement(); // legalese - break; - - case Atom::Link: - case Atom::LinkNode: - if (!inLink) { - const Node *node = findNode(atom, relative, marker); - if (node) - startLink(writer, atom, node, relative); - } - break; - - case Atom::ListLeft: - writer.writeStartElement("list"); - - if (atom->string() == ATOM_LIST_BULLET) - writer.writeAttribute("type", "bullet"); - else if (atom->string() == ATOM_LIST_TAG) - writer.writeAttribute("type", "definition"); - else if (atom->string() == ATOM_LIST_VALUE) - writer.writeAttribute("type", "enum"); - else { - writer.writeAttribute("type", "ordered"); - if (atom->string() == ATOM_LIST_UPPERALPHA) - writer.writeAttribute("start", "A"); - else if (atom->string() == ATOM_LIST_LOWERALPHA) - writer.writeAttribute("start", "a"); - else if (atom->string() == ATOM_LIST_UPPERROMAN) - writer.writeAttribute("start", "I"); - else if (atom->string() == ATOM_LIST_LOWERROMAN) - writer.writeAttribute("start", "i"); - else // (atom->string() == ATOM_LIST_NUMERIC) - writer.writeAttribute("start", "1"); - } - break; - - case Atom::ListItemNumber: - break; - - case Atom::ListTagLeft: - { - writer.writeStartElement("definition"); - - writer.writeTextElement("term", plainCode( - marker->markedUpEnumValue(atom->next()->string(), relative))); - } - break; - - case Atom::ListTagRight: - writer.writeEndElement(); // definition - break; - - case Atom::ListItemLeft: - writer.writeStartElement("item"); - break; - - case Atom::ListItemRight: - writer.writeEndElement(); // item - break; - - case Atom::ListRight: - writer.writeEndElement(); // list - break; - - case Atom::Nop: - break; - - case Atom::ParaLeft: - writer.writeStartElement("para"); - break; - - case Atom::ParaRight: - writer.writeEndElement(); // para - break; - - case Atom::QuotationLeft: - writer.writeStartElement("quote"); - break; - - case Atom::QuotationRight: - writer.writeEndElement(); // quote - break; - - case Atom::RawString: - writer.writeCharacters(atom->string()); - break; - - case Atom::SectionLeft: - writer.writeStartElement("section"); - writer.writeAttribute("id", Doc::canonicalTitle(Text::sectionHeading(atom).toString())); - break; - - case Atom::SectionRight: - writer.writeEndElement(); // section - break; - - case Atom::SectionHeadingLeft: - writer.writeStartElement("heading"); - writer.writeAttribute("level", atom->string()); // + hOffset(relative) - inSectionHeading = true; - break; - - case Atom::SectionHeadingRight: - writer.writeEndElement(); // heading - inSectionHeading = false; - break; - - case Atom::SidebarLeft: - case Atom::SidebarRight: - break; - - case Atom::SnippetCommand: - writer.writeStartElement(atom->string()); - break; - - case Atom::SnippetIdentifier: - writer.writeAttribute("identifier", atom->string()); - writer.writeEndElement(); // snippet - break; - - case Atom::SnippetLocation: - writer.writeAttribute("location", atom->string()); - break; - - case Atom::String: - writer.writeCharacters(atom->string()); - break; - - case Atom::TableLeft: - writer.writeStartElement("table"); - if (atom->string().contains("%")) - writer.writeAttribute("width", atom->string()); - break; - - case Atom::TableRight: - writer.writeEndElement(); // table - break; - - case Atom::TableHeaderLeft: - writer.writeStartElement("header"); - break; - - case Atom::TableHeaderRight: - writer.writeEndElement(); // header - break; - - case Atom::TableRowLeft: - writer.writeStartElement("row"); - break; - - case Atom::TableRowRight: - writer.writeEndElement(); // row - break; - - case Atom::TableItemLeft: - { - writer.writeStartElement("item"); - QStringList spans = atom->string().split(","); - if (spans.size() == 2) { - if (spans.at(0) != "1") - writer.writeAttribute("colspan", spans.at(0).trimmed()); - if (spans.at(1) != "1") - writer.writeAttribute("rowspan", spans.at(1).trimmed()); - } - } - break; - - case Atom::TableItemRight: - writer.writeEndElement(); // item - break; - - case Atom::TableOfContents: - writer.writeStartElement("tableofcontents"); - writer.writeAttribute("details", atom->string()); - { - int numColumns = 1; - const Node *node = relative; - - Doc::SectioningUnit sectioningUnit = Doc::Section4; - QStringList params = atom->string().split(","); - QString columnText = params.at(0); - QStringList pieces = columnText.split(" ", QString::SkipEmptyParts); - if (pieces.size() >= 2) { - columnText = pieces.at(0); - pieces.pop_front(); - QString path = pieces.join(" ").trimmed(); - node = findNode(path, relative, marker); - if (node) - writer.writeAttribute("href", fileName(node)); - } - - if (params.size() == 2) { - numColumns = qMax(columnText.toInt(), numColumns); - sectioningUnit = (Doc::SectioningUnit)params.at(1).toInt(); - writer.writeAttribute("columns", QString::number(numColumns)); - writer.writeAttribute("unit", QString::number(sectioningUnit)); - } - - if (node) - generateTableOfContents(writer, node, sectioningUnit, numColumns, - relative); - } - writer.writeEndElement(); // tableofcontents - break; - - case Atom::Target: - writer.writeStartElement("target"); - writer.writeAttribute("name", Doc::canonicalTitle(atom->string())); - writer.writeEndElement(); // target - break; - - case Atom::UnhandledFormat: - case Atom::UnknownCommand: - writer.writeCharacters(atom->typeString()); - break; - default: - break; - } - - if (atom) - return atom->next(); - - return 0; -} -/* - QDomElement atomElement = document.createElement(atom->typeString().toLower()); - QDomText atomValue = document.createTextNode(atom->string()); - atomElement.appendChild(atomValue); - descriptionElement.appendChild(atomElement); -*/ - -/* - ### Warning: findNode() is a modified version of HtmlGenerator::getLink(). -*/ -const Node *WebXMLGenerator::findNode(const Atom *atom, const Node *relative, CodeMarker *marker) -{ - return findNode(atom->string(), relative, marker); -} - -const Node *WebXMLGenerator::findNode(const QString &title, const Node *relative, CodeMarker *marker) -{ - QString link; - if (title.contains(":") && - (title.startsWith("file:") - || title.startsWith("http:") - || title.startsWith("https:") - || title.startsWith("ftp:") - || title.startsWith("mailto:"))) { - - return 0; - } else if (title.count('@') == 1) { - return 0; - } else { - QStringList path; - if (title.contains('#')) { - path = title.split('#'); - } else { - path.append(title); - } - - const Node *node = 0; - Atom *targetAtom = 0; - - QString first = path.first().trimmed(); - if (first.isEmpty()) { - node = relative; - } else if (first.endsWith(".html")) { - node = tre->root()->findNode(first, Node::Fake); - } else { - node = marker->resolveTarget(first, tre, relative); - if (!node) - node = tre->findFakeNodeByTitle(first); - if (!node) - node = tre->findUnambiguousTarget(first, targetAtom); - } - - if (node) { - if (!node->url().isEmpty()) - return node; - else - path.removeFirst(); - } else { - return 0; - } - - while (!path.isEmpty()) { - targetAtom = tre->findTarget(path.first(), node); - if (targetAtom == 0) - break; - path.removeFirst(); - } -/* We would ideally treat targets as nodes to be consistent. - if (targetAtom && node && node->isInnerNode()) { - Node *parentNode = const_cast(node); - node = new TargetNode(static_cast(parentNode), first); - } -*/ - return node; - } - return 0; -} - -void WebXMLGenerator::startLink(QXmlStreamWriter &writer, const Atom *atom, - const Node *node, const Node *relative) -{ - QString location = tre->fullDocumentLocation(node); - if (!location.isEmpty()) { - writer.writeStartElement("link"); - writer.writeAttribute("raw", atom->string()); - if (atom->string().contains("#") || node == relative) { - QString target = atom->string().split("#").last(); - Atom *targetAtom = tre->findTarget(target, node); - if (targetAtom) - location += "#" + Doc::canonicalTitle(target); - } - writer.writeAttribute("href", location); - QString type = targetType(node); - writer.writeAttribute("type", type); - switch (node->type()) { - case Node::Enum: - writer.writeAttribute("enum", tre->fullDocumentName(node)); - break; - case Node::Fake: - writer.writeAttribute("page", tre->fullDocumentName(node)); - break; - case Node::Property: - { - const PropertyNode *propertyNode = static_cast(node); - if (propertyNode->getters().size() > 0) - writer.writeAttribute("getter", tre->fullDocumentName(propertyNode->getters()[0])); - } - default: - ; - } - inLink = true; - } -} - -QString WebXMLGenerator::targetType(const Node *node) -{ - switch (node->type()) { - case Node::Namespace: - return "namespace"; - break; - case Node::Class: - return "class"; - break; - case Node::Fake: - return "page"; - break; - case Node::Enum: - return "enum"; - break; - case Node::Typedef: - return "typedef"; - break; - case Node::Property: - return "property"; - break; - case Node::Function: - return "function"; - break; - case Node::Variable: - return "variable"; - break; - case Node::Target: - return "target"; - break; - default: - return ""; - } - return ""; -} - -void WebXMLGenerator::generateRelations(QXmlStreamWriter &writer, const Node *node, CodeMarker *marker) -{ - if (node && !node->links().empty()) { - QPair linkPair; - QPair anchorPair; - const Node *linkNode; - - foreach (Node::LinkType relation, node->links().keys()) { - - linkPair = node->links()[relation]; - linkNode = findNode(linkPair.first, node, marker); - - if (!linkNode) - linkNode = node; - - if (linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - - writer.writeStartElement("relation"); - writer.writeAttribute("href", anchorPair.first); - writer.writeAttribute("type", targetType(linkNode)); - - switch (relation) { - case Node::StartLink: - writer.writeAttribute("meta", "start"); - break; - case Node::NextLink: - writer.writeAttribute("meta", "next"); - break; - case Node::PreviousLink: - writer.writeAttribute("meta", "previous"); - break; - case Node::ContentsLink: - writer.writeAttribute("meta", "contents"); - break; - case Node::IndexLink: - writer.writeAttribute("meta", "index"); - break; - default: - writer.writeAttribute("meta", ""); - } - writer.writeAttribute("description", anchorPair.second); - writer.writeEndElement(); // link - } - } -} - -// Classes adapted from HtmlGenerator. - -void WebXMLGenerator::generateTableOfContents(QXmlStreamWriter &writer, const Node *node, - Doc::SectioningUnit sectioningUnit, - int numColumns, const Node *relative) - -{ - if (!node->doc().hasTableOfContents()) - return; - QList toc = node->doc().tableOfContents(); - if (toc.isEmpty()) - return; - - QString nodeName = ""; - if (node != relative) - nodeName = node->name(); - - QStringList sectionNumber; - int columnSize = 0; - - if (numColumns > 1) { - writer.writeStartElement("table"); - writer.writeAttribute("width", "100%"); - writer.writeStartElement("row"); - writer.writeStartElement("item"); - writer.writeAttribute("width", QString::number((100 + numColumns - 1) / numColumns) + "%"); - } - - // disable nested links in table of contents - inContents = true; - inLink = true; - - for (int i = 0; i < toc.size(); ++i) { - Atom *atom = toc.at(i); - - int nextLevel = atom->string().toInt(); - if (nextLevel > (int)sectioningUnit) - continue; - - if (sectionNumber.size() < nextLevel) { - do { - writer.writeStartElement("list"); - sectionNumber.append("1"); - } while (sectionNumber.size() < nextLevel); - } else { - while (sectionNumber.size() > nextLevel) { - writer.writeEndElement(); - sectionNumber.removeLast(); - } - sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1); - } - Text headingText = Text::sectionHeading(atom); - - if (sectionNumber.size() == 1 && columnSize > toc.size() / numColumns) { - writer.writeEndElement(); // list - writer.writeEndElement(); // item - writer.writeStartElement("item"); - writer.writeAttribute("width", QString::number((100 + numColumns - 1) / numColumns) + "%"); - writer.writeStartElement("list"); - columnSize = 0; - } - - writer.writeStartElement("item"); - writer.writeStartElement("para"); - writer.writeStartElement("link"); - writer.writeAttribute("href", nodeName + "#" + Doc::canonicalTitle(headingText.toString())); - writer.writeAttribute("type", "page"); - writer.writeCharacters(headingText.toString()); - writer.writeEndElement(); // link - writer.writeEndElement(); // para - writer.writeEndElement(); // item - - ++columnSize; - } - while (!sectionNumber.isEmpty()) { - writer.writeEndElement(); // list - sectionNumber.removeLast(); - } - - if (numColumns > 1) { - writer.writeEndElement(); // item - writer.writeEndElement(); // row - writer.writeEndElement(); // table - } - - inContents = false; - inLink = false; -} - -void WebXMLGenerator::generateAnnotatedList(QXmlStreamWriter &writer, - const Node *relative, CodeMarker *marker, const QMap &nodeMap) -{ - writer.writeStartElement("table"); - writer.writeAttribute("width", "100%"); - - foreach (QString name, nodeMap.keys()) { - const Node *node = nodeMap[name]; - - writer.writeStartElement("row"); - writer.writeStartElement("heading"); - generateFullName(writer, node, relative, marker); - writer.writeEndElement(); // heading - - writer.writeStartElement("item"); - writer.writeCharacters(node->doc().briefText().toString()); - writer.writeEndElement(); // item - writer.writeEndElement(); // row - } - writer.writeEndElement(); // table -} - -void WebXMLGenerator::generateFullName(QXmlStreamWriter &writer, - const Node *apparentNode, const Node *relative, CodeMarker *marker, - const Node *actualNode) -{ - if ( actualNode == 0 ) - actualNode = apparentNode; - writer.writeStartElement("link"); - writer.writeAttribute("href", tre->fullDocumentLocation(actualNode)); - writer.writeAttribute("type", targetType(actualNode)); - writer.writeCharacters(fullName(apparentNode, relative, marker)); - writer.writeEndElement(); // link -} - -// Classes copied (and slightly adapted) from the HtmlGenerator. These need -// refactoring into a common ancestor class. - -void WebXMLGenerator::findAllClasses(const InnerNode *node) -{ - NodeList::const_iterator c = node->childNodes().constBegin(); - while (c != node->childNodes().constEnd()) { - if ((*c)->access() != Node::Private && (*c)->url().isEmpty()) { - if ((*c)->type() == Node::Class && !(*c)->doc().isEmpty()) { - QString className = (*c)->name(); - if ((*c)->parent() && (*c)->parent()->type() == Node::Namespace && - !(*c)->parent()->name().isEmpty()) - className = (*c)->parent()->name()+"::"+className; - - QString moduleName = (*c)->moduleName(); - if (!moduleName.isEmpty()) - moduleClassMap[moduleName].insert((*c)->name(), *c); - - QString serviceName = - (static_cast(*c))->serviceName(); - if (!serviceName.isEmpty()) - serviceClasses.insert(serviceName, *c); - } else if ((*c)->isInnerNode()) { - findAllClasses(static_cast(*c)); - } - } - ++c; - } -} - -void WebXMLGenerator::findAllNamespaces(const InnerNode *node) -{ - NodeList::ConstIterator c = node->childNodes().begin(); - while (c != node->childNodes().end()) { - if ((*c)->access() != Node::Private) { - if ((*c)->isInnerNode() && (*c)->url().isEmpty()) { - findAllNamespaces(static_cast(*c)); - if ((*c)->type() == Node::Namespace) { - const NamespaceNode *nspace = static_cast(*c); - // Ensure that the namespace's name is not empty (the root - // namespace has no name). - if (!nspace->name().isEmpty()) { - namespaceIndex.insert(nspace->name(), *c); - QString moduleName = (*c)->moduleName(); - if (!moduleName.isEmpty()) - moduleNamespaceMap[moduleName].insert((*c)->name(), *c); - } - } - } - } - ++c; - } -} - -const QPair WebXMLGenerator::anchorForNode(const Node *node) -{ - QPair anchorPair; - - anchorPair.first = PageGenerator::fileName(node); - if (node->type() == Node::Fake) { - const FakeNode *fakeNode = static_cast(node); - anchorPair.second = fakeNode->title(); - } - - return anchorPair; -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/webxmlgenerator.h b/tools/qdoc3/webxmlgenerator.h deleted file mode 100644 index 071896a..0000000 --- a/tools/qdoc3/webxmlgenerator.h +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - WebXMLGenerator.h -*/ - -#ifndef WEBXMLGENERATOR_H -#define WEBXMLGENERATOR_H - -#include - -#include "codemarker.h" -#include "config.h" -#include "pagegenerator.h" - -QT_BEGIN_NAMESPACE - -class QXmlStreamReader; -class QXmlStreamWriter; - -class WebXMLGenerator : public PageGenerator -{ -public: - WebXMLGenerator(); - ~WebXMLGenerator(); - - virtual void initializeGenerator(const Config &config); - virtual void terminateGenerator(); - virtual QString format(); - virtual void generateTree(const Tree *tree, CodeMarker *marker); - -protected: - virtual void startText( const Node *relative, CodeMarker *marker ); - virtual int generateAtom(QXmlStreamWriter &writer, const Atom *atom, - const Node *relative, CodeMarker *marker ); - virtual void generateClassLikeNode(const InnerNode *inner, CodeMarker *marker); - virtual void generateFakeNode(const FakeNode *fake, CodeMarker *marker); - virtual QString fileExtension(const Node *node) const; - - virtual const Atom *addAtomElements(QXmlStreamWriter &writer, const Atom *atom, - const Node *relative, CodeMarker *marker); - virtual void generateIndexSections(QXmlStreamWriter &writer, const Node *node, - CodeMarker *marker); - virtual void generateInnerNode( const InnerNode *node, CodeMarker *marker ); - -private: - const QPair anchorForNode(const Node *node); - void findAllClasses(const InnerNode *node); - void findAllNamespaces(const InnerNode *node); - const Node *findNode(const Atom *atom, const Node *relative, CodeMarker *marker); - const Node *findNode(const QString &title, const Node *relative, CodeMarker *marker); - void generateAnnotatedList(QXmlStreamWriter &writer, const Node *relative, - CodeMarker *marker, const QMap &nodeMap); - void generateFullName(QXmlStreamWriter &writer, const Node *apparentNode, - const Node *relative, CodeMarker *marker, - const Node *actualNode = 0); - void generateRelations(QXmlStreamWriter &writer, const Node *node, CodeMarker *marker); - void generateTableOfContents(QXmlStreamWriter &writer, const Node *node, - Doc::SectioningUnit sectioningUnit, - int numColumns, const Node *relative); - void startLink(QXmlStreamWriter &writer, const Atom *atom, const Node *node, - const Node *relative); - QString targetType(const Node *node); - - const Tree *tre; - bool generateIndex; - bool inLink; - bool inContents; - bool inSectionHeading; - bool inTableHeader; - int numTableRows; - bool threeColumnEnumValueTable; - QMap > moduleClassMap; - QMap > moduleNamespaceMap; - QMap namespaceIndex; - QMap serviceClasses; - QString link; - QString project; - QString projectDescription; - QString projectUrl; - QString quoteCommand; - QStringList sectionNumber; -}; - -QT_END_NAMESPACE - -#endif -- cgit v0.12 From c9ff1b8851b166b786864ee7bbe0eceb0220660e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 19 Nov 2010 19:04:03 +0100 Subject: Updated code comments. --- tools/qdoc3/quoter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/qdoc3/quoter.cpp b/tools/qdoc3/quoter.cpp index b8055a7..6dc7894 100644 --- a/tools/qdoc3/quoter.cpp +++ b/tools/qdoc3/quoter.cpp @@ -41,7 +41,6 @@ #include #include -#include #include "quoter.h" @@ -123,9 +122,9 @@ Quoter::Quoter() /* We're going to hard code these delimiters: * C++, Qt, Qt Script, Java: //! [] - * .pro files: + * .pro, .py files: #! [] - * .xq, .xml, .html files: + * .html, .qrc, .ui, .xq, .xml files: */ commentHash["pro"] = "#!"; -- cgit v0.12 From 6a5aebd47fca17663074c323795e37f3581154c2 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 19 Nov 2010 19:04:23 +0100 Subject: Improved translation support, using the application object if possible. --- tools/qdoc3/tr.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/tr.h b/tools/qdoc3/tr.h index 4d601e9..4ba7aa4 100644 --- a/tools/qdoc3/tr.h +++ b/tools/qdoc3/tr.h @@ -46,14 +46,26 @@ #ifndef TR_H #define TR_H +#ifndef QT_BOOTSTRAPPED +# include "qcoreapplication.h" +#endif + #include QT_BEGIN_NAMESPACE -inline QString tr( const char *sourceText, const char * /* comment */ = 0 ) +#if defined(QT_BOOTSTRAPPED) || defined(QT_NO_TRANSLATION) +inline QString tr(const char *sourceText, const char *comment = 0) { + Q_UNUSED(comment); return QString( QLatin1String(sourceText) ); } +#else +inline QString tr(const char *sourceText, const char *comment = 0) +{ + return QCoreApplication::instance()->translate("", sourceText, comment); +} +#endif QT_END_NAMESPACE -- cgit v0.12 From 93093b972cae3c1362c5d443ed8288b4694b2735 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 19 Nov 2010 19:57:38 +0100 Subject: Removed the unused C code parser. --- tools/qdoc3/ccodeparser.cpp | 73 --------------------------------------------- tools/qdoc3/ccodeparser.h | 66 ---------------------------------------- tools/qdoc3/qdoc3.pro | 2 -- 3 files changed, 141 deletions(-) delete mode 100644 tools/qdoc3/ccodeparser.cpp delete mode 100644 tools/qdoc3/ccodeparser.h diff --git a/tools/qdoc3/ccodeparser.cpp b/tools/qdoc3/ccodeparser.cpp deleted file mode 100644 index 48aa539..0000000 --- a/tools/qdoc3/ccodeparser.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - ccodeparser.cpp -*/ - -#include "ccodeparser.h" - -QT_BEGIN_NAMESPACE - -CCodeParser::CCodeParser() -{ -} - -CCodeParser::~CCodeParser() -{ -} - -QString CCodeParser::language() -{ - return QLatin1String("C"); -} - -QString CCodeParser::headerFileNameFilter() -{ - return QLatin1String("*.ch *.h"); -} - -QString CCodeParser::sourceFileNameFilter() -{ - return QLatin1String("*.c"); -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/ccodeparser.h b/tools/qdoc3/ccodeparser.h deleted file mode 100644 index 1771fc9..0000000 --- a/tools/qdoc3/ccodeparser.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - ccodeparser.h -*/ - -#ifndef CCODEPARSER_H -#define CCODEPARSER_H - -#include "cppcodeparser.h" - -QT_BEGIN_NAMESPACE - -class CCodeParser : public CppCodeParser -{ -public: - CCodeParser(); - ~CCodeParser(); - - virtual QString language(); - virtual QString headerFileNameFilter(); - virtual QString sourceFileNameFilter(); -}; - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 77c95f8..074fdf6 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -25,7 +25,6 @@ build_all:!build_pass { CONFIG -= app_bundle HEADERS += atom.h \ - ccodeparser.h \ codechunk.h \ codemarker.h \ codeparser.h \ @@ -51,7 +50,6 @@ HEADERS += atom.h \ tr.h \ tree.h SOURCES += atom.cpp \ - ccodeparser.cpp \ codechunk.cpp \ codemarker.cpp \ codeparser.cpp \ -- cgit v0.12 From 035a1416bbe95771649da7e3bfb3ed5c19ab4524 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 19 Nov 2010 20:15:14 +0100 Subject: Removed unused functions. --- tools/qdoc3/command.cpp | 103 ------------------------------------------------ tools/qdoc3/command.h | 60 ---------------------------- tools/qdoc3/qdoc3.pro | 2 - 3 files changed, 165 deletions(-) delete mode 100644 tools/qdoc3/command.cpp delete mode 100644 tools/qdoc3/command.h diff --git a/tools/qdoc3/command.cpp b/tools/qdoc3/command.cpp deleted file mode 100644 index b78ad07..0000000 --- a/tools/qdoc3/command.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - command.cpp -*/ - -#include - -#include "command.h" - -#include - -QT_BEGIN_NAMESPACE - -void executeCommand(const Location& location, - const QString& format, - const QStringList& args) -{ - QString actualCommand; - for (int i = 0; i < (int) format.length(); i++) { - int ch = format[i].unicode(); - if (ch > 0 && ch < 8) { - actualCommand += args[ch - 1]; - } - else { - actualCommand += format[i]; - } - } - - QString toolName = actualCommand; - int space = toolName.indexOf(QLatin1Char(' ')); - if (space != -1) - toolName.truncate(space); - -#ifdef QT_BOOTSTRAPPED - int status = system(qPrintable(actualCommand)); - int exitCode = WEXITSTATUS(status); - if (status == -1 || exitCode != EXIT_SUCCESS) - location.fatal(QString("Error executing '$1': $2").arg(toolName).arg(exitCode)); -#else - QProcess process; - process.start(QLatin1String("sh"), - QStringList() << QLatin1String("-c") << actualCommand); - process.waitForFinished(); - - if (process.exitCode() == 127) - location.fatal(tr("Couldn't launch the '%1' tool") - .arg(toolName), - tr("Make sure the tool is installed and in the" - " path.")); - - QString errors = QString::fromLocal8Bit(process.readAllStandardError()); - while (errors.endsWith(QLatin1Char('\n'))) - errors.truncate(errors.length() - 1); - if (!errors.isEmpty()) - location.fatal(tr("The '%1' tool encountered some problems") - .arg(toolName), - tr("The tool was invoked like this:\n%1\n" - "It emitted these errors:\n%2") - .arg(actualCommand).arg(errors)); -#endif -} - -QT_END_NAMESPACE diff --git a/tools/qdoc3/command.h b/tools/qdoc3/command.h deleted file mode 100644 index 2346aff..0000000 --- a/tools/qdoc3/command.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - command.h -*/ - -#ifndef COMMAND_H -#define COMMAND_H - -#include - -#include "location.h" - -QT_BEGIN_NAMESPACE - -void executeCommand( const Location& location, const QString& commandFormat, - const QStringList& args ); - -QT_END_NAMESPACE - -#endif diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 074fdf6..c9b05d2 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -28,7 +28,6 @@ HEADERS += atom.h \ codechunk.h \ codemarker.h \ codeparser.h \ - command.h \ config.h \ cppcodemarker.h \ cppcodeparser.h \ @@ -53,7 +52,6 @@ SOURCES += atom.cpp \ codechunk.cpp \ codemarker.cpp \ codeparser.cpp \ - command.cpp \ config.cpp \ cppcodemarker.cpp \ cppcodeparser.cpp \ -- cgit v0.12 From d468fe4ca99561e9e575edc0e9d99080e93d91a3 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 22 Nov 2010 17:08:00 +0100 Subject: Removed unused code. --- tools/qdoc3/codemarker.cpp | 1 - tools/qdoc3/cppcodemarker.cpp | 15 -------- tools/qdoc3/cppcodeparser.cpp | 10 ----- tools/qdoc3/doc.cpp | 23 ------------ tools/qdoc3/generator.cpp | 14 +------ tools/qdoc3/htmlgenerator.cpp | 86 ------------------------------------------- tools/qdoc3/location.cpp | 4 -- tools/qdoc3/node.cpp | 5 --- tools/qdoc3/tree.cpp | 16 +------- 9 files changed, 2 insertions(+), 172 deletions(-) diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp index ec86ae3..f1b6346 100644 --- a/tools/qdoc3/codemarker.cpp +++ b/tools/qdoc3/codemarker.cpp @@ -40,7 +40,6 @@ ****************************************************************************/ #include -#include #include "codemarker.h" #include "config.h" #include "node.h" diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 3615a84..576d103 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -455,21 +455,6 @@ QString CppCodeMarker::functionEndRegExp(const QString& /* funcName */) return "^\\}$"; } -#if 0 - FastSection privateReimpFuncs(classe, - "Private Reimplemented Functions", - "private reimplemented function", - "private reimplemented functions"); - FastSection protectedReimpFuncs(classe, - "Protected Reimplemented Functions", - "protected reimplemented function", - "protected reimplemented functions"); - FastSection publicReimpFuncs(classe, - "Public Reimplemented Functions", - "public reimplemented function", - "public reimplemented functions"); -#endif - QList
    CppCodeMarker::sections(const InnerNode *inner, SynopsisStyle style, Status status) diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index a120e45..8e891b8 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -966,16 +966,6 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, .arg(COMMAND_REIMP).arg(node->name())); } -#if 0 - // Reimplemented functions now reported in separate sections. - /* - Note: Setting the access to Private hides the documentation, - but setting the status to Internal makes the node available - in the XML output when the WebXMLGenerator is used. - */ - func->setAccess(Node::Private); - func->setStatus(Node::Internal); -#endif func->setReimp(true); } else { diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index 280f055..be16c59 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -1685,13 +1685,6 @@ void DocParser::startSection(Doc::SectioningUnit unit, int cmd) leavePara(); if (currentSectioningUnit == Doc::Book) { -#if 0 - // mws didn't think this was necessary. - if (unit > Doc::Section1) - location().warning(tr("Unexpected '\\%1' without '\\%2'") - .arg(cmdName(cmd)) - .arg(cmdName(CMD_SECTION1))); -#endif currentSectioningUnit = (Doc::SectioningUnit) (unit - 1); priv->constructExtra(); priv->extra->sectioningUnit = currentSectioningUnit; @@ -1866,9 +1859,6 @@ void DocParser::enterPara(Atom::Type leftType, pendingParaRightType = rightType; pendingParaString = string; if ( -#if 0 - leftType == Atom::BriefLeft || -#endif leftType == Atom::SectionHeadingLeft) { paraState = InsideSingleLinePara; } @@ -2273,12 +2263,6 @@ QString DocParser::getCode(int cmd, CodeMarker *marker) QString DocParser::getUnmarkedCode(int cmd) { QString code = getUntilEnd(cmd); -#if 0 - int indent = indentLevel(code); - if (indent < minIndent) - minIndent = indent; - code = unindent(minIndent, code); -#endif return code; } @@ -3043,13 +3027,6 @@ QString Doc::canonicalTitle(const QString &title) result += QLatin1Char('-'); dashAppended = true; } -#if 0 - // This was screwing things up. - else { - result += title[i]; - lastAlnum = result.size(); - } -#endif } result.truncate(lastAlnum); return result; diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 74e966a..0f2454e 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -383,14 +383,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) { bool quiet = false; - if (node->type() == Node::Function) { -#if 0 - const FunctionNode *func = (const FunctionNode *) node; - if (func->isOverload() && func->metaness() != FunctionNode::Ctor) - generateOverload(node, marker); -#endif - } - else if (node->type() == Node::Fake) { + if (node->type() == Node::Fake) { const FakeNode *fake = static_cast(node); if (fake->subType() == Node::Example) generateExampleFiles(fake, marker); @@ -510,11 +503,6 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) if (!body.contains("return", Qt::CaseInsensitive)) node->doc().location().warning(tr("Undocumented return value")); } -#if 0 - // Now we put this at the top, before the other text. - if (func->reimplementedFrom() != 0) - generateReimplementedFrom(func, marker); -#endif } } diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 0cd534e..4faab50 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -63,10 +63,6 @@ QT_BEGIN_NAMESPACE int HtmlGenerator::id = 0; bool HtmlGenerator::debugging_on = false; -#if 0 -QString HtmlGenerator::divNavTop = "
    "; -#endif - QString HtmlGenerator::divNavTop = ""; QString HtmlGenerator::sinceTitles[] = @@ -1020,26 +1016,8 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << atom->string(); break; case Atom::SectionLeft: -#if 0 - { - int nextLevel = atom->string().toInt(); - if (sectionNumber.size() < nextLevel) { - do { - sectionNumber.append("1"); - } while (sectionNumber.size() < nextLevel); - } - else { - while (sectionNumber.size() > nextLevel) { - sectionNumber.removeLast(); - } - sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1); - } - out() << "" << divNavTop << "\n"; - } -#else out() << "" << divNavTop << "\n"; -#endif break; case Atom::SectionRight: break; @@ -2022,39 +2000,6 @@ void HtmlGenerator::generateTableOfContents(const Node *node, inLink = false; } -#if 0 -void HtmlGenerator::generateNavigationBar(const NavigationBar& bar, - const Node *node, - CodeMarker *marker) -{ - if (bar.prev.begin() != 0 || bar.current.begin() != 0 || - bar.next.begin() != 0) { - out() << "

    "; - if (bar.prev.begin() != 0) { -#if 0 - out() << "[Prev: "; - generateText(section.previousHeading(), node, marker); - out() << "]\n"; -#endif - } - if (fake->name() != QString("index.html")) { - if (bar.current.begin() != 0) { - out() << "[Home]\n"; - } - if (bar.next.begin() != 0) { - out() << "[Next: "; - generateText(Text::sectionHeading(bar.next.begin()), node, marker); - out() << "]\n"; - } - out() << "

    \n"; - } - } -} -#endif - QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, CodeMarker *marker) { @@ -3237,29 +3182,6 @@ QString HtmlGenerator::fileBase(const Node *node) return result; } -#if 0 -QString HtmlGenerator::fileBase(const Node *node, - const SectionIterator& section) -{ - QStringList::ConstIterator s = section.sectionNumber().end(); - QStringList::ConstIterator b = section.baseNameStack().end(); - - QString suffix; - QString base = fileBase(node); - - while (s != section.sectionNumber().begin()) { - --s; - --b; - if (!(*b).isEmpty()) { - base = *b; - break; - } - suffix.prepend("-" + *s); - } - return base + suffix; -} -#endif - QString HtmlGenerator::fileName(const Node *node) { if (node->type() == Node::Fake) { @@ -3813,14 +3735,6 @@ QString HtmlGenerator::getLink(const Atom *atom, << (*node)->name() << "no relative"; } } -#if 0 - else if ((*node)->status() == Node::Deprecated) { - qDebug() << "Link to Deprecated entity"; - } - else if ((*node)->status() == Node::Internal) { - qDebug() << "Link to Internal entity"; - } -#endif } while (!path.isEmpty()) { diff --git a/tools/qdoc3/location.cpp b/tools/qdoc3/location.cpp index dee87d1..1257a45 100644 --- a/tools/qdoc3/location.cpp +++ b/tools/qdoc3/location.cpp @@ -390,10 +390,6 @@ QString Location::top() const if (lineNo() >= 1) { str += QLatin1Char(':'); str += QString::number(lineNo()); -#if 0 - if (columnNo() >= 1) - str += ":" + QString::number(columnNo()); -#endif } if (etc()) str += QLatin1String(" (etc.)"); diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 41f90d5..e043f5d 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -1545,11 +1545,6 @@ void QmlClassNode::clear() */ QString QmlClassNode::fileBase() const { -#if 0 - if (Node::fileBase() == "item") - qDebug() << "FILEBASE: qmlitem" << name(); - return "qml_" + Node::fileBase(); -#endif return Node::fileBase(); } diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index 540ffa9..9946f0b 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -591,12 +591,6 @@ void Tree::resolveGroups() if (fake && fake->subType() == Node::Group) { fake->addGroupMember(i.value()); } -#if 0 - else { - if (prevGroup != i.key()) - i.value()->doc().location().warning(tr("No such group '%1'").arg(i.key())); - } -#endif prevGroup = i.key(); } @@ -1986,15 +1980,7 @@ QString Tree::fullDocumentLocation(const Node *node) const else parentName = fullDocumentLocation(node->parent()); } -#if 0 - if (node->type() == Node::QmlProperty) { - qDebug() << "Node::QmlProperty:" << node->name() - << "parentName:" << parentName; - if (parentNode) - qDebug() << "PARENT NODE" << parentNode->type() - << parentNode->subType() << parentNode->name(); - } -#endif + switch (node->type()) { case Node::Class: case Node::Namespace: -- cgit v0.12 From e64535b227599b5adb8847dfda0b2516ae7e5625 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 10 Nov 2010 14:43:11 +1000 Subject: Fix ListModel::set() to update the model cache when setting a list value Task-number: QTBUG-15190 --- src/declarative/util/qdeclarativelistmodel.cpp | 2 ++ .../qdeclarativelistmodel/data/setmodelcachelist.qml | 20 ++++++++++++++++++++ .../tst_qdeclarativelistmodel.cpp | 12 ++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 398480e..538e8af 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -1450,6 +1450,8 @@ void ModelNode::setObjectValue(const QScriptValue& valuemap, bool writeToCache) if (v.isArray()) { value->isArray = true; value->setListValue(v); + if (writeToCache && objectCache) + objectCache->setValue(it.name().toUtf8(), QVariant::fromValue(value->model(m_model))); } else { value->values << v.toVariant(); if (writeToCache && objectCache) diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml b/tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml new file mode 100644 index 0000000..ffe417a --- /dev/null +++ b/tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml @@ -0,0 +1,20 @@ +import QtQuick 1.0 + +ListModel { + id: model + property bool ok : false + + Component.onCompleted: { + model.append({"attrs": []}) + model.get(0) + model.set(0, {"attrs": [{'abc': 123, 'def': 456}] } ) + ok = ( model.get(0).attrs.get(0).abc == 123 + && model.get(0).attrs.get(0).def == 456 ) + + model.set(0, {"attrs": [{'abc': 789, 'def': 101}] } ) + ok = ( model.get(0).attrs.get(0).abc == 789 + && model.get(0).attrs.get(0).def == 101 ) + + } +} + diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index 4b8d772..55f7421 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -100,6 +100,7 @@ private slots: void get_nested(); void get_nested_data(); void crash_model_with_multiple_roles(); + void set_model_cache(); }; int tst_qdeclarativelistmodel::roleFromName(const QDeclarativeListModel *model, const QString &roleName) { @@ -928,6 +929,17 @@ void tst_qdeclarativelistmodel::crash_model_with_multiple_roles() model->setProperty(0, "black", true); } +//QTBUG-15190 +void tst_qdeclarativelistmodel::set_model_cache() +{ + QDeclarativeEngine eng; + QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/setmodelcachelist.qml")); + QObject *model = component.create(); + QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString())); + QVERIFY(model != 0); + QVERIFY(model->property("ok").toBool()); +} + QTEST_MAIN(tst_qdeclarativelistmodel) #include "tst_qdeclarativelistmodel.moc" -- cgit v0.12 From 9830ef3b28502285a9c99ce07985668ad16a636a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 24 Nov 2010 15:08:20 +0100 Subject: Removed unused code. --- tools/qdoc3/codemarker.h | 7 --- tools/qdoc3/codeparser.cpp | 3 +- tools/qdoc3/ditaxmlgenerator.h | 3 -- tools/qdoc3/htmlgenerator.cpp | 112 ----------------------------------------- tools/qdoc3/htmlgenerator.h | 25 --------- 5 files changed, 1 insertion(+), 149 deletions(-) diff --git a/tools/qdoc3/codemarker.h b/tools/qdoc3/codemarker.h index f17b28e..029ddb9 100644 --- a/tools/qdoc3/codemarker.h +++ b/tools/qdoc3/codemarker.h @@ -107,13 +107,6 @@ struct FastSection }; -#if 0 - const QString& name0 = "", - const QString& divClass0 = "", - const QString& singularMember0 = "member", - const QString& pluralMember0 = "members") -#endif - class CodeMarker { public: diff --git a/tools/qdoc3/codeparser.cpp b/tools/qdoc3/codeparser.cpp index 65d9572..ed8b54e 100644 --- a/tools/qdoc3/codeparser.cpp +++ b/tools/qdoc3/codeparser.cpp @@ -47,7 +47,6 @@ #include "node.h" #include "tree.h" #include "config.h" -#include QT_BEGIN_NAMESPACE @@ -99,7 +98,7 @@ void CodeParser::initializeParser(const Config& config) } /*! - Teerminating a code parser is trivial. + Terminating a code parser is trivial. */ void CodeParser::terminateParser() { diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 446f735..36bd990 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -234,9 +234,6 @@ class DitaXmlGenerator : public PageGenerator QString registerRef(const QString& ref); QString fileBase(const Node *node); -#if 0 - QString fileBase(const Node *node, const SectionIterator& section); -#endif QString fileName(const Node *node); void findAllClasses(const InnerNode *node); void findAllFunctions(const InnerNode *node); diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 4faab50..74db762 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1116,33 +1116,6 @@ int HtmlGenerator::generateAtom(const Atom *atom, skipAhead = 1; break; case Atom::TableOfContents: - { - int numColumns = 1; - const Node *node = relative; - - Doc::SectioningUnit sectioningUnit = Doc::Section4; - QStringList params = atom->string().split(","); - QString columnText = params.at(0); - QStringList pieces = columnText.split(" ", QString::SkipEmptyParts); - if (pieces.size() >= 2) { - columnText = pieces.at(0); - pieces.pop_front(); - QString path = pieces.join(" ").trimmed(); - node = findNodeForTarget(path, relative, marker, atom); - } - - if (params.size() == 2) { - numColumns = qMax(columnText.toInt(), numColumns); - sectioningUnit = (Doc::SectioningUnit)params.at(1).toInt(); - } - - if (node) - generateTableOfContents(node, - marker, - sectioningUnit, - numColumns, - relative); - } break; case Atom::Target: out() << "string()) << "\">"; @@ -1799,91 +1772,6 @@ void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) } /*! - Generates a table of contents beginning at \a node. - */ -void HtmlGenerator::generateTableOfContents(const Node *node, - CodeMarker *marker, - Doc::SectioningUnit sectioningUnit, - int numColumns, - const Node *relative) - -{ - return; - if (!node->doc().hasTableOfContents()) - return; - QList toc = node->doc().tableOfContents(); - if (toc.isEmpty()) - return; - - QString nodeName = ""; - if (node != relative) - nodeName = node->name(); - - QStringList sectionNumber; - int columnSize = 0; - - QString tdTag; - if (numColumns > 1) { - tdTag = ""; /* width=\"" + QString::number((100 + numColumns - 1) / numColumns) + "%\">";*/ - out() << "\n" - << tdTag << "\n"; - } - - // disable nested links in table of contents - inContents = true; - inLink = true; - - for (int i = 0; i < toc.size(); ++i) { - Atom *atom = toc.at(i); - - int nextLevel = atom->string().toInt(); - if (nextLevel > (int)sectioningUnit) - continue; - - if (sectionNumber.size() < nextLevel) { - do { - out() << "
      "; - sectionNumber.append("1"); - } while (sectionNumber.size() < nextLevel); - } - else { - while (sectionNumber.size() > nextLevel) { - out() << "
    \n"; - sectionNumber.removeLast(); - } - sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1); - } - int numAtoms; - Text headingText = Text::sectionHeading(atom); - - if (sectionNumber.size() == 1 && columnSize > toc.size() / numColumns) { - out() << "" << tdTag << "\n"; - sectionNumber.removeLast(); - } - - if (numColumns > 1) - out() << "
    \n"; - - inContents = false; - inLink = false; -} - -/*! Revised for the new doc format. Generates a table of contents beginning at \a node. */ diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index c0a4ce8..547cf2f 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -56,15 +56,6 @@ QT_BEGIN_NAMESPACE -#if 0 -struct NavigationBar -{ - SectionIterator prev; - SectionIterator current; - SectionIterator next; -}; -#endif - typedef QMultiMap NodeMultiMap; typedef QMap NewSinceMaps; typedef QMap ParentMaps; @@ -150,16 +141,6 @@ class HtmlGenerator : public PageGenerator CodeMarker *marker, const Node *relative = 0); void generateIncludes(const InnerNode *inner, CodeMarker *marker); -#if 0 - void generateNavigationBar(const NavigationBar& bar, - const Node *node, - CodeMarker *marker); -#endif - void generateTableOfContents(const Node *node, - CodeMarker *marker, - Doc::SectioningUnit sectioningUnit, - int numColumns, - const Node *relative = 0); void generateTableOfContents(const Node *node, CodeMarker *marker, QList
    * sections = 0); @@ -237,9 +218,6 @@ class HtmlGenerator : public PageGenerator QString registerRef(const QString& ref); QString fileBase(const Node *node); -#if 0 - QString fileBase(const Node *node, const SectionIterator& section); -#endif QString fileName(const Node *node); void findAllClasses(const InnerNode *node); void findAllFunctions(const InnerNode *node); @@ -273,9 +251,6 @@ class HtmlGenerator : public PageGenerator CodeMarker* marker) const; void generateExtractionMark(const Node *node, ExtractionMarkType markType); -#if 0 - NavigationBar currentNavigationBar; -#endif QMap refMap; int codeIndent; HelpProjectWriter *helpProjectWriter; -- cgit v0.12 From f79dfe06afe9aae34e064b5668cc3429f659dd16 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 24 Nov 2010 19:31:06 +0100 Subject: Added the version number to the configuration and fixed the generator. Now the version number should appear in the documentation again. --- tools/qdoc3/htmlgenerator.cpp | 4 +--- tools/qdoc3/test/qt-project.qdocconf | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 74db762..b095f23 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1618,12 +1618,10 @@ void HtmlGenerator::generateHeader(const QString& title, out() << QString("\n").arg(naturalLanguage); out() << "\n"; out() << " \n"; - QString shortVersion; - shortVersion = project + " " + shortVersion + ": "; if (node && !node->doc().location().isEmpty()) out() << "\n"; - shortVersion = myTree->version(); + QString shortVersion = myTree->version(); if (shortVersion.count(QChar('.')) == 2) shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); if (!shortVersion.isEmpty()) { diff --git a/tools/qdoc3/test/qt-project.qdocconf b/tools/qdoc3/test/qt-project.qdocconf index be2a227..135fbbb 100644 --- a/tools/qdoc3/test/qt-project.qdocconf +++ b/tools/qdoc3/test/qt-project.qdocconf @@ -6,6 +6,7 @@ include(qt-defines.qdocconf) project = Qt description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.7 +version = 4.7.1 sourceencoding = UTF-8 outputencoding = UTF-8 @@ -86,7 +87,9 @@ excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \ $QT_SOURCE_TREE/doc/src/ja_JP \ $QT_SOURCE_TREE/doc/src/zh_CN -sources.fileextensions = "*.cpp *.qdoc *.mm" +sources.fileextensions = "*.c++ *.cc *.cpp *.cxx *.mm *.qml *.qdoc" +headers.fileextensions = "*.ch *.h *.h++ *.hh *.hpp *.hxx" + examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml" examples.imageextensions = "*.png" -- cgit v0.12 From 9529188304b47d3fdb39cec52ad233f37a477f2f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 24 Nov 2010 19:33:21 +0100 Subject: Refactored use of parsers to parse files based on their types. The full range of file types is specified in the configuration file. Each parser is asked if it handles each file. The pure documentation parser conceptually handles qdoc files, but it uses the same code as the C++ parser. --- tools/qdoc3/codeparser.cpp | 38 ++++++++- tools/qdoc3/codeparser.h | 6 +- tools/qdoc3/config.cpp | 6 +- tools/qdoc3/config.h | 1 - tools/qdoc3/cppcodeparser.cpp | 9 +- tools/qdoc3/cppcodeparser.h | 4 +- tools/qdoc3/main.cpp | 74 +++++++++------- tools/qdoc3/puredocparser.cpp | 63 ++++++++++++++ tools/qdoc3/puredocparser.h | 72 ++++++++++++++++ tools/qdoc3/qdoc3.pro | 11 +++ tools/qdoc3/qmlcodeparser.cpp | 168 +++++++++++++++++++++++++++++++++++++ tools/qdoc3/qmlcodeparser.h | 90 ++++++++++++++++++++ tools/qdoc3/qmlvisitor.cpp | 191 ++++++++++++++++++++++++++++++++++++++++++ tools/qdoc3/qmlvisitor.h | 83 ++++++++++++++++++ 14 files changed, 769 insertions(+), 47 deletions(-) create mode 100644 tools/qdoc3/puredocparser.cpp create mode 100644 tools/qdoc3/puredocparser.h create mode 100644 tools/qdoc3/qmlcodeparser.cpp create mode 100644 tools/qdoc3/qmlcodeparser.h create mode 100644 tools/qdoc3/qmlvisitor.cpp create mode 100644 tools/qdoc3/qmlvisitor.h diff --git a/tools/qdoc3/codeparser.cpp b/tools/qdoc3/codeparser.cpp index ed8b54e..3652758 100644 --- a/tools/qdoc3/codeparser.cpp +++ b/tools/qdoc3/codeparser.cpp @@ -105,7 +105,7 @@ void CodeParser::terminateParser() // nothing. } -QString CodeParser::headerFileNameFilter() +QStringList CodeParser::headerFileNameFilter() { return sourceFileNameFilter(); } @@ -158,6 +158,42 @@ CodeParser *CodeParser::parserForLanguage(const QString& language) return 0; } +CodeParser *CodeParser::parserForHeaderFile(const QString &filePath) +{ + QString fileName = QFileInfo(filePath).fileName(); + + QList::ConstIterator p = parsers.begin(); + while (p != parsers.end()) { + + QStringList headerPatterns = (*p)->headerFileNameFilter(); + foreach (QString pattern, headerPatterns) { + QRegExp re(pattern, Qt::CaseInsensitive, QRegExp::Wildcard); + if (re.exactMatch(fileName)) + return *p; + } + ++p; + } + return 0; +} + +CodeParser *CodeParser::parserForSourceFile(const QString &filePath) +{ + QString fileName = QFileInfo(filePath).fileName(); + + QList::ConstIterator p = parsers.begin(); + while (p != parsers.end()) { + + QStringList sourcePatterns = (*p)->sourceFileNameFilter(); + foreach (QString pattern, sourcePatterns) { + QRegExp re(pattern, Qt::CaseInsensitive, QRegExp::Wildcard); + if (re.exactMatch(fileName)) + return *p; + } + ++p; + } + return 0; +} + /*! Returns the set of strings representing the common metacommands. */ diff --git a/tools/qdoc3/codeparser.h b/tools/qdoc3/codeparser.h index ebba601..2d11ee0 100644 --- a/tools/qdoc3/codeparser.h +++ b/tools/qdoc3/codeparser.h @@ -66,8 +66,8 @@ class CodeParser virtual void initializeParser(const Config& config); virtual void terminateParser(); virtual QString language() = 0; - virtual QString headerFileNameFilter(); - virtual QString sourceFileNameFilter() = 0; + virtual QStringList headerFileNameFilter(); + virtual QStringList sourceFileNameFilter() = 0; virtual void parseHeaderFile(const Location& location, const QString& filePath, Tree *tree); virtual void parseSourceFile(const Location& location, @@ -78,6 +78,8 @@ class CodeParser static void initialize(const Config& config); static void terminate(); static CodeParser *parserForLanguage(const QString& language); + static CodeParser *parserForHeaderFile(const QString &filePath); + static CodeParser *parserForSourceFile(const QString &filePath); static const QString titleFromName(const QString& name); protected: diff --git a/tools/qdoc3/config.cpp b/tools/qdoc3/config.cpp index 0146a26..c2ab559 100644 --- a/tools/qdoc3/config.cpp +++ b/tools/qdoc3/config.cpp @@ -359,16 +359,12 @@ QSet Config::subVars(const QString& var) const */ QStringList Config::getAllFiles(const QString &filesVar, const QString &dirsVar, - const QString &defaultNameFilter, const QSet &excludedDirs) { QStringList result = getStringList(filesVar); QStringList dirs = getStringList(dirsVar); - QString nameFilter = getString(filesVar + dot + - QLatin1String(CONFIG_FILEEXTENSIONS)); - if (nameFilter.isEmpty()) - nameFilter = defaultNameFilter; + QString nameFilter = getString(filesVar + dot + QLatin1String(CONFIG_FILEEXTENSIONS)); QStringList::ConstIterator d = dirs.begin(); while (d != dirs.end()) { diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h index f089a70..bc36f3d 100644 --- a/tools/qdoc3/config.h +++ b/tools/qdoc3/config.h @@ -76,7 +76,6 @@ class Config QSet subVars(const QString& var) const; QStringList getAllFiles(const QString& filesVar, const QString& dirsVar, - const QString& defaultNameFilter, const QSet &excludedDirs = QSet()); static QStringList getFilesHere(const QString& dir, diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 8e891b8..fce2553 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -47,7 +47,6 @@ #include #include -#include #include "codechunk.h" #include "config.h" @@ -258,18 +257,18 @@ QString CppCodeParser::language() /*! Returns a list of extensions for header files. */ -QString CppCodeParser::headerFileNameFilter() +QStringList CppCodeParser::headerFileNameFilter() { - return "*.ch *.h *.h++ *.hh *.hpp *.hxx"; + return QStringList() << "*.ch" << "*.h" << "*.h++" << "*.hh" << "*.hpp" << "*.hxx"; } /*! Returns a list of extensions for source files, i.e. not header files. */ -QString CppCodeParser::sourceFileNameFilter() +QStringList CppCodeParser::sourceFileNameFilter() { - return "*.c++ *.cc *.cpp *.cxx"; + return QStringList() << "*.c++" << "*.cc" << "*.cpp" << "*.cxx" << "*.mm"; } /*! diff --git a/tools/qdoc3/cppcodeparser.h b/tools/qdoc3/cppcodeparser.h index 55d9ddf..64e9119 100644 --- a/tools/qdoc3/cppcodeparser.h +++ b/tools/qdoc3/cppcodeparser.h @@ -69,8 +69,8 @@ class CppCodeParser : public CodeParser virtual void initializeParser(const Config& config); virtual void terminateParser(); virtual QString language(); - virtual QString headerFileNameFilter(); - virtual QString sourceFileNameFilter(); + virtual QStringList headerFileNameFilter(); + virtual QStringList sourceFileNameFilter(); virtual void parseHeaderFile(const Location& location, const QString& filePath, Tree *tree); diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 768c5eb..2d3f034 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -50,10 +50,12 @@ #include "config.h" #include "cppcodemarker.h" #include "cppcodeparser.h" +#include "ditaxmlgenerator.h" #include "doc.h" #include "htmlgenerator.h" #include "plaincodemarker.h" -#include "ditaxmlgenerator.h" +#include "puredocparser.h" +#include "qmlcodeparser.h" #include "tokenizer.h" #include "tree.h" #include @@ -235,14 +237,6 @@ static void processQdocconfFile(const QString &fileName) tree->setVersion(config.getString(CONFIG_VERSION)); /* - There must be a code parser for the source code language, e.g. C++. - If there isn't one, give up. - */ - CodeParser *codeParser = CodeParser::parserForLanguage(lang); - if (codeParser == 0) - config.lastLocation().fatal(tr("Cannot parse programming language '%1'").arg(lang)); - - /* By default, the only output format is HTML. */ QSet outputFormats = config.getStringSet(CONFIG_OUTPUTFORMATS); @@ -257,52 +251,69 @@ static void processQdocconfFile(const QString &fileName) langLocation.fatal(tr("Cannot output documentation for programming language '%1'").arg(lang)); /* - Read some XML indexes. What are they??? + Read some XML indexes containing definitions from other documentation sets. */ QStringList indexFiles = config.getStringList(CONFIG_INDEXES); tree->readIndexes(indexFiles); - + /* - Get all the header files: "*.ch *.h *.h++ *.hh *.hpp *.hxx" - Put them in a set. + Read the list of excluded directories. */ QSet excludedDirs; QStringList excludedDirsList = config.getStringList(CONFIG_EXCLUDEDIRS); foreach (const QString &excludeDir, excludedDirsList) excludedDirs.insert(QDir::fromNativeSeparators(excludeDir)); - QSet headers = QSet::fromList( - config.getAllFiles(CONFIG_HEADERS, CONFIG_HEADERDIRS, - codeParser->headerFileNameFilter(), - excludedDirs)); /* - Parse each header file in the set and add it to the big tree. + Get all the header files: "*.ch *.h *.h++ *.hh *.hpp *.hxx" + Put them in a set. */ - QSet::ConstIterator h = headers.begin(); - while (h != headers.end()) { - codeParser->parseHeaderFile(config.location(), *h, tree); - ++h; - } - codeParser->doneParsingHeaderFiles(tree); + QSet headers = QSet::fromList( + config.getAllFiles(CONFIG_HEADERS, CONFIG_HEADERDIRS, excludedDirs)); /* Get all the source text files: "*.cpp *.qdoc *.mm" Put them in a set. */ QSet sources = QSet::fromList( - config.getAllFiles(CONFIG_SOURCES, CONFIG_SOURCEDIRS, - codeParser->sourceFileNameFilter(), - excludedDirs)); + config.getAllFiles(CONFIG_SOURCES, CONFIG_SOURCEDIRS, excludedDirs)); + + /* + Parse each header file in the set using the appropriate parser and add it + to the big tree. + */ + QSet usedParsers; + + QSet::ConstIterator h = headers.begin(); + while (h != headers.end()) { + CodeParser *codeParser = CodeParser::parserForHeaderFile(*h); + if (codeParser) { + codeParser->parseHeaderFile(config.location(), *h, tree); + usedParsers.insert(codeParser); + } + ++h; + } + foreach (CodeParser *codeParser, usedParsers) + codeParser->doneParsingHeaderFiles(tree); + + usedParsers.clear(); /* - Parse each source text file in the set and add it to the big tree. + Parse each source text file in the set using the appropriate parser and + add it to the big tree. */ QSet::ConstIterator s = sources.begin(); while (s != sources.end()) { - codeParser->parseSourceFile(config.location(), *s, tree); + CodeParser *codeParser = CodeParser::parserForSourceFile(*s); + if (codeParser) { + codeParser->parseSourceFile(config.location(), *s, tree); + usedParsers.insert(codeParser); + } ++s; } - codeParser->doneParsingSourceFiles(tree); + + foreach (CodeParser *codeParser, usedParsers) + codeParser->doneParsingSourceFiles(tree); /* Now the big tree has been built from all the header and @@ -371,7 +382,8 @@ int main(int argc, char **argv) and create a tree for C++. */ CppCodeParser cppParser; - Tree *cppTree = treeForLanguage(cppParser.language()); + QmlCodeParser qmlParser; + PureDocParser docParser; /* Create code markers for plain text and C++. diff --git a/tools/qdoc3/puredocparser.cpp b/tools/qdoc3/puredocparser.cpp new file mode 100644 index 0000000..de7d668 --- /dev/null +++ b/tools/qdoc3/puredocparser.cpp @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + puredocparser.cpp +*/ + +#include "puredocparser.h" + +QT_BEGIN_NAMESPACE + +PureDocParser::PureDocParser() +{ +} + +PureDocParser::~PureDocParser() +{ +} + +QStringList PureDocParser::sourceFileNameFilter() +{ + return QStringList("*.qdoc"); +} + +QT_END_NAMESPACE diff --git a/tools/qdoc3/puredocparser.h b/tools/qdoc3/puredocparser.h new file mode 100644 index 0000000..6e37dbd --- /dev/null +++ b/tools/qdoc3/puredocparser.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + puredocparser.h +*/ + +#ifndef PUREDOCPARSER_H +#define PUREDOCPARSER_H + +#include + +#include "cppcodeparser.h" +#include "location.h" + +QT_BEGIN_NAMESPACE + +class Config; +class Node; +class QString; +class Tree; + +class PureDocParser : public CppCodeParser +{ +public: + PureDocParser(); + virtual ~PureDocParser(); + + virtual QStringList sourceFileNameFilter(); +}; + +QT_END_NAMESPACE + +#endif diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index c9b05d2..2c91a9c 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -42,6 +42,9 @@ HEADERS += atom.h \ openedlist.h \ pagegenerator.h \ plaincodemarker.h \ + puredocparser.h \ + qmlcodeparser.h \ + qmlvisitor.h \ quoter.h \ separator.h \ text.h \ @@ -67,6 +70,9 @@ SOURCES += atom.cpp \ openedlist.cpp \ pagegenerator.cpp \ plaincodemarker.cpp \ + puredocparser.cpp \ + qmlcodeparser.cpp \ + qmlvisitor.cpp \ quoter.cpp \ separator.cpp \ text.cpp \ @@ -74,6 +80,11 @@ SOURCES += atom.cpp \ tree.cpp \ yyindent.cpp +# Include the QML parsing library from Qt Creator. + +LIBS += -L$$(QTCREATOR_LIBPATH) -lQmlJS -lUtils +INCLUDEPATH += $$(QTCREATOR_INCPATH) + ### Documentation for qdoc3 ### qtPrepareTool(QDOC, qdoc3) diff --git a/tools/qdoc3/qmlcodeparser.cpp b/tools/qdoc3/qmlcodeparser.cpp new file mode 100644 index 0000000..c6ace7d --- /dev/null +++ b/tools/qdoc3/qmlcodeparser.cpp @@ -0,0 +1,168 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + qmlcodeparser.cpp +*/ + +#include "parser/qmljsast_p.h" +#include "parser/qmljsastvisitor_p.h" +#include "parser/qmljsnodepool_p.h" + +#include "qmlcodeparser.h" +#include "node.h" +#include "tree.h" +#include "config.h" +#include "qmlvisitor.h" + +QT_BEGIN_NAMESPACE + +#define COMMAND_STARTPAGE Doc::alias("startpage") +#define COMMAND_VARIABLE Doc::alias("variable") + +#define COMMAND_QMLCLASS Doc::alias("qmlclass") +#define COMMAND_QMLPROPERTY Doc::alias("qmlproperty") +#define COMMAND_QMLATTACHEDPROPERTY Doc::alias("qmlattachedproperty") +#define COMMAND_QMLINHERITS Doc::alias("inherits") +#define COMMAND_QMLSIGNAL Doc::alias("qmlsignal") +#define COMMAND_QMLATTACHEDSIGNAL Doc::alias("qmlattachedsignal") +#define COMMAND_QMLMETHOD Doc::alias("qmlmethod") +#define COMMAND_QMLATTACHEDMETHOD Doc::alias("qmlattachedmethod") +#define COMMAND_QMLDEFAULT Doc::alias("default") +#define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype") + +QmlCodeParser::QmlCodeParser() +{ +} + +QmlCodeParser::~QmlCodeParser() +{ +} + +/*! + Initialize the code parser base class. + */ +void QmlCodeParser::initializeParser(const Config &config) +{ + CodeParser::initializeParser(config); + + lexer = new QmlJS::Lexer(&engine); + parser = new QmlJS::Parser(&engine); +} + +void QmlCodeParser::terminateParser() +{ + delete lexer; + delete parser; +} + +QString QmlCodeParser::language() +{ + return "QML"; +} + +QStringList QmlCodeParser::sourceFileNameFilter() +{ + return QStringList("*.qml"); +} + +void QmlCodeParser::parseSourceFile(const Location& location, + const QString& filePath, + Tree *tree) +{ + QFile in(filePath); + if (!in.open(QIODevice::ReadOnly)) { + location.error(tr("Cannot open QML file '%1'").arg(filePath)); + return; + } + + QString document = in.readAll(); + in.close(); + + Location fileLocation(filePath); + lexer->setCode(document, 1); + + QSet topicCommandsAllowed = topicCommands(); + QSet otherMetacommandsAllowed = otherMetaCommands(); + QSet metacommandsAllowed = topicCommandsAllowed + + otherMetacommandsAllowed; + + QmlJS::NodePool m_nodePool(filePath, &engine); + + if (parser->parse()) { + QmlJS::AST::UiProgram *ast = parser->ast(); + DocVisitor visitor(filePath, document, &engine, tree, metacommandsAllowed); + QmlJS::AST::Node::accept(ast, &visitor); + } +} + +void QmlCodeParser::doneParsingSourceFiles(Tree *tree) +{ +} + +/*! + Returns the set of strings reopresenting the topic commands. + */ +QSet QmlCodeParser::topicCommands() +{ + return QSet() << COMMAND_VARIABLE + << COMMAND_QMLCLASS + << COMMAND_QMLPROPERTY + << COMMAND_QMLATTACHEDPROPERTY + << COMMAND_QMLSIGNAL + << COMMAND_QMLATTACHEDSIGNAL + << COMMAND_QMLMETHOD + << COMMAND_QMLATTACHEDMETHOD + << COMMAND_QMLBASICTYPE; +} + +/*! + Returns the set of strings representing the common metacommands + plus some other metacommands. + */ +QSet QmlCodeParser::otherMetaCommands() +{ + return commonMetaCommands() << COMMAND_STARTPAGE + << COMMAND_QMLINHERITS + << COMMAND_QMLDEFAULT; +} + +QT_END_NAMESPACE diff --git a/tools/qdoc3/qmlcodeparser.h b/tools/qdoc3/qmlcodeparser.h new file mode 100644 index 0000000..f6d6684 --- /dev/null +++ b/tools/qdoc3/qmlcodeparser.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + qmlcodeparser.h +*/ + +#ifndef QMLCODEPARSER_H +#define QMLCODEPARSER_H + +#include +#include "parser/qmljsengine_p.h" +#include "parser/qmljslexer_p.h" +#include "parser/qmljsparser_p.h" + +#include "codeparser.h" +#include "location.h" + +QT_BEGIN_NAMESPACE + +class Config; +class Node; +class QString; +class Tree; + +class QmlCodeParser : public CodeParser +{ +public: + QmlCodeParser(); + virtual ~QmlCodeParser(); + + virtual void initializeParser(const Config& config); + virtual void terminateParser(); + virtual QString language(); + virtual QStringList sourceFileNameFilter(); + virtual void parseSourceFile(const Location& location, + const QString& filePath, Tree *tree); + virtual void doneParsingSourceFiles(Tree *tree); + +protected: + virtual QSet topicCommands(); + virtual QSet otherMetaCommands(); + +private: + QmlJS::Engine engine; + QmlJS::Lexer *lexer; + QmlJS::Parser *parser; +}; + +QT_END_NAMESPACE + +#endif diff --git a/tools/qdoc3/qmlvisitor.cpp b/tools/qdoc3/qmlvisitor.cpp new file mode 100644 index 0000000..83bf96f --- /dev/null +++ b/tools/qdoc3/qmlvisitor.cpp @@ -0,0 +1,191 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include "parser/qmljsast_p.h" +#include "parser/qmljsastfwd_p.h" +#include "parser/qmljsengine_p.h" + +#include "node.h" +#include "qmlvisitor.h" + +DocVisitor::DocVisitor(const QString &filePath, const QString &code, + QmlJS::Engine *engine, Tree *tree, QSet &commands) +{ + this->filePath = filePath; + this->name = QFileInfo(filePath).baseName(); + document = code; + this->engine = engine; + this->tree = tree; + this->commands = commands; + current = tree->root(); +} + +DocVisitor::~DocVisitor() +{ +} + +QmlJS::AST::SourceLocation DocVisitor::precedingComment(unsigned offset) const +{ + QmlJS::AST::SourceLocation currentLoc; + + foreach (const QmlJS::AST::SourceLocation &loc, engine->comments()) { + if (loc.begin() > lastEndOffset && loc.end() < offset) + currentLoc = loc; + else + break; + } + if (currentLoc.isValid()) { + QString comment = document.mid(currentLoc.offset, currentLoc.length); + if (comment.startsWith("!") || comment.startsWith("*")) + return currentLoc; + } + + return QmlJS::AST::SourceLocation(); +} + +void DocVisitor::applyDocumentation(QmlJS::AST::SourceLocation location, + InnerNode *node) +{ + QmlJS::AST::SourceLocation loc = precedingComment(location.begin()); + + if (loc.isValid()) { + QString source = document.mid(loc.offset, loc.length); + if (source.startsWith(QLatin1String("!")) || + source.startsWith(QLatin1String("*"))) { + + Location start(filePath); + start.setLineNo(loc.startLine); + start.setColumnNo(loc.startColumn); + Location finish(filePath); + finish.setLineNo(loc.startLine); + finish.setColumnNo(loc.startColumn); + + Doc doc(start, finish, source.mid(1), commands); + node->setDoc(doc); + } + } +} + +/*! + Visits element definitions, recording them in a tree structure. +*/ +bool DocVisitor::visit(QmlJS::AST::UiObjectDefinition *definition) +{ + QString type = definition->qualifiedTypeNameId->name->asString(); + + if (current->type() == Node::Namespace) { + QmlClassNode *component = new QmlClassNode(current, name, 0); + applyDocumentation(definition->firstSourceLocation(), component); + current = component; + } + + return true; +} + +void DocVisitor::endVisit(QmlJS::AST::UiObjectDefinition *definition) +{ + lastEndOffset = definition->lastSourceLocation().end(); +} + +bool DocVisitor::visit(QmlJS::AST::UiImportList *imports) +{ + // Note that the imports list can be traversed by iteration to obtain + // all the imports in the document at once, having found just one: + // *it = imports; it; it = it->next + + QString module = document.mid(imports->import->fileNameToken.offset, + imports->import->fileNameToken.length); + QString version = document.mid(imports->import->versionToken.offset, + imports->import->versionToken.length); + importList.append(QPair(module, version)); + + return true; +} + +/*! + Visits public member declarations, such as signals and properties. + These only include custom signals and properties. +*/ +bool DocVisitor::visit(QmlJS::AST::UiPublicMember *member) +{ + switch (member->type) { + case QmlJS::AST::UiPublicMember::Signal: + { + QString name = member->name->asString(); + + QList > parameters; + for (QmlJS::AST::UiParameterList *it = member->parameters; it; it = it->next) { + if (it->type && it->name) + parameters.append(QPair(it->type->asString(), + it->name->asString())); + } + + //current->addSignal(new Signal(name, parameters)); + break; + } + case QmlJS::AST::UiPublicMember::Property: + { + QString type = member->memberType->asString(); + QString name = member->name->asString(); + + //current->addProperty(new Property(type, name)); + break; + } + default: + return false; + } + + //current->doc = precedingComment(member->firstSourceLocation().begin()); + return true; +} + +void DocVisitor::endVisit(QmlJS::AST::UiPublicMember *definition) +{ + lastEndOffset = definition->lastSourceLocation().end(); +} + +bool DocVisitor::visit(QmlJS::AST::IdentifierPropertyName *idproperty) +{ + return true; +} diff --git a/tools/qdoc3/qmlvisitor.h b/tools/qdoc3/qmlvisitor.h new file mode 100644 index 0000000..01da98e --- /dev/null +++ b/tools/qdoc3/qmlvisitor.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef DOCVISITOR_H +#define DOCVISITOR_H + +#include +#include "parser/qmljsastvisitor_p.h" +#include "node.h" +#include "tree.h" + +class DocVisitor : public QmlJS::AST::Visitor +{ +public: + DocVisitor(const QString &filePath, const QString &code, + QmlJS::Engine *engine, Tree *tree, QSet &commands); + virtual ~DocVisitor(); + + bool visit(QmlJS::AST::UiImportList *imports); + + bool visit(QmlJS::AST::UiObjectDefinition *definition); + void endVisit(QmlJS::AST::UiObjectDefinition *definition); + + bool visit(QmlJS::AST::UiPublicMember *member); + void endVisit(QmlJS::AST::UiPublicMember *definition); + + bool visit(QmlJS::AST::IdentifierPropertyName *idproperty); + +private: + QmlJS::AST::SourceLocation precedingComment(unsigned offset) const; + void applyDocumentation(QmlJS::AST::SourceLocation location, + InnerNode *node); + + QmlJS::Engine *engine; + quint32 lastEndOffset; + QString filePath; + QString name; + QString document; + QList > importList; + QSet commands; + Tree *tree; + InnerNode *current; +}; + +#endif -- cgit v0.12 From dcaa2b69af5d242248c8e12355539b6e8349f5d5 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Thu, 25 Nov 2010 10:17:13 +0100 Subject: Doc: Fixing typo --- src/gui/painting/qdrawingprimitive_sse2_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h index d8f6bf5..64f17d2 100644 --- a/src/gui/painting/qdrawingprimitive_sse2_p.h +++ b/src/gui/painting/qdrawingprimitive_sse2_p.h @@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE pixelVectorAG = _mm_mullo_epi16(pixelVectorAG, alphaChannel); \ pixelVectorRB = _mm_mullo_epi16(pixelVectorRB, alphaChannel); \ \ - /* 3. devide by 255, that's the tricky part. \ + /* 3. divide by 255, that's the tricky part. \ we do it like for BYTE_MUL(), with bit shift: X/255 ~= (X + X/256 + rounding)/256 */ \ /** so first (X + X/256 + rounding) */\ pixelVectorRB = _mm_add_epi16(pixelVectorRB, _mm_srli_epi16(pixelVectorRB, 8)); \ @@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE pixelVectorAG = _mm_add_epi16(pixelVectorAG, _mm_srli_epi16(pixelVectorAG, 8)); \ pixelVectorAG = _mm_add_epi16(pixelVectorAG, half); \ \ - /** second devide by 256 */\ + /** second divide by 256 */\ pixelVectorRB = _mm_srli_epi16(pixelVectorRB, 8); \ /** for AG, we could >> 8 to divide followed by << 8 to put the \ bytes in the correct position. By masking instead, we execute \ @@ -129,7 +129,7 @@ QT_BEGIN_NAMESPACE } // Basically blend src over dst with the const alpha defined as constAlphaVector. -// nullVector, half, one, colorMask are constant accross the whole image/texture, and should be defined as: +// nullVector, half, one, colorMask are constant across the whole image/texture, and should be defined as: //const __m128i nullVector = _mm_set1_epi32(0); //const __m128i half = _mm_set1_epi16(0x80); //const __m128i one = _mm_set1_epi16(0xff); @@ -186,7 +186,7 @@ QT_BEGIN_NAMESPACE } // Basically blend src over dst with the const alpha defined as constAlphaVector. -// nullVector, half, one, colorMask are constant accross the whole image/texture, and should be defined as: +// nullVector, half, one, colorMask are constant across the whole image/texture, and should be defined as: //const __m128i nullVector = _mm_set1_epi32(0); //const __m128i half = _mm_set1_epi16(0x80); //const __m128i one = _mm_set1_epi16(0xff); -- cgit v0.12 From 9d80633e7dea2e054b4b748032879dc302b36a23 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 25 Nov 2010 16:21:29 +0100 Subject: Add a way to set QHeaderView initial sort order Merge-request: 814 Reviewed-by: Thierry Bastian --- src/corelib/global/qnamespace.h | 1 + src/corelib/global/qnamespace.qdoc | 28 +++++++++++++++------------- src/gui/itemviews/qheaderview.cpp | 14 +++++++++++--- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 3ed6291..830d35b 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1617,6 +1617,7 @@ public: AccessibleDescriptionRole = 12, // More general purpose SizeHintRole = 13, + InitialSortOrderRole = 14, // Internal UiLib roles. Start worrying when public roles go that high. DisplayPropertyRole = 27, DecorationPropertyRole = 28, diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index f097f2a..c923a41 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2679,19 +2679,21 @@ Roles describing appearance and meta data (with associated types): - \value FontRole The font used for items rendered with the default - delegate. (QFont) - \value TextAlignmentRole The alignment of the text for items rendered with the - default delegate. (Qt::AlignmentFlag) - \value BackgroundRole The background brush used for items rendered with - the default delegate. (QBrush) - \value BackgroundColorRole This role is obsolete. Use BackgroundRole instead. - \value ForegroundRole The foreground brush (text color, typically) - used for items rendered with the default delegate. - (QBrush) - \value TextColorRole This role is obsolete. Use ForegroundRole instead. - \value CheckStateRole This role is used to obtain the checked state of - an item. (Qt::CheckState) + \value FontRole The font used for items rendered with the default + delegate. (QFont) + \value TextAlignmentRole The alignment of the text for items rendered with the + default delegate. (Qt::AlignmentFlag) + \value BackgroundRole The background brush used for items rendered with + the default delegate. (QBrush) + \value BackgroundColorRole This role is obsolete. Use BackgroundRole instead. + \value ForegroundRole The foreground brush (text color, typically) + used for items rendered with the default delegate. + (QBrush) + \value TextColorRole This role is obsolete. Use ForegroundRole instead. + \value CheckStateRole This role is used to obtain the checked state of + an item. (Qt::CheckState) + \value InitialSortOrderRole This role is used to obtain the initial sort order + of a header view section. (Qt::SortOrder) Accessibility roles (with associated types): diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index 7eb3ddc..754e8b5 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -3274,9 +3274,17 @@ void QHeaderViewPrivate::clear() void QHeaderViewPrivate::flipSortIndicator(int section) { Q_Q(QHeaderView); - bool ascending = (sortIndicatorSection != section - || sortIndicatorOrder == Qt::DescendingOrder); - q->setSortIndicator(section, ascending ? Qt::AscendingOrder : Qt::DescendingOrder); + Qt::SortOrder sortOrder; + if (sortIndicatorSection == section) { + sortOrder = (sortIndicatorOrder == Qt::DescendingOrder) ? Qt::AscendingOrder : Qt::DescendingOrder; + } else { + const QVariant value = model->headerData(section, orientation, Qt::InitialSortOrderRole); + if (value.canConvert(QVariant::Int)) + sortOrder = static_cast(value.toInt()); + else + sortOrder = Qt::AscendingOrder; + } + q->setSortIndicator(section, sortOrder); } void QHeaderViewPrivate::cascadingResize(int visual, int newSize) -- cgit v0.12 From 2bfeab705c659cf12a6e7863d86da1ccdb2089dc Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 25 Nov 2010 16:21:34 +0100 Subject: Mention when the role was introduced Merge-request: 814 Reviewed-by: Thierry Bastian --- src/corelib/global/qnamespace.qdoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index c923a41..d911c4c 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2693,7 +2693,8 @@ \value CheckStateRole This role is used to obtain the checked state of an item. (Qt::CheckState) \value InitialSortOrderRole This role is used to obtain the initial sort order - of a header view section. (Qt::SortOrder) + of a header view section. (Qt::SortOrder). This + role was introduced in Qt 4.8. Accessibility roles (with associated types): -- cgit v0.12 From d8ee9ddffa4e0cad8c1d991ab6fb84b705c075e5 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 25 Nov 2010 16:21:39 +0100 Subject: Autotest illustrating Qt::InitialSortOrderRole Merge-request: 814 Reviewed-by: Thierry Bastian --- tests/auto/qheaderview/tst_qheaderview.cpp | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp index 5252ec6..2128880 100644 --- a/tests/auto/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/qheaderview/tst_qheaderview.cpp @@ -195,6 +195,8 @@ private slots: void QTBUG8650_crashOnInsertSections(); void QTBUG12268_hiddenMovedSectionSorting(); + void initialSortOrderRole(); + protected: QWidget *topLevel; QHeaderView *view; @@ -2097,5 +2099,40 @@ void tst_QHeaderView::QTBUG12268_hiddenMovedSectionSorting() QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1); } +void tst_QHeaderView::initialSortOrderRole() +{ + QTableView view; + QStandardItemModel *model = new QStandardItemModel(4, 3, &view); + for (int i = 0; i< model->rowCount(); ++i) + for (int j = 0; j< model->columnCount(); ++j) + model->setData(model->index(i,j), QString("item [%1,%2]").arg(i).arg(j)); + QStandardItem *ascendingItem = new QStandardItem(); + QStandardItem *descendingItem = new QStandardItem(); + ascendingItem->setData(Qt::AscendingOrder, Qt::InitialSortOrderRole); + descendingItem->setData(Qt::DescendingOrder, Qt::InitialSortOrderRole); + model->setHorizontalHeaderItem(1, ascendingItem); + model->setHorizontalHeaderItem(2, descendingItem); + view.setModel(model); + view.setSortingEnabled(true); + view.sortByColumn(0, Qt::AscendingOrder); + view.show(); + QTest::qWaitForWindowShown(&view); + + const int column1Pos = view.horizontalHeader()->sectionViewportPosition(1) + 5; // +5 not to be on the handle + QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(column1Pos, 0)); + QCOMPARE(view.horizontalHeader()->sortIndicatorSection(), 1); + QCOMPARE(view.horizontalHeader()->sortIndicatorOrder(), Qt::AscendingOrder); + + const int column2Pos = view.horizontalHeader()->sectionViewportPosition(2) + 5; // +5 not to be on the handle + QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(column2Pos, 0)); + QCOMPARE(view.horizontalHeader()->sortIndicatorSection(), 2); + QCOMPARE(view.horizontalHeader()->sortIndicatorOrder(), Qt::DescendingOrder); + + const int column0Pos = view.horizontalHeader()->sectionViewportPosition(0) + 5; // +5 not to be on the handle + QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(column0Pos, 0)); + QCOMPARE(view.horizontalHeader()->sortIndicatorSection(), 0); + QCOMPARE(view.horizontalHeader()->sortIndicatorOrder(), Qt::AscendingOrder); +} + QTEST_MAIN(tst_QHeaderView) #include "tst_qheaderview.moc" -- cgit v0.12 From b235215ebadaed8b985323b581e8818dd4f09d7f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 25 Nov 2010 17:17:21 +0100 Subject: Ensured that the inObsoleteLink variable is initialized. --- tools/qdoc3/htmlgenerator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index b095f23..3f76204 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -218,7 +218,8 @@ HtmlGenerator::HtmlGenerator() funcLeftParen("\\S(\\()"), myTree(0), slow(false), - obsoleteLinks(false) + obsoleteLinks(false), + inObsoleteLink(false) { } -- cgit v0.12 From fc124dd191f285d6003ad458621f752c2a164cf4 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 25 Nov 2010 17:34:56 +0100 Subject: Ensured that the inObsoleteLink variable is initialized. --- tools/qdoc3/ditaxmlgenerator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index a83a321..ce597f2 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -385,7 +385,8 @@ DitaXmlGenerator::DitaXmlGenerator() myTree(0), slow(false), obsoleteLinks(false), - noLinks(0) + noLinks(0), + inObsoleteLink(false) { } -- cgit v0.12 From 25762d8825d5085287c3266f29a67046b99ff38a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 25 Nov 2010 17:36:10 +0100 Subject: Trivial whitespace fixes. --- tools/qdoc3/node.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 40b78ef..ae713d5 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -87,8 +87,8 @@ class Node enum SubType { NoSubType, - Example, - HeaderFile, + Example, + HeaderFile, File, Image, Group, @@ -114,7 +114,7 @@ class Node Commendable, Main, Internal - }; // don't reorder thisw enum + }; // don't reorder this enum enum ThreadSafeness { UnspecifiedSafeness, -- cgit v0.12 From 74fd34b43e2954881767e33fd62fe5b922643f88 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 25 Nov 2010 17:36:57 +0100 Subject: Added a check for read-only pure QML properties before C++ checks. --- tools/qdoc3/node.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index e043f5d..3e8230c 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -1680,6 +1680,9 @@ static QString valueType(const QString& n) */ bool QmlPropertyNode::isWritable(const Tree* tree) const { + if (wri != Trool_Default) + return fromTrool(wri, false); + Node* n = parent(); while (n && n->subType() != Node::QmlClass) n = n->parent(); -- cgit v0.12 From 5edca8bf762e7f3efcff2d95790b7e5ad3e9a89c Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 25 Nov 2010 17:37:44 +0100 Subject: Ensured that QML nodes are imported from indexes. --- tools/qdoc3/tree.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index 9946f0b..20c1373 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -806,6 +806,12 @@ void Tree::readIndexSection(const QDomElement &element, subtype = Node::Page; else if (element.attribute("subtype") == "externalpage") subtype = Node::ExternalPage; + else if (element.attribute("subtype") == "qmlclass") + subtype = Node::QmlClass; + else if (element.attribute("subtype") == "qmlpropertygroup") + subtype = Node::QmlPropertyGroup; + else if (element.attribute("subtype") == "qmlbasictype") + subtype = Node::QmlBasicType; else return; -- cgit v0.12 From b81081ff67d3e27e36c8165c9b0814feca1fcf15 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 25 Nov 2010 17:38:29 +0100 Subject: Added support for pure QML signals and properties. Generalized the function to annotate nodes with documentation. --- tools/qdoc3/qmlvisitor.cpp | 50 +++++++++++++++++++++++++++++++++++----------- tools/qdoc3/qmlvisitor.h | 3 +-- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/tools/qdoc3/qmlvisitor.cpp b/tools/qdoc3/qmlvisitor.cpp index 83bf96f..1d65c3d 100644 --- a/tools/qdoc3/qmlvisitor.cpp +++ b/tools/qdoc3/qmlvisitor.cpp @@ -85,14 +85,15 @@ QmlJS::AST::SourceLocation DocVisitor::precedingComment(unsigned offset) const } void DocVisitor::applyDocumentation(QmlJS::AST::SourceLocation location, - InnerNode *node) + Node *node) { QmlJS::AST::SourceLocation loc = precedingComment(location.begin()); if (loc.isValid()) { QString source = document.mid(loc.offset, loc.length); if (source.startsWith(QLatin1String("!")) || - source.startsWith(QLatin1String("*"))) { + (source.startsWith(QLatin1String("*")) && + source[1] != QLatin1Char('*'))) { Location start(filePath); start.setLineNo(loc.startLine); @@ -116,7 +117,13 @@ bool DocVisitor::visit(QmlJS::AST::UiObjectDefinition *definition) if (current->type() == Node::Namespace) { QmlClassNode *component = new QmlClassNode(current, name, 0); + component->setTitle(QLatin1String("QML ") + name + QLatin1String(" Component")); + + QmlClassNode::addInheritedBy(type, component); + component->setLink(Node::InheritsLink, type, type); + applyDocumentation(definition->firstSourceLocation(), component); + current = component; } @@ -152,16 +159,23 @@ bool DocVisitor::visit(QmlJS::AST::UiPublicMember *member) switch (member->type) { case QmlJS::AST::UiPublicMember::Signal: { - QString name = member->name->asString(); - - QList > parameters; - for (QmlJS::AST::UiParameterList *it = member->parameters; it; it = it->next) { - if (it->type && it->name) - parameters.append(QPair(it->type->asString(), - it->name->asString())); + if (current->type() == Node::Fake) { + QmlClassNode *qmlClass = static_cast(current); + if (qmlClass) { + + QString name = member->name->asString(); + FunctionNode *qmlSignal = new FunctionNode(Node::QmlSignal, current, name, false); + + QList parameters; + for (QmlJS::AST::UiParameterList *it = member->parameters; it; it = it->next) { + if (it->type && it->name) + parameters.append(Parameter(it->type->asString(), "", it->name->asString())); + } + + qmlSignal->setParameters(parameters); + applyDocumentation(member->firstSourceLocation(), qmlSignal); + } } - - //current->addSignal(new Signal(name, parameters)); break; } case QmlJS::AST::UiPublicMember::Property: @@ -169,7 +183,19 @@ bool DocVisitor::visit(QmlJS::AST::UiPublicMember *member) QString type = member->memberType->asString(); QString name = member->name->asString(); - //current->addProperty(new Property(type, name)); + if (current->type() == Node::Fake) { + QmlClassNode *qmlClass = static_cast(current); + if (qmlClass) { + + QString name = member->name->asString(); + QmlPropGroupNode *qmlPropGroup = new QmlPropGroupNode(qmlClass, name, false); + if (member->isDefaultMember) + qmlPropGroup->setDefault(); + QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlPropGroup, name, type, false); + qmlPropNode->setWritable(!member->isReadonlyMember); + applyDocumentation(member->firstSourceLocation(), qmlPropNode); + } + } break; } default: diff --git a/tools/qdoc3/qmlvisitor.h b/tools/qdoc3/qmlvisitor.h index 01da98e..a830793 100644 --- a/tools/qdoc3/qmlvisitor.h +++ b/tools/qdoc3/qmlvisitor.h @@ -66,8 +66,7 @@ public: private: QmlJS::AST::SourceLocation precedingComment(unsigned offset) const; - void applyDocumentation(QmlJS::AST::SourceLocation location, - InnerNode *node); + void applyDocumentation(QmlJS::AST::SourceLocation location, Node *node); QmlJS::Engine *engine; quint32 lastEndOffset; -- cgit v0.12 From 4ccef56d692e549e00b0c381f1ceb8e9191a3b15 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Fri, 26 Nov 2010 17:24:51 +0100 Subject: Compile fix on solaris Task-number: QTBUG-15323 Reviewed-by: TrustMe --- tests/auto/qwidget/tst_qwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index ae46fe6..e6af8fb 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -10599,7 +10599,7 @@ void tst_QWidget::nativeChildFocus() QTest::qWaitForWindowShown(&w); QCOMPARE(QApplication::activeWindow(), &w); - QCOMPARE(QApplication::focusWidget(), p1); + QCOMPARE(QApplication::focusWidget(), static_cast(p1)); } QTEST_MAIN(tst_QWidget) -- cgit v0.12 From 344c3ad32bd36ad67731aa3171103a6c5e2f93e0 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Sun, 28 Nov 2010 20:44:21 +0100 Subject: Added the foundations of QML markup support. Use the QtDeclarative parser instead of Qt Creator's QML parser. Split the QML visitor into documentation and markup visitors. The code marker used for each file is now determined from its extension. --- tools/qdoc3/cppcodemarker.cpp | 1 - tools/qdoc3/cppcodemarker.h | 56 +- tools/qdoc3/ditaxmlgenerator.cpp | 4 +- tools/qdoc3/ditaxmlgenerator.h | 2 +- tools/qdoc3/generator.h | 2 +- tools/qdoc3/htmlgenerator.cpp | 26 +- tools/qdoc3/htmlgenerator.h | 5 +- tools/qdoc3/main.cpp | 12 +- tools/qdoc3/node.cpp | 1 - tools/qdoc3/pagegenerator.cpp | 14 +- tools/qdoc3/pagegenerator.h | 4 +- tools/qdoc3/qdoc3.pro | 9 +- tools/qdoc3/qmlcodeparser.cpp | 18 +- tools/qdoc3/qmlcodeparser.h | 12 +- tools/qdoc3/qmlmarkupvisitor.cpp | 1415 ++++++++++++++++++++++++++++++++++++++ tools/qdoc3/qmlmarkupvisitor.h | 338 +++++++++ tools/qdoc3/qmlvisitor.cpp | 48 +- tools/qdoc3/qmlvisitor.h | 36 +- 18 files changed, 1877 insertions(+), 126 deletions(-) create mode 100644 tools/qdoc3/qmlmarkupvisitor.cpp create mode 100644 tools/qdoc3/qmlmarkupvisitor.h diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 576d103..55a455f 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -43,7 +43,6 @@ cppcodemarker.cpp */ -#include #include "atom.h" #include "cppcodemarker.h" #include "node.h" diff --git a/tools/qdoc3/cppcodemarker.h b/tools/qdoc3/cppcodemarker.h index 804a302..40695c5 100644 --- a/tools/qdoc3/cppcodemarker.h +++ b/tools/qdoc3/cppcodemarker.h @@ -56,36 +56,36 @@ class CppCodeMarker : public CodeMarker CppCodeMarker(); ~CppCodeMarker(); - bool recognizeCode(const QString& code); - bool recognizeExtension(const QString& ext); - bool recognizeLanguage(const QString& lang); - QString plainName(const Node *node); - QString plainFullName(const Node *node, const Node *relative); - QString markedUpCode(const QString& code, - const Node *relative, - const QString& dirPath); - QString markedUpSynopsis(const Node *node, - const Node *relative, - SynopsisStyle style); + virtual bool recognizeCode(const QString& code); + virtual bool recognizeExtension(const QString& ext); + virtual bool recognizeLanguage(const QString& lang); + virtual QString plainName(const Node *node); + virtual QString plainFullName(const Node *node, const Node *relative); + virtual QString markedUpCode(const QString& code, + const Node *relative, + const QString& dirPath); + virtual QString markedUpSynopsis(const Node *node, + const Node *relative, + SynopsisStyle style); #ifdef QDOC_QML - QString markedUpQmlItem(const Node *node, bool summary); + virtual QString markedUpQmlItem(const Node *node, bool summary); #endif - QString markedUpName(const Node *node); - QString markedUpFullName(const Node *node, const Node *relative); - QString markedUpEnumValue(const QString &enumValue, const Node *relative); - QString markedUpIncludes(const QStringList& includes); - QString functionBeginRegExp(const QString& funcName); - QString functionEndRegExp(const QString& funcName); - QList
    sections(const InnerNode *innerNode, - SynopsisStyle style, - Status status); - QList
    qmlSections(const QmlClassNode* qmlClassNode, - SynopsisStyle style, - const Tree* tree); - const Node* resolveTarget(const QString& target, - const Tree* tree, - const Node* relative, - const Node* self = 0); + virtual QString markedUpName(const Node *node); + virtual QString markedUpFullName(const Node *node, const Node *relative); + virtual QString markedUpEnumValue(const QString &enumValue, const Node *relative); + virtual QString markedUpIncludes(const QStringList& includes); + virtual QString functionBeginRegExp(const QString& funcName); + virtual QString functionEndRegExp(const QString& funcName); + virtual QList
    sections(const InnerNode *innerNode, + SynopsisStyle style, + Status status); + virtual QList
    qmlSections(const QmlClassNode* qmlClassNode, + SynopsisStyle style, + const Tree* tree); + virtual const Node* resolveTarget(const QString& target, + const Tree* tree, + const Node* relative, + const Node* self = 0); private: QString addMarkUp(const QString& protectedCode, diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index ce597f2..1014f79 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -533,7 +533,7 @@ QString DitaXmlGenerator::lookupGuid(QString text) \note The file generation is done in the base class, PageGenerator::generateTree(). */ -void DitaXmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) +void DitaXmlGenerator::generateTree(const Tree *tree) { myTree = tree; nonCompatClasses.clear(); @@ -552,7 +552,7 @@ void DitaXmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) findAllNamespaces(tree->root()); findAllSince(tree->root()); - PageGenerator::generateTree(tree, marker); + PageGenerator::generateTree(tree); } void DitaXmlGenerator::startText(const Node* /* relative */, diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 36bd990..a29df77 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -91,7 +91,7 @@ class DitaXmlGenerator : public PageGenerator virtual void initializeGenerator(const Config& config); virtual void terminateGenerator(); virtual QString format(); - virtual void generateTree(const Tree *tree, CodeMarker *marker); + virtual void generateTree(const Tree *tree); QString protectEnc(const QString &string); static QString protect(const QString &string, const QString &encoding = "ISO-8859-1"); diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index 326a247..18c3855 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -78,7 +78,7 @@ class Generator virtual void terminateGenerator(); virtual QString format() = 0; virtual bool canHandleFormat(const QString &format) { return format == this->format(); } - virtual void generateTree(const Tree *tree, CodeMarker *marker) = 0; + virtual void generateTree(const Tree *tree) = 0; static void initialize(const Config& config); static void terminate(); diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 3f76204..9f5f182 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -217,9 +217,9 @@ HtmlGenerator::HtmlGenerator() threeColumnEnumValueTable(true), funcLeftParen("\\S(\\()"), myTree(0), + inObsoleteLink(false), slow(false), - obsoleteLinks(false), - inObsoleteLink(false) + obsoleteLinks(false) { } @@ -356,7 +356,7 @@ QString HtmlGenerator::format() \note The HTML file generation is done in the base class, PageGenerator::generateTree(). */ -void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) +void HtmlGenerator::generateTree(const Tree *tree) { myTree = tree; nonCompatClasses.clear(); @@ -375,11 +375,11 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) findAllNamespaces(tree->root()); findAllSince(tree->root()); - PageGenerator::generateTree(tree, marker); + PageGenerator::generateTree(tree); QString fileBase = project.toLower().simplified().replace(" ", "-"); generateIndex(fileBase, projectUrl, projectDescription); - generatePageIndex(outputDir() + "/" + fileBase + ".pageindex", marker); + generatePageIndex(outputDir() + "/" + fileBase + ".pageindex"); helpProjectWriter->generate(myTree); } @@ -2913,18 +2913,6 @@ void HtmlGenerator::generateLink(const Atom* atom, } inLink = false; out() << protectEnc(atom->string().mid(k)); - } else if (marker->recognizeLanguage("Java")) { - // hack for Java: remove () and use when appropriate - bool func = atom->string().endsWith("()"); - bool tt = (func || atom->string().contains(camelCase)); - if (tt) - out() << ""; - if (func) { - out() << protectEnc(atom->string().left(atom->string().length() - 2)); - } else { - out() << protectEnc(atom->string()); - } - out() << ""; } else { out() << protectEnc(atom->string()); } @@ -4168,12 +4156,14 @@ void HtmlGenerator::generatePageElements(QXmlStreamWriter& writer, const Node* n /*! Outputs the file containing the index used for searching the html docs. */ -void HtmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* marker) const +void HtmlGenerator::generatePageIndex(const QString& fileName) const { QFile file(fileName); if (!file.open(QFile::WriteOnly | QFile::Text)) return ; + CodeMarker *marker = CodeMarker::markerForFileName(fileName); + QXmlStreamWriter writer(&file); writer.setAutoFormatting(true); writer.writeStartDocument(); diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 547cf2f..4276475 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -92,7 +92,7 @@ class HtmlGenerator : public PageGenerator virtual void initializeGenerator(const Config& config); virtual void terminateGenerator(); virtual QString format(); - virtual void generateTree(const Tree *tree, CodeMarker *marker); + virtual void generateTree(const Tree *tree); QString protectEnc(const QString &string); static QString protect(const QString &string, const QString &encoding = "ISO-8859-1"); @@ -247,8 +247,7 @@ class HtmlGenerator : public PageGenerator void generatePageElements(QXmlStreamWriter& writer, const Node* node, CodeMarker* marker) const; - void generatePageIndex(const QString& fileName, - CodeMarker* marker) const; + void generatePageIndex(const QString& fileName) const; void generateExtractionMark(const Node *node, ExtractionMarkType markType); QMap refMap; diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 2d3f034..ac1c5de 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -55,6 +55,7 @@ #include "htmlgenerator.h" #include "plaincodemarker.h" #include "puredocparser.h" +#include "qmlcodemarker.h" #include "qmlcodeparser.h" #include "tokenizer.h" #include "tree.h" @@ -243,14 +244,6 @@ static void processQdocconfFile(const QString &fileName) Location outputFormatsLocation = config.lastLocation(); /* - There must be a code marker for the source code language, e.g. C++. - If there isn't one, give up. - */ - CodeMarker *marker = CodeMarker::markerForLanguage(lang); - if (!marker && !outputFormats.isEmpty()) - langLocation.fatal(tr("Cannot output documentation for programming language '%1'").arg(lang)); - - /* Read some XML indexes containing definitions from other documentation sets. */ QStringList indexFiles = config.getStringList(CONFIG_INDEXES); @@ -334,7 +327,7 @@ static void processQdocconfFile(const QString &fileName) if (generator == 0) outputFormatsLocation.fatal(tr("Unknown output format '%1'") .arg(*of)); - generator->generateTree(tree, marker); + generator->generateTree(tree); ++of; } @@ -390,6 +383,7 @@ int main(int argc, char **argv) */ PlainCodeMarker plainMarker; CppCodeMarker cppMarker; + QmlCodeMarker qmlMarker; HtmlGenerator htmlGenerator; DitaXmlGenerator ditaxmlGenerator; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 3e8230c..838bbfb 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -45,7 +45,6 @@ #include "node.h" #include "tree.h" -#include "codemarker.h" #include QT_BEGIN_NAMESPACE diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index 37dc191..60b40c9 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -46,6 +46,7 @@ #include #include #include +#include "codemarker.h" #include "pagegenerator.h" #include "tree.h" @@ -175,9 +176,9 @@ bool PageGenerator::parseArg(const QString& src, /*! This function is recursive. */ -void PageGenerator::generateTree(const Tree *tree, CodeMarker *marker) +void PageGenerator::generateTree(const Tree *tree) { - generateInnerNode(tree->root(), marker); + generateInnerNode(tree->root()); } QString PageGenerator::fileBase(const Node *node) const @@ -301,7 +302,7 @@ QTextStream &PageGenerator::out() Recursive writing of html files from the root \a node. */ void -PageGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) +PageGenerator::generateInnerNode(const InnerNode* node) { if (!node->url().isNull()) return; @@ -320,6 +321,11 @@ PageGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) } } + /* + Obtain a code marker for the source file. + */ + CodeMarker *marker = CodeMarker::markerForFileName(node->location().filePath()); + if (node->parent() != 0) { beginSubPage(node->location(), fileName(node)); if (node->type() == Node::Namespace || node->type() == Node::Class) { @@ -334,7 +340,7 @@ PageGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) NodeList::ConstIterator c = node->childNodes().begin(); while (c != node->childNodes().end()) { if ((*c)->isInnerNode() && (*c)->access() != Node::Private) - generateInnerNode((const InnerNode *) *c, marker); + generateInnerNode((const InnerNode *) *c); ++c; } } diff --git a/tools/qdoc3/pagegenerator.h b/tools/qdoc3/pagegenerator.h index 1aa24a1..abb8f1c 100644 --- a/tools/qdoc3/pagegenerator.h +++ b/tools/qdoc3/pagegenerator.h @@ -66,7 +66,7 @@ class PageGenerator : public Generator PageGenerator(); ~PageGenerator(); - virtual void generateTree(const Tree *tree, CodeMarker *marker); + virtual void generateTree(const Tree *tree); protected: virtual QString fileBase(const Node *node) const; @@ -75,7 +75,7 @@ class PageGenerator : public Generator QString outFileName(); void beginSubPage(const Location& location, const QString& fileName); void endSubPage(); - virtual void generateInnerNode(const InnerNode *node, CodeMarker *marker); + virtual void generateInnerNode(const InnerNode *node); QTextStream& out(); QString naturalLanguage; diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 2c91a9c..23ff7bd 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -43,7 +43,9 @@ HEADERS += atom.h \ pagegenerator.h \ plaincodemarker.h \ puredocparser.h \ + qmlcodemarker.h \ qmlcodeparser.h \ + qmlmarkupvisitor.h \ qmlvisitor.h \ quoter.h \ separator.h \ @@ -71,7 +73,9 @@ SOURCES += atom.cpp \ pagegenerator.cpp \ plaincodemarker.cpp \ puredocparser.cpp \ + qmlcodemarker.cpp \ qmlcodeparser.cpp \ + qmlmarkupvisitor.cpp \ qmlvisitor.cpp \ quoter.cpp \ separator.cpp \ @@ -80,10 +84,9 @@ SOURCES += atom.cpp \ tree.cpp \ yyindent.cpp -# Include the QML parsing library from Qt Creator. +INCLUDEPATH += $$(QT_BUILD_TREE)/include/QtDeclarative -LIBS += -L$$(QTCREATOR_LIBPATH) -lQmlJS -lUtils -INCLUDEPATH += $$(QTCREATOR_INCPATH) +include($$(QT_SOURCE_TREE)/src/declarative/qml/parser/parser.pri) ### Documentation for qdoc3 ### diff --git a/tools/qdoc3/qmlcodeparser.cpp b/tools/qdoc3/qmlcodeparser.cpp index c6ace7d..329912c 100644 --- a/tools/qdoc3/qmlcodeparser.cpp +++ b/tools/qdoc3/qmlcodeparser.cpp @@ -43,9 +43,9 @@ qmlcodeparser.cpp */ -#include "parser/qmljsast_p.h" -#include "parser/qmljsastvisitor_p.h" -#include "parser/qmljsnodepool_p.h" +#include "private/qdeclarativejsast_p.h" +#include "private/qdeclarativejsastvisitor_p.h" +#include "private/qdeclarativejsnodepool_p.h" #include "qmlcodeparser.h" #include "node.h" @@ -84,8 +84,8 @@ void QmlCodeParser::initializeParser(const Config &config) { CodeParser::initializeParser(config); - lexer = new QmlJS::Lexer(&engine); - parser = new QmlJS::Parser(&engine); + lexer = new QDeclarativeJS::Lexer(&engine); + parser = new QDeclarativeJS::Parser(&engine); } void QmlCodeParser::terminateParser() @@ -125,12 +125,12 @@ void QmlCodeParser::parseSourceFile(const Location& location, QSet metacommandsAllowed = topicCommandsAllowed + otherMetacommandsAllowed; - QmlJS::NodePool m_nodePool(filePath, &engine); + QDeclarativeJS::NodePool m_nodePool(filePath, &engine); if (parser->parse()) { - QmlJS::AST::UiProgram *ast = parser->ast(); - DocVisitor visitor(filePath, document, &engine, tree, metacommandsAllowed); - QmlJS::AST::Node::accept(ast, &visitor); + QDeclarativeJS::AST::UiProgram *ast = parser->ast(); + QmlDocVisitor visitor(filePath, document, &engine, tree, metacommandsAllowed); + QDeclarativeJS::AST::Node::accept(ast, &visitor); } } diff --git a/tools/qdoc3/qmlcodeparser.h b/tools/qdoc3/qmlcodeparser.h index f6d6684..a99e8a3 100644 --- a/tools/qdoc3/qmlcodeparser.h +++ b/tools/qdoc3/qmlcodeparser.h @@ -47,9 +47,9 @@ #define QMLCODEPARSER_H #include -#include "parser/qmljsengine_p.h" -#include "parser/qmljslexer_p.h" -#include "parser/qmljsparser_p.h" +#include "private/qdeclarativejsengine_p.h" +#include "private/qdeclarativejslexer_p.h" +#include "private/qdeclarativejsparser_p.h" #include "codeparser.h" #include "location.h" @@ -80,9 +80,9 @@ protected: virtual QSet otherMetaCommands(); private: - QmlJS::Engine engine; - QmlJS::Lexer *lexer; - QmlJS::Parser *parser; + QDeclarativeJS::Engine engine; + QDeclarativeJS::Lexer *lexer; + QDeclarativeJS::Parser *parser; }; QT_END_NAMESPACE diff --git a/tools/qdoc3/qmlmarkupvisitor.cpp b/tools/qdoc3/qmlmarkupvisitor.cpp new file mode 100644 index 0000000..72a2334 --- /dev/null +++ b/tools/qdoc3/qmlmarkupvisitor.cpp @@ -0,0 +1,1415 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include "private/qdeclarativejsast_p.h" +#include "private/qdeclarativejsastfwd_p.h" +#include "private/qdeclarativejsengine_p.h" + +#include "qmlmarkupvisitor.h" + +QT_BEGIN_NAMESPACE + +QmlMarkupVisitor::QmlMarkupVisitor(const QString &source, bool debug) +{ + this->source = source; + indent = 0; + cursor = 0; + showDebug = debug; +} + +QmlMarkupVisitor::~QmlMarkupVisitor() +{ +} + +QString QmlMarkupVisitor::markedUpCode() +{ + if (cursor < source.length()) + return output + source.mid(cursor); + else + return output; +} + +void QmlMarkupVisitor::addMarkedUpToken( + QDeclarativeJS::AST::SourceLocation &location, const QString &text) +{ + //qDebug() << "t**" << cursor << location.offset; + if (location.offset > cursor) { + QString extra = source.mid(cursor, location.offset - cursor); + if (extra.trimmed().isEmpty()) + output += extra; + else + output += "<<<" + extra + ">>>"; + //qDebug() << "+++" << source.mid(cursor, location.offset - cursor); + cursor += location.offset; + } + + //qDebug() << "-->" << text; + output += text; + cursor += location.length; +} + +QString QmlMarkupVisitor::sourceText(QDeclarativeJS::AST::SourceLocation &location) +{ + return source.mid(location.offset, location.length); +} + +void QmlMarkupVisitor::addVerbatim(QDeclarativeJS::AST::SourceLocation first, + QDeclarativeJS::AST::SourceLocation last) +{ + quint32 start = first.begin(); + //qDebug() << "v**" << cursor << start; + quint32 finish; + if (last.isValid()) + finish = last.end(); + else + finish = first.end(); + + if (start > cursor) { + QString extra = source.mid(cursor, start - cursor); + if (extra.trimmed().isEmpty()) + output += extra; + else + output += "<<<" + extra + ">>>"; + //qDebug() << "+++" << source.mid(cursor, start - cursor); + cursor = start; + } + + QString text = source.mid(start, finish - start); + //qDebug() << "-->" << text; + write(text); + indent -= 1; + output += text; + cursor += text.length(); +} + +void QmlMarkupVisitor::write(const QString &text) +{ + if (showDebug) + qDebug() << QString().fill(QChar(' '), indent) << text; + indent += 1; +} + +void QmlMarkupVisitor::endWrite(const QString &) +{ + indent -= 1; +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiProgram *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiProgram *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImport *uiimport) +{ + write(""); + addVerbatim(uiimport->importToken); + if (!uiimport->importUri) + addVerbatim(uiimport->fileNameToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiImport *uiimport) +{ + endWrite(""); + addVerbatim(uiimport->versionToken); + addVerbatim(uiimport->asToken); + addVerbatim(uiimport->importIdToken); + addVerbatim(uiimport->semicolonToken); + //endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member) +{ + write(""); + if (member->type == QDeclarativeJS::AST::UiPublicMember::Property) { + addVerbatim(member->defaultToken); + addVerbatim(member->readonlyToken); + addVerbatim(member->propertyToken); + addVerbatim(member->typeModifierToken); + addVerbatim(member->typeToken); + addVerbatim(member->identifierToken); + addVerbatim(member->colonToken); + QDeclarativeJS::AST::Node::accept(member->binding, this); + } else { + addVerbatim(member->propertyToken); + addVerbatim(member->typeModifierToken); + addVerbatim(member->typeToken); + //addVerbatim(member->identifierToken); + QDeclarativeJS::AST::Node::accept(member->parameters, this); + } + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiPublicMember *member) +{ + addVerbatim(member->semicolonToken); + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSourceElement *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiSourceElement *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiParameterList *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiParameterList *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectInitializer *initializer) +{ + write(""); + addVerbatim(initializer->lbraceToken, initializer->lbraceToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectInitializer *initializer) +{ + endWrite(""); + addVerbatim(initializer->rbraceToken, initializer->rbraceToken); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectBinding *binding) +{ + write(""); + QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); + addVerbatim(binding->colonToken); + QDeclarativeJS::AST::Node::accept(binding->qualifiedTypeNameId, this); + QDeclarativeJS::AST::Node::accept(binding->initializer, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectBinding *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiScriptBinding *binding) +{ + write(""); + QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); + addVerbatim(binding->colonToken); + QDeclarativeJS::AST::Node::accept(binding->statement, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiScriptBinding *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayBinding *binding) +{ + write(""); + QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); + addVerbatim(binding->colonToken); + addVerbatim(binding->lbracketToken); + QDeclarativeJS::AST::Node::accept(binding->members, this); + addVerbatim(binding->rbracketToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayBinding *formal) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayMemberList *list) +{ + write(""); + for (QDeclarativeJS::AST::UiArrayMemberList *it = list; it; it = it->next) { + QDeclarativeJS::AST::Node::accept(it->member, this); + addVerbatim(it->commaToken); + } + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayMemberList *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiQualifiedId *id) +{ + write(""); + addVerbatim(id->identifierToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiQualifiedId *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSignature *signature) +{ + write(""); + addVerbatim(signature->lparenToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiSignature *signature) +{ + addVerbatim(signature->rparenToken); + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormal *formal) +{ + write(""); + addVerbatim(formal->identifierToken); + addVerbatim(formal->asToken); + addVerbatim(formal->aliasToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiFormal *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThisExpression *expression) +{ + write(""); + addVerbatim(expression->thisToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThisExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierExpression *identifier) +{ + write(""); + addVerbatim(identifier->identifierToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NullExpression *null) +{ + write(""); + addVerbatim(null->nullToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NullExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TrueLiteral *literal) +{ + write(""); + addVerbatim(literal->trueToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TrueLiteral *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FalseLiteral *literal) +{ + write(""); + addVerbatim(literal->falseToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FalseLiteral *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteral *literal) +{ + //write(""); + addVerbatim(literal->literalToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteral *) +{ + //endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteral *literal) +{ + //write(""); + addVerbatim(literal->literalToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteral *) +{ + //endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::RegExpLiteral *literal) +{ + write(""); + addVerbatim(literal->literalToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::RegExpLiteral *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayLiteral *literal) +{ + write(""); + addVerbatim(literal->lbracketToken); + QDeclarativeJS::AST::Node::accept(literal->elements, this); + addVerbatim(literal->rbracketToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArrayLiteral *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ObjectLiteral *literal) +{ + write(""); + addVerbatim(literal->lbraceToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ObjectLiteral *literal) +{ + addVerbatim(literal->rbraceToken); + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ElementList *list) +{ + write(""); + for (QDeclarativeJS::AST::ElementList *it = list; it; it = it->next) { + QDeclarativeJS::AST::Node::accept(it->expression, this); + addVerbatim(it->commaToken); + } + QDeclarativeJS::AST::Node::accept(list->elision, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ElementList *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Elision *elision) +{ + write(""); + addVerbatim(elision->commaToken, elision->commaToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Elision *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierPropertyName *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierPropertyName *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteralPropertyName *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteralPropertyName *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteralPropertyName *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteralPropertyName *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PropertyNameAndValueList *list) +{ + write(""); + QDeclarativeJS::AST::Node::accept(list->name, this); + addVerbatim(list->colonToken, list->colonToken); + QDeclarativeJS::AST::Node::accept(list->value, this); + addVerbatim(list->commaToken, list->commaToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PropertyNameAndValueList *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NestedExpression *expression) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NestedExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayMemberExpression *expression) +{ + write(""); + QDeclarativeJS::AST::Node::accept(expression->base, this); + addVerbatim(expression->lbracketToken); + QDeclarativeJS::AST::Node::accept(expression->expression, this); + addVerbatim(expression->rbracketToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArrayMemberExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FieldMemberExpression *expression) +{ + write(""); + QDeclarativeJS::AST::Node::accept(expression->base, this); + addVerbatim(expression->dotToken); + addVerbatim(expression->identifierToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FieldMemberExpression *expression) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewMemberExpression *expression) +{ + write(""); + addVerbatim(expression->newToken); + QDeclarativeJS::AST::Node::accept(expression->base, this); + addVerbatim(expression->lparenToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewMemberExpression *expression) +{ + addVerbatim(expression->rparenToken); + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewExpression *expression) +{ + write(""); + addVerbatim(expression->newToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CallExpression *expression) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CallExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArgumentList *list) +{ + write(""); + addVerbatim(list->commaToken, list->commaToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArgumentList *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PostIncrementExpression *expression) +{ + write(""); + addVerbatim(expression->incrementToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PostIncrementExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PostDecrementExpression *expression) +{ + write(""); + addVerbatim(expression->decrementToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PostDecrementExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DeleteExpression *expression) +{ + write(""); + addVerbatim(expression->deleteToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DeleteExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VoidExpression *expression) +{ + write(""); + addVerbatim(expression->voidToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VoidExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TypeOfExpression *expression) +{ + write(""); + addVerbatim(expression->typeofToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TypeOfExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PreIncrementExpression *expression) +{ + write(""); + addVerbatim(expression->incrementToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PreIncrementExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PreDecrementExpression *expression) +{ + write(""); + addVerbatim(expression->decrementToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PreDecrementExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryPlusExpression *expression) +{ + write(""); + addVerbatim(expression->plusToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryPlusExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryMinusExpression *expression) +{ + write(""); + addVerbatim(expression->minusToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryMinusExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TildeExpression *expression) +{ + write(""); + addVerbatim(expression->tildeToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TildeExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NotExpression *expression) +{ + write(""); + addVerbatim(expression->notToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NotExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BinaryExpression *expression) +{ + write(""); + QDeclarativeJS::AST::Node::accept(expression->left, this); + addVerbatim(expression->operatorToken); + QDeclarativeJS::AST::Node::accept(expression->right, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BinaryExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ConditionalExpression *expression) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ConditionalExpression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Expression *expression) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Expression *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Block *block) +{ + write(""); + addVerbatim(block->lbraceToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Block *block) +{ + addVerbatim(block->rbraceToken); + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StatementList *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementList *) +{ + endWrite(""); + addVerbatim(statement->declarationKindToken); + QDeclarativeJS::AST::Node::accept(statement->declarations, this); + addVerbatim(statement->semicolonToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclarationList *list) +{ + write(""); + for (QDeclarativeJS::AST::VariableDeclarationList *it = list; it; it = it->next) { + QDeclarativeJS::AST::Node::accept(it->declaration, this); + addVerbatim(it->commaToken); + } + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclarationList *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclaration *declaration) +{ + write(""); + addVerbatim(declaration->identifierToken); + QDeclarativeJS::AST::Node::accept(declaration->expression, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclaration *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::EmptyStatement *statement) +{ + write(""); + addVerbatim(statement->semicolonToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::EmptyStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ExpressionStatement *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ExpressionStatement *statement) +{ + addVerbatim(statement->semicolonToken); + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement) +{ + write(""); + addVerbatim(statement->ifToken); + addVerbatim(statement->lparenToken); + QDeclarativeJS::AST::Node::accept(statement->expression, this); + addVerbatim(statement->rparenToken); + QDeclarativeJS::AST::Node::accept(statement->ok, this); + //addVerbatim(statement->elseToken); ### this token referred to the wrong source text for some reason + QDeclarativeJS::AST::Node::accept(statement->ko, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IfStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DoWhileStatement *statement) +{ + write(""); + addVerbatim(statement->doToken); + QDeclarativeJS::AST::Node::accept(statement->statement, this); + addVerbatim(statement->whileToken); + addVerbatim(statement->lparenToken); + QDeclarativeJS::AST::Node::accept(statement->expression, this); + addVerbatim(statement->rparenToken); + addVerbatim(statement->semicolonToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DoWhileStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WhileStatement *statement) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WhileStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForStatement *statement) +{ + write(""); + addVerbatim(statement->forToken); + addVerbatim(statement->lparenToken); + QDeclarativeJS::AST::Node::accept(statement->initialiser, this); + addVerbatim(statement->firstSemicolonToken); + QDeclarativeJS::AST::Node::accept(statement->condition, this); + addVerbatim(statement->secondSemicolonToken); + QDeclarativeJS::AST::Node::accept(statement->expression, this); + addVerbatim(statement->rparenToken); + QDeclarativeJS::AST::Node::accept(statement->statement, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForStatement *statement) +{ + write(""); + addVerbatim(statement->forToken); + addVerbatim(statement->lparenToken); + addVerbatim(statement->varToken); + QDeclarativeJS::AST::Node::accept(statement->declarations, this); + addVerbatim(statement->firstSemicolonToken); + QDeclarativeJS::AST::Node::accept(statement->condition, this); + addVerbatim(statement->secondSemicolonToken); + QDeclarativeJS::AST::Node::accept(statement->expression, this); + addVerbatim(statement->rparenToken); + QDeclarativeJS::AST::Node::accept(statement->statement, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForEachStatement *statement) +{ + write(""); + addVerbatim(statement->forToken); + addVerbatim(statement->lparenToken); + QDeclarativeJS::AST::Node::accept(statement->initialiser, this); + addVerbatim(statement->inToken); + QDeclarativeJS::AST::Node::accept(statement->expression, this); + addVerbatim(statement->rparenToken); + QDeclarativeJS::AST::Node::accept(statement->statement, this); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForEachStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForEachStatement *statement) +{ + write(""); + addVerbatim(statement->forToken); + addVerbatim(statement->lparenToken); + addVerbatim(statement->varToken); + QDeclarativeJS::AST::Node::accept(statement->declaration, this); + addVerbatim(statement->inToken); + QDeclarativeJS::AST::Node::accept(statement->expression, this); + addVerbatim(statement->rparenToken); + QDeclarativeJS::AST::Node::accept(statement->statement, this); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForEachStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ContinueStatement *statement) +{ + write(""); + addVerbatim(statement->continueToken); + addVerbatim(statement->identifierToken); + addVerbatim(statement->semicolonToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ContinueStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BreakStatement *statement) +{ + write(""); + addVerbatim(statement->breakToken); + addVerbatim(statement->identifierToken); + addVerbatim(statement->semicolonToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BreakStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ReturnStatement *statement) +{ + write(""); + addVerbatim(statement->returnToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ReturnStatement *statement) +{ + addVerbatim(statement->semicolonToken); + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WithStatement *statement) +{ + write(""); + addVerbatim(statement->withToken); + addVerbatim(statement->lparenToken); + addVerbatim(statement->rparenToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WithStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseBlock *block) +{ + write(""); + addVerbatim(block->lbraceToken, block->lbraceToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseBlock *block) +{ + endWrite(""); + addVerbatim(block->rbraceToken, block->rbraceToken); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SwitchStatement *statement) +{ + write(""); + addVerbatim(statement->switchToken); + addVerbatim(statement->lparenToken); + QDeclarativeJS::AST::Node::accept(statement->expression, this); + addVerbatim(statement->rparenToken); + QDeclarativeJS::AST::Node::accept(statement->block, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::SwitchStatement *statement) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClauses *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClauses *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClause *clause) +{ + write(""); + addVerbatim(clause->caseToken); + QDeclarativeJS::AST::Node::accept(clause->expression, this); + addVerbatim(clause->colonToken); + QDeclarativeJS::AST::Node::accept(clause->statements, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClause *clause) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DefaultClause *clause) +{ + write(""); + addVerbatim(clause->defaultToken, clause->defaultToken); + addVerbatim(clause->colonToken, clause->colonToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DefaultClause *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LabelledStatement *statement) +{ + write(""); + addVerbatim(statement->identifierToken); + addVerbatim(statement->colonToken); + QDeclarativeJS::AST::Node::accept(statement->statement, this); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LabelledStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThrowStatement *statement) +{ + write(""); + addVerbatim(statement->throwToken); + QDeclarativeJS::AST::Node::accept(statement->expression, this); + addVerbatim(statement->semicolonToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThrowStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Catch *c) +{ + write(""); + addVerbatim(c->catchToken, c->catchToken); + addVerbatim(c->lparenToken, c->lparenToken); + addVerbatim(c->identifierToken, c->identifierToken); + addVerbatim(c->rparenToken, c->rparenToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Catch *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Finally *f) +{ + write(""); + addVerbatim(f->finallyToken); + QDeclarativeJS::AST::Node::accept(f->statement, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Finally *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TryStatement *statement) +{ + write(""); + addVerbatim(statement->tryToken); + QDeclarativeJS::AST::Node::accept(statement->statement, this); + QDeclarativeJS::AST::Node::accept(statement->catchExpression, this); + QDeclarativeJS::AST::Node::accept(statement->finallyExpression, this); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TryStatement *) +{ + endWrite(""); +} + + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionExpression *expression) +{ + write(""); + addVerbatim(expression->functionToken); + addVerbatim(expression->identifierToken); + addVerbatim(expression->lparenToken); + QDeclarativeJS::AST::Node::accept(expression->formals, this); + addVerbatim(expression->rparenToken); + addVerbatim(expression->lbraceToken); + QDeclarativeJS::AST::Node::accept(expression->body, this); + addVerbatim(expression->rbraceToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionExpression *expression) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionDeclaration *declaration) +{ + write(""); + addVerbatim(declaration->functionToken); + addVerbatim(declaration->identifierToken); + addVerbatim(declaration->lparenToken); + QDeclarativeJS::AST::Node::accept(declaration->formals, this); + addVerbatim(declaration->rparenToken); + addVerbatim(declaration->lbraceToken); + QDeclarativeJS::AST::Node::accept(declaration->body, this); + addVerbatim(declaration->rbraceToken); + return false; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionDeclaration *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FormalParameterList *list) +{ + write(""); + addVerbatim(list->commaToken, list->commaToken); + addVerbatim(list->identifierToken, list->identifierToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FormalParameterList *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionBody *body) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionBody *body) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DebuggerStatement *statement) +{ + write(""); + addVerbatim(statement->debuggerToken); + addVerbatim(statement->semicolonToken); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DebuggerStatement *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionSourceElement *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionSourceElement *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StatementSourceElement *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementSourceElement *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectDefinition *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImportList *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiImportList *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectMemberList *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectMemberList *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormalList *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiFormalList *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Program *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Program *) +{ + endWrite(""); +} + +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SourceElements *) +{ + write(""); + return true; +} + +void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::SourceElements *) +{ + endWrite(""); +} + +QT_END_NAMESPACE diff --git a/tools/qdoc3/qmlmarkupvisitor.h b/tools/qdoc3/qmlmarkupvisitor.h new file mode 100644 index 0000000..86e1ac2 --- /dev/null +++ b/tools/qdoc3/qmlmarkupvisitor.h @@ -0,0 +1,338 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLVISITOR_H +#define QMLVISITOR_H + +#include +#include "private/qdeclarativejsastvisitor_p.h" +#include "node.h" +#include "tree.h" + +QT_BEGIN_NAMESPACE + +class QmlMarkupVisitor : public QDeclarativeJS::AST::Visitor +{ +public: + QmlMarkupVisitor(const QString &code, bool debug = false); + virtual ~QmlMarkupVisitor(); + + QString markedUpCode(); + + virtual bool visit(QDeclarativeJS::AST::UiProgram *); + virtual bool visit(QDeclarativeJS::AST::UiImportList *); + virtual bool visit(QDeclarativeJS::AST::UiImport *); + virtual bool visit(QDeclarativeJS::AST::UiPublicMember *); + virtual bool visit(QDeclarativeJS::AST::UiSourceElement *); + virtual bool visit(QDeclarativeJS::AST::UiObjectDefinition *); + virtual bool visit(QDeclarativeJS::AST::UiObjectInitializer *); + virtual bool visit(QDeclarativeJS::AST::UiObjectBinding *); + virtual bool visit(QDeclarativeJS::AST::UiScriptBinding *); + virtual bool visit(QDeclarativeJS::AST::UiArrayBinding *); + virtual bool visit(QDeclarativeJS::AST::UiObjectMemberList *); + virtual bool visit(QDeclarativeJS::AST::UiArrayMemberList *); + virtual bool visit(QDeclarativeJS::AST::UiQualifiedId *); + virtual bool visit(QDeclarativeJS::AST::UiSignature *); + virtual bool visit(QDeclarativeJS::AST::UiFormalList *); + virtual bool visit(QDeclarativeJS::AST::UiFormal *); + + virtual void endVisit(QDeclarativeJS::AST::UiProgram *); + virtual void endVisit(QDeclarativeJS::AST::UiImportList *); + virtual void endVisit(QDeclarativeJS::AST::UiImport *); + virtual void endVisit(QDeclarativeJS::AST::UiPublicMember *); + virtual void endVisit(QDeclarativeJS::AST::UiSourceElement *); + virtual void endVisit(QDeclarativeJS::AST::UiObjectDefinition *); + virtual void endVisit(QDeclarativeJS::AST::UiObjectInitializer *); + virtual void endVisit(QDeclarativeJS::AST::UiObjectBinding *); + virtual void endVisit(QDeclarativeJS::AST::UiScriptBinding *); + virtual void endVisit(QDeclarativeJS::AST::UiArrayBinding *); + virtual void endVisit(QDeclarativeJS::AST::UiObjectMemberList *); + virtual void endVisit(QDeclarativeJS::AST::UiArrayMemberList *); + virtual void endVisit(QDeclarativeJS::AST::UiQualifiedId *); + virtual void endVisit(QDeclarativeJS::AST::UiSignature *); + virtual void endVisit(QDeclarativeJS::AST::UiFormalList *); + virtual void endVisit(QDeclarativeJS::AST::UiFormal *); + + // QDeclarativeJS + virtual bool visit(QDeclarativeJS::AST::ThisExpression *); + virtual void endVisit(QDeclarativeJS::AST::ThisExpression *); + + virtual bool visit(QDeclarativeJS::AST::IdentifierExpression *); + virtual void endVisit(QDeclarativeJS::AST::IdentifierExpression *); + + virtual bool visit(QDeclarativeJS::AST::NullExpression *); + virtual void endVisit(QDeclarativeJS::AST::NullExpression *); + + virtual bool visit(QDeclarativeJS::AST::TrueLiteral *); + virtual void endVisit(QDeclarativeJS::AST::TrueLiteral *); + + virtual bool visit(QDeclarativeJS::AST::FalseLiteral *); + virtual void endVisit(QDeclarativeJS::AST::FalseLiteral *); + + virtual bool visit(QDeclarativeJS::AST::NumericLiteral *); + virtual void endVisit(QDeclarativeJS::AST::NumericLiteral *); + + virtual bool visit(QDeclarativeJS::AST::StringLiteral *); + virtual void endVisit(QDeclarativeJS::AST::StringLiteral *); + + virtual bool visit(QDeclarativeJS::AST::RegExpLiteral *); + virtual void endVisit(QDeclarativeJS::AST::RegExpLiteral *); + + virtual bool visit(QDeclarativeJS::AST::ArrayLiteral *); + virtual void endVisit(QDeclarativeJS::AST::ArrayLiteral *); + + virtual bool visit(QDeclarativeJS::AST::ObjectLiteral *); + virtual void endVisit(QDeclarativeJS::AST::ObjectLiteral *); + + virtual bool visit(QDeclarativeJS::AST::ElementList *); + virtual void endVisit(QDeclarativeJS::AST::ElementList *); + + virtual bool visit(QDeclarativeJS::AST::Elision *); + virtual void endVisit(QDeclarativeJS::AST::Elision *); + + virtual bool visit(QDeclarativeJS::AST::PropertyNameAndValueList *); + virtual void endVisit(QDeclarativeJS::AST::PropertyNameAndValueList *); + + virtual bool visit(QDeclarativeJS::AST::NestedExpression *); + virtual void endVisit(QDeclarativeJS::AST::NestedExpression *); + + virtual bool visit(QDeclarativeJS::AST::IdentifierPropertyName *); + virtual void endVisit(QDeclarativeJS::AST::IdentifierPropertyName *); + + virtual bool visit(QDeclarativeJS::AST::StringLiteralPropertyName *); + virtual void endVisit(QDeclarativeJS::AST::StringLiteralPropertyName *); + + virtual bool visit(QDeclarativeJS::AST::NumericLiteralPropertyName *); + virtual void endVisit(QDeclarativeJS::AST::NumericLiteralPropertyName *); + + virtual bool visit(QDeclarativeJS::AST::ArrayMemberExpression *); + virtual void endVisit(QDeclarativeJS::AST::ArrayMemberExpression *); + + virtual bool visit(QDeclarativeJS::AST::FieldMemberExpression *); + virtual void endVisit(QDeclarativeJS::AST::FieldMemberExpression *); + + virtual bool visit(QDeclarativeJS::AST::NewMemberExpression *); + virtual void endVisit(QDeclarativeJS::AST::NewMemberExpression *); + + virtual bool visit(QDeclarativeJS::AST::NewExpression *); + virtual void endVisit(QDeclarativeJS::AST::NewExpression *); + + virtual bool visit(QDeclarativeJS::AST::CallExpression *); + virtual void endVisit(QDeclarativeJS::AST::CallExpression *); + + virtual bool visit(QDeclarativeJS::AST::ArgumentList *); + virtual void endVisit(QDeclarativeJS::AST::ArgumentList *); + + virtual bool visit(QDeclarativeJS::AST::PostIncrementExpression *); + virtual void endVisit(QDeclarativeJS::AST::PostIncrementExpression *); + + virtual bool visit(QDeclarativeJS::AST::PostDecrementExpression *); + virtual void endVisit(QDeclarativeJS::AST::PostDecrementExpression *); + + virtual bool visit(QDeclarativeJS::AST::DeleteExpression *); + virtual void endVisit(QDeclarativeJS::AST::DeleteExpression *); + + virtual bool visit(QDeclarativeJS::AST::VoidExpression *); + virtual void endVisit(QDeclarativeJS::AST::VoidExpression *); + + virtual bool visit(QDeclarativeJS::AST::TypeOfExpression *); + virtual void endVisit(QDeclarativeJS::AST::TypeOfExpression *); + + virtual bool visit(QDeclarativeJS::AST::PreIncrementExpression *); + virtual void endVisit(QDeclarativeJS::AST::PreIncrementExpression *); + + virtual bool visit(QDeclarativeJS::AST::PreDecrementExpression *); + virtual void endVisit(QDeclarativeJS::AST::PreDecrementExpression *); + + virtual bool visit(QDeclarativeJS::AST::UnaryPlusExpression *); + virtual void endVisit(QDeclarativeJS::AST::UnaryPlusExpression *); + + virtual bool visit(QDeclarativeJS::AST::UnaryMinusExpression *); + virtual void endVisit(QDeclarativeJS::AST::UnaryMinusExpression *); + + virtual bool visit(QDeclarativeJS::AST::TildeExpression *); + virtual void endVisit(QDeclarativeJS::AST::TildeExpression *); + + virtual bool visit(QDeclarativeJS::AST::NotExpression *); + virtual void endVisit(QDeclarativeJS::AST::NotExpression *); + + virtual bool visit(QDeclarativeJS::AST::BinaryExpression *); + virtual void endVisit(QDeclarativeJS::AST::BinaryExpression *); + + virtual bool visit(QDeclarativeJS::AST::ConditionalExpression *); + virtual void endVisit(QDeclarativeJS::AST::ConditionalExpression *); + + virtual bool visit(QDeclarativeJS::AST::Expression *); + virtual void endVisit(QDeclarativeJS::AST::Expression *); + + virtual bool visit(QDeclarativeJS::AST::Block *); + virtual void endVisit(QDeclarativeJS::AST::Block *); + + virtual bool visit(QDeclarativeJS::AST::StatementList *); + virtual void endVisit(QDeclarativeJS::AST::StatementList *); + + virtual bool visit(QDeclarativeJS::AST::VariableStatement *); + virtual void endVisit(QDeclarativeJS::AST::VariableStatement *); + + virtual bool visit(QDeclarativeJS::AST::VariableDeclarationList *); + virtual void endVisit(QDeclarativeJS::AST::VariableDeclarationList *); + + virtual bool visit(QDeclarativeJS::AST::VariableDeclaration *); + virtual void endVisit(QDeclarativeJS::AST::VariableDeclaration *); + + virtual bool visit(QDeclarativeJS::AST::EmptyStatement *); + virtual void endVisit(QDeclarativeJS::AST::EmptyStatement *); + + virtual bool visit(QDeclarativeJS::AST::ExpressionStatement *); + virtual void endVisit(QDeclarativeJS::AST::ExpressionStatement *); + + virtual bool visit(QDeclarativeJS::AST::IfStatement *); + virtual void endVisit(QDeclarativeJS::AST::IfStatement *); + + virtual bool visit(QDeclarativeJS::AST::DoWhileStatement *); + virtual void endVisit(QDeclarativeJS::AST::DoWhileStatement *); + + virtual bool visit(QDeclarativeJS::AST::WhileStatement *); + virtual void endVisit(QDeclarativeJS::AST::WhileStatement *); + + virtual bool visit(QDeclarativeJS::AST::ForStatement *); + virtual void endVisit(QDeclarativeJS::AST::ForStatement *); + + virtual bool visit(QDeclarativeJS::AST::LocalForStatement *); + virtual void endVisit(QDeclarativeJS::AST::LocalForStatement *); + + virtual bool visit(QDeclarativeJS::AST::ForEachStatement *); + virtual void endVisit(QDeclarativeJS::AST::ForEachStatement *); + + virtual bool visit(QDeclarativeJS::AST::LocalForEachStatement *); + virtual void endVisit(QDeclarativeJS::AST::LocalForEachStatement *); + + virtual bool visit(QDeclarativeJS::AST::ContinueStatement *); + virtual void endVisit(QDeclarativeJS::AST::ContinueStatement *); + + virtual bool visit(QDeclarativeJS::AST::BreakStatement *); + virtual void endVisit(QDeclarativeJS::AST::BreakStatement *); + + virtual bool visit(QDeclarativeJS::AST::ReturnStatement *); + virtual void endVisit(QDeclarativeJS::AST::ReturnStatement *); + + virtual bool visit(QDeclarativeJS::AST::WithStatement *); + virtual void endVisit(QDeclarativeJS::AST::WithStatement *); + + virtual bool visit(QDeclarativeJS::AST::CaseBlock *); + virtual void endVisit(QDeclarativeJS::AST::CaseBlock *); + + virtual bool visit(QDeclarativeJS::AST::SwitchStatement *); + virtual void endVisit(QDeclarativeJS::AST::SwitchStatement *); + + virtual bool visit(QDeclarativeJS::AST::CaseClauses *); + virtual void endVisit(QDeclarativeJS::AST::CaseClauses *); + + virtual bool visit(QDeclarativeJS::AST::CaseClause *); + virtual void endVisit(QDeclarativeJS::AST::CaseClause *); + + virtual bool visit(QDeclarativeJS::AST::DefaultClause *); + virtual void endVisit(QDeclarativeJS::AST::DefaultClause *); + + virtual bool visit(QDeclarativeJS::AST::LabelledStatement *); + virtual void endVisit(QDeclarativeJS::AST::LabelledStatement *); + + virtual bool visit(QDeclarativeJS::AST::ThrowStatement *); + virtual void endVisit(QDeclarativeJS::AST::ThrowStatement *); + + virtual bool visit(QDeclarativeJS::AST::TryStatement *); + virtual void endVisit(QDeclarativeJS::AST::TryStatement *); + + virtual bool visit(QDeclarativeJS::AST::Catch *); + virtual void endVisit(QDeclarativeJS::AST::Catch *); + + virtual bool visit(QDeclarativeJS::AST::Finally *); + virtual void endVisit(QDeclarativeJS::AST::Finally *); + + virtual bool visit(QDeclarativeJS::AST::FunctionDeclaration *); + virtual void endVisit(QDeclarativeJS::AST::FunctionDeclaration *); + + virtual bool visit(QDeclarativeJS::AST::FunctionExpression *); + virtual void endVisit(QDeclarativeJS::AST::FunctionExpression *); + + virtual bool visit(QDeclarativeJS::AST::FormalParameterList *); + virtual void endVisit(QDeclarativeJS::AST::FormalParameterList *); + + virtual bool visit(QDeclarativeJS::AST::FunctionBody *); + virtual void endVisit(QDeclarativeJS::AST::FunctionBody *); + + virtual bool visit(QDeclarativeJS::AST::Program *); + virtual void endVisit(QDeclarativeJS::AST::Program *); + + virtual bool visit(QDeclarativeJS::AST::SourceElements *); + virtual void endVisit(QDeclarativeJS::AST::SourceElements *); + + virtual bool visit(QDeclarativeJS::AST::FunctionSourceElement *); + virtual void endVisit(QDeclarativeJS::AST::FunctionSourceElement *); + + virtual bool visit(QDeclarativeJS::AST::StatementSourceElement *); + virtual void endVisit(QDeclarativeJS::AST::StatementSourceElement *); + + virtual bool visit(QDeclarativeJS::AST::DebuggerStatement *); + virtual void endVisit(QDeclarativeJS::AST::DebuggerStatement *); + + virtual bool visit(QDeclarativeJS::AST::UiParameterList *); + virtual void endVisit(QDeclarativeJS::AST::UiParameterList *); + +private: + void addMarkedUpToken(QDeclarativeJS::AST::SourceLocation &location, + const QString &text); + void addVerbatim(QDeclarativeJS::AST::SourceLocation first, + QDeclarativeJS::AST::SourceLocation last = QDeclarativeJS::AST::SourceLocation()); + QString sourceText(QDeclarativeJS::AST::SourceLocation &location); + void write(const QString &text); + void endWrite(const QString &text); + + QString source; + QString output; + quint32 cursor; + int indent; + bool showDebug; +}; + +QT_END_NAMESPACE + +#endif diff --git a/tools/qdoc3/qmlvisitor.cpp b/tools/qdoc3/qmlvisitor.cpp index 1d65c3d..9295624 100644 --- a/tools/qdoc3/qmlvisitor.cpp +++ b/tools/qdoc3/qmlvisitor.cpp @@ -42,15 +42,17 @@ #include #include #include -#include "parser/qmljsast_p.h" -#include "parser/qmljsastfwd_p.h" -#include "parser/qmljsengine_p.h" +#include "private/qdeclarativejsast_p.h" +#include "private/qdeclarativejsastfwd_p.h" +#include "private/qdeclarativejsengine_p.h" #include "node.h" #include "qmlvisitor.h" -DocVisitor::DocVisitor(const QString &filePath, const QString &code, - QmlJS::Engine *engine, Tree *tree, QSet &commands) +QT_BEGIN_NAMESPACE + +QmlDocVisitor::QmlDocVisitor(const QString &filePath, const QString &code, + QDeclarativeJS::Engine *engine, Tree *tree, QSet &commands) { this->filePath = filePath; this->name = QFileInfo(filePath).baseName(); @@ -61,17 +63,17 @@ DocVisitor::DocVisitor(const QString &filePath, const QString &code, current = tree->root(); } -DocVisitor::~DocVisitor() +QmlDocVisitor::~QmlDocVisitor() { } -QmlJS::AST::SourceLocation DocVisitor::precedingComment(unsigned offset) const +QDeclarativeJS::AST::SourceLocation QmlDocVisitor::precedingComment(unsigned offset) const { - QmlJS::AST::SourceLocation currentLoc; + QDeclarativeJS::AST::SourceLocation currentLoc; - foreach (const QmlJS::AST::SourceLocation &loc, engine->comments()) { + foreach (const QDeclarativeJS::AST::SourceLocation &loc, engine->comments()) { if (loc.begin() > lastEndOffset && loc.end() < offset) - currentLoc = loc; + currentLoc = loc; else break; } @@ -81,13 +83,13 @@ QmlJS::AST::SourceLocation DocVisitor::precedingComment(unsigned offset) const return currentLoc; } - return QmlJS::AST::SourceLocation(); + return QDeclarativeJS::AST::SourceLocation(); } -void DocVisitor::applyDocumentation(QmlJS::AST::SourceLocation location, +void QmlDocVisitor::applyDocumentation(QDeclarativeJS::AST::SourceLocation location, Node *node) { - QmlJS::AST::SourceLocation loc = precedingComment(location.begin()); + QDeclarativeJS::AST::SourceLocation loc = precedingComment(location.begin()); if (loc.isValid()) { QString source = document.mid(loc.offset, loc.length); @@ -111,7 +113,7 @@ void DocVisitor::applyDocumentation(QmlJS::AST::SourceLocation location, /*! Visits element definitions, recording them in a tree structure. */ -bool DocVisitor::visit(QmlJS::AST::UiObjectDefinition *definition) +bool QmlDocVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition) { QString type = definition->qualifiedTypeNameId->name->asString(); @@ -130,12 +132,12 @@ bool DocVisitor::visit(QmlJS::AST::UiObjectDefinition *definition) return true; } -void DocVisitor::endVisit(QmlJS::AST::UiObjectDefinition *definition) +void QmlDocVisitor::endVisit(QDeclarativeJS::AST::UiObjectDefinition *definition) { lastEndOffset = definition->lastSourceLocation().end(); } -bool DocVisitor::visit(QmlJS::AST::UiImportList *imports) +bool QmlDocVisitor::visit(QDeclarativeJS::AST::UiImportList *imports) { // Note that the imports list can be traversed by iteration to obtain // all the imports in the document at once, having found just one: @@ -154,10 +156,10 @@ bool DocVisitor::visit(QmlJS::AST::UiImportList *imports) Visits public member declarations, such as signals and properties. These only include custom signals and properties. */ -bool DocVisitor::visit(QmlJS::AST::UiPublicMember *member) +bool QmlDocVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member) { switch (member->type) { - case QmlJS::AST::UiPublicMember::Signal: + case QDeclarativeJS::AST::UiPublicMember::Signal: { if (current->type() == Node::Fake) { QmlClassNode *qmlClass = static_cast(current); @@ -167,7 +169,7 @@ bool DocVisitor::visit(QmlJS::AST::UiPublicMember *member) FunctionNode *qmlSignal = new FunctionNode(Node::QmlSignal, current, name, false); QList parameters; - for (QmlJS::AST::UiParameterList *it = member->parameters; it; it = it->next) { + for (QDeclarativeJS::AST::UiParameterList *it = member->parameters; it; it = it->next) { if (it->type && it->name) parameters.append(Parameter(it->type->asString(), "", it->name->asString())); } @@ -178,7 +180,7 @@ bool DocVisitor::visit(QmlJS::AST::UiPublicMember *member) } break; } - case QmlJS::AST::UiPublicMember::Property: + case QDeclarativeJS::AST::UiPublicMember::Property: { QString type = member->memberType->asString(); QString name = member->name->asString(); @@ -206,12 +208,14 @@ bool DocVisitor::visit(QmlJS::AST::UiPublicMember *member) return true; } -void DocVisitor::endVisit(QmlJS::AST::UiPublicMember *definition) +void QmlDocVisitor::endVisit(QDeclarativeJS::AST::UiPublicMember *definition) { lastEndOffset = definition->lastSourceLocation().end(); } -bool DocVisitor::visit(QmlJS::AST::IdentifierPropertyName *idproperty) +bool QmlDocVisitor::visit(QDeclarativeJS::AST::IdentifierPropertyName *idproperty) { return true; } + +QT_END_NAMESPACE diff --git a/tools/qdoc3/qmlvisitor.h b/tools/qdoc3/qmlvisitor.h index a830793..c7b4bda 100644 --- a/tools/qdoc3/qmlvisitor.h +++ b/tools/qdoc3/qmlvisitor.h @@ -39,36 +39,38 @@ ** ****************************************************************************/ -#ifndef DOCVISITOR_H -#define DOCVISITOR_H +#ifndef QMLVISITOR_H +#define QMLVISITOR_H #include -#include "parser/qmljsastvisitor_p.h" +#include "private/qdeclarativejsastvisitor_p.h" #include "node.h" #include "tree.h" -class DocVisitor : public QmlJS::AST::Visitor +QT_BEGIN_NAMESPACE + +class QmlDocVisitor : public QDeclarativeJS::AST::Visitor { public: - DocVisitor(const QString &filePath, const QString &code, - QmlJS::Engine *engine, Tree *tree, QSet &commands); - virtual ~DocVisitor(); + QmlDocVisitor(const QString &filePath, const QString &code, + QDeclarativeJS::Engine *engine, Tree *tree, QSet &commands); + virtual ~QmlDocVisitor(); - bool visit(QmlJS::AST::UiImportList *imports); + bool visit(QDeclarativeJS::AST::UiImportList *imports); - bool visit(QmlJS::AST::UiObjectDefinition *definition); - void endVisit(QmlJS::AST::UiObjectDefinition *definition); + bool visit(QDeclarativeJS::AST::UiObjectDefinition *definition); + void endVisit(QDeclarativeJS::AST::UiObjectDefinition *definition); - bool visit(QmlJS::AST::UiPublicMember *member); - void endVisit(QmlJS::AST::UiPublicMember *definition); + bool visit(QDeclarativeJS::AST::UiPublicMember *member); + void endVisit(QDeclarativeJS::AST::UiPublicMember *definition); - bool visit(QmlJS::AST::IdentifierPropertyName *idproperty); + bool visit(QDeclarativeJS::AST::IdentifierPropertyName *idproperty); private: - QmlJS::AST::SourceLocation precedingComment(unsigned offset) const; - void applyDocumentation(QmlJS::AST::SourceLocation location, Node *node); + QDeclarativeJS::AST::SourceLocation precedingComment(unsigned offset) const; + void applyDocumentation(QDeclarativeJS::AST::SourceLocation location, Node *node); - QmlJS::Engine *engine; + QDeclarativeJS::Engine *engine; quint32 lastEndOffset; QString filePath; QString name; @@ -79,4 +81,6 @@ private: InnerNode *current; }; +QT_END_NAMESPACE + #endif -- cgit v0.12 From 940856ee20287ce0a61cfaf46012dd5509f857b5 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 29 Nov 2010 09:10:08 +1000 Subject: Add PinchArea. Provides two finger gestures: zoom, rotate, pan. Task-number: QTBUG-15491 Reviewed-by: Aaron Kennedy --- src/declarative/graphicsitems/graphicsitems.pri | 7 +- .../graphicsitems/qdeclarativeitemsmodule.cpp | 4 + .../graphicsitems/qdeclarativepincharea.cpp | 579 +++++++++++++++++++++ .../graphicsitems/qdeclarativepincharea_p.h | 308 +++++++++++ .../graphicsitems/qdeclarativepincharea_p_p.h | 109 ++++ .../qdeclarativepincharea/data/pinchproperties.qml | 46 ++ .../qdeclarativepincharea.pro | 16 + .../tst_qdeclarativepincharea.cpp | 315 +++++++++++ 8 files changed, 1382 insertions(+), 2 deletions(-) create mode 100644 src/declarative/graphicsitems/qdeclarativepincharea.cpp create mode 100644 src/declarative/graphicsitems/qdeclarativepincharea_p.h create mode 100644 src/declarative/graphicsitems/qdeclarativepincharea_p_p.h create mode 100644 tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml create mode 100644 tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro create mode 100644 tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp diff --git a/src/declarative/graphicsitems/graphicsitems.pri b/src/declarative/graphicsitems/graphicsitems.pri index ffdeb29..2cd3323 100644 --- a/src/declarative/graphicsitems/graphicsitems.pri +++ b/src/declarative/graphicsitems/graphicsitems.pri @@ -50,7 +50,9 @@ HEADERS += \ $$PWD/qdeclarativelayoutitem_p.h \ $$PWD/qdeclarativeitemchangelistener_p.h \ $$PWD/qdeclarativegraphicswidget_p.h \ - $$PWD/qdeclarativetextlayout_p.h + $$PWD/qdeclarativetextlayout_p.h \ + $$PWD/qdeclarativepincharea_p.h \ + $$PWD/qdeclarativepincharea_p_p.h SOURCES += \ $$PWD/qdeclarativeitemsmodule.cpp \ @@ -83,5 +85,6 @@ SOURCES += \ $$PWD/qdeclarativelistview.cpp \ $$PWD/qdeclarativelayoutitem.cpp \ $$PWD/qdeclarativegraphicswidget.cpp \ - $$PWD/qdeclarativetextlayout.cpp + $$PWD/qdeclarativetextlayout.cpp \ + $$PWD/qdeclarativepincharea.cpp diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 52703c2..a462763 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -78,6 +78,7 @@ #include "private/qdeclarativewebview_p_p.h" #endif #include "private/qdeclarativeanchors_p.h" +#include "private/qdeclarativepincharea_p.h" static QDeclarativePrivate::AutoParentResult qgraphicsobject_autoParent(QObject *obj, QObject *parent) { @@ -147,10 +148,13 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType("QtQuick",1,0,"ViewSection"); qmlRegisterType("QtQuick",1,0,"VisualDataModel"); qmlRegisterType("QtQuick",1,0,"VisualItemModel"); + qmlRegisterType("QtQuick",1,1,"PinchArea"); + qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); + qmlRegisterType(); qmlRegisterType(); qmlRegisterType("QtQuick",1,0,"QGraphicsWidget"); qmlRegisterExtendedType("QtQuick",1,0,"QGraphicsWidget"); diff --git a/src/declarative/graphicsitems/qdeclarativepincharea.cpp b/src/declarative/graphicsitems/qdeclarativepincharea.cpp new file mode 100644 index 0000000..998c30d --- /dev/null +++ b/src/declarative/graphicsitems/qdeclarativepincharea.cpp @@ -0,0 +1,579 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdeclarativepincharea_p.h" +#include "qdeclarativepincharea_p_p.h" + +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + + +/*! + \qmlclass PinchEvent QDeclarativePinchEvent + \ingroup qml-event-elements + \brief The PinchEvent object provides information about a pinch event. + + \bold {The PinchEvent element was added in QtQuick 1.1} + + The \c center, \c startCenter, \c lastCenter properties provide the center position between the two touch points. + + The \c scale and \c lastScale properties provide the scale factor. + + The \c angle, \c lastAngle and \c rotation properties provide the angle between the two points and the amount of rotation. + + The \c point1, \c point2, \c startPoint1, \c startPoint2 properties provide the positions of the touch points. + + The \c accepted property may be set to false in the \c onPinchStarted handler if the gesture should not + be handled. + + \sa PinchArea +*/ + +/*! + \qmlproperty QPointF PinchEvent::center + \qmlproperty QPointF PinchEvent::startCenter + \qmlproperty QPointF PinchEvent::lastCenter + + These properties hold the position of the center point between the two touch points. + + \list + \o \c center is the current center point + \o \c lastCenter is the center point of the previous event. + \o \c startCenter is the center point when the gesture began + \endlist +*/ + +/*! + \qmlproperty real PinchEvent::scale + \qmlproperty real PinchEvent::lastScale + + These properties hold the scale factor determined by the change in distance between the two touch points. + + \list + \o \c scale is the current scale factor. + \o \c lastScale is the scale factor of the previous event. + \endlist + + When a pinch gesture is started, the scale is 1.0. +*/ + +/*! + \qmlproperty real PinchEvent::angle + \qmlproperty real PinchEvent::lastAngle + \qmlproperty real PinchEvent::rotation + + These properties hold the angle between the two touch points. + + \list + \o \c angle is the current angle between the two points in the range -180 to 180. + \o \c lastAngle is the angle of the previous event. + \o \c rotation is the total rotation since the pinch gesture started. + \endlist + + When a pinch gesture is started, the rotation is 0.0. +*/ + +/*! + \qmlproperty QPointF PinchEvent::point1 + \qmlproperty QPointF PinchEvent::startPoint1 + \qmlproperty QPointF PinchEvent::point2 + \qmlproperty QPointF PinchEvent::startPoint2 + + These properties provide the actual touch points generating the pinch. + + \list + \o \c point1 and \c point2 hold the current positions of the points. + \o \c startPoint1 and \c startPoint2 hold the positions of the points when the second point was touched. + \endlist +*/ + +/*! + \qmlproperty bool PinchEvent::accepted + + Setting this property to false in the \c PinchArea::onPinchStarted handler + will result in no further pinch events being generated, and the gesture + ignored. +*/ + +QDeclarativePinch::QDeclarativePinch() + : m_target(0), m_minScale(1.0), m_maxScale(1.0) + , m_minRotation(0.0), m_maxRotation(0.0) + , m_axis(NoDrag), m_xmin(-FLT_MAX), m_xmax(FLT_MAX) + , m_ymin(-FLT_MAX), m_ymax(FLT_MAX), m_active(false) +{ +} + +QDeclarativePinchAreaPrivate::~QDeclarativePinchAreaPrivate() +{ + delete pinch; +} + +/*! + \qmlclass PinchArea QDeclarativePinchArea + \brief The PinchArea item enables simple pinch gesture handling. + \inherits Item + + \bold {The PinchArea element was added in QtQuick 1.1} + + A PinchArea is an invisible item that is typically used in conjunction with + a visible item in order to provide pinch gesture handling for that item. + + The \l enabled property is used to enable and disable pinch handling for + the proxied item. When disabled, the pinch area becomes transparent to + mouse/touch events. + + PinchArea can be used in two ways: + + \list + \o setting a \c pinch.target to provide automatic interaction with an element + \o using the onPinchStarted, onPinchChanged and onPinchFinished handlers + \endlist + + \sa PinchEvent +*/ + +/*! + \qmlsignal PinchArea::onPinchStarted() + + This handler is called when the pinch area detects that a pinch gesture has started. + + The \l {PinchEvent}{pinch} parameter provides information about the pinch gesture, + including the scale, center and angle of the pinch. + + To ignore this gesture set the \c pinch.accepted property to false. The gesture + will be cancelled and no further events will be sent. +*/ + +/*! + \qmlsignal PinchArea::onPinchChanged() + + This handler is called when the pinch area detects that a pinch gesture has changed. + + The \l {PinchEvent}{pinch} parameter provides information about the pinch gesture, + including the scale, center and angle of the pinch. +*/ + +/*! + \qmlsignal PinchArea::onPinchFinished() + + This handler is called when the pinch area detects that a pinch gesture has finished. + + The \l {PinchEvent}{pinch} parameter provides information about the pinch gesture, + including the scale, center and angle of the pinch. +*/ + + +/*! + \qmlproperty Item PinchArea::pinch.target + \qmlproperty bool PinchArea::pinch.active + \qmlproperty real PinchArea::pinch.minimumScale + \qmlproperty real PinchArea::pinch.maximumScale + \qmlproperty real PinchArea::pinch.minimumRotation + \qmlproperty real PinchArea::pinch.maximumRotation + \qmlproperty enumeration PinchArea::pinch.dragAxis + \qmlproperty real PinchArea::pinch.minimumX + \qmlproperty real PinchArea::pinch.maximumX + \qmlproperty real PinchArea::pinch.minimumY + \qmlproperty real PinchArea::pinch.maximumY + + \c pinch provides a convenient way to make an item react to pinch gestures. + + \list + \i \c pinch.target specifies the id of the item to drag. + \i \c pinch.active specifies if the target item is currently being dragged. + \i \c pinch.minimumScale and \c pinch.maximumScale limit the range of the Item::scale property. + \i \c pinch.minimumRotation and \c pinch.maximumRotation limit the range of the Item::rotation property. + \i \c pinch.dragAxis specifies whether dragging in not allowed (\c Pinch.NoDrag), can be done horizontally (\c Pinch.XAxis), vertically (\c Pinch.YAxis), or both (\c Pinch.XandYAxis) + \i \c pinch.minimum and \c pinch.maximum limit how far the target can be dragged along the corresponding axes. + \endlist +*/ + +QDeclarativePinchArea::QDeclarativePinchArea(QDeclarativeItem *parent) + : QDeclarativeItem(*(new QDeclarativePinchAreaPrivate), parent) +{ + Q_D(QDeclarativePinchArea); + d->init(); +} + +QDeclarativePinchArea::~QDeclarativePinchArea() +{ +} + +/*! + \qmlproperty bool PinchArea::enabled + This property holds whether the item accepts pinch gestures. + + This property defaults to true. +*/ +bool QDeclarativePinchArea::isEnabled() const +{ + Q_D(const QDeclarativePinchArea); + return d->absorb; +} + +void QDeclarativePinchArea::setEnabled(bool a) +{ + Q_D(QDeclarativePinchArea); + if (a != d->absorb) { + d->absorb = a; + emit enabledChanged(); + } +} + +bool QDeclarativePinchArea::event(QEvent *event) +{ + Q_D(QDeclarativePinchArea); + if (!d->absorb || !isVisible()) + return QDeclarativeItem::event(event); + switch (event->type()) { + case QEvent::TouchBegin: + case QEvent::TouchUpdate: { + QTouchEvent *touch = static_cast(event); + d->touchPoints.clear(); + for (int i = 0; i < touch->touchPoints().count(); ++i) { + if (!(touch->touchPoints().at(i).state() & Qt::TouchPointReleased)) { + d->touchPoints << touch->touchPoints().at(i); + } + } + updatePinch(); + } + return true; + case QEvent::TouchEnd: + d->touchPoints.clear(); + updatePinch(); + break; + default: + return QDeclarativeItem::event(event); + } + + return QDeclarativeItem::event(event); +} + +void QDeclarativePinchArea::updatePinch() +{ + Q_D(QDeclarativePinchArea); + if (d->touchPoints.count() != 2) { + if (d->inPinch) { + d->stealMouse = false; + setKeepMouseGrab(false); + d->inPinch = false; + const qreal rotationAngle = d->pinchStartAngle - d->pinchLastAngle; + QPointF pinchCenter = mapFromScene(d->sceneLastCenter); + QDeclarativePinchEvent pe(pinchCenter, d->pinchLastScale, d->pinchLastAngle, rotationAngle); + pe.setStartCenter(d->pinchStartCenter); + pe.setLastCenter(pinchCenter); + pe.setLastAngle(d->pinchLastAngle); + pe.setLastScale(d->pinchLastScale); + pe.setStartPoint1(mapFromScene(d->sceneStartPoint1)); + pe.setStartPoint2(mapFromScene(d->sceneStartPoint2)); + pe.setPoint1(d->lastPoint1); + pe.setPoint2(d->lastPoint2); + emit pinchFinished(&pe); + if (d->pinch && d->pinch->target()) + d->pinch->setActive(false); + } + return; + } + if (d->touchPoints.at(0).state() & Qt::TouchPointPressed + || d->touchPoints.at(1).state() & Qt::TouchPointPressed) { + d->sceneStartPoint1 = d->touchPoints.at(0).scenePos(); + d->sceneStartPoint2 = d->touchPoints.at(1).scenePos(); + d->inPinch = false; + d->pinchRejected = false; + } else if (!d->pinchRejected){ + QDeclarativeItem *grabber = scene() ? qobject_cast(scene()->mouseGrabberItem()) : 0; + if (grabber == this || !grabber || !grabber->keepMouseGrab()) { + const int dragThreshold = QApplication::startDragDistance(); + QPointF p1 = d->touchPoints.at(0).scenePos(); + QPointF p2 = d->touchPoints.at(1).scenePos(); + qreal dx = p1.x() - p2.x(); + qreal dy = p1.y() - p2.y(); + qreal dist = sqrt(dx*dx + dy*dy); + QPointF sceneCenter = (p1 + p2)/2; + qreal angle = QLineF(p1, p2).angle(); + if (angle > 180) + angle -= 360; + if (!d->inPinch) { + if (qAbs(p1.x()-d->sceneStartPoint1.x()) > dragThreshold + || qAbs(p1.y()-d->sceneStartPoint1.y()) > dragThreshold + || qAbs(p2.x()-d->sceneStartPoint2.x()) > dragThreshold + || qAbs(p2.y()-d->sceneStartPoint2.y()) > dragThreshold) { + d->sceneStartCenter = sceneCenter; + d->sceneLastCenter = sceneCenter; + d->pinchStartCenter = mapFromScene(sceneCenter); + d->pinchStartDist = dist; + d->pinchStartAngle = angle; + d->pinchLastScale = 1.0; + d->pinchLastAngle = angle; + d->lastPoint1 = d->touchPoints.at(0).pos(); + d->lastPoint2 = d->touchPoints.at(1).pos(); + QDeclarativePinchEvent pe(d->pinchStartCenter, 1.0, angle, 0.0); + pe.setStartCenter(d->pinchStartCenter); + pe.setLastCenter(d->pinchStartCenter); + pe.setLastAngle(d->pinchLastAngle); + pe.setLastScale(d->pinchLastScale); + pe.setStartPoint1(mapFromScene(d->sceneStartPoint1)); + pe.setStartPoint2(mapFromScene(d->sceneStartPoint2)); + pe.setPoint1(d->lastPoint1); + pe.setPoint2(d->lastPoint2); + emit pinchStarted(&pe); + if (pe.accepted()) { + d->inPinch = true; + d->stealMouse = true; + grabMouse(); + setKeepMouseGrab(true); + if (d->pinch && d->pinch->target()) { + d->pinchStartPos = pinch()->target()->pos(); + d->pinchStartScale = d->pinch->target()->scale(); + d->pinchStartRotation = d->pinch->target()->rotation(); + d->pinch->setActive(true); + } + } else { + d->pinchRejected = true; + } + } + } else if (d->pinchStartDist > 0) { + qreal scale = dist / d->pinchStartDist; + qreal rotationAngle = d->pinchStartAngle - angle; + if (rotationAngle > 180) + rotationAngle -= 360; + QPointF pinchCenter = mapFromScene(sceneCenter); + QDeclarativePinchEvent pe(pinchCenter, scale, angle, rotationAngle); + pe.setStartCenter(d->pinchStartCenter); + pe.setLastCenter(mapFromScene(d->sceneLastCenter)); + pe.setLastAngle(d->pinchLastAngle); + pe.setLastScale(d->pinchLastScale); + pe.setStartPoint1(mapFromScene(d->sceneStartPoint1)); + pe.setStartPoint2(mapFromScene(d->sceneStartPoint2)); + pe.setPoint1(d->touchPoints.at(0).pos()); + pe.setPoint2(d->touchPoints.at(1).pos()); + d->pinchLastScale = scale; + d->sceneLastCenter = sceneCenter; + d->pinchLastAngle = angle; + d->lastPoint1 = d->touchPoints.at(0).pos(); + d->lastPoint2 = d->touchPoints.at(1).pos(); + emit pinchChanged(&pe); + if (d->pinch && d->pinch->target()) { + qreal s = d->pinchStartScale * scale; + s = qMin(qMax(pinch()->minimumScale(),s), pinch()->maximumScale()); + pinch()->target()->setScale(s); + QPointF pos = sceneCenter - d->sceneStartCenter + d->pinchStartPos; + if (pinch()->axis() & QDeclarativePinch::XAxis) { + qreal x = pos.x(); + if (x < pinch()->xmin()) + x = pinch()->xmin(); + else if (x > pinch()->xmax()) + x = pinch()->xmax(); + pinch()->target()->setX(x); + } + if (pinch()->axis() & QDeclarativePinch::YAxis) { + qreal y = pos.y(); + if (y < pinch()->ymin()) + y = pinch()->ymin(); + else if (y > pinch()->ymax()) + y = pinch()->ymax(); + pinch()->target()->setY(y); + } + if (d->pinchStartRotation >= pinch()->minimumRotation() + && d->pinchStartRotation <= pinch()->maximumRotation()) { + qreal r = rotationAngle + d->pinchStartRotation; + r = qMin(qMax(pinch()->minimumRotation(),r), pinch()->maximumRotation()); + pinch()->target()->setRotation(r); + } + } + } + } + } +} + +void QDeclarativePinchArea::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + Q_D(QDeclarativePinchArea); + d->stealMouse = false; + if (!d->absorb) + QDeclarativeItem::mousePressEvent(event); + else { + setKeepMouseGrab(false); + event->setAccepted(true); + } +} + +void QDeclarativePinchArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event) +{ + Q_D(QDeclarativePinchArea); + if (!d->absorb) { + QDeclarativeItem::mouseMoveEvent(event); + return; + } +} + +void QDeclarativePinchArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +{ + Q_D(QDeclarativePinchArea); + d->stealMouse = false; + if (!d->absorb) { + QDeclarativeItem::mouseReleaseEvent(event); + } else { + QGraphicsScene *s = scene(); + if (s && s->mouseGrabberItem() == this) + ungrabMouse(); + setKeepMouseGrab(false); + } +} + +bool QDeclarativePinchArea::sceneEvent(QEvent *event) +{ + bool rv = QDeclarativeItem::sceneEvent(event); + if (event->type() == QEvent::UngrabMouse) { + setKeepMouseGrab(false); + } + return rv; +} + +bool QDeclarativePinchArea::sendMouseEvent(QGraphicsSceneMouseEvent *event) +{ + Q_D(QDeclarativePinchArea); + QGraphicsSceneMouseEvent mouseEvent(event->type()); + QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect(); + + QGraphicsScene *s = scene(); + QDeclarativeItem *grabber = s ? qobject_cast(s->mouseGrabberItem()) : 0; + bool stealThisEvent = d->stealMouse; + if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) { + mouseEvent.setAccepted(false); + for (int i = 0x1; i <= 0x10; i <<= 1) { + if (event->buttons() & i) { + Qt::MouseButton button = Qt::MouseButton(i); + mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button))); + } + } + mouseEvent.setScenePos(event->scenePos()); + mouseEvent.setLastScenePos(event->lastScenePos()); + mouseEvent.setPos(mapFromScene(event->scenePos())); + mouseEvent.setLastPos(mapFromScene(event->lastScenePos())); + + switch(mouseEvent.type()) { + case QEvent::GraphicsSceneMouseMove: + mouseMoveEvent(&mouseEvent); + break; + case QEvent::GraphicsSceneMousePress: + mousePressEvent(&mouseEvent); + break; + case QEvent::GraphicsSceneMouseRelease: + mouseReleaseEvent(&mouseEvent); + break; + default: + break; + } + grabber = qobject_cast(s->mouseGrabberItem()); + if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) + grabMouse(); + + return stealThisEvent; + } + if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease) { + d->stealMouse = false; + if (s && s->mouseGrabberItem() == this) + ungrabMouse(); + setKeepMouseGrab(false); + } + return false; +} + +bool QDeclarativePinchArea::sceneEventFilter(QGraphicsItem *i, QEvent *e) +{ + Q_D(QDeclarativePinchArea); + if (!d->absorb || !isVisible()) + return QDeclarativeItem::sceneEventFilter(i, e); + switch (e->type()) { + case QEvent::GraphicsSceneMousePress: + case QEvent::GraphicsSceneMouseMove: + case QEvent::GraphicsSceneMouseRelease: + return sendMouseEvent(static_cast(e)); + break; + case QEvent::TouchBegin: + case QEvent::TouchUpdate: { + QTouchEvent *touch = static_cast(e); + d->touchPoints.clear(); + for (int i = 0; i < touch->touchPoints().count(); ++i) + if (!(touch->touchPoints().at(i).state() & Qt::TouchPointReleased)) + d->touchPoints << touch->touchPoints().at(i); + updatePinch(); + } + return d->inPinch; + case QEvent::TouchEnd: + d->touchPoints.clear(); + updatePinch(); + break; + default: + break; + } + + return QDeclarativeItem::sceneEventFilter(i, e); +} + +void QDeclarativePinchArea::geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry) +{ + QDeclarativeItem::geometryChanged(newGeometry, oldGeometry); +} + +QVariant QDeclarativePinchArea::itemChange(GraphicsItemChange change, + const QVariant &value) +{ + return QDeclarativeItem::itemChange(change, value); +} + +QDeclarativePinch *QDeclarativePinchArea::pinch() +{ + Q_D(QDeclarativePinchArea); + if (!d->pinch) + d->pinch = new QDeclarativePinch; + return d->pinch; +} + + +QT_END_NAMESPACE diff --git a/src/declarative/graphicsitems/qdeclarativepincharea_p.h b/src/declarative/graphicsitems/qdeclarativepincharea_p.h new file mode 100644 index 0000000..9a73a17 --- /dev/null +++ b/src/declarative/graphicsitems/qdeclarativepincharea_p.h @@ -0,0 +1,308 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEPINCHAREA_H +#define QDECLARATIVEPINCHAREA_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class Q_AUTOTEST_EXPORT QDeclarativePinch : public QObject +{ + Q_OBJECT + + Q_ENUMS(Axis) + Q_PROPERTY(QGraphicsObject *target READ target WRITE setTarget RESET resetTarget) + Q_PROPERTY(qreal minimumScale READ minimumScale WRITE setMinimumScale NOTIFY minimumScaleChanged) + Q_PROPERTY(qreal maximumScale READ maximumScale WRITE setMaximumScale NOTIFY maximumScaleChanged) + Q_PROPERTY(qreal minimumRotation READ minimumRotation WRITE setMinimumRotation NOTIFY minimumRotationChanged) + Q_PROPERTY(qreal maximumRotation READ maximumRotation WRITE setMaximumRotation NOTIFY maximumRotationChanged) + Q_PROPERTY(Axis dragAxis READ axis WRITE setAxis NOTIFY dragAxisChanged) + Q_PROPERTY(qreal minimumX READ xmin WRITE setXmin NOTIFY minimumXChanged) + Q_PROPERTY(qreal maximumX READ xmax WRITE setXmax NOTIFY maximumXChanged) + Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin NOTIFY minimumYChanged) + Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax NOTIFY maximumYChanged) + Q_PROPERTY(bool active READ active NOTIFY activeChanged) + +public: + QDeclarativePinch(); + + QGraphicsObject *target() const { return m_target; } + void setTarget(QGraphicsObject *target) { + if (target == m_target) + return; + m_target = target; + emit targetChanged(); + } + void resetTarget() { + if (!m_target) + return; + m_target = 0; + emit targetChanged(); + } + + qreal minimumScale() const { return m_minScale; } + void setMinimumScale(qreal s) { + if (s == m_minScale) + return; + m_minScale = s; + emit minimumScaleChanged(); + } + qreal maximumScale() const { return m_maxScale; } + void setMaximumScale(qreal s) { + if (s == m_maxScale) + return; + m_maxScale = s; + emit maximumScaleChanged(); + } + + qreal minimumRotation() const { return m_minRotation; } + void setMinimumRotation(qreal r) { + if (r == m_minRotation) + return; + m_minRotation = r; + emit minimumRotationChanged(); + } + qreal maximumRotation() const { return m_maxRotation; } + void setMaximumRotation(qreal r) { + if (r == m_maxRotation) + return; + m_maxRotation = r; + emit maximumRotationChanged(); + } + + enum Axis { NoDrag=0x00, XAxis=0x01, YAxis=0x02, XandYAxis=0x03 }; + Axis axis() const { return m_axis; } + void setAxis(Axis a) { + if (a == m_axis) + return; + m_axis = a; + emit dragAxisChanged(); + } + + qreal xmin() const { return m_xmin; } + void setXmin(qreal x) { + if (x == m_xmin) + return; + m_xmin = x; + emit minimumXChanged(); + } + qreal xmax() const { return m_xmax; } + void setXmax(qreal x) { + if (x == m_xmax) + return; + m_xmax = x; + emit maximumXChanged(); + } + qreal ymin() const { return m_ymin; } + void setYmin(qreal y) { + if (y == m_ymin) + return; + m_ymin = y; + emit minimumYChanged(); + } + qreal ymax() const { return m_ymax; } + void setYmax(qreal y) { + if (y == m_ymax) + return; + m_ymax = y; + emit maximumYChanged(); + } + + bool active() const { return m_active; } + void setActive(bool a) { + if (a == m_active) + return; + m_active = a; + emit activeChanged(); + } + +signals: + void targetChanged(); + void minimumScaleChanged(); + void maximumScaleChanged(); + void minimumRotationChanged(); + void maximumRotationChanged(); + void dragAxisChanged(); + void minimumXChanged(); + void maximumXChanged(); + void minimumYChanged(); + void maximumYChanged(); + void activeChanged(); + +private: + QGraphicsObject *m_target; + qreal m_minScale; + qreal m_maxScale; + qreal m_minRotation; + qreal m_maxRotation; + Axis m_axis; + qreal m_xmin; + qreal m_xmax; + qreal m_ymin; + qreal m_ymax; + bool m_active; +}; + +class Q_AUTOTEST_EXPORT QDeclarativePinchEvent : public QObject +{ + Q_OBJECT + + Q_PROPERTY(QPointF center READ center) + Q_PROPERTY(QPointF startCenter READ startCenter) + Q_PROPERTY(QPointF lastCenter READ lastCenter) + Q_PROPERTY(qreal scale READ scale) + Q_PROPERTY(qreal lastScale READ lastScale) + Q_PROPERTY(qreal angle READ angle) + Q_PROPERTY(qreal lastAngle READ lastAngle) + Q_PROPERTY(qreal rotation READ rotation) + Q_PROPERTY(QPointF point1 READ point1) + Q_PROPERTY(QPointF startPoint1 READ startPoint1) + Q_PROPERTY(QPointF point2 READ point2) + Q_PROPERTY(QPointF startPoint2 READ startPoint2) + Q_PROPERTY(bool accepted READ accepted WRITE setAccepted) + +public: + QDeclarativePinchEvent(QPointF c, qreal s, qreal a, qreal r) + : QObject(), m_center(c), m_scale(s), m_angle(a), m_rotation(r) {} + + QPointF center() const { return m_center; } + QPointF startCenter() const { return m_startCenter; } + void setStartCenter(QPointF c) { m_startCenter = c; } + QPointF lastCenter() const { return m_lastCenter; } + void setLastCenter(QPointF c) { m_lastCenter = c; } + qreal scale() const { return m_scale; } + qreal lastScale() const { return m_lastScale; } + void setLastScale(qreal s) { m_lastScale = s; } + qreal angle() const { return m_angle; } + qreal lastAngle() const { return m_lastAngle; } + void setLastAngle(qreal a) { m_lastAngle = a; } + qreal rotation() const { return m_rotation; } + QPointF point1() const { return m_point1; } + void setPoint1(QPointF p) { m_point1 = p; } + QPointF startPoint1() const { return m_startPoint1; } + void setStartPoint1(QPointF p) { m_startPoint1 = p; } + QPointF point2() const { return m_point2; } + void setPoint2(QPointF p) { m_point2 = p; } + QPointF startPoint2() const { return m_startPoint2; } + void setStartPoint2(QPointF p) { m_startPoint2 = p; } + + bool accepted() const { return m_accepted; } + void setAccepted(bool a) { m_accepted = a; } + +private: + QPointF m_center; + QPointF m_startCenter; + QPointF m_lastCenter; + qreal m_scale; + qreal m_lastScale; + qreal m_angle; + qreal m_lastAngle; + qreal m_rotation; + QPointF m_point1; + QPointF m_point2; + QPointF m_startPoint1; + QPointF m_startPoint2; + bool m_accepted; +}; + + +class QDeclarativeMouseEvent; +class QDeclarativePinchAreaPrivate; +class Q_AUTOTEST_EXPORT QDeclarativePinchArea : public QDeclarativeItem +{ + Q_OBJECT + + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) + Q_PROPERTY(QDeclarativePinch *pinch READ pinch CONSTANT) + +public: + QDeclarativePinchArea(QDeclarativeItem *parent=0); + ~QDeclarativePinchArea(); + + bool isEnabled() const; + void setEnabled(bool); + + QDeclarativePinch *pinch(); + +Q_SIGNALS: + void enabledChanged(); + void pinchStarted(QDeclarativePinchEvent *pinch); + void pinchChanged(QDeclarativePinchEvent *pinch); + void pinchFinished(QDeclarativePinchEvent *pinch); + +protected: + void mousePressEvent(QGraphicsSceneMouseEvent *event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + bool sceneEvent(QEvent *); + bool sendMouseEvent(QGraphicsSceneMouseEvent *event); + bool sceneEventFilter(QGraphicsItem *i, QEvent *e); + bool event(QEvent *); + + virtual void geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry); + virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value); + +private: + void updatePinch(); + void handlePress(); + void handleRelease(); + +private: + Q_DISABLE_COPY(QDeclarativePinchArea) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativePinchArea) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QDeclarativePinch) +QML_DECLARE_TYPE(QDeclarativePinchEvent) +QML_DECLARE_TYPE(QDeclarativePinchArea) + +QT_END_HEADER + +#endif // QDECLARATIVEPINCHAREA_H diff --git a/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h b/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h new file mode 100644 index 0000000..b1cdf68 --- /dev/null +++ b/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEPINCHAREA_P_H +#define QDECLARATIVEPINCHAREA_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include "qdeclarativeitem_p.h" + +QT_BEGIN_NAMESPACE + +class QDeclarativePinch; +class QDeclarativePinchAreaPrivate : public QDeclarativeItemPrivate +{ + Q_DECLARE_PUBLIC(QDeclarativePinchArea) +public: + QDeclarativePinchAreaPrivate() + : absorb(true), stealMouse(false), inPinch(false) + , pinchRejected(false), pinch(0) + { + } + + ~QDeclarativePinchAreaPrivate(); + + void init() + { + Q_Q(QDeclarativePinchArea); + q->setAcceptedMouseButtons(Qt::LeftButton); + q->setAcceptTouchEvents(true); + q->setFiltersChildEvents(true); + } + + bool absorb : 1; + bool stealMouse : 1; + bool inPinch : 1; + bool pinchRejected : 1; + QDeclarativePinch *pinch; + QPointF sceneStartPoint1; + QPointF sceneStartPoint2; + QPointF lastPoint1; + QPointF lastPoint2; + qreal pinchStartDist; + qreal pinchStartScale; + qreal pinchLastScale; + qreal pinchStartRotation; + qreal pinchStartAngle; + qreal pinchLastAngle; + QPointF sceneStartCenter; + QPointF pinchStartCenter; + QPointF sceneLastCenter; + QPointF pinchStartPos; + QList touchPoints; +}; + +QT_END_NAMESPACE + +#endif // QDECLARATIVEPINCHAREA_P_H diff --git a/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml b/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml new file mode 100644 index 0000000..f39ea06 --- /dev/null +++ b/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml @@ -0,0 +1,46 @@ +import QtQuick 1.1 +Rectangle { + id: whiteRect + property variant center + property real scale + width: 240; height: 320 + color: "white" + Rectangle { + id: blackRect + objectName: "blackrect" + color: "black" + y: 50 + x: 50 + width: 100 + height: 100 + opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200 + Text { text: blackRect.opacity} + PinchArea { + id: pincharea + objectName: "pincharea" + anchors.fill: parent + pinch.target: blackRect + pinch.dragAxis: Drag.XandYAxis + pinch.minimumX: 0 + pinch.maximumX: whiteRect.width-blackRect.width + pinch.minimumY: 0 + pinch.maximumY: whiteRect.height-blackRect.height + pinch.minimumScale: 1.0 + pinch.maximumScale: 2.0 + pinch.minimumRotation: 0.0 + pinch.maximumRotation: 90.0 + onPinchStarted: { + whiteRect.center = pinch.center + whiteRect.scale = pinch.scale + } + onPinchChanged: { + whiteRect.center = pinch.center + whiteRect.scale = pinch.scale + } + onPinchFinished: { + whiteRect.center = pinch.center + whiteRect.scale = pinch.scale + } + } + } + } diff --git a/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro b/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro new file mode 100644 index 0000000..2c13644 --- /dev/null +++ b/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro @@ -0,0 +1,16 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qdeclarativepincharea.cpp + +symbian: { + importFiles.sources = data + importFiles.path = . + DEPLOYMENT = importFiles +} else { + DEFINES += SRCDIR=\\\"$$PWD\\\" +} + +CONFIG += parallel_test + diff --git a/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp b/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp new file mode 100644 index 0000000..d1015fc --- /dev/null +++ b/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp @@ -0,0 +1,315 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +#ifdef Q_OS_SYMBIAN +// In Symbian OS test data is located in applications private dir +#define SRCDIR "." +#endif + +class tst_QDeclarativePinchArea: public QObject +{ + Q_OBJECT +private slots: + void pinchProperties(); + void scale(); + void pan(); + +private: + QDeclarativeView *createView(); +}; + +void tst_QDeclarativePinchArea::pinchProperties() +{ + QDeclarativeView *canvas = createView(); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pinchproperties.qml")); + canvas->show(); + canvas->setFocus(); + QVERIFY(canvas->rootObject() != 0); + + QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild("pincharea"); + QDeclarativePinch *pinch = pinchArea->pinch(); + QVERIFY(pinchArea != 0); + QVERIFY(pinch != 0); + + // target + QDeclarativeItem *blackRect = canvas->rootObject()->findChild("blackrect"); + QVERIFY(blackRect != 0); + QVERIFY(blackRect == pinch->target()); + QDeclarativeItem *rootItem = qobject_cast(canvas->rootObject()); + QVERIFY(rootItem != 0); + QSignalSpy targetSpy(pinch, SIGNAL(targetChanged())); + pinch->setTarget(rootItem); + QCOMPARE(targetSpy.count(),1); + pinch->setTarget(rootItem); + QCOMPARE(targetSpy.count(),1); + + // axis + QCOMPARE(pinch->axis(), QDeclarativePinch::XandYAxis); + QSignalSpy axisSpy(pinch, SIGNAL(dragAxisChanged())); + pinch->setAxis(QDeclarativePinch::XAxis); + QCOMPARE(pinch->axis(), QDeclarativePinch::XAxis); + QCOMPARE(axisSpy.count(),1); + pinch->setAxis(QDeclarativePinch::XAxis); + QCOMPARE(axisSpy.count(),1); + + // minimum and maximum drag properties + QSignalSpy xminSpy(pinch, SIGNAL(minimumXChanged())); + QSignalSpy xmaxSpy(pinch, SIGNAL(maximumXChanged())); + QSignalSpy yminSpy(pinch, SIGNAL(minimumYChanged())); + QSignalSpy ymaxSpy(pinch, SIGNAL(maximumYChanged())); + + QCOMPARE(pinch->xmin(), 0.0); + QCOMPARE(pinch->xmax(), rootItem->width()-blackRect->width()); + QCOMPARE(pinch->ymin(), 0.0); + QCOMPARE(pinch->ymax(), rootItem->height()-blackRect->height()); + + pinch->setXmin(10); + pinch->setXmax(10); + pinch->setYmin(10); + pinch->setYmax(10); + + QCOMPARE(pinch->xmin(), 10.0); + QCOMPARE(pinch->xmax(), 10.0); + QCOMPARE(pinch->ymin(), 10.0); + QCOMPARE(pinch->ymax(), 10.0); + + QCOMPARE(xminSpy.count(),1); + QCOMPARE(xmaxSpy.count(),1); + QCOMPARE(yminSpy.count(),1); + QCOMPARE(ymaxSpy.count(),1); + + pinch->setXmin(10); + pinch->setXmax(10); + pinch->setYmin(10); + pinch->setYmax(10); + + QCOMPARE(xminSpy.count(),1); + QCOMPARE(xmaxSpy.count(),1); + QCOMPARE(yminSpy.count(),1); + QCOMPARE(ymaxSpy.count(),1); + + // minimum and maximum scale properties + QSignalSpy scaleMinSpy(pinch, SIGNAL(minimumScaleChanged())); + QSignalSpy scaleMaxSpy(pinch, SIGNAL(maximumScaleChanged())); + + QCOMPARE(pinch->minimumScale(), 1.0); + QCOMPARE(pinch->maximumScale(), 2.0); + + pinch->setMinimumScale(0.5); + pinch->setMaximumScale(1.5); + + QCOMPARE(pinch->minimumScale(), 0.5); + QCOMPARE(pinch->maximumScale(), 1.5); + + QCOMPARE(scaleMinSpy.count(),1); + QCOMPARE(scaleMaxSpy.count(),1); + + pinch->setMinimumScale(0.5); + pinch->setMaximumScale(1.5); + + QCOMPARE(scaleMinSpy.count(),1); + QCOMPARE(scaleMaxSpy.count(),1); + + // minimum and maximum rotation properties + QSignalSpy rotMinSpy(pinch, SIGNAL(minimumRotationChanged())); + QSignalSpy rotMaxSpy(pinch, SIGNAL(maximumRotationChanged())); + + QCOMPARE(pinch->minimumRotation(), 0.0); + QCOMPARE(pinch->maximumRotation(), 90.0); + + pinch->setMinimumRotation(-90.0); + pinch->setMaximumRotation(45.0); + + QCOMPARE(pinch->minimumRotation(), -90.0); + QCOMPARE(pinch->maximumRotation(), 45.0); + + QCOMPARE(rotMinSpy.count(),1); + QCOMPARE(rotMaxSpy.count(),1); + + pinch->setMinimumRotation(-90.0); + pinch->setMaximumRotation(45.0); + + QCOMPARE(rotMinSpy.count(),1); + QCOMPARE(rotMaxSpy.count(),1); + + delete canvas; +} + +QTouchEvent::TouchPoint makeTouchPoint(int id, QPoint p, QGraphicsView *v, QGraphicsItem *i) +{ + QTouchEvent::TouchPoint touchPoint(id); + touchPoint.setPos(i->mapFromScene(p)); + touchPoint.setScreenPos(v->mapToGlobal(p)); + touchPoint.setScenePos(p); + return touchPoint; +} + +void tst_QDeclarativePinchArea::scale() +{ + QDeclarativeView *canvas = createView(); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pinchproperties.qml")); + canvas->show(); + canvas->setFocus(); + QTest::qWaitForWindowShown(canvas); + QVERIFY(canvas->rootObject() != 0); + qApp->processEvents(); + + QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild("pincharea"); + QDeclarativePinch *pinch = pinchArea->pinch(); + QVERIFY(pinchArea != 0); + QVERIFY(pinch != 0); + + QDeclarativeItem *root = qobject_cast(canvas->rootObject()); + QVERIFY(root != 0); + + // target + QDeclarativeItem *blackRect = canvas->rootObject()->findChild("blackrect"); + QVERIFY(blackRect != 0); + + QWidget *vp = canvas->viewport(); + + QPoint p1(80, 80); + QPoint p2(100, 100); + + QTest::touchEvent(vp).press(0, p1); + QTest::touchEvent(vp).stationary(0).press(1, p2); + p1 -= QPoint(10,10); + p2 += QPoint(10,10); + QTest::touchEvent(vp).move(0, p1).move(1, p2); + + QCOMPARE(root->property("scale").toReal(), 1.0); + + p1 -= QPoint(10,10); + p2 += QPoint(10,10); + QTest::touchEvent(vp).move(0, p1).move(1, p2); + + QCOMPARE(root->property("scale").toReal(), 1.5); + QCOMPARE(root->property("center").toPointF(), QPointF(90, 90)); + QCOMPARE(blackRect->scale(), 1.5); + + // scale beyond bound + p1 -= QPoint(50,50); + p2 += QPoint(50,50); + QTest::touchEvent(vp).move(0, p1).move(1, p2); + + QCOMPARE(blackRect->scale(), 2.0); + + QTest::touchEvent(vp).release(0, p1).release(1, p2); + + delete canvas; +} + +void tst_QDeclarativePinchArea::pan() +{ + QDeclarativeView *canvas = createView(); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pinchproperties.qml")); + canvas->show(); + canvas->setFocus(); + QTest::qWaitForWindowShown(canvas); + QVERIFY(canvas->rootObject() != 0); + qApp->processEvents(); + + QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild("pincharea"); + QDeclarativePinch *pinch = pinchArea->pinch(); + QVERIFY(pinchArea != 0); + QVERIFY(pinch != 0); + + QDeclarativeItem *root = qobject_cast(canvas->rootObject()); + QVERIFY(root != 0); + + // target + QDeclarativeItem *blackRect = canvas->rootObject()->findChild("blackrect"); + QVERIFY(blackRect != 0); + + QWidget *vp = canvas->viewport(); + + QPoint p1(80, 80); + QPoint p2(100, 100); + + QTest::touchEvent(vp).press(0, p1); + QTest::touchEvent(vp).stationary(0).press(1, p2); + p1 += QPoint(10,10); + p2 += QPoint(10,10); + QTest::touchEvent(vp).move(0, p1).move(1, p2); + + QCOMPARE(root->property("scale").toReal(), 1.0); + + p1 += QPoint(10,10); + p2 += QPoint(10,10); + QTest::touchEvent(vp).move(0, p1).move(1, p2); + + QCOMPARE(root->property("center").toPointF(), QPointF(110, 110)); + + QCOMPARE(blackRect->x(), 60.0); + QCOMPARE(blackRect->y(), 60.0); + + // pan x beyond bound + p1 += QPoint(100,100); + p2 += QPoint(100,100); + QTest::touchEvent(vp).move(0, p1).move(1, p2); + + QCOMPARE(blackRect->x(), 140.0); + QCOMPARE(blackRect->y(), 160.0); + + QTest::touchEvent(vp).release(0, p1).release(1, p2); + + delete canvas; +} + +QDeclarativeView *tst_QDeclarativePinchArea::createView() +{ + QDeclarativeView *canvas = new QDeclarativeView(0); + canvas->viewport()->setAttribute(Qt::WA_AcceptTouchEvents); + canvas->setFixedSize(240,320); + + return canvas; +} + +QTEST_MAIN(tst_QDeclarativePinchArea) + +#include "tst_qdeclarativepincharea.moc" -- cgit v0.12 From 031ab2136c632d582a324941798be9e37825d287 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 29 Nov 2010 11:01:46 +1000 Subject: Allow resizing Flickable content about a center point. Useful for zooming via pinch, for example. Task-number: QTBUG-15148 Reviewed-by: Aaron Kennedy --- .../graphicsitems/qdeclarativeflickable.cpp | 54 ++++++++++++++++++++++ .../graphicsitems/qdeclarativeflickable_p.h | 4 ++ .../qdeclarativeflickable/data/resize.qml | 27 +++++++++++ .../tst_qdeclarativeflickable.cpp | 54 ++++++++++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativeflickable/data/resize.qml diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 377f3b5..b13d82b 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1269,6 +1269,60 @@ void QDeclarativeFlickable::setContentHeight(qreal h) d->updateBeginningEnd(); } +/*! + \qmlmethod Flickable::resizeContent(real width, real height, QPointF center) + \preliminary + + Resizes the content to \a width x \a height about \a center. + + \bold {This method was added in QtQuick 1.1.} + + This does not scale the contents of the Flickable - it only resizes the \l contentWidth + and \l contentHeight. + + Resizing the content may result in the content being positioned outside + the bounds of the Flickable. Calling \l returnToBounds() will + move the content back within legal bounds. +*/ +void QDeclarativeFlickable::resizeContent(qreal w, qreal h, QPointF center) +{ + Q_D(QDeclarativeFlickable); + if (w != d->hData.viewSize) { + qreal oldSize = d->hData.viewSize; + setContentWidth(w); + if (center.x() != 0) { + qreal pos = center.x() * w / oldSize; + setContentX(contentX() + pos - center.x()); + } + } + if (h != d->vData.viewSize) { + qreal oldSize = d->vData.viewSize; + setContentHeight(h); + if (center.y() != 0) { + qreal pos = center.y() * h / oldSize; + setContentY(contentY() + pos - center.y()); + } + } +} + +/*! + \qmlmethod Flickable::returnToBounds() + \preliminary + + Ensures the content is within legal bounds. + + \bold {This method was added in QtQuick 1.1.} + + This may be called to ensure that the content is within legal bounds + after manually positioning the content. +*/ +void QDeclarativeFlickable::returnToBounds() +{ + Q_D(QDeclarativeFlickable); + d->fixupX(); + d->fixupY(); +} + qreal QDeclarativeFlickable::vWidth() const { Q_D(const QDeclarativeFlickable); diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h index 6e4d8ed..ece2db7 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable_p.h +++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h @@ -149,6 +149,10 @@ public: FlickableDirection flickableDirection() const; void setFlickableDirection(FlickableDirection); + //XXX Added in QtQuick 1.1 + Q_INVOKABLE void resizeContent(qreal w, qreal h, QPointF center); + Q_INVOKABLE void returnToBounds(); + Q_SIGNALS: void contentWidthChanged(); void contentHeightChanged(); diff --git a/tests/auto/declarative/qdeclarativeflickable/data/resize.qml b/tests/auto/declarative/qdeclarativeflickable/data/resize.qml new file mode 100644 index 0000000..e2abb99 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeflickable/data/resize.qml @@ -0,0 +1,27 @@ +import QtQuick 1.1 + +Rectangle { + function resizeContent() { + flick.resizeContent(600, 600, Qt.point(100, 100)) + } + function returnToBounds() { + flick.returnToBounds() + } + width: 400 + height: 360 + color: "gray" + + Flickable { + id: flick + objectName: "flick" + anchors.fill: parent + contentWidth: 300 + contentHeight: 300 + + Rectangle { + width: flick.contentWidth + height: flick.contentHeight + color: "red" + } + } +} diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp index 25edb36..c1564bc 100644 --- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp +++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp @@ -46,6 +46,7 @@ #include #include #include +#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir @@ -69,6 +70,8 @@ private slots: void pressDelay(); void flickableDirection(); void qgraphicswidget(); + void resizeContent(); + void returnToBounds(); private: QDeclarativeEngine engine; @@ -277,6 +280,57 @@ void tst_qdeclarativeflickable::qgraphicswidget() QVERIFY(widget); } +// QtQuick 1.1 +void tst_qdeclarativeflickable::resizeContent() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/resize.qml")); + QDeclarativeItem *root = qobject_cast(c.create()); + QDeclarativeFlickable *obj = findItem(root, "flick"); + + QVERIFY(obj != 0); + QCOMPARE(obj->contentX(), 0.); + QCOMPARE(obj->contentY(), 0.); + QCOMPARE(obj->contentWidth(), 300.); + QCOMPARE(obj->contentHeight(), 300.); + + QMetaObject::invokeMethod(root, "resizeContent"); + + QCOMPARE(obj->contentX(), 100.); + QCOMPARE(obj->contentY(), 100.); + QCOMPARE(obj->contentWidth(), 600.); + QCOMPARE(obj->contentHeight(), 600.); + + delete root; +} + +// QtQuick 1.1 +void tst_qdeclarativeflickable::returnToBounds() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/resize.qml")); + QDeclarativeItem *root = qobject_cast(c.create()); + QDeclarativeFlickable *obj = findItem(root, "flick"); + + QVERIFY(obj != 0); + QCOMPARE(obj->contentX(), 0.); + QCOMPARE(obj->contentY(), 0.); + QCOMPARE(obj->contentWidth(), 300.); + QCOMPARE(obj->contentHeight(), 300.); + + obj->setContentX(100); + obj->setContentY(400); + QTRY_COMPARE(obj->contentX(), 100.); + QTRY_COMPARE(obj->contentY(), 400.); + + QMetaObject::invokeMethod(root, "returnToBounds"); + + QTRY_COMPARE(obj->contentX(), 0.); + QTRY_COMPARE(obj->contentY(), 0.); + + delete root; +} + template T *tst_qdeclarativeflickable::findItem(QGraphicsObject *parent, const QString &objectName) { -- cgit v0.12 From 6258fc281f5b66b2634b81a2633b117165cea7ef Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 29 Nov 2010 11:03:31 +1000 Subject: Add an example of using PinchArea. Task-number: QTBUG-15491 --- .../touchinteraction/pincharea/flickresize.qml | 50 +++++++++++++++++++++ .../touchinteraction/pincharea/qt-logo.jpg | Bin 0 -> 40886 bytes 2 files changed, 50 insertions(+) create mode 100644 examples/declarative/touchinteraction/pincharea/flickresize.qml create mode 100644 examples/declarative/touchinteraction/pincharea/qt-logo.jpg diff --git a/examples/declarative/touchinteraction/pincharea/flickresize.qml b/examples/declarative/touchinteraction/pincharea/flickresize.qml new file mode 100644 index 0000000..8034e29 --- /dev/null +++ b/examples/declarative/touchinteraction/pincharea/flickresize.qml @@ -0,0 +1,50 @@ +import QtQuick 1.1 + +Rectangle { + width: 640 + height: 360 + color: "gray" + + Flickable { + id: flick + anchors.fill: parent + contentWidth: 500 + contentHeight: 500 + + PinchArea { + width: Math.max(flick.contentWidth, flick.width) + height: Math.max(flick.contentHeight, flick.height) + onPinchChanged: { + // adjust content pos due to drag + flick.contentX += pinch.lastCenter.x - pinch.center.x + flick.contentY += pinch.lastCenter.y - pinch.center.y + + // resize content + var scale = 1.0 + pinch.scale - pinch.lastScale + flick.resizeContent(flick.contentWidth * scale, flick.contentHeight * scale, pinch.center) + } + + onPinchFinished: { + // Move its content within bounds. + flick.returnToBounds() + } + + Rectangle { + width: flick.contentWidth + height: flick.contentHeight + color: "white" + Image { + anchors.fill: parent + source: "qt-logo.jpg" + MouseArea { + anchors.fill: parent + onDoubleClicked: { + flick.contentWidth = 500 + flick.contentHeight = 500 + } + } + } + } + } + } +} diff --git a/examples/declarative/touchinteraction/pincharea/qt-logo.jpg b/examples/declarative/touchinteraction/pincharea/qt-logo.jpg new file mode 100644 index 0000000..4014b46 Binary files /dev/null and b/examples/declarative/touchinteraction/pincharea/qt-logo.jpg differ -- cgit v0.12 From 755f2907ee4bc2b632237409c1d1d77b343aaa2a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 29 Nov 2010 19:57:56 +0100 Subject: Removed unnecessary include, fixed whitespace. --- tools/qdoc3/doc.cpp | 937 ++++++++++++++++++++++++++-------------------------- 1 file changed, 468 insertions(+), 469 deletions(-) diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index be16c59..4152207 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -48,7 +48,6 @@ #include "text.h" #include "tokenizer.h" #include -#include #include #include #include @@ -225,13 +224,13 @@ class DocPrivateExtra QStringMap metaMap; DocPrivateExtra() - : granularity(Doc::Part) { } + : granularity(Doc::Part) { } }; struct Shared // ### get rid of { Shared() - : count(1) { } + : count(1) { } void ref() { ++count; } bool deref() { return (--count == 0); } @@ -301,7 +300,7 @@ void DocPrivate::addAlso(const Text& also) void DocPrivate::constructExtra() { if (extra == 0) - extra = new DocPrivateExtra; + extra = new DocPrivateExtra; } bool DocPrivate::isEnumDocSimplifiable() const @@ -350,7 +349,7 @@ class DocParser private: Location& location(); QString detailsUnknownCommand(const QSet& metaCommandSet, - const QString& str); + const QString& str); void checkExpiry(const QString& date); void insertBaseName(const QString &baseName); void insertTarget(const QString& target, bool keyword); @@ -367,8 +366,8 @@ class DocParser void appendToCode(const QString &code); void startNewPara(); void enterPara(Atom::Type leftType = Atom::ParaLeft, - Atom::Type rightType = Atom::ParaRight, - const QString& string = ""); + Atom::Type rightType = Atom::ParaRight, + const QString& string = ""); void leavePara(); void leaveValue(); void leaveValueList(); @@ -547,7 +546,7 @@ void DocParser::parse(const QString& source, leavePara(); append(Atom::Code, getCode(CMD_CODE, marker)); break; -#ifdef QDOC_QML +#ifdef QDOC_QML case CMD_QML: leavePara(); append(Atom::Qml, getCode(CMD_QML, marker)); @@ -555,7 +554,7 @@ void DocParser::parse(const QString& source, case CMD_QMLTEXT: append(Atom::QmlText); break; -#endif +#endif case CMD_CODELINE: { if (!quoting) { @@ -1465,35 +1464,35 @@ void DocParser::checkExpiry(const QString& date) QRegExp ymd("(\\d{4})(?:-(\\d{2})(?:-(\\d{2})))"); if (ymd.exactMatch(date)) { - int y = ymd.cap(1).toInt(); - int m = ymd.cap(2).toInt(); - int d = ymd.cap(3).toInt(); - - if (m == 0) - m = 1; - if (d == 0) - d = 1; - QDate expiryDate(y, m, d); - if (expiryDate.isValid()) { - int days = expiryDate.daysTo(QDate::currentDate()); - if (days == 0) { - location().warning(tr("Documentation expires today")); - } + int y = ymd.cap(1).toInt(); + int m = ymd.cap(2).toInt(); + int d = ymd.cap(3).toInt(); + + if (m == 0) + m = 1; + if (d == 0) + d = 1; + QDate expiryDate(y, m, d); + if (expiryDate.isValid()) { + int days = expiryDate.daysTo(QDate::currentDate()); + if (days == 0) { + location().warning(tr("Documentation expires today")); + } else if (days == 1) { - location().warning(tr("Documentation expired yesterday")); - } + location().warning(tr("Documentation expired yesterday")); + } else if (days >= 2) { - location().warning(tr("Documentation expired %1 days ago") - .arg(days)); - } - } + location().warning(tr("Documentation expired %1 days ago") + .arg(days)); + } + } else { - location().warning(tr("Date '%1' invalid").arg(date)); - } + location().warning(tr("Date '%1' invalid").arg(date)); + } } else { - location().warning(tr("Date '%1' not in YYYY-MM-DD format") - .arg(date)); + location().warning(tr("Date '%1' not in YYYY-MM-DD format") + .arg(date)); } } @@ -1501,34 +1500,34 @@ void DocParser::insertBaseName(const QString &baseName) { priv->constructExtra(); if (currentSectioningUnit == priv->extra->sectioningUnit) { - priv->extra->baseName = baseName; + priv->extra->baseName = baseName; } else { - Atom *atom = priv->text.firstAtom(); - Atom *sectionLeft = 0; + Atom *atom = priv->text.firstAtom(); + Atom *sectionLeft = 0; - int delta = currentSectioningUnit - priv->extra->sectioningUnit; + int delta = currentSectioningUnit - priv->extra->sectioningUnit; - while (atom != 0) { - if (atom->type() == Atom::SectionLeft && - atom->string().toInt() == delta) - sectionLeft = atom; - atom = atom->next(); - } - if (sectionLeft != 0) - (void) new Atom(sectionLeft, Atom::BaseName, baseName); + while (atom != 0) { + if (atom->type() == Atom::SectionLeft && + atom->string().toInt() == delta) + sectionLeft = atom; + atom = atom->next(); + } + if (sectionLeft != 0) + (void) new Atom(sectionLeft, Atom::BaseName, baseName); } } void DocParser::insertTarget(const QString &target, bool keyword) { if (targetMap.contains(target)) { - location().warning(tr("Duplicate target name '%1'").arg(target)); - targetMap[target].warning(tr("(The previous occurrence is here)")); + location().warning(tr("Duplicate target name '%1'").arg(target)); + targetMap[target].warning(tr("(The previous occurrence is here)")); } else { - targetMap.insert(target, location()); - append(Atom::Target, target); + targetMap.insert(target, location()); + append(Atom::Target, target); priv->constructExtra(); if (keyword) priv->extra->keywords.append(priv->text.lastAtom()); @@ -1540,8 +1539,8 @@ void DocParser::insertTarget(const QString &target, bool keyword) void DocParser::include(const QString& fileName) { if (location().depth() > 16) - location().fatal(tr("Too many nested '\\%1's") - .arg(cmdName(CMD_INCLUDE))); + location().fatal(tr("Too many nested '\\%1's") + .arg(cmdName(CMD_INCLUDE))); QString userFriendlyFilePath; // ### use current directory? @@ -1551,25 +1550,25 @@ void DocParser::include(const QString& fileName) fileName, userFriendlyFilePath); if (filePath.isEmpty()) { - location().warning(tr("Cannot find leaf file '%1'").arg(fileName)); + location().warning(tr("Cannot find leaf file '%1'").arg(fileName)); } else { - QFile inFile(filePath); - if (!inFile.open(QFile::ReadOnly)) { - location().warning(tr("Cannot open leaf file '%1'") - .arg(userFriendlyFilePath)); - } + QFile inFile(filePath); + if (!inFile.open(QFile::ReadOnly)) { + location().warning(tr("Cannot open leaf file '%1'") + .arg(userFriendlyFilePath)); + } else { - location().push(userFriendlyFilePath); + location().push(userFriendlyFilePath); - QTextStream inStream(&inFile); - QString includedStuff = inStream.readAll(); - inFile.close(); + QTextStream inStream(&inFile); + QString includedStuff = inStream.readAll(); + inFile.close(); - in.insert(pos, includedStuff); - len = in.length(); - openedInputs.push(pos + includedStuff.length()); - } + in.insert(pos, includedStuff); + len = in.length(); + openedInputs.push(pos + includedStuff.length()); + } } } @@ -1579,29 +1578,29 @@ void DocParser::startFormat(const QString& format, int cmd) QMap::ConstIterator f = pendingFormats.begin(); while (f != pendingFormats.end()) { - if (*f == format) { - location().warning(tr("Cannot nest '\\%1' commands") - .arg(cmdName(cmd))); - return; - } - ++f; + if (*f == format) { + location().warning(tr("Cannot nest '\\%1' commands") + .arg(cmdName(cmd))); + return; + } + ++f; } append(Atom::FormattingLeft, format); if (isLeftBraceAhead()) { - skipSpacesOrOneEndl(); - pendingFormats.insert(braceDepth, format); - ++braceDepth; - ++pos; + skipSpacesOrOneEndl(); + pendingFormats.insert(braceDepth, format); + ++braceDepth; + ++pos; } else { - append(Atom::String, getArgument()); - append(Atom::FormattingRight, format); - if (format == ATOM_FORMATTING_INDEX && indexStartedPara) { - skipAllSpaces(); - indexStartedPara = false; - } + append(Atom::String, getArgument()); + append(Atom::FormattingRight, format); + if (format == ATOM_FORMATTING_INDEX && indexStartedPara) { + skipAllSpaces(); + indexStartedPara = false; + } } } @@ -1612,37 +1611,37 @@ bool DocParser::openCommand(int cmd) if (cmd != CMD_LINK) { if (outer == CMD_LIST) { - ok = (cmd == CMD_FOOTNOTE || cmd == CMD_LIST); + ok = (cmd == CMD_FOOTNOTE || cmd == CMD_LIST); } else if (outer == CMD_ABSTRACT) { - ok = (cmd == CMD_LIST || + ok = (cmd == CMD_LIST || cmd == CMD_QUOTATION || cmd == CMD_TABLE); } else if (outer == CMD_SIDEBAR) { - ok = (cmd == CMD_LIST || + ok = (cmd == CMD_LIST || cmd == CMD_QUOTATION || cmd == CMD_SIDEBAR); } else if (outer == CMD_QUOTATION) { - ok = (cmd == CMD_LIST); + ok = (cmd == CMD_LIST); } else if (outer == CMD_TABLE) { - ok = (cmd == CMD_LIST || + ok = (cmd == CMD_LIST || cmd == CMD_FOOTNOTE || cmd == CMD_QUOTATION); } else if (outer == CMD_FOOTNOTE || outer == CMD_LINK) { - ok = false; + ok = false; } } if (ok) { - openedCommands.push(cmd); + openedCommands.push(cmd); } else { - location().warning(tr("Cannot use '\\%1' within '\\%2'") - .arg(cmdName(cmd)).arg(cmdName(outer))); + location().warning(tr("Cannot use '\\%1' within '\\%2'") + .arg(cmdName(cmd)).arg(cmdName(outer))); } return ok; } @@ -1650,33 +1649,33 @@ bool DocParser::openCommand(int cmd) bool DocParser::closeCommand(int endCmd) { if (endCmdFor(openedCommands.top()) == endCmd && openedCommands.size() > 1) { - openedCommands.pop(); - return true; + openedCommands.pop(); + return true; } else { - bool contains = false; - QStack opened2 = openedCommands; - while (opened2.size() > 1) { - if (endCmdFor(opened2.top()) == endCmd) { - contains = true; - break; - } - opened2.pop(); - } - - if (contains) { - while (endCmdFor(openedCommands.top()) != endCmd && openedCommands.size() > 1) { - location().warning(tr("Missing '\\%1' before '\\%2'") - .arg(endCmdName(openedCommands.top())) - .arg(cmdName(endCmd))); - openedCommands.pop(); - } - } + bool contains = false; + QStack opened2 = openedCommands; + while (opened2.size() > 1) { + if (endCmdFor(opened2.top()) == endCmd) { + contains = true; + break; + } + opened2.pop(); + } + + if (contains) { + while (endCmdFor(openedCommands.top()) != endCmd && openedCommands.size() > 1) { + location().warning(tr("Missing '\\%1' before '\\%2'") + .arg(endCmdName(openedCommands.top())) + .arg(cmdName(endCmd))); + openedCommands.pop(); + } + } else { - location().warning(tr("Unexpected '\\%1'") - .arg(cmdName(endCmd))); - } - return false; + location().warning(tr("Unexpected '\\%1'") + .arg(cmdName(endCmd))); + } + return false; } } @@ -1685,32 +1684,32 @@ void DocParser::startSection(Doc::SectioningUnit unit, int cmd) leavePara(); if (currentSectioningUnit == Doc::Book) { - currentSectioningUnit = (Doc::SectioningUnit) (unit - 1); - priv->constructExtra(); - priv->extra->sectioningUnit = currentSectioningUnit; + currentSectioningUnit = (Doc::SectioningUnit) (unit - 1); + priv->constructExtra(); + priv->extra->sectioningUnit = currentSectioningUnit; } if (unit <= priv->extra->sectioningUnit) { - location().warning(tr("Unexpected '\\%1' in this documentation") - .arg(cmdName(cmd))); + location().warning(tr("Unexpected '\\%1' in this documentation") + .arg(cmdName(cmd))); } else if (unit - currentSectioningUnit > 1) { - location().warning(tr("Unexpected '\\%1' at this point") - .arg(cmdName(cmd))); + location().warning(tr("Unexpected '\\%1' at this point") + .arg(cmdName(cmd))); } else { - if (currentSectioningUnit >= unit) - endSection(unit, cmd); + if (currentSectioningUnit >= unit) + endSection(unit, cmd); - int delta = unit - priv->extra->sectioningUnit; - append(Atom::SectionLeft, QString::number(delta)); + int delta = unit - priv->extra->sectioningUnit; + append(Atom::SectionLeft, QString::number(delta)); priv->constructExtra(); priv->extra->tableOfContents.append(priv->text.lastAtom()); priv->extra->tableOfContentsLevels.append(unit); - enterPara(Atom::SectionHeadingLeft, + enterPara(Atom::SectionHeadingLeft, Atom::SectionHeadingRight, QString::number(delta)); - currentSectioningUnit = unit; + currentSectioningUnit = unit; } } @@ -1719,20 +1718,20 @@ void DocParser::endSection(int unit, int endCmd) leavePara(); if (unit < priv->extra->sectioningUnit) { - location().warning(tr("Unexpected '\\%1' in this documentation") - .arg(cmdName(endCmd))); + location().warning(tr("Unexpected '\\%1' in this documentation") + .arg(cmdName(endCmd))); } else if (unit > currentSectioningUnit) { - location().warning(tr("Unexpected '\\%1' at this point") - .arg(cmdName(endCmd))); + location().warning(tr("Unexpected '\\%1' at this point") + .arg(cmdName(endCmd))); } else { - while (currentSectioningUnit >= unit) { - int delta = currentSectioningUnit - priv->extra->sectioningUnit; - append(Atom::SectionRight, QString::number(delta)); - currentSectioningUnit = - (Doc::SectioningUnit) (currentSectioningUnit - 1); - } + while (currentSectioningUnit >= unit) { + int delta = currentSectioningUnit - priv->extra->sectioningUnit; + append(Atom::SectionRight, QString::number(delta)); + currentSectioningUnit = + (Doc::SectioningUnit) (currentSectioningUnit - 1); + } } } @@ -1821,10 +1820,10 @@ void DocParser::appendChar(QChar ch) void DocParser::appendWord(const QString &word) { if (priv->text.lastAtom()->type() != Atom::String) { - append(Atom::String, word); + append(Atom::String, word); } else - priv->text.lastAtom()->appendString(word); + priv->text.lastAtom()->appendString(word); } void DocParser::appendToCode(const QString& markedCode) @@ -1832,10 +1831,10 @@ void DocParser::appendToCode(const QString& markedCode) Atom::Type lastType = priv->text.lastAtom()->type(); #ifdef QDOC_QML if (lastType != Atom::Qml) - append(Atom::Qml); + append(Atom::Qml); #else if (lastType != Atom::Code) - append(Atom::Code); + append(Atom::Code); #endif priv->text.lastAtom()->appendString(markedCode); } @@ -1853,44 +1852,44 @@ void DocParser::enterPara(Atom::Type leftType, if (paraState == OutsidePara) { if (priv->text.lastAtom()->type() != Atom::ListItemLeft) leaveValueList(); - append(leftType, string); - indexStartedPara = false; - pendingParaLeftType = leftType; - pendingParaRightType = rightType; - pendingParaString = string; - if ( - leftType == Atom::SectionHeadingLeft) { - paraState = InsideSingleLinePara; - } + append(leftType, string); + indexStartedPara = false; + pendingParaLeftType = leftType; + pendingParaRightType = rightType; + pendingParaString = string; + if ( + leftType == Atom::SectionHeadingLeft) { + paraState = InsideSingleLinePara; + } else { - paraState = InsideMultiLinePara; - } - skipSpacesOrOneEndl(); + paraState = InsideMultiLinePara; + } + skipSpacesOrOneEndl(); } } void DocParser::leavePara() { if (paraState != OutsidePara) { - if (!pendingFormats.isEmpty()) { - location().warning(tr("Missing '}'")); - pendingFormats.clear(); - } - - if (priv->text.lastAtom()->type() == pendingParaLeftType) { - priv->text.stripLastAtom(); - } + if (!pendingFormats.isEmpty()) { + location().warning(tr("Missing '}'")); + pendingFormats.clear(); + } + + if (priv->text.lastAtom()->type() == pendingParaLeftType) { + priv->text.stripLastAtom(); + } else { - if (priv->text.lastAtom()->type() == Atom::String && - priv->text.lastAtom()->string().endsWith(" ")) { - priv->text.lastAtom()->chopString(); - } - append(pendingParaRightType, pendingParaString); - } - paraState = OutsidePara; - indexStartedPara = false; - pendingParaRightType = Atom::Nop; - pendingParaString = ""; + if (priv->text.lastAtom()->type() == Atom::String && + priv->text.lastAtom()->string().endsWith(" ")) { + priv->text.lastAtom()->chopString(); + } + append(pendingParaRightType, pendingParaString); + } + paraState = OutsidePara; + indexStartedPara = false; + pendingParaRightType = Atom::Nop; + pendingParaString = ""; } } @@ -1898,13 +1897,13 @@ void DocParser::leaveValue() { leavePara(); if (openedLists.isEmpty()) { - openedLists.push(OpenedList(OpenedList::Value)); - append(Atom::ListLeft, ATOM_LIST_VALUE); + openedLists.push(OpenedList(OpenedList::Value)); + append(Atom::ListLeft, ATOM_LIST_VALUE); } else { if (priv->text.lastAtom()->type() == Atom::Nop) priv->text.stripLastAtom(); - append(Atom::ListItemRight, ATOM_LIST_VALUE); + append(Atom::ListItemRight, ATOM_LIST_VALUE); } } @@ -1915,9 +1914,9 @@ void DocParser::leaveValueList() (openedLists.top().style() == OpenedList::Value)) { if (priv->text.lastAtom()->type() == Atom::Nop) priv->text.stripLastAtom(); - append(Atom::ListItemRight, ATOM_LIST_VALUE); - append(Atom::ListRight, ATOM_LIST_VALUE); - openedLists.pop(); + append(Atom::ListItemRight, ATOM_LIST_VALUE); + append(Atom::ListRight, ATOM_LIST_VALUE); + openedLists.pop(); } } @@ -1948,43 +1947,43 @@ void DocParser::expandMacro(const QString &name, int numParams) { if (numParams == 0) { - append(Atom::RawString, def); + append(Atom::RawString, def); } else { - QStringList args; - QString rawString; + QStringList args; + QString rawString; - for (int i = 0; i < numParams; i++) { - if (numParams == 1 || isLeftBraceAhead()) { - args << getArgument(true); - } + for (int i = 0; i < numParams; i++) { + if (numParams == 1 || isLeftBraceAhead()) { + args << getArgument(true); + } else { - location().warning(tr("Macro '\\%1' invoked with too few" - " arguments (expected %2, got %3)") - .arg(name).arg(numParams).arg(i)); - break; - } - } - - int j = 0; - while (j < def.size()) { - int paramNo; - if ((def[j] == '\\') && (j < def.size() - 1) && + location().warning(tr("Macro '\\%1' invoked with too few" + " arguments (expected %2, got %3)") + .arg(name).arg(numParams).arg(i)); + break; + } + } + + int j = 0; + while (j < def.size()) { + int paramNo; + if ((def[j] == '\\') && (j < def.size() - 1) && ((paramNo = def[j + 1].digitValue()) >= 1) && (paramNo <= numParams)) { - if (!rawString.isEmpty()) { - append(Atom::RawString, rawString); - rawString = ""; - } - append(Atom::String, args[paramNo - 1]); - j += 2; - } + if (!rawString.isEmpty()) { + append(Atom::RawString, rawString); + rawString = ""; + } + append(Atom::String, args[paramNo - 1]); + j += 2; + } else { - rawString += def[j++]; - } - } - if (!rawString.isEmpty()) - append(Atom::RawString, rawString); + rawString += def[j++]; + } + } + if (!rawString.isEmpty()) + append(Atom::RawString, rawString); } } @@ -1993,29 +1992,29 @@ Doc::SectioningUnit DocParser::getSectioningUnit() QString name = getOptionalArgument(); if (name == "part") { - return Doc::Part; + return Doc::Part; } else if (name == "chapter") { - return Doc::Chapter; + return Doc::Chapter; } else if (name == "section1") { - return Doc::Section1; + return Doc::Section1; } else if (name == "section2") { - return Doc::Section2; + return Doc::Section2; } else if (name == "section3") { - return Doc::Section3; + return Doc::Section3; } else if (name == "section4") { - return Doc::Section4; + return Doc::Section4; } else if (name.isEmpty()) { - return Doc::Section4; + return Doc::Section4; } else { - location().warning(tr("Invalid sectioning unit '%1'").arg(name)); - return Doc::Book; + location().warning(tr("Invalid sectioning unit '%1'").arg(name)); + return Doc::Book; } } @@ -2032,115 +2031,115 @@ QString DocParser::getArgument(bool verbatim) Typically, an argument ends at the next white-space. However, braces can be used to group words: - {a few words} + {a few words} Also, opening and closing parentheses have to match. Thus, - printf("%d\n", x) + printf("%d\n", x) is an argument too, although it contains spaces. Finally, trailing punctuation is not included in an argument, nor is 's. */ if (pos < (int) in.length() && in[pos] == '{') { - pos++; - while (pos < (int) in.length() && delimDepth >= 0) { - switch (in[pos].unicode()) { - case '{': - delimDepth++; - arg += "{"; - pos++; - break; - case '}': - delimDepth--; - if (delimDepth >= 0) - arg += "}"; - pos++; - break; - case '\\': - if (verbatim) { - arg += in[pos]; - pos++; - } + pos++; + while (pos < (int) in.length() && delimDepth >= 0) { + switch (in[pos].unicode()) { + case '{': + delimDepth++; + arg += "{"; + pos++; + break; + case '}': + delimDepth--; + if (delimDepth >= 0) + arg += "}"; + pos++; + break; + case '\\': + if (verbatim) { + arg += in[pos]; + pos++; + } else { - pos++; - if (pos < (int) in.length()) { - if (in[pos].isLetterOrNumber()) - break; - arg += in[pos]; - if (in[pos].isSpace()) { - skipAllSpaces(); - } + pos++; + if (pos < (int) in.length()) { + if (in[pos].isLetterOrNumber()) + break; + arg += in[pos]; + if (in[pos].isSpace()) { + skipAllSpaces(); + } else { - pos++; - } - } - } - break; - default: - arg += in[pos]; - pos++; - } - } - if (delimDepth > 0) - location().warning(tr("Missing '}'")); + pos++; + } + } + } + break; + default: + arg += in[pos]; + pos++; + } + } + if (delimDepth > 0) + location().warning(tr("Missing '}'")); } else { - while (pos < in.length() && + while (pos < in.length() && ((delimDepth > 0) || ((delimDepth == 0) && !in[pos].isSpace()))) { - switch (in[pos].unicode()) { - case '(': - case '[': - case '{': - delimDepth++; - arg += in[pos]; - pos++; - break; - case ')': - case ']': - case '}': - delimDepth--; - if (pos == startPos || delimDepth >= 0) { - arg += in[pos]; - pos++; - } - break; - case '\\': - if (verbatim) { - arg += in[pos]; - pos++; - } + switch (in[pos].unicode()) { + case '(': + case '[': + case '{': + delimDepth++; + arg += in[pos]; + pos++; + break; + case ')': + case ']': + case '}': + delimDepth--; + if (pos == startPos || delimDepth >= 0) { + arg += in[pos]; + pos++; + } + break; + case '\\': + if (verbatim) { + arg += in[pos]; + pos++; + } else { - pos++; - if (pos < (int) in.length()) { - if (in[pos].isLetterOrNumber()) - break; - arg += in[pos]; - if (in[pos].isSpace()) { - skipAllSpaces(); - } + pos++; + if (pos < (int) in.length()) { + if (in[pos].isLetterOrNumber()) + break; + arg += in[pos]; + if (in[pos].isSpace()) { + skipAllSpaces(); + } else { - pos++; - } - } - } - break; - default: - arg += in[pos]; - pos++; - } - } - if ((arg.length() > 1) && + pos++; + } + } + } + break; + default: + arg += in[pos]; + pos++; + } + } + if ((arg.length() > 1) && (QString(".,:;!?").indexOf(in[pos - 1]) != -1) && !arg.endsWith("...")) { - arg.truncate(arg.length() - 1); - pos--; - } - if (arg.length() > 2 && in.mid(pos - 2, 2) == "'s") { - arg.truncate(arg.length() - 2); - pos -= 2; - } + arg.truncate(arg.length() - 1); + pos--; + } + if (arg.length() > 2 && in.mid(pos - 2, 2) == "'s") { + arg.truncate(arg.length() - 2); + pos -= 2; + } } return arg.simplified(); } @@ -2149,11 +2148,11 @@ QString DocParser::getOptionalArgument() { skipSpacesOrOneEndl(); if (pos + 1 < (int) in.length() && in[pos] == '\\' && - in[pos + 1].isLetterOrNumber()) { - return ""; + in[pos + 1].isLetterOrNumber()) { + return ""; } else { - return getArgument(); + return getArgument(); } } @@ -2216,7 +2215,7 @@ QString DocParser::getMetaCommandArgument(const QString &cmdStr) else if (in.at(pos) == ')') --parenDepth; - ++pos; + ++pos; } if (pos == in.size() && parenDepth > 0) { pos = begin; @@ -2236,12 +2235,12 @@ QString DocParser::getUntilEnd(int cmd) int end = rx.indexIn(in, pos); if (end == -1) { - location().warning(tr("Missing '\\%1'").arg(cmdName(endCmd))); - pos = in.length(); + location().warning(tr("Missing '\\%1'").arg(cmdName(endCmd))); + pos = in.length(); } else { - t = in.mid(pos, end - pos); - pos = end + rx.matchedLength(); + t = in.mid(pos, end - pos); + pos = end + rx.matchedLength(); } return t; } @@ -2271,9 +2270,9 @@ bool DocParser::isBlankLine() int i = pos; while (i < len && in[i].isSpace()) { - if (in[i] == '\n') - return true; - i++; + if (in[i] == '\n') + return true; + i++; } return false; } @@ -2284,10 +2283,10 @@ bool DocParser::isLeftBraceAhead() int i = pos; while (i < len && in[i].isSpace() && numEndl < 2) { - // ### bug with '\\' - if (in[i] == '\n') - numEndl++; - i++; + // ### bug with '\\' + if (in[i] == '\n') + numEndl++; + i++; } return numEndl < 2 && i < len && in[i] == '{'; } @@ -2297,31 +2296,31 @@ void DocParser::skipSpacesOnLine() while ((pos < in.length()) && in[pos].isSpace() && (in[pos].unicode() != '\n')) - ++pos; + ++pos; } void DocParser::skipSpacesOrOneEndl() { int firstEndl = -1; while (pos < (int) in.length() && in[pos].isSpace()) { - QChar ch = in[pos]; - if (ch == '\n') { - if (firstEndl == -1) { - firstEndl = pos; - } + QChar ch = in[pos]; + if (ch == '\n') { + if (firstEndl == -1) { + firstEndl = pos; + } else { - pos = firstEndl; - break; - } - } - pos++; + pos = firstEndl; + break; + } + } + pos++; } } void DocParser::skipAllSpaces() { while (pos < len && in[pos].isSpace()) - pos++; + pos++; } void DocParser::skipToNextPreprocessorCommand() @@ -2332,62 +2331,62 @@ void DocParser::skipToNextPreprocessorCommand() int end = rx.indexIn(in, pos + 1); // ### + 1 necessary? if (end == -1) - pos = in.length(); + pos = in.length(); else - pos = end; + pos = end; } int DocParser::endCmdFor(int cmd) { switch (cmd) { case CMD_ABSTRACT: - return CMD_ENDABSTRACT; + return CMD_ENDABSTRACT; case CMD_BADCODE: - return CMD_ENDCODE; + return CMD_ENDCODE; case CMD_CHAPTER: - return CMD_ENDCHAPTER; + return CMD_ENDCHAPTER; case CMD_CODE: - return CMD_ENDCODE; + return CMD_ENDCODE; #ifdef QDOC_QML case CMD_QML: - return CMD_ENDQML; + return CMD_ENDQML; case CMD_QMLTEXT: - return CMD_ENDQMLTEXT; + return CMD_ENDQMLTEXT; #endif case CMD_FOOTNOTE: - return CMD_ENDFOOTNOTE; + return CMD_ENDFOOTNOTE; case CMD_LEGALESE: return CMD_ENDLEGALESE; case CMD_LINK: return CMD_ENDLINK; case CMD_LIST: - return CMD_ENDLIST; + return CMD_ENDLIST; case CMD_NEWCODE: return CMD_ENDCODE; case CMD_OLDCODE: return CMD_NEWCODE; case CMD_OMIT: - return CMD_ENDOMIT; + return CMD_ENDOMIT; case CMD_PART: - return CMD_ENDPART; + return CMD_ENDPART; case CMD_QUOTATION: - return CMD_ENDQUOTATION; + return CMD_ENDQUOTATION; case CMD_RAW: return CMD_ENDRAW; case CMD_SECTION1: - return CMD_ENDSECTION1; + return CMD_ENDSECTION1; case CMD_SECTION2: - return CMD_ENDSECTION2; + return CMD_ENDSECTION2; case CMD_SECTION3: - return CMD_ENDSECTION3; + return CMD_ENDSECTION3; case CMD_SECTION4: - return CMD_ENDSECTION4; + return CMD_ENDSECTION4; case CMD_SIDEBAR: - return CMD_ENDSIDEBAR; + return CMD_ENDSIDEBAR; case CMD_TABLE: - return CMD_ENDTABLE; + return CMD_ENDTABLE; default: - return cmd; + return cmd; } } @@ -2441,14 +2440,14 @@ int DocParser::indentLevel(const QString& str) int column = 0; for (int i = 0; i < (int) str.length(); i++) { - if (str[i] == '\n') { - column = 0; - } + if (str[i] == '\n') { + column = 0; + } else { - if (str[i] != ' ' && column < minIndent) - minIndent = column; - column++; - } + if (str[i] != ' ' && column < minIndent) + minIndent = column; + column++; + } } return minIndent; } @@ -2456,21 +2455,21 @@ int DocParser::indentLevel(const QString& str) QString DocParser::unindent(int level, const QString& str) { if (level == 0) - return str; + return str; QString t; int column = 0; for (int i = 0; i < (int) str.length(); i++) { if (str[i] == QLatin1Char('\n')) { - t += '\n'; - column = 0; - } + t += '\n'; + column = 0; + } else { - if (column >= level) - t += str[i]; - column++; - } + if (column >= level) + t += str[i]; + column++; + } } return t; } @@ -2508,15 +2507,15 @@ Doc::Doc(const Doc& doc) Doc::~Doc() { if (priv && priv->deref()) - delete priv; + delete priv; } Doc &Doc::operator=(const Doc& doc) { if (doc.priv) - doc.priv->ref(); + doc.priv->ref(); if (priv && priv->deref()) - delete priv; + delete priv; priv = doc.priv; return *this; } @@ -2683,18 +2682,18 @@ Text Doc::trimmedBriefText(const QString &className) const whats = w.join(" "); if (whats.endsWith(".")) - whats.truncate(whats.length() - 1); + whats.truncate(whats.length() - 1); if (whats.isEmpty()) { - location().warning( + location().warning( tr("Nonstandard wording in '\\%1' text for '%2' (expected more text)") .arg(COMMAND_BRIEF).arg(className)); - standardWording = false; + standardWording = false; } else - whats[0] = whats[0].toUpper(); + whats[0] = whats[0].toUpper(); - // ### move this once \brief is abolished for properties + // ### move this once \brief is abolished for properties if (standardWording) resultText << whats; } @@ -2704,29 +2703,29 @@ Text Doc::trimmedBriefText(const QString &className) const Text Doc::legaleseText() const { if (priv == 0 || !priv->hasLegalese) - return Text(); + return Text(); else - return body().subText(Atom::LegaleseLeft, Atom::LegaleseRight); + return body().subText(Atom::LegaleseLeft, Atom::LegaleseRight); } const QString& Doc::baseName() const { static QString null; if (priv == 0 || priv->extra == 0) { - return null; + return null; } else { - return priv->extra->baseName; + return priv->extra->baseName; } } Doc::SectioningUnit Doc::granularity() const { if (priv == 0 || priv->extra == 0) { - return DocPrivateExtra().granularity; + return DocPrivateExtra().granularity; } else { - return priv->extra->granularity; + return priv->extra->granularity; } } @@ -2822,80 +2821,80 @@ void Doc::initialize(const Config& config) QSet commands = config.subVars(CONFIG_ALIAS); QSet::ConstIterator c = commands.begin(); while (c != commands.end()) { - QString alias = config.getString(CONFIG_ALIAS + Config::dot + *c); - if (reverseAliasMap.contains(alias)) { - config.lastLocation().warning(tr("Command name '\\%1' cannot stand" - " for both '\\%2' and '\\%3'") - .arg(alias) - .arg(reverseAliasMap[alias]) - .arg(*c)); - } + QString alias = config.getString(CONFIG_ALIAS + Config::dot + *c); + if (reverseAliasMap.contains(alias)) { + config.lastLocation().warning(tr("Command name '\\%1' cannot stand" + " for both '\\%2' and '\\%3'") + .arg(alias) + .arg(reverseAliasMap[alias]) + .arg(*c)); + } else { - reverseAliasMap.insert(alias, *c); - } - aliasMap()->insert(*c, alias); - ++c; + reverseAliasMap.insert(alias, *c); + } + aliasMap()->insert(*c, alias); + ++c; } int i = 0; while (cmds[i].english) { - cmds[i].alias = new QString(alias(cmds[i].english)); - cmdHash()->insert(*cmds[i].alias, cmds[i].no); + cmds[i].alias = new QString(alias(cmds[i].english)); + cmdHash()->insert(*cmds[i].alias, cmds[i].no); - if (cmds[i].no != i) - Location::internalError(tr("command %1 missing").arg(i)); - i++; + if (cmds[i].no != i) + Location::internalError(tr("command %1 missing").arg(i)); + i++; } QSet macroNames = config.subVars(CONFIG_MACRO); QSet::ConstIterator n = macroNames.begin(); while (n != macroNames.end()) { - QString macroDotName = CONFIG_MACRO + Config::dot + *n; - Macro macro; - macro.numParams = -1; - macro.defaultDef = config.getString(macroDotName); - if (!macro.defaultDef.isEmpty()) { - macro.defaultDefLocation = config.lastLocation(); - macro.numParams = Config::numParams(macro.defaultDef); - } - bool silent = false; - - QSet formats = config.subVars(macroDotName); - QSet::ConstIterator f = formats.begin(); - while (f != formats.end()) { - QString def = config.getString(macroDotName + Config::dot + *f); - if (!def.isEmpty()) { - macro.otherDefs.insert(*f, def); - int m = Config::numParams(macro.defaultDef); - if (macro.numParams == -1) { - macro.numParams = m; - } + QString macroDotName = CONFIG_MACRO + Config::dot + *n; + Macro macro; + macro.numParams = -1; + macro.defaultDef = config.getString(macroDotName); + if (!macro.defaultDef.isEmpty()) { + macro.defaultDefLocation = config.lastLocation(); + macro.numParams = Config::numParams(macro.defaultDef); + } + bool silent = false; + + QSet formats = config.subVars(macroDotName); + QSet::ConstIterator f = formats.begin(); + while (f != formats.end()) { + QString def = config.getString(macroDotName + Config::dot + *f); + if (!def.isEmpty()) { + macro.otherDefs.insert(*f, def); + int m = Config::numParams(macro.defaultDef); + if (macro.numParams == -1) { + macro.numParams = m; + } else if (macro.numParams != m) { - if (!silent) { - QString other = tr("default"); - if (macro.defaultDef.isEmpty()) - other = macro.otherDefs.begin().key(); - config.lastLocation().warning(tr("Macro '\\%1' takes" - " inconsistent number" - " of arguments (%2" - " %3, %4 %5)") - .arg(*n) - .arg(*f) - .arg(m) - .arg(other) - .arg(macro.numParams)); - silent = true; - } - if (macro.numParams < m) - macro.numParams = m; - } - } - ++f; - } - - if (macro.numParams != -1) - macroHash()->insert(*n, macro); - ++n; + if (!silent) { + QString other = tr("default"); + if (macro.defaultDef.isEmpty()) + other = macro.otherDefs.begin().key(); + config.lastLocation().warning(tr("Macro '\\%1' takes" + " inconsistent number" + " of arguments (%2" + " %3, %4 %5)") + .arg(*n) + .arg(*f) + .arg(m) + .arg(other) + .arg(macro.numParams)); + silent = true; + } + if (macro.numParams < m) + macro.numParams = m; + } + } + ++f; + } + + if (macro.numParams != -1) + macroHash()->insert(*n, macro); + ++n; } } @@ -2935,27 +2934,27 @@ void Doc::trimCStyleComment(Location& location, QString& str) int i; for (i = 0; i < (int) str.length(); i++) { - if (m.columnNo() == asterColumn) { - if (str[i] != '*') - break; - cleaned += ' '; - metAsterColumn = true; - } + if (m.columnNo() == asterColumn) { + if (str[i] != '*') + break; + cleaned += ' '; + metAsterColumn = true; + } else { - if (str[i] == '\n') { - if (!metAsterColumn) - break; - metAsterColumn = false; - } - cleaned += str[i]; - } - m.advance(str[i]); + if (str[i] == '\n') { + if (!metAsterColumn) + break; + metAsterColumn = false; + } + cleaned += str[i]; + } + m.advance(str[i]); } if (cleaned.length() == str.length()) - str = cleaned; + str = cleaned; for (int i = 0; i < 3; i++) - location.advance(str[i]); + location.advance(str[i]); str = str.mid(3, str.length() - 5); } @@ -2971,19 +2970,19 @@ CodeMarker *Doc::quoteFromFile(const Location &location, QString filePath = Config::findFile(location, DocParser::exampleFiles, DocParser::exampleDirs, - fileName, userFriendlyFilePath); + fileName, userFriendlyFilePath); if (filePath.isEmpty()) { - location.warning(tr("Cannot find example file '%1'").arg(fileName)); + location.warning(tr("Cannot find example file '%1'").arg(fileName)); } else { - QFile inFile(filePath); - if (!inFile.open(QFile::ReadOnly)) { - location.warning(tr("Cannot open example file '%1'").arg(userFriendlyFilePath)); - } + QFile inFile(filePath); + if (!inFile.open(QFile::ReadOnly)) { + location.warning(tr("Cannot open example file '%1'").arg(userFriendlyFilePath)); + } else { - QTextStream inStream(&inFile); - code = DocParser::untabifyEtc(inStream.readAll()); - } + QTextStream inStream(&inFile); + code = DocParser::untabifyEtc(inStream.readAll()); + } } QString dirPath = QFileInfo(filePath).path(); -- cgit v0.12 From 04e6c74420ba808a3bd9ae502ff12c60cc6b58f8 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 29 Nov 2010 19:58:43 +0100 Subject: Added more span classes to make the QML output more colorful. --- tools/qdoc3/htmlgenerator.cpp | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 9f5f182..b4e9d2a 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -89,7 +89,7 @@ static bool showBrokenLinks = false; static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*()"); static QRegExp funcTag("(<@func target=\"([^\"]*)\">)(.*)()"); static QRegExp typeTag("(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)()"); -static QRegExp spanTag(""); +static QRegExp spanTag(""); static QRegExp unknownTag("]*>"); bool parseArg(const QString &src, @@ -216,8 +216,8 @@ HtmlGenerator::HtmlGenerator() numTableRows(0), threeColumnEnumValueTable(true), funcLeftParen("\\S(\\()"), - myTree(0), inObsoleteLink(false), + myTree(0), slow(false), obsoleteLinks(false) { @@ -1476,7 +1476,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) return; } #endif - + sections = marker->sections(fake, CodeMarker::Summary, CodeMarker::Okay); s = sections.begin(); while (s != sections.end()) { @@ -2846,23 +2846,40 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, // "<@preprocessor>" -> ""; // "<@string>" -> ""; // "<@char>" -> ""; - // "" -> "" + // "<@number>" -> ""; + // "<@op>" -> ""; + // "<@type>" -> ""; + // "<@name>" -> ""; + // "<@keyword>" -> ""; + // "" -> "" src = html; html = QString(); static const QString spanTags[] = { - "<@comment>", "", - "<@preprocessor>", "", - "<@string>", "", - "<@char>", "", - "", "", - "","", - "", "", - "", "" + "<@comment>", "", + "<@preprocessor>", "", + "<@string>", "", + "<@char>", "", + "<@number>", "", + "<@op>", "", + "<@type>", "", + "<@name>", "", + "<@keyword>", "", + "", "", + "", "", + "", "", + "", "", + "", "", + "", "", + "", "", + "", "", + "", "", }; + // Update the upper bound of k in the following code to match the length + // of the above array. for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle) { bool handled = false; - for (int k = 0; k != 8; ++k) { + for (int k = 0; k != 18; ++k) { const QString & tag = spanTags[2 * k]; if (tag == QStringRef(&src, i, tag.length())) { html += spanTags[2 * k + 1]; -- cgit v0.12 From 7072882e6873782f258fa3f7d2acee801226d8c0 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 29 Nov 2010 19:59:45 +0100 Subject: Fixed grammar. --- tools/qdoc3/test/qt-html-templates-online.qdocconf | 2 +- tools/qdoc3/test/qt-html-templates.qdocconf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/test/qt-html-templates-online.qdocconf b/tools/qdoc3/test/qt-html-templates-online.qdocconf index 7ed8c90..1d55cee 100644 --- a/tools/qdoc3/test/qt-html-templates-online.qdocconf +++ b/tools/qdoc3/test/qt-html-templates-online.qdocconf @@ -126,7 +126,7 @@ HTML.postheader = \ "
    \n" \ "
      \n" \ "
    • Home
    • \n" \ - " \n" + " \n" HTML.postpostheader = \ "
    \n" \ diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index bbd1b21..67ce95a 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -13,7 +13,7 @@ HTML.postheader = \ "
    \n" \ "
      \n" \ "
    • Home
    • \n" \ - " \n" + " \n" HTML.postpostheader = \ "
    \n" \ -- cgit v0.12 From 361fa33371a855e82b63b4d45b2ffe36fed82867 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 29 Nov 2010 20:00:26 +0100 Subject: Made further refinements to the node traversal and comment handling. --- tools/qdoc3/qmlmarkupvisitor.cpp | 285 ++++++++++++++++++++++++--------------- tools/qdoc3/qmlmarkupvisitor.h | 10 +- 2 files changed, 186 insertions(+), 109 deletions(-) diff --git a/tools/qdoc3/qmlmarkupvisitor.cpp b/tools/qdoc3/qmlmarkupvisitor.cpp index 72a2334..4564dc5 100644 --- a/tools/qdoc3/qmlmarkupvisitor.cpp +++ b/tools/qdoc3/qmlmarkupvisitor.cpp @@ -40,7 +40,6 @@ ****************************************************************************/ #include -#include #include #include #include "private/qdeclarativejsast_p.h" @@ -51,42 +50,116 @@ QT_BEGIN_NAMESPACE -QmlMarkupVisitor::QmlMarkupVisitor(const QString &source, bool debug) +QmlMarkupVisitor::QmlMarkupVisitor(const QString &source, QDeclarativeJS::Engine *engine) { this->source = source; + this->engine = engine; indent = 0; cursor = 0; - showDebug = debug; + commentIndex = 0; + debug += QString("Comments %1\n").arg(engine->comments().length()); } QmlMarkupVisitor::~QmlMarkupVisitor() { } +// The protect() function is a copy of the one from CppCodeMarker. + +static const QString samp = QLatin1String("&"); +static const QString slt = QLatin1String("<"); +static const QString sgt = QLatin1String(">"); +static const QString squot = QLatin1String("""); + +QString QmlMarkupVisitor::protect(const QString& str) +{ + int n = str.length(); + QString marked; + marked.reserve(n * 2 + 30); + const QChar *data = str.constData(); + for (int i = 0; i != n; ++i) { + switch (data[i].unicode()) { + case '&': marked += samp; break; + case '<': marked += slt; break; + case '>': marked += sgt; break; + case '"': marked += squot; break; + default : marked += data[i]; + } + } + return marked; +} + QString QmlMarkupVisitor::markedUpCode() { if (cursor < source.length()) - return output + source.mid(cursor); - else - return output; + addExtra(cursor, source.length()); + + //qDebug() << debug; + qDebug() << output; + return output; } -void QmlMarkupVisitor::addMarkedUpToken( - QDeclarativeJS::AST::SourceLocation &location, const QString &text) +void QmlMarkupVisitor::addExtra(quint32 start, quint32 finish) { - //qDebug() << "t**" << cursor << location.offset; - if (location.offset > cursor) { - QString extra = source.mid(cursor, location.offset - cursor); + if (commentIndex >= engine->comments().length()) { + QString extra = source.mid(start, finish - start); if (extra.trimmed().isEmpty()) output += extra; else - output += "<<<" + extra + ">>>"; - //qDebug() << "+++" << source.mid(cursor, location.offset - cursor); - cursor += location.offset; + output += protect(extra); // text that should probably have been caught by the parser + + cursor = finish; + return; } - //qDebug() << "-->" << text; - output += text; + while (commentIndex < engine->comments().length()) { + if (engine->comments()[commentIndex].offset - 2 >= start) + break; + commentIndex++; + } + + quint32 i = start; + while (i < finish && commentIndex < engine->comments().length()) { + quint32 j = engine->comments()[commentIndex].offset - 2; + if (i <= j && j < finish) { + if (i < j) + output += protect(source.mid(i, j - i)); + + quint32 l = engine->comments()[commentIndex].length; + if (source.mid(j, 2) == QLatin1String("/*")) + l += 4; + else + l += 2; + output += QLatin1String("<@comment>"); + output += protect(source.mid(j, l)); + output += QLatin1String(""); + commentIndex++; + i = j + l; + } else + break; + } + + QString extra = source.mid(i, finish - i); + if (extra.trimmed().isEmpty()) + output += extra; + else + output += protect(extra); // text that should probably have been caught by the parser + + cursor = finish; +} + +void QmlMarkupVisitor::addMarkedUpToken( + QDeclarativeJS::AST::SourceLocation &location, const QString &tagName) +{ + if (!location.isValid()) + return; + + if (cursor < location.offset) + addExtra(cursor, location.offset); + else if (cursor > location.offset) + debug += QString("%1 %2\n").arg(cursor).arg(location.offset); + + output += QString(QLatin1String("<@%1>%2")).arg(tagName, protect(sourceText(location)), tagName); cursor += location.length; } @@ -98,36 +171,31 @@ QString QmlMarkupVisitor::sourceText(QDeclarativeJS::AST::SourceLocation &locati void QmlMarkupVisitor::addVerbatim(QDeclarativeJS::AST::SourceLocation first, QDeclarativeJS::AST::SourceLocation last) { + if (!first.isValid()) + return; + quint32 start = first.begin(); - //qDebug() << "v**" << cursor << start; quint32 finish; if (last.isValid()) finish = last.end(); else finish = first.end(); - if (start > cursor) { - QString extra = source.mid(cursor, start - cursor); - if (extra.trimmed().isEmpty()) - output += extra; - else - output += "<<<" + extra + ">>>"; - //qDebug() << "+++" << source.mid(cursor, start - cursor); - cursor = start; - } + if (cursor < start) + addExtra(cursor, start); + else if (cursor > start) + debug += QString("%1 %2 %3 x\n").arg(sourceText(first)).arg(cursor).arg(start); QString text = source.mid(start, finish - start); - //qDebug() << "-->" << text; write(text); indent -= 1; - output += text; - cursor += text.length(); + output += protect(text); + cursor = finish; } void QmlMarkupVisitor::write(const QString &text) { - if (showDebug) - qDebug() << QString().fill(QChar(' '), indent) << text; + debug += QString().fill(QChar(' '), indent) + text + QLatin1String("\n"); indent += 1; } @@ -152,8 +220,8 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImport *uiimport) write(""); addVerbatim(uiimport->importToken); if (!uiimport->importUri) - addVerbatim(uiimport->fileNameToken); - return true; + addMarkedUpToken(uiimport->fileNameToken, QLatin1String("headerfile")); + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiImport *uiimport) @@ -161,7 +229,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiImport *uiimport) endWrite(""); addVerbatim(uiimport->versionToken); addVerbatim(uiimport->asToken); - addVerbatim(uiimport->importIdToken); + addMarkedUpToken(uiimport->importIdToken, QLatin1String("headerfile")); addVerbatim(uiimport->semicolonToken); //endWrite(""); } @@ -174,23 +242,23 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member) addVerbatim(member->readonlyToken); addVerbatim(member->propertyToken); addVerbatim(member->typeModifierToken); - addVerbatim(member->typeToken); - addVerbatim(member->identifierToken); + addMarkedUpToken(member->typeToken, QLatin1String("type")); + addMarkedUpToken(member->identifierToken, QLatin1String("name")); addVerbatim(member->colonToken); QDeclarativeJS::AST::Node::accept(member->binding, this); } else { addVerbatim(member->propertyToken); addVerbatim(member->typeModifierToken); - addVerbatim(member->typeToken); + addMarkedUpToken(member->typeToken, QLatin1String("type")); //addVerbatim(member->identifierToken); QDeclarativeJS::AST::Node::accept(member->parameters, this); } - return true; + addVerbatim(member->semicolonToken); + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiPublicMember *member) { - addVerbatim(member->semicolonToken); endWrite(""); } @@ -279,7 +347,7 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayMemberList *list) write(""); for (QDeclarativeJS::AST::UiArrayMemberList *it = list; it; it = it->next) { QDeclarativeJS::AST::Node::accept(it->member, this); - addVerbatim(it->commaToken); + //addVerbatim(it->commaToken); } return false; } @@ -292,7 +360,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayMemberList *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiQualifiedId *id) { write(""); - addVerbatim(id->identifierToken); + addMarkedUpToken(id->identifierToken, QLatin1String("name")); return false; } @@ -317,7 +385,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiSignature *signature) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormal *formal) { write(""); - addVerbatim(formal->identifierToken); + addMarkedUpToken(formal->identifierToken, QLatin1String("name")); addVerbatim(formal->asToken); addVerbatim(formal->aliasToken); return false; @@ -344,8 +412,8 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThisExpression *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierExpression *identifier) { write(""); - addVerbatim(identifier->identifierToken); - return true; + addMarkedUpToken(identifier->identifierToken, QLatin1String("name")); + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierExpression *) @@ -357,7 +425,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierExpression *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NullExpression *null) { write(""); - addVerbatim(null->nullToken); + addMarkedUpToken(null->nullToken, QLatin1String("number")); return true; } @@ -370,7 +438,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NullExpression *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TrueLiteral *literal) { write(""); - addVerbatim(literal->trueToken); + addMarkedUpToken(literal->trueToken, QLatin1String("number")); return true; } @@ -383,7 +451,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TrueLiteral *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FalseLiteral *literal) { write(""); - addVerbatim(literal->falseToken); + addMarkedUpToken(literal->falseToken, QLatin1String("number")); return true; } @@ -396,10 +464,10 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FalseLiteral *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteral *literal) { //write(""); - addVerbatim(literal->literalToken); - return true; + addMarkedUpToken(literal->literalToken, QLatin1String("number")); + return false; } - + void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteral *) { //endWrite(""); @@ -409,10 +477,10 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteral *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteral *literal) { //write(""); - addVerbatim(literal->literalToken); + addMarkedUpToken(literal->literalToken, QLatin1String("string")); return true; } - + void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteral *) { //endWrite(""); @@ -466,7 +534,7 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ElementList *list) write(""); for (QDeclarativeJS::AST::ElementList *it = list; it; it = it->next) { QDeclarativeJS::AST::Node::accept(it->expression, this); - addVerbatim(it->commaToken); + //addVerbatim(it->commaToken); } QDeclarativeJS::AST::Node::accept(list->elision, this); return false; @@ -571,7 +639,7 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FieldMemberExpression *express write(""); QDeclarativeJS::AST::Node::accept(expression->base, this); addVerbatim(expression->dotToken); - addVerbatim(expression->identifierToken); + addMarkedUpToken(expression->identifierToken, QLatin1String("name")); return false; } @@ -587,12 +655,13 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewMemberExpression *expressio addVerbatim(expression->newToken); QDeclarativeJS::AST::Node::accept(expression->base, this); addVerbatim(expression->lparenToken); - return true; + QDeclarativeJS::AST::Node::accept(expression->arguments, this); + addVerbatim(expression->rparenToken); + return false; } - + void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewMemberExpression *expression) { - addVerbatim(expression->rparenToken); endWrite(""); } @@ -745,7 +814,7 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryMinusExpression *expressi addVerbatim(expression->minusToken); return true; } - + void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryMinusExpression *) { endWrite(""); @@ -758,7 +827,7 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TildeExpression *expression) addVerbatim(expression->tildeToken); return true; } - + void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TildeExpression *) { endWrite(""); @@ -771,7 +840,7 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NotExpression *expression) addVerbatim(expression->notToken); return true; } - + void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NotExpression *) { endWrite(""); @@ -782,7 +851,7 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BinaryExpression *expression) { write(""); QDeclarativeJS::AST::Node::accept(expression->left, this); - addVerbatim(expression->operatorToken); + addMarkedUpToken(expression->operatorToken, QLatin1String("op")); QDeclarativeJS::AST::Node::accept(expression->right, this); return false; } @@ -798,7 +867,7 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ConditionalExpression *express write(""); return true; } - + void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ConditionalExpression *) { endWrite(""); @@ -816,7 +885,6 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Expression *) endWrite(""); } - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Block *block) { write(""); @@ -874,7 +942,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclarationList *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclaration *declaration) { write(""); - addVerbatim(declaration->identifierToken); + addMarkedUpToken(declaration->identifierToken, QLatin1String("name")); QDeclarativeJS::AST::Node::accept(declaration->expression, this); return false; } @@ -914,11 +982,12 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ExpressionStatement *statem bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement) { write(""); - addVerbatim(statement->ifToken); + addMarkedUpToken(statement->ifToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->rparenToken); QDeclarativeJS::AST::Node::accept(statement->ok, this); + //addMarkedUpToken(statement->elseToken, QLatin1String("keyword")); //addVerbatim(statement->elseToken); ### this token referred to the wrong source text for some reason QDeclarativeJS::AST::Node::accept(statement->ko, this); return false; @@ -933,9 +1002,9 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IfStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DoWhileStatement *statement) { write(""); - addVerbatim(statement->doToken); + addMarkedUpToken(statement->doToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->statement, this); - addVerbatim(statement->whileToken); + addMarkedUpToken(statement->whileToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->rparenToken); @@ -954,7 +1023,7 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WhileStatement *statement) write(""); return true; } - + void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WhileStatement *) { endWrite(""); @@ -964,7 +1033,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WhileStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForStatement *statement) { write(""); - addVerbatim(statement->forToken); + addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->initialiser, this); addVerbatim(statement->firstSemicolonToken); @@ -985,9 +1054,9 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForStatement *statement) { write(""); - addVerbatim(statement->forToken); + addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); - addVerbatim(statement->varToken); + addMarkedUpToken(statement->varToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->declarations, this); addVerbatim(statement->firstSemicolonToken); QDeclarativeJS::AST::Node::accept(statement->condition, this); @@ -1007,14 +1076,14 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForEachStatement *statement) { write(""); - addVerbatim(statement->forToken); + addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->initialiser, this); addVerbatim(statement->inToken); QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->rparenToken); QDeclarativeJS::AST::Node::accept(statement->statement, this); - return true; + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForEachStatement *) @@ -1026,15 +1095,15 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForEachStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForEachStatement *statement) { write(""); - addVerbatim(statement->forToken); + addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); - addVerbatim(statement->varToken); + addMarkedUpToken(statement->varToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->declaration, this); addVerbatim(statement->inToken); QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->rparenToken); QDeclarativeJS::AST::Node::accept(statement->statement, this); - return true; + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForEachStatement *) @@ -1046,10 +1115,10 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForEachStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ContinueStatement *statement) { write(""); - addVerbatim(statement->continueToken); - addVerbatim(statement->identifierToken); + addMarkedUpToken(statement->continueToken, QLatin1String("keyword")); + addMarkedUpToken(statement->identifierToken, QLatin1String("name")); addVerbatim(statement->semicolonToken); - return true; + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ContinueStatement *) @@ -1061,10 +1130,10 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ContinueStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BreakStatement *statement) { write(""); - addVerbatim(statement->breakToken); - addVerbatim(statement->identifierToken); + addMarkedUpToken(statement->breakToken, QLatin1String("keyword")); + addMarkedUpToken(statement->identifierToken, QLatin1String("name")); addVerbatim(statement->semicolonToken); - return true; + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BreakStatement *) @@ -1076,7 +1145,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BreakStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ReturnStatement *statement) { write(""); - addVerbatim(statement->returnToken); + addMarkedUpToken(statement->returnToken, QLatin1String("keyword")); return true; } @@ -1090,7 +1159,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ReturnStatement *statement) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WithStatement *statement) { write(""); - addVerbatim(statement->withToken); + addMarkedUpToken(statement->withToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); addVerbatim(statement->rparenToken); return true; @@ -1105,7 +1174,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WithStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseBlock *block) { write(""); - addVerbatim(block->lbraceToken, block->lbraceToken); + addVerbatim(block->lbraceToken); return true; } @@ -1119,7 +1188,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseBlock *block) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SwitchStatement *statement) { write(""); - addVerbatim(statement->switchToken); + addMarkedUpToken(statement->switchToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->rparenToken); @@ -1146,7 +1215,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClauses *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClause *clause) { write(""); - addVerbatim(clause->caseToken); + addMarkedUpToken(clause->caseToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(clause->expression, this); addVerbatim(clause->colonToken); QDeclarativeJS::AST::Node::accept(clause->statements, this); @@ -1162,7 +1231,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClause *clause) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DefaultClause *clause) { write(""); - addVerbatim(clause->defaultToken, clause->defaultToken); + addMarkedUpToken(clause->defaultToken, QLatin1String("keyword")); addVerbatim(clause->colonToken, clause->colonToken); return true; } @@ -1176,10 +1245,10 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DefaultClause *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LabelledStatement *statement) { write(""); - addVerbatim(statement->identifierToken); + addMarkedUpToken(statement->identifierToken, QLatin1String("name")); addVerbatim(statement->colonToken); QDeclarativeJS::AST::Node::accept(statement->statement, this); - return true; + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LabelledStatement *) @@ -1191,7 +1260,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LabelledStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThrowStatement *statement) { write(""); - addVerbatim(statement->throwToken); + addMarkedUpToken(statement->throwToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->semicolonToken); return false; @@ -1206,11 +1275,11 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThrowStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Catch *c) { write(""); - addVerbatim(c->catchToken, c->catchToken); - addVerbatim(c->lparenToken, c->lparenToken); - addVerbatim(c->identifierToken, c->identifierToken); - addVerbatim(c->rparenToken, c->rparenToken); - return true; + addMarkedUpToken(c->catchToken, QLatin1String("keyword")); + addVerbatim(c->lparenToken); + addMarkedUpToken(c->identifierToken, QLatin1String("name")); + addVerbatim(c->rparenToken); + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Catch *) @@ -1222,7 +1291,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Catch *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Finally *f) { write(""); - addVerbatim(f->finallyToken); + addMarkedUpToken(f->finallyToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(f->statement, this); return false; } @@ -1236,7 +1305,7 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Finally *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TryStatement *statement) { write(""); - addVerbatim(statement->tryToken); + addMarkedUpToken(statement->tryToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->statement, this); QDeclarativeJS::AST::Node::accept(statement->catchExpression, this); QDeclarativeJS::AST::Node::accept(statement->finallyExpression, this); @@ -1252,8 +1321,8 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TryStatement *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionExpression *expression) { write(""); - addVerbatim(expression->functionToken); - addVerbatim(expression->identifierToken); + addMarkedUpToken(expression->functionToken, QLatin1String("keyword")); + addMarkedUpToken(expression->identifierToken, QLatin1String("name")); addVerbatim(expression->lparenToken); QDeclarativeJS::AST::Node::accept(expression->formals, this); addVerbatim(expression->rparenToken); @@ -1271,8 +1340,8 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionExpression *express bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionDeclaration *declaration) { write(""); - addVerbatim(declaration->functionToken); - addVerbatim(declaration->identifierToken); + addMarkedUpToken(declaration->functionToken, QLatin1String("keyword")); + addMarkedUpToken(declaration->identifierToken, QLatin1String("name")); addVerbatim(declaration->lparenToken); QDeclarativeJS::AST::Node::accept(declaration->formals, this); addVerbatim(declaration->rparenToken); @@ -1290,9 +1359,9 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionDeclaration *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FormalParameterList *list) { write(""); - addVerbatim(list->commaToken, list->commaToken); - addVerbatim(list->identifierToken, list->identifierToken); - return true; + addVerbatim(list->commaToken); + addMarkedUpToken(list->identifierToken, QLatin1String("name")); + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FormalParameterList *) @@ -1346,10 +1415,12 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementSourceElement *) endWrite(""); } -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *) +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition) { write(""); - return true; + QDeclarativeJS::AST::Node::accept(definition->qualifiedTypeNameId, this); + QDeclarativeJS::AST::Node::accept(definition->initializer, this); + return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectDefinition *) diff --git a/tools/qdoc3/qmlmarkupvisitor.h b/tools/qdoc3/qmlmarkupvisitor.h index 86e1ac2..01b0acf 100644 --- a/tools/qdoc3/qmlmarkupvisitor.h +++ b/tools/qdoc3/qmlmarkupvisitor.h @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE class QmlMarkupVisitor : public QDeclarativeJS::AST::Visitor { public: - QmlMarkupVisitor(const QString &code, bool debug = false); + QmlMarkupVisitor(const QString &code, QDeclarativeJS::Engine *engine); virtual ~QmlMarkupVisitor(); QString markedUpCode(); @@ -317,7 +317,11 @@ public: virtual bool visit(QDeclarativeJS::AST::UiParameterList *); virtual void endVisit(QDeclarativeJS::AST::UiParameterList *); +protected: + QString protect(const QString &string); + private: + void addExtra(quint32 start, quint32 finish); void addMarkedUpToken(QDeclarativeJS::AST::SourceLocation &location, const QString &text); void addVerbatim(QDeclarativeJS::AST::SourceLocation first, @@ -326,11 +330,13 @@ private: void write(const QString &text); void endWrite(const QString &text); + QDeclarativeJS::Engine *engine; QString source; QString output; quint32 cursor; + quint32 commentIndex; int indent; - bool showDebug; + QString debug; }; QT_END_NAMESPACE -- cgit v0.12 From 88a86d8e2c82edf53b56afcc2f80fffd32a18e49 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 30 Nov 2010 18:28:27 +0100 Subject: Made more adjustments to node handling and removed debugging statements. --- tools/qdoc3/qmlmarkupvisitor.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/qdoc3/qmlmarkupvisitor.cpp b/tools/qdoc3/qmlmarkupvisitor.cpp index 4564dc5..387b562 100644 --- a/tools/qdoc3/qmlmarkupvisitor.cpp +++ b/tools/qdoc3/qmlmarkupvisitor.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ -#include #include #include #include "private/qdeclarativejsast_p.h" @@ -57,7 +56,7 @@ QmlMarkupVisitor::QmlMarkupVisitor(const QString &source, QDeclarativeJS::Engine indent = 0; cursor = 0; commentIndex = 0; - debug += QString("Comments %1\n").arg(engine->comments().length()); + QString("Comments %1\n").arg(engine->comments().length()); } QmlMarkupVisitor::~QmlMarkupVisitor() @@ -94,8 +93,6 @@ QString QmlMarkupVisitor::markedUpCode() if (cursor < source.length()) addExtra(cursor, source.length()); - //qDebug() << debug; - qDebug() << output; return output; } @@ -157,7 +154,7 @@ void QmlMarkupVisitor::addMarkedUpToken( if (cursor < location.offset) addExtra(cursor, location.offset); else if (cursor > location.offset) - debug += QString("%1 %2\n").arg(cursor).arg(location.offset); + return; output += QString(QLatin1String("<@%1>%2")).arg(tagName, protect(sourceText(location)), tagName); cursor += location.length; @@ -184,7 +181,7 @@ void QmlMarkupVisitor::addVerbatim(QDeclarativeJS::AST::SourceLocation first, if (cursor < start) addExtra(cursor, start); else if (cursor > start) - debug += QString("%1 %2 %3 x\n").arg(sourceText(first)).arg(cursor).arg(start); + return; QString text = source.mid(start, finish - start); write(text); @@ -195,11 +192,10 @@ void QmlMarkupVisitor::addVerbatim(QDeclarativeJS::AST::SourceLocation first, void QmlMarkupVisitor::write(const QString &text) { - debug += QString().fill(QChar(' '), indent) + text + QLatin1String("\n"); indent += 1; } -void QmlMarkupVisitor::endWrite(const QString &) +void QmlMarkupVisitor::endWrite(const QString &text) { indent -= 1; } @@ -877,6 +873,9 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ConditionalExpression *) bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Expression *expression) { write(""); + QDeclarativeJS::AST::Node::accept(expression->left, this); + addVerbatim(expression->commaToken); + QDeclarativeJS::AST::Node::accept(expression->right, this); return true; } @@ -987,9 +986,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement) QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->rparenToken); QDeclarativeJS::AST::Node::accept(statement->ok, this); - //addMarkedUpToken(statement->elseToken, QLatin1String("keyword")); - //addVerbatim(statement->elseToken); ### this token referred to the wrong source text for some reason - QDeclarativeJS::AST::Node::accept(statement->ko, this); + if (statement->ko) { + addMarkedUpToken(statement->elseToken, QLatin1String("keyword")); + QDeclarativeJS::AST::Node::accept(statement->ko, this); + } return false; } -- cgit v0.12 From eae5f69a23d46d237ee2021319d093c580dff679 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Dec 2010 11:57:35 +0100 Subject: Removed an unused function. --- tools/qdoc3/main.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index ac1c5de..68b5370 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -95,21 +95,6 @@ static QStringList defines; static QHash trees; /*! - Find the Tree for language \a lang and return a pointer to it. - If there is no Tree for language \a lang in the Tree table, add - a new one. The Tree table is indexed by \a lang strings. - */ -static Tree* treeForLanguage(const QString &lang) -{ - Tree* tree = trees.value(lang); - if (tree == 0) { - tree = new Tree; - trees.insert( lang, tree ); - } - return tree; -} - -/*! Print the help message to \c stdout. */ static void printHelp() -- cgit v0.12 From 0dd0313a194c73508a4fbbf69c716407b781cc6e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Dec 2010 12:04:46 +0100 Subject: Select the appropriate code marker for each file. --- tools/qdoc3/generator.cpp | 2 +- tools/qdoc3/htmlgenerator.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 0f2454e..1b17452 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -514,7 +514,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) Doc::quoteFromFile(fake->doc().location(), quoter, fake->name()); QString code = quoter.quoteTo(fake->location(), "", ""); text << Atom(Atom::Code, code); - generateText(text, fake, marker); + generateText(text, fake, CodeMarker::markerForFileName(fake->name())); } } } diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 5f70de4..456654f 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1341,8 +1341,8 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, } /*! - Generate the html page for a qdoc file that doesn't map - to an underlying c++ file. + Generate the HTML page for a qdoc file that doesn't map + to an underlying C++ file. */ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) { @@ -1360,6 +1360,9 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) else if (fake->subType() == Node::QmlBasicType) { fullTitle = "QML Basic Type: " + fullTitle; htmlTitle = fullTitle; + + // Replace the marker with a QML code marker. + marker = CodeMarker::markerForLanguage(QLatin1String("QML")); } generateHeader(htmlTitle, fake, marker); @@ -1373,6 +1376,9 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) qml_cn = static_cast(fake); sections = marker->qmlSections(qml_cn,CodeMarker::Summary,0); generateTableOfContents(fake,marker,§ions); + + // Replace the marker with a QML code marker. + marker = CodeMarker::markerForLanguage(QLatin1String("QML")); } else if (fake->name() != QString("index.html")) generateTableOfContents(fake,marker,0); -- cgit v0.12 From 76152172c04a40dc9e27423ec092f23da4d628dc Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Dec 2010 12:05:35 +0100 Subject: Trivial comment fix. --- tools/qdoc3/pagegenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index 60b40c9..cde4b45 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -299,7 +299,7 @@ QTextStream &PageGenerator::out() } /*! - Recursive writing of html files from the root \a node. + Recursive writing of HTML files from the root \a node. */ void PageGenerator::generateInnerNode(const InnerNode* node) -- cgit v0.12 From d877b3d3b34d4f5c6f9683c54d54e54a37a39998 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Dec 2010 12:30:19 +0100 Subject: Fixed/adjusted handling of UiPublicMember nodes. Removed debugging code. --- tools/qdoc3/qmlmarkupvisitor.cpp | 202 +-------------------------------------- tools/qdoc3/qmlmarkupvisitor.h | 2 - 2 files changed, 5 insertions(+), 199 deletions(-) diff --git a/tools/qdoc3/qmlmarkupvisitor.cpp b/tools/qdoc3/qmlmarkupvisitor.cpp index 387b562..6335ab6 100644 --- a/tools/qdoc3/qmlmarkupvisitor.cpp +++ b/tools/qdoc3/qmlmarkupvisitor.cpp @@ -56,7 +56,6 @@ QmlMarkupVisitor::QmlMarkupVisitor(const QString &source, QDeclarativeJS::Engine indent = 0; cursor = 0; commentIndex = 0; - QString("Comments %1\n").arg(engine->comments().length()); } QmlMarkupVisitor::~QmlMarkupVisitor() @@ -90,7 +89,7 @@ QString QmlMarkupVisitor::protect(const QString& str) QString QmlMarkupVisitor::markedUpCode() { - if (cursor < source.length()) + if (int(cursor) < source.length()) addExtra(cursor, source.length()); return output; @@ -184,36 +183,22 @@ void QmlMarkupVisitor::addVerbatim(QDeclarativeJS::AST::SourceLocation first, return; QString text = source.mid(start, finish - start); - write(text); indent -= 1; output += protect(text); cursor = finish; } -void QmlMarkupVisitor::write(const QString &text) -{ - indent += 1; -} - -void QmlMarkupVisitor::endWrite(const QString &text) -{ - indent -= 1; -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiProgram *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiProgram *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImport *uiimport) { - write(""); addVerbatim(uiimport->importToken); if (!uiimport->importUri) addMarkedUpToken(uiimport->fileNameToken, QLatin1String("headerfile")); @@ -222,17 +207,14 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImport *uiimport) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiImport *uiimport) { - endWrite(""); addVerbatim(uiimport->versionToken); addVerbatim(uiimport->asToken); addMarkedUpToken(uiimport->importIdToken, QLatin1String("headerfile")); addVerbatim(uiimport->semicolonToken); - //endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member) { - write(""); if (member->type == QDeclarativeJS::AST::UiPublicMember::Property) { addVerbatim(member->defaultToken); addVerbatim(member->readonlyToken); @@ -241,7 +223,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member) addMarkedUpToken(member->typeToken, QLatin1String("type")); addMarkedUpToken(member->identifierToken, QLatin1String("name")); addVerbatim(member->colonToken); - QDeclarativeJS::AST::Node::accept(member->binding, this); + if (member->binding) + QDeclarativeJS::AST::Node::accept(member->binding, this); + else if (member->expression) + QDeclarativeJS::AST::Node::accept(member->expression, this); } else { addVerbatim(member->propertyToken); addVerbatim(member->typeModifierToken); @@ -255,47 +240,39 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiPublicMember *member) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSourceElement *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiSourceElement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiParameterList *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiParameterList *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectInitializer *initializer) { - write(""); addVerbatim(initializer->lbraceToken, initializer->lbraceToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectInitializer *initializer) { - endWrite(""); addVerbatim(initializer->rbraceToken, initializer->rbraceToken); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectBinding *binding) { - write(""); QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); addVerbatim(binding->colonToken); QDeclarativeJS::AST::Node::accept(binding->qualifiedTypeNameId, this); @@ -305,12 +282,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectBinding *binding) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectBinding *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiScriptBinding *binding) { - write(""); QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); addVerbatim(binding->colonToken); QDeclarativeJS::AST::Node::accept(binding->statement, this); @@ -319,12 +294,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiScriptBinding *binding) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiScriptBinding *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayBinding *binding) { - write(""); QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); addVerbatim(binding->colonToken); addVerbatim(binding->lbracketToken); @@ -335,12 +308,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayBinding *binding) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayBinding *formal) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayMemberList *list) { - write(""); for (QDeclarativeJS::AST::UiArrayMemberList *it = list; it; it = it->next) { QDeclarativeJS::AST::Node::accept(it->member, this); //addVerbatim(it->commaToken); @@ -350,24 +321,20 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayMemberList *list) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayMemberList *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiQualifiedId *id) { - write(""); addMarkedUpToken(id->identifierToken, QLatin1String("name")); return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiQualifiedId *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSignature *signature) { - write(""); addVerbatim(signature->lparenToken); return true; } @@ -375,12 +342,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSignature *signature) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiSignature *signature) { addVerbatim(signature->rparenToken); - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormal *formal) { - write(""); addMarkedUpToken(formal->identifierToken, QLatin1String("name")); addVerbatim(formal->asToken); addVerbatim(formal->aliasToken); @@ -389,116 +354,98 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormal *formal) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiFormal *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThisExpression *expression) { - write(""); addVerbatim(expression->thisToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThisExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierExpression *identifier) { - write(""); addMarkedUpToken(identifier->identifierToken, QLatin1String("name")); return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NullExpression *null) { - write(""); addMarkedUpToken(null->nullToken, QLatin1String("number")); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NullExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TrueLiteral *literal) { - write(""); addMarkedUpToken(literal->trueToken, QLatin1String("number")); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TrueLiteral *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FalseLiteral *literal) { - write(""); addMarkedUpToken(literal->falseToken, QLatin1String("number")); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FalseLiteral *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteral *literal) { - //write(""); addMarkedUpToken(literal->literalToken, QLatin1String("number")); return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteral *) { - //endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteral *literal) { - //write(""); addMarkedUpToken(literal->literalToken, QLatin1String("string")); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteral *) { - //endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::RegExpLiteral *literal) { - write(""); addVerbatim(literal->literalToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::RegExpLiteral *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayLiteral *literal) { - write(""); addVerbatim(literal->lbracketToken); QDeclarativeJS::AST::Node::accept(literal->elements, this); addVerbatim(literal->rbracketToken); @@ -507,13 +454,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayLiteral *literal) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArrayLiteral *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ObjectLiteral *literal) { - write(""); addVerbatim(literal->lbraceToken); return true; } @@ -521,13 +466,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ObjectLiteral *literal) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ObjectLiteral *literal) { addVerbatim(literal->rbraceToken); - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ElementList *list) { - write(""); for (QDeclarativeJS::AST::ElementList *it = list; it; it = it->next) { QDeclarativeJS::AST::Node::accept(it->expression, this); //addVerbatim(it->commaToken); @@ -538,58 +481,48 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ElementList *list) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ElementList *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Elision *elision) { - write(""); addVerbatim(elision->commaToken, elision->commaToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Elision *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierPropertyName *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierPropertyName *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteralPropertyName *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteralPropertyName *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteralPropertyName *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteralPropertyName *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PropertyNameAndValueList *list) { - write(""); QDeclarativeJS::AST::Node::accept(list->name, this); addVerbatim(list->colonToken, list->colonToken); QDeclarativeJS::AST::Node::accept(list->value, this); @@ -599,24 +532,20 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PropertyNameAndValueList *list void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PropertyNameAndValueList *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NestedExpression *expression) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NestedExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayMemberExpression *expression) { - write(""); QDeclarativeJS::AST::Node::accept(expression->base, this); addVerbatim(expression->lbracketToken); QDeclarativeJS::AST::Node::accept(expression->expression, this); @@ -626,13 +555,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayMemberExpression *express void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArrayMemberExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FieldMemberExpression *expression) { - write(""); QDeclarativeJS::AST::Node::accept(expression->base, this); addVerbatim(expression->dotToken); addMarkedUpToken(expression->identifierToken, QLatin1String("name")); @@ -641,13 +568,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FieldMemberExpression *express void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FieldMemberExpression *expression) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewMemberExpression *expression) { - write(""); addVerbatim(expression->newToken); QDeclarativeJS::AST::Node::accept(expression->base, this); addVerbatim(expression->lparenToken); @@ -658,194 +583,164 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewMemberExpression *expressio void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewMemberExpression *expression) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewExpression *expression) { - write(""); addVerbatim(expression->newToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CallExpression *expression) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CallExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArgumentList *list) { - write(""); addVerbatim(list->commaToken, list->commaToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArgumentList *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PostIncrementExpression *expression) { - write(""); addVerbatim(expression->incrementToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PostIncrementExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PostDecrementExpression *expression) { - write(""); addVerbatim(expression->decrementToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PostDecrementExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DeleteExpression *expression) { - write(""); addVerbatim(expression->deleteToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DeleteExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VoidExpression *expression) { - write(""); addVerbatim(expression->voidToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VoidExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TypeOfExpression *expression) { - write(""); addVerbatim(expression->typeofToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TypeOfExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PreIncrementExpression *expression) { - write(""); addVerbatim(expression->incrementToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PreIncrementExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PreDecrementExpression *expression) { - write(""); addVerbatim(expression->decrementToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PreDecrementExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryPlusExpression *expression) { - write(""); addVerbatim(expression->plusToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryPlusExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryMinusExpression *expression) { - write(""); addVerbatim(expression->minusToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryMinusExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TildeExpression *expression) { - write(""); addVerbatim(expression->tildeToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TildeExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NotExpression *expression) { - write(""); addVerbatim(expression->notToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NotExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BinaryExpression *expression) { - write(""); QDeclarativeJS::AST::Node::accept(expression->left, this); addMarkedUpToken(expression->operatorToken, QLatin1String("op")); QDeclarativeJS::AST::Node::accept(expression->right, this); @@ -854,25 +749,21 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BinaryExpression *expression) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BinaryExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ConditionalExpression *expression) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ConditionalExpression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Expression *expression) { - write(""); QDeclarativeJS::AST::Node::accept(expression->left, this); addVerbatim(expression->commaToken); QDeclarativeJS::AST::Node::accept(expression->right, this); @@ -881,12 +772,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Expression *expression) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Expression *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Block *block) { - write(""); addVerbatim(block->lbraceToken); return true; } @@ -894,23 +783,19 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Block *block) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Block *block) { addVerbatim(block->rbraceToken); - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StatementList *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementList *) { - endWrite(""); addVerbatim(statement->declarationKindToken); QDeclarativeJS::AST::Node::accept(statement->declarations, this); addVerbatim(statement->semicolonToken); @@ -919,13 +804,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclarationList *list) { - write(""); for (QDeclarativeJS::AST::VariableDeclarationList *it = list; it; it = it->next) { QDeclarativeJS::AST::Node::accept(it->declaration, this); addVerbatim(it->commaToken); @@ -935,12 +818,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclarationList *list) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclarationList *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclaration *declaration) { - write(""); addMarkedUpToken(declaration->identifierToken, QLatin1String("name")); QDeclarativeJS::AST::Node::accept(declaration->expression, this); return false; @@ -948,39 +829,33 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclaration *declarati void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclaration *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::EmptyStatement *statement) { - write(""); addVerbatim(statement->semicolonToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::EmptyStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ExpressionStatement *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ExpressionStatement *statement) { addVerbatim(statement->semicolonToken); - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement) { - write(""); addMarkedUpToken(statement->ifToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->expression, this); @@ -995,13 +870,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IfStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DoWhileStatement *statement) { - write(""); addMarkedUpToken(statement->doToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->statement, this); addMarkedUpToken(statement->whileToken, QLatin1String("keyword")); @@ -1014,25 +887,21 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DoWhileStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DoWhileStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WhileStatement *statement) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WhileStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForStatement *statement) { - write(""); addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->initialiser, this); @@ -1047,13 +916,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForStatement *statement) { - write(""); addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); addMarkedUpToken(statement->varToken, QLatin1String("keyword")); @@ -1069,13 +936,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForEachStatement *statement) { - write(""); addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->initialiser, this); @@ -1088,13 +953,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForEachStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForEachStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForEachStatement *statement) { - write(""); addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); addMarkedUpToken(statement->varToken, QLatin1String("keyword")); @@ -1108,13 +971,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForEachStatement *stateme void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForEachStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ContinueStatement *statement) { - write(""); addMarkedUpToken(statement->continueToken, QLatin1String("keyword")); addMarkedUpToken(statement->identifierToken, QLatin1String("name")); addVerbatim(statement->semicolonToken); @@ -1123,13 +984,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ContinueStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ContinueStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BreakStatement *statement) { - write(""); addMarkedUpToken(statement->breakToken, QLatin1String("keyword")); addMarkedUpToken(statement->identifierToken, QLatin1String("name")); addVerbatim(statement->semicolonToken); @@ -1138,13 +997,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BreakStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BreakStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ReturnStatement *statement) { - write(""); addMarkedUpToken(statement->returnToken, QLatin1String("keyword")); return true; } @@ -1152,13 +1009,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ReturnStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ReturnStatement *statement) { addVerbatim(statement->semicolonToken); - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WithStatement *statement) { - write(""); addMarkedUpToken(statement->withToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); addVerbatim(statement->rparenToken); @@ -1167,27 +1022,23 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WithStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WithStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseBlock *block) { - write(""); addVerbatim(block->lbraceToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseBlock *block) { - endWrite(""); addVerbatim(block->rbraceToken, block->rbraceToken); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SwitchStatement *statement) { - write(""); addMarkedUpToken(statement->switchToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->expression, this); @@ -1198,23 +1049,19 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SwitchStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::SwitchStatement *statement) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClauses *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClauses *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClause *clause) { - write(""); addMarkedUpToken(clause->caseToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(clause->expression, this); addVerbatim(clause->colonToken); @@ -1224,13 +1071,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClause *clause) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClause *clause) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DefaultClause *clause) { - write(""); addMarkedUpToken(clause->defaultToken, QLatin1String("keyword")); addVerbatim(clause->colonToken, clause->colonToken); return true; @@ -1238,13 +1083,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DefaultClause *clause) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DefaultClause *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LabelledStatement *statement) { - write(""); addMarkedUpToken(statement->identifierToken, QLatin1String("name")); addVerbatim(statement->colonToken); QDeclarativeJS::AST::Node::accept(statement->statement, this); @@ -1253,13 +1096,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LabelledStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LabelledStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThrowStatement *statement) { - write(""); addMarkedUpToken(statement->throwToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->semicolonToken); @@ -1268,13 +1109,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThrowStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThrowStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Catch *c) { - write(""); addMarkedUpToken(c->catchToken, QLatin1String("keyword")); addVerbatim(c->lparenToken); addMarkedUpToken(c->identifierToken, QLatin1String("name")); @@ -1284,13 +1123,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Catch *c) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Catch *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Finally *f) { - write(""); addMarkedUpToken(f->finallyToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(f->statement, this); return false; @@ -1298,13 +1135,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Finally *f) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Finally *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TryStatement *statement) { - write(""); addMarkedUpToken(statement->tryToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->statement, this); QDeclarativeJS::AST::Node::accept(statement->catchExpression, this); @@ -1314,13 +1149,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TryStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TryStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionExpression *expression) { - write(""); addMarkedUpToken(expression->functionToken, QLatin1String("keyword")); addMarkedUpToken(expression->identifierToken, QLatin1String("name")); addVerbatim(expression->lparenToken); @@ -1334,12 +1167,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionExpression *expression void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionExpression *expression) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionDeclaration *declaration) { - write(""); addMarkedUpToken(declaration->functionToken, QLatin1String("keyword")); addMarkedUpToken(declaration->identifierToken, QLatin1String("name")); addVerbatim(declaration->lparenToken); @@ -1353,12 +1184,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionDeclaration *declarati void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionDeclaration *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FormalParameterList *list) { - write(""); addVerbatim(list->commaToken); addMarkedUpToken(list->identifierToken, QLatin1String("name")); return false; @@ -1366,23 +1195,19 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FormalParameterList *list) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FormalParameterList *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionBody *body) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionBody *body) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DebuggerStatement *statement) { - write(""); addVerbatim(statement->debuggerToken); addVerbatim(statement->semicolonToken); return true; @@ -1390,34 +1215,28 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DebuggerStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DebuggerStatement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionSourceElement *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionSourceElement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StatementSourceElement *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementSourceElement *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition) { - write(""); QDeclarativeJS::AST::Node::accept(definition->qualifiedTypeNameId, this); QDeclarativeJS::AST::Node::accept(definition->initializer, this); return false; @@ -1425,62 +1244,51 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectDefinition *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImportList *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiImportList *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectMemberList *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectMemberList *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormalList *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiFormalList *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Program *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Program *) { - endWrite(""); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SourceElements *) { - write(""); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::SourceElements *) { - endWrite(""); } QT_END_NAMESPACE diff --git a/tools/qdoc3/qmlmarkupvisitor.h b/tools/qdoc3/qmlmarkupvisitor.h index 01b0acf..8177798 100644 --- a/tools/qdoc3/qmlmarkupvisitor.h +++ b/tools/qdoc3/qmlmarkupvisitor.h @@ -327,8 +327,6 @@ private: void addVerbatim(QDeclarativeJS::AST::SourceLocation first, QDeclarativeJS::AST::SourceLocation last = QDeclarativeJS::AST::SourceLocation()); QString sourceText(QDeclarativeJS::AST::SourceLocation &location); - void write(const QString &text); - void endWrite(const QString &text); QDeclarativeJS::Engine *engine; QString source; -- cgit v0.12 From fa74b4a710618f2c738030550ff7c6b668980324 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 1 Dec 2010 16:53:59 +0100 Subject: Fixed a problem with toolbars not relayouting This could happen when dragging an extended toolbar from a mainwindow PAtch was provided on IRC by ravek (#dev) Task-number: QTBUG-10920 Reviewed-by: Trust-Me --- src/gui/widgets/qtoolbarlayout.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qtoolbarlayout.cpp b/src/gui/widgets/qtoolbarlayout.cpp index 59b027e..f25d97d 100644 --- a/src/gui/widgets/qtoolbarlayout.cpp +++ b/src/gui/widgets/qtoolbarlayout.cpp @@ -647,15 +647,15 @@ QSize QToolBarLayout::expandedSize(const QSize &size) const void QToolBarLayout::setExpanded(bool exp) { - if (exp == expanded) + QWidget *tb = qobject_cast(parentWidget()); + if (!tb) + return; + if (exp == expanded && !tb->isWindow()) return; expanded = exp; extension->setChecked(expanded); - QToolBar *tb = qobject_cast(parentWidget()); - if (!tb) - return; if (QMainWindow *win = qobject_cast(tb->parentWidget())) { #ifdef QT_NO_DOCKWIDGET animating = false; -- cgit v0.12 From ff9b210719da21a6724bad51e908f9754c7fa172 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Dec 2010 18:15:46 +0100 Subject: Updated handling of some statement nodes, removed unnecessary functions. --- tools/qdoc3/qmlmarkupvisitor.cpp | 512 ++------------------------------------- tools/qdoc3/qmlmarkupvisitor.h | 185 +------------- 2 files changed, 28 insertions(+), 669 deletions(-) diff --git a/tools/qdoc3/qmlmarkupvisitor.cpp b/tools/qdoc3/qmlmarkupvisitor.cpp index 6335ab6..907b95d 100644 --- a/tools/qdoc3/qmlmarkupvisitor.cpp +++ b/tools/qdoc3/qmlmarkupvisitor.cpp @@ -53,7 +53,6 @@ QmlMarkupVisitor::QmlMarkupVisitor(const QString &source, QDeclarativeJS::Engine { this->source = source; this->engine = engine; - indent = 0; cursor = 0; commentIndex = 0; } @@ -183,20 +182,10 @@ void QmlMarkupVisitor::addVerbatim(QDeclarativeJS::AST::SourceLocation first, return; QString text = source.mid(start, finish - start); - indent -= 1; output += protect(text); cursor = finish; } -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiProgram *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiProgram *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImport *uiimport) { addVerbatim(uiimport->importToken); @@ -238,28 +227,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiPublicMember *member) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSourceElement *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiSourceElement *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiParameterList *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiParameterList *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectInitializer *initializer) { addVerbatim(initializer->lbraceToken, initializer->lbraceToken); @@ -280,10 +247,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectBinding *binding) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectBinding *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiScriptBinding *binding) { QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); @@ -292,10 +255,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiScriptBinding *binding) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiScriptBinding *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayBinding *binding) { QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); @@ -306,10 +265,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayBinding *binding) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayBinding *formal) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayMemberList *list) { for (QDeclarativeJS::AST::UiArrayMemberList *it = list; it; it = it->next) { @@ -319,20 +274,12 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayMemberList *list) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayMemberList *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiQualifiedId *id) { addMarkedUpToken(id->identifierToken, QLatin1String("name")); return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiQualifiedId *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSignature *signature) { addVerbatim(signature->lparenToken); @@ -352,98 +299,54 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormal *formal) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiFormal *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThisExpression *expression) { addVerbatim(expression->thisToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThisExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierExpression *identifier) { addMarkedUpToken(identifier->identifierToken, QLatin1String("name")); return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NullExpression *null) { addMarkedUpToken(null->nullToken, QLatin1String("number")); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NullExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TrueLiteral *literal) { addMarkedUpToken(literal->trueToken, QLatin1String("number")); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TrueLiteral *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FalseLiteral *literal) { addMarkedUpToken(literal->falseToken, QLatin1String("number")); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FalseLiteral *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteral *literal) { addMarkedUpToken(literal->literalToken, QLatin1String("number")); return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteral *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteral *literal) { addMarkedUpToken(literal->literalToken, QLatin1String("string")); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteral *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::RegExpLiteral *literal) { addVerbatim(literal->literalToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::RegExpLiteral *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayLiteral *literal) { addVerbatim(literal->lbracketToken); @@ -452,11 +355,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayLiteral *literal) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArrayLiteral *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ObjectLiteral *literal) { addVerbatim(literal->lbraceToken); @@ -479,48 +377,12 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ElementList *list) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ElementList *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Elision *elision) { addVerbatim(elision->commaToken, elision->commaToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Elision *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierPropertyName *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierPropertyName *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteralPropertyName *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteralPropertyName *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteralPropertyName *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteralPropertyName *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PropertyNameAndValueList *list) { QDeclarativeJS::AST::Node::accept(list->name, this); @@ -530,20 +392,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PropertyNameAndValueList *list return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PropertyNameAndValueList *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NestedExpression *expression) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NestedExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayMemberExpression *expression) { QDeclarativeJS::AST::Node::accept(expression->base, this); @@ -553,11 +401,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayMemberExpression *express return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArrayMemberExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FieldMemberExpression *expression) { QDeclarativeJS::AST::Node::accept(expression->base, this); @@ -566,11 +409,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FieldMemberExpression *express return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FieldMemberExpression *expression) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewMemberExpression *expression) { addVerbatim(expression->newToken); @@ -581,164 +419,84 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewMemberExpression *expressio return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewMemberExpression *expression) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewExpression *expression) { addVerbatim(expression->newToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewExpression *) -{ -} - - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CallExpression *expression) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CallExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArgumentList *list) { addVerbatim(list->commaToken, list->commaToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArgumentList *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PostIncrementExpression *expression) { addVerbatim(expression->incrementToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PostIncrementExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PostDecrementExpression *expression) { addVerbatim(expression->decrementToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PostDecrementExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DeleteExpression *expression) { addVerbatim(expression->deleteToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DeleteExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VoidExpression *expression) { addVerbatim(expression->voidToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VoidExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TypeOfExpression *expression) { addVerbatim(expression->typeofToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TypeOfExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PreIncrementExpression *expression) { addVerbatim(expression->incrementToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PreIncrementExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PreDecrementExpression *expression) { addVerbatim(expression->decrementToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PreDecrementExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryPlusExpression *expression) { addVerbatim(expression->plusToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryPlusExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryMinusExpression *expression) { addVerbatim(expression->minusToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryMinusExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TildeExpression *expression) { addVerbatim(expression->tildeToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TildeExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NotExpression *expression) { addVerbatim(expression->notToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NotExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BinaryExpression *expression) { QDeclarativeJS::AST::Node::accept(expression->left, this); @@ -747,31 +505,22 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BinaryExpression *expression) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BinaryExpression *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ConditionalExpression *expression) { - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ConditionalExpression *) -{ + QDeclarativeJS::AST::Node::accept(expression->expression, this); + addVerbatim(expression->questionToken); + QDeclarativeJS::AST::Node::accept(expression->ok, this); + addVerbatim(expression->colonToken); + QDeclarativeJS::AST::Node::accept(expression->ko, this); + return false; } - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Expression *expression) { QDeclarativeJS::AST::Node::accept(expression->left, this); addVerbatim(expression->commaToken); QDeclarativeJS::AST::Node::accept(expression->right, this); - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Expression *) -{ + return false; } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Block *block) @@ -785,15 +534,6 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Block *block) addVerbatim(block->rbraceToken); } -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StatementList *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementList *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableStatement *statement) { addVerbatim(statement->declarationKindToken); @@ -802,11 +542,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclarationList *list) { for (QDeclarativeJS::AST::VariableDeclarationList *it = list; it; it = it->next) { @@ -816,10 +551,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclarationList *list) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclarationList *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclaration *declaration) { addMarkedUpToken(declaration->identifierToken, QLatin1String("name")); @@ -827,33 +558,19 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclaration *declarati return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclaration *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::EmptyStatement *statement) { addVerbatim(statement->semicolonToken); return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::EmptyStatement *) -{ -} - - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ExpressionStatement *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ExpressionStatement *statement) +bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ExpressionStatement *statement) { + QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->semicolonToken); + return false; } - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement) { addMarkedUpToken(statement->ifToken, QLatin1String("keyword")); @@ -868,11 +585,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IfStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DoWhileStatement *statement) { addMarkedUpToken(statement->doToken, QLatin1String("keyword")); @@ -885,21 +597,16 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DoWhileStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DoWhileStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WhileStatement *statement) { - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WhileStatement *) -{ + addMarkedUpToken(statement->whileToken, QLatin1String("keyword")); + addVerbatim(statement->lparenToken); + QDeclarativeJS::AST::Node::accept(statement->expression, this); + addVerbatim(statement->rparenToken); + QDeclarativeJS::AST::Node::accept(statement->statement, this); + return false; } - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForStatement *statement) { addMarkedUpToken(statement->forToken, QLatin1String("keyword")); @@ -914,11 +621,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForStatement *statement) { addMarkedUpToken(statement->forToken, QLatin1String("keyword")); @@ -934,11 +636,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForEachStatement *statement) { addMarkedUpToken(statement->forToken, QLatin1String("keyword")); @@ -951,11 +648,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForEachStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForEachStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForEachStatement *statement) { addMarkedUpToken(statement->forToken, QLatin1String("keyword")); @@ -969,11 +661,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForEachStatement *stateme return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForEachStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ContinueStatement *statement) { addMarkedUpToken(statement->continueToken, QLatin1String("keyword")); @@ -982,11 +669,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ContinueStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ContinueStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BreakStatement *statement) { addMarkedUpToken(statement->breakToken, QLatin1String("keyword")); @@ -995,36 +677,24 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BreakStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BreakStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ReturnStatement *statement) { addMarkedUpToken(statement->returnToken, QLatin1String("keyword")); - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ReturnStatement *statement) -{ + QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->semicolonToken); + return false; } - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WithStatement *statement) { addMarkedUpToken(statement->withToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); + QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->rparenToken); - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WithStatement *) -{ + QDeclarativeJS::AST::Node::accept(statement->statement, this); + return false; } - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseBlock *block) { addVerbatim(block->lbraceToken); @@ -1047,19 +717,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SwitchStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::SwitchStatement *statement) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClauses *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClauses *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClause *clause) { addMarkedUpToken(clause->caseToken, QLatin1String("keyword")); @@ -1069,11 +726,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClause *clause) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClause *clause) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DefaultClause *clause) { addMarkedUpToken(clause->defaultToken, QLatin1String("keyword")); @@ -1081,11 +733,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DefaultClause *clause) return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DefaultClause *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LabelledStatement *statement) { addMarkedUpToken(statement->identifierToken, QLatin1String("name")); @@ -1094,11 +741,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LabelledStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LabelledStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThrowStatement *statement) { addMarkedUpToken(statement->throwToken, QLatin1String("keyword")); @@ -1107,11 +749,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThrowStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThrowStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Catch *c) { addMarkedUpToken(c->catchToken, QLatin1String("keyword")); @@ -1121,11 +758,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Catch *c) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Catch *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Finally *f) { addMarkedUpToken(f->finallyToken, QLatin1String("keyword")); @@ -1133,11 +765,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Finally *f) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Finally *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TryStatement *statement) { addMarkedUpToken(statement->tryToken, QLatin1String("keyword")); @@ -1147,11 +774,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TryStatement *statement) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TryStatement *) -{ -} - - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionExpression *expression) { addMarkedUpToken(expression->functionToken, QLatin1String("keyword")); @@ -1165,10 +787,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionExpression *expression return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionExpression *expression) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionDeclaration *declaration) { addMarkedUpToken(declaration->functionToken, QLatin1String("keyword")); @@ -1182,10 +800,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionDeclaration *declarati return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionDeclaration *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FormalParameterList *list) { addVerbatim(list->commaToken); @@ -1193,19 +807,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FormalParameterList *list) return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FormalParameterList *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionBody *body) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionBody *body) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DebuggerStatement *statement) { addVerbatim(statement->debuggerToken); @@ -1213,28 +814,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DebuggerStatement *statement) return true; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DebuggerStatement *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionSourceElement *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionSourceElement *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StatementSourceElement *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementSourceElement *) -{ -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition) { QDeclarativeJS::AST::Node::accept(definition->qualifiedTypeNameId, this); @@ -1242,53 +821,4 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition return false; } -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectDefinition *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImportList *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiImportList *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectMemberList *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectMemberList *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormalList *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiFormalList *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Program *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Program *) -{ -} - -bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SourceElements *) -{ - return true; -} - -void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::SourceElements *) -{ -} - QT_END_NAMESPACE diff --git a/tools/qdoc3/qmlmarkupvisitor.h b/tools/qdoc3/qmlmarkupvisitor.h index 8177798..35f1b5bc 100644 --- a/tools/qdoc3/qmlmarkupvisitor.h +++ b/tools/qdoc3/qmlmarkupvisitor.h @@ -57,265 +57,96 @@ public: QString markedUpCode(); - virtual bool visit(QDeclarativeJS::AST::UiProgram *); - virtual bool visit(QDeclarativeJS::AST::UiImportList *); virtual bool visit(QDeclarativeJS::AST::UiImport *); + virtual void endVisit(QDeclarativeJS::AST::UiImport *); + virtual bool visit(QDeclarativeJS::AST::UiPublicMember *); - virtual bool visit(QDeclarativeJS::AST::UiSourceElement *); virtual bool visit(QDeclarativeJS::AST::UiObjectDefinition *); + virtual bool visit(QDeclarativeJS::AST::UiObjectInitializer *); + virtual void endVisit(QDeclarativeJS::AST::UiObjectInitializer *); + virtual bool visit(QDeclarativeJS::AST::UiObjectBinding *); virtual bool visit(QDeclarativeJS::AST::UiScriptBinding *); virtual bool visit(QDeclarativeJS::AST::UiArrayBinding *); - virtual bool visit(QDeclarativeJS::AST::UiObjectMemberList *); virtual bool visit(QDeclarativeJS::AST::UiArrayMemberList *); virtual bool visit(QDeclarativeJS::AST::UiQualifiedId *); - virtual bool visit(QDeclarativeJS::AST::UiSignature *); - virtual bool visit(QDeclarativeJS::AST::UiFormalList *); - virtual bool visit(QDeclarativeJS::AST::UiFormal *); - virtual void endVisit(QDeclarativeJS::AST::UiProgram *); - virtual void endVisit(QDeclarativeJS::AST::UiImportList *); - virtual void endVisit(QDeclarativeJS::AST::UiImport *); - virtual void endVisit(QDeclarativeJS::AST::UiPublicMember *); - virtual void endVisit(QDeclarativeJS::AST::UiSourceElement *); - virtual void endVisit(QDeclarativeJS::AST::UiObjectDefinition *); - virtual void endVisit(QDeclarativeJS::AST::UiObjectInitializer *); - virtual void endVisit(QDeclarativeJS::AST::UiObjectBinding *); - virtual void endVisit(QDeclarativeJS::AST::UiScriptBinding *); - virtual void endVisit(QDeclarativeJS::AST::UiArrayBinding *); - virtual void endVisit(QDeclarativeJS::AST::UiObjectMemberList *); - virtual void endVisit(QDeclarativeJS::AST::UiArrayMemberList *); - virtual void endVisit(QDeclarativeJS::AST::UiQualifiedId *); + virtual bool visit(QDeclarativeJS::AST::UiSignature *); virtual void endVisit(QDeclarativeJS::AST::UiSignature *); - virtual void endVisit(QDeclarativeJS::AST::UiFormalList *); - virtual void endVisit(QDeclarativeJS::AST::UiFormal *); - // QDeclarativeJS + virtual bool visit(QDeclarativeJS::AST::UiFormal *); virtual bool visit(QDeclarativeJS::AST::ThisExpression *); - virtual void endVisit(QDeclarativeJS::AST::ThisExpression *); - virtual bool visit(QDeclarativeJS::AST::IdentifierExpression *); - virtual void endVisit(QDeclarativeJS::AST::IdentifierExpression *); - virtual bool visit(QDeclarativeJS::AST::NullExpression *); - virtual void endVisit(QDeclarativeJS::AST::NullExpression *); - virtual bool visit(QDeclarativeJS::AST::TrueLiteral *); - virtual void endVisit(QDeclarativeJS::AST::TrueLiteral *); - virtual bool visit(QDeclarativeJS::AST::FalseLiteral *); - virtual void endVisit(QDeclarativeJS::AST::FalseLiteral *); - virtual bool visit(QDeclarativeJS::AST::NumericLiteral *); - virtual void endVisit(QDeclarativeJS::AST::NumericLiteral *); - virtual bool visit(QDeclarativeJS::AST::StringLiteral *); - virtual void endVisit(QDeclarativeJS::AST::StringLiteral *); - virtual bool visit(QDeclarativeJS::AST::RegExpLiteral *); - virtual void endVisit(QDeclarativeJS::AST::RegExpLiteral *); - virtual bool visit(QDeclarativeJS::AST::ArrayLiteral *); - virtual void endVisit(QDeclarativeJS::AST::ArrayLiteral *); virtual bool visit(QDeclarativeJS::AST::ObjectLiteral *); virtual void endVisit(QDeclarativeJS::AST::ObjectLiteral *); virtual bool visit(QDeclarativeJS::AST::ElementList *); - virtual void endVisit(QDeclarativeJS::AST::ElementList *); - virtual bool visit(QDeclarativeJS::AST::Elision *); - virtual void endVisit(QDeclarativeJS::AST::Elision *); - virtual bool visit(QDeclarativeJS::AST::PropertyNameAndValueList *); - virtual void endVisit(QDeclarativeJS::AST::PropertyNameAndValueList *); - - virtual bool visit(QDeclarativeJS::AST::NestedExpression *); - virtual void endVisit(QDeclarativeJS::AST::NestedExpression *); - - virtual bool visit(QDeclarativeJS::AST::IdentifierPropertyName *); - virtual void endVisit(QDeclarativeJS::AST::IdentifierPropertyName *); - - virtual bool visit(QDeclarativeJS::AST::StringLiteralPropertyName *); - virtual void endVisit(QDeclarativeJS::AST::StringLiteralPropertyName *); - - virtual bool visit(QDeclarativeJS::AST::NumericLiteralPropertyName *); - virtual void endVisit(QDeclarativeJS::AST::NumericLiteralPropertyName *); - virtual bool visit(QDeclarativeJS::AST::ArrayMemberExpression *); - virtual void endVisit(QDeclarativeJS::AST::ArrayMemberExpression *); - virtual bool visit(QDeclarativeJS::AST::FieldMemberExpression *); - virtual void endVisit(QDeclarativeJS::AST::FieldMemberExpression *); - virtual bool visit(QDeclarativeJS::AST::NewMemberExpression *); - virtual void endVisit(QDeclarativeJS::AST::NewMemberExpression *); - virtual bool visit(QDeclarativeJS::AST::NewExpression *); - virtual void endVisit(QDeclarativeJS::AST::NewExpression *); - - virtual bool visit(QDeclarativeJS::AST::CallExpression *); - virtual void endVisit(QDeclarativeJS::AST::CallExpression *); - virtual bool visit(QDeclarativeJS::AST::ArgumentList *); - virtual void endVisit(QDeclarativeJS::AST::ArgumentList *); - virtual bool visit(QDeclarativeJS::AST::PostIncrementExpression *); - virtual void endVisit(QDeclarativeJS::AST::PostIncrementExpression *); - virtual bool visit(QDeclarativeJS::AST::PostDecrementExpression *); - virtual void endVisit(QDeclarativeJS::AST::PostDecrementExpression *); - virtual bool visit(QDeclarativeJS::AST::DeleteExpression *); - virtual void endVisit(QDeclarativeJS::AST::DeleteExpression *); - virtual bool visit(QDeclarativeJS::AST::VoidExpression *); - virtual void endVisit(QDeclarativeJS::AST::VoidExpression *); - virtual bool visit(QDeclarativeJS::AST::TypeOfExpression *); - virtual void endVisit(QDeclarativeJS::AST::TypeOfExpression *); - virtual bool visit(QDeclarativeJS::AST::PreIncrementExpression *); - virtual void endVisit(QDeclarativeJS::AST::PreIncrementExpression *); - virtual bool visit(QDeclarativeJS::AST::PreDecrementExpression *); - virtual void endVisit(QDeclarativeJS::AST::PreDecrementExpression *); - virtual bool visit(QDeclarativeJS::AST::UnaryPlusExpression *); - virtual void endVisit(QDeclarativeJS::AST::UnaryPlusExpression *); - virtual bool visit(QDeclarativeJS::AST::UnaryMinusExpression *); - virtual void endVisit(QDeclarativeJS::AST::UnaryMinusExpression *); - virtual bool visit(QDeclarativeJS::AST::TildeExpression *); - virtual void endVisit(QDeclarativeJS::AST::TildeExpression *); - virtual bool visit(QDeclarativeJS::AST::NotExpression *); - virtual void endVisit(QDeclarativeJS::AST::NotExpression *); - virtual bool visit(QDeclarativeJS::AST::BinaryExpression *); - virtual void endVisit(QDeclarativeJS::AST::BinaryExpression *); - virtual bool visit(QDeclarativeJS::AST::ConditionalExpression *); - virtual void endVisit(QDeclarativeJS::AST::ConditionalExpression *); - virtual bool visit(QDeclarativeJS::AST::Expression *); - virtual void endVisit(QDeclarativeJS::AST::Expression *); virtual bool visit(QDeclarativeJS::AST::Block *); virtual void endVisit(QDeclarativeJS::AST::Block *); - virtual bool visit(QDeclarativeJS::AST::StatementList *); - virtual void endVisit(QDeclarativeJS::AST::StatementList *); - virtual bool visit(QDeclarativeJS::AST::VariableStatement *); - virtual void endVisit(QDeclarativeJS::AST::VariableStatement *); - virtual bool visit(QDeclarativeJS::AST::VariableDeclarationList *); - virtual void endVisit(QDeclarativeJS::AST::VariableDeclarationList *); - virtual bool visit(QDeclarativeJS::AST::VariableDeclaration *); - virtual void endVisit(QDeclarativeJS::AST::VariableDeclaration *); - virtual bool visit(QDeclarativeJS::AST::EmptyStatement *); - virtual void endVisit(QDeclarativeJS::AST::EmptyStatement *); - virtual bool visit(QDeclarativeJS::AST::ExpressionStatement *); - virtual void endVisit(QDeclarativeJS::AST::ExpressionStatement *); - virtual bool visit(QDeclarativeJS::AST::IfStatement *); - virtual void endVisit(QDeclarativeJS::AST::IfStatement *); - virtual bool visit(QDeclarativeJS::AST::DoWhileStatement *); - virtual void endVisit(QDeclarativeJS::AST::DoWhileStatement *); - virtual bool visit(QDeclarativeJS::AST::WhileStatement *); - virtual void endVisit(QDeclarativeJS::AST::WhileStatement *); - virtual bool visit(QDeclarativeJS::AST::ForStatement *); - virtual void endVisit(QDeclarativeJS::AST::ForStatement *); - virtual bool visit(QDeclarativeJS::AST::LocalForStatement *); - virtual void endVisit(QDeclarativeJS::AST::LocalForStatement *); - virtual bool visit(QDeclarativeJS::AST::ForEachStatement *); - virtual void endVisit(QDeclarativeJS::AST::ForEachStatement *); - virtual bool visit(QDeclarativeJS::AST::LocalForEachStatement *); - virtual void endVisit(QDeclarativeJS::AST::LocalForEachStatement *); - virtual bool visit(QDeclarativeJS::AST::ContinueStatement *); - virtual void endVisit(QDeclarativeJS::AST::ContinueStatement *); - virtual bool visit(QDeclarativeJS::AST::BreakStatement *); - virtual void endVisit(QDeclarativeJS::AST::BreakStatement *); - virtual bool visit(QDeclarativeJS::AST::ReturnStatement *); - virtual void endVisit(QDeclarativeJS::AST::ReturnStatement *); - virtual bool visit(QDeclarativeJS::AST::WithStatement *); - virtual void endVisit(QDeclarativeJS::AST::WithStatement *); virtual bool visit(QDeclarativeJS::AST::CaseBlock *); virtual void endVisit(QDeclarativeJS::AST::CaseBlock *); virtual bool visit(QDeclarativeJS::AST::SwitchStatement *); - virtual void endVisit(QDeclarativeJS::AST::SwitchStatement *); - - virtual bool visit(QDeclarativeJS::AST::CaseClauses *); - virtual void endVisit(QDeclarativeJS::AST::CaseClauses *); - virtual bool visit(QDeclarativeJS::AST::CaseClause *); - virtual void endVisit(QDeclarativeJS::AST::CaseClause *); - virtual bool visit(QDeclarativeJS::AST::DefaultClause *); - virtual void endVisit(QDeclarativeJS::AST::DefaultClause *); - virtual bool visit(QDeclarativeJS::AST::LabelledStatement *); - virtual void endVisit(QDeclarativeJS::AST::LabelledStatement *); - virtual bool visit(QDeclarativeJS::AST::ThrowStatement *); - virtual void endVisit(QDeclarativeJS::AST::ThrowStatement *); - virtual bool visit(QDeclarativeJS::AST::TryStatement *); - virtual void endVisit(QDeclarativeJS::AST::TryStatement *); - virtual bool visit(QDeclarativeJS::AST::Catch *); - virtual void endVisit(QDeclarativeJS::AST::Catch *); - virtual bool visit(QDeclarativeJS::AST::Finally *); - virtual void endVisit(QDeclarativeJS::AST::Finally *); - virtual bool visit(QDeclarativeJS::AST::FunctionDeclaration *); - virtual void endVisit(QDeclarativeJS::AST::FunctionDeclaration *); - virtual bool visit(QDeclarativeJS::AST::FunctionExpression *); - virtual void endVisit(QDeclarativeJS::AST::FunctionExpression *); - virtual bool visit(QDeclarativeJS::AST::FormalParameterList *); - virtual void endVisit(QDeclarativeJS::AST::FormalParameterList *); - - virtual bool visit(QDeclarativeJS::AST::FunctionBody *); - virtual void endVisit(QDeclarativeJS::AST::FunctionBody *); - - virtual bool visit(QDeclarativeJS::AST::Program *); - virtual void endVisit(QDeclarativeJS::AST::Program *); - - virtual bool visit(QDeclarativeJS::AST::SourceElements *); - virtual void endVisit(QDeclarativeJS::AST::SourceElements *); - - virtual bool visit(QDeclarativeJS::AST::FunctionSourceElement *); - virtual void endVisit(QDeclarativeJS::AST::FunctionSourceElement *); - - virtual bool visit(QDeclarativeJS::AST::StatementSourceElement *); - virtual void endVisit(QDeclarativeJS::AST::StatementSourceElement *); - virtual bool visit(QDeclarativeJS::AST::DebuggerStatement *); - virtual void endVisit(QDeclarativeJS::AST::DebuggerStatement *); - - virtual bool visit(QDeclarativeJS::AST::UiParameterList *); - virtual void endVisit(QDeclarativeJS::AST::UiParameterList *); protected: QString protect(const QString &string); @@ -333,8 +164,6 @@ private: QString output; quint32 cursor; quint32 commentIndex; - int indent; - QString debug; }; QT_END_NAMESPACE -- cgit v0.12 From 3773bf874b3c9bd8b5a01984091768481c7b4e65 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 2 Dec 2010 20:37:52 +0100 Subject: Added a specialized version of the QML code marker for JavaScript files. --- tools/qdoc3/jscodemarker.cpp | 129 +++++++++++++++++++++++++++++++++++++++++++ tools/qdoc3/jscodemarker.h | 74 +++++++++++++++++++++++++ tools/qdoc3/main.cpp | 2 + tools/qdoc3/qdoc3.pro | 2 + 4 files changed, 207 insertions(+) create mode 100644 tools/qdoc3/jscodemarker.cpp create mode 100644 tools/qdoc3/jscodemarker.h diff --git a/tools/qdoc3/jscodemarker.cpp b/tools/qdoc3/jscodemarker.cpp new file mode 100644 index 0000000..e3a0ff1 --- /dev/null +++ b/tools/qdoc3/jscodemarker.cpp @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + jscodemarker.cpp +*/ + +#include "private/qdeclarativejsast_p.h" +#include "private/qdeclarativejsengine_p.h" +#include "private/qdeclarativejslexer_p.h" +#include "private/qdeclarativejsnodepool_p.h" +#include "private/qdeclarativejsparser_p.h" + +#include "atom.h" +#include "node.h" +#include "jscodemarker.h" +#include "qmlmarkupvisitor.h" +#include "text.h" +#include "tree.h" + +QT_BEGIN_NAMESPACE + +JsCodeMarker::JsCodeMarker() +{ +} + +JsCodeMarker::~JsCodeMarker() +{ +} + +/*! + Returns true if the \a code is recognized by the parser. + */ +bool JsCodeMarker::recognizeCode(const QString &code) +{ + QDeclarativeJS::Engine engine; + QDeclarativeJS::Lexer lexer(&engine); + QDeclarativeJS::Parser parser(&engine); + QDeclarativeJS::NodePool m_nodePool("", &engine); + lexer.setCode(code, 1); + + return parser.parseProgram(); +} + +/*! + Returns true if \a ext is any of a list of file extensions + for the QML language. + */ +bool JsCodeMarker::recognizeExtension(const QString &ext) +{ + return ext == "js"; +} + +/*! + Returns true if the \a language is recognized. Only "QML" is + recognized by this marker. + */ +bool JsCodeMarker::recognizeLanguage(const QString &language) +{ + return language == "JavaScript" || language == "ECMAScript"; +} + +QString JsCodeMarker::markedUpCode(const QString &code, + const Node *relative, + const QString &dirPath) +{ + return addMarkUp(code, relative, dirPath); +} + +QString JsCodeMarker::addMarkUp(const QString &code, + const Node * /* relative */, + const QString &dirPath) +{ + QDeclarativeJS::Engine engine; + QDeclarativeJS::Lexer lexer(&engine); + lexer.setCode(code, 1); + + QDeclarativeJS::Parser parser(&engine); + QDeclarativeJS::NodePool m_nodePool("", &engine); + QString output; + + if (parser.parseProgram()) { + QDeclarativeJS::AST::Node *ast = parser.rootNode(); + QmlMarkupVisitor visitor(code, &engine); + QDeclarativeJS::AST::Node::accept(ast, &visitor); + output = visitor.markedUpCode(); + } + return output; +} + +QT_END_NAMESPACE diff --git a/tools/qdoc3/jscodemarker.h b/tools/qdoc3/jscodemarker.h new file mode 100644 index 0000000..f7cb025 --- /dev/null +++ b/tools/qdoc3/jscodemarker.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + jscodemarker.h +*/ + +#ifndef JSCODEMARKER_H +#define JSCODEMARKER_H + +#include "qmlcodemarker.h" + +QT_BEGIN_NAMESPACE + +class JsCodeMarker : public QmlCodeMarker +{ +public: + JsCodeMarker(); + ~JsCodeMarker(); + + virtual bool recognizeCode(const QString &code); + virtual bool recognizeExtension(const QString &ext); + virtual bool recognizeLanguage(const QString &language); + + virtual QString markedUpCode(const QString &code, + const Node *relative, + const QString &dirPath); + +private: + QString addMarkUp(const QString &code, const Node * /* relative */, + const QString & /* dirPath */); +}; + +QT_END_NAMESPACE + +#endif diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 68b5370..782df39 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -53,6 +53,7 @@ #include "ditaxmlgenerator.h" #include "doc.h" #include "htmlgenerator.h" +#include "jscodemarker.h" #include "plaincodemarker.h" #include "puredocparser.h" #include "qmlcodemarker.h" @@ -368,6 +369,7 @@ int main(int argc, char **argv) */ PlainCodeMarker plainMarker; CppCodeMarker cppMarker; + JsCodeMarker jsMarker; QmlCodeMarker qmlMarker; HtmlGenerator htmlGenerator; diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 23ff7bd..4bc6bca 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -37,6 +37,7 @@ HEADERS += atom.h \ generator.h \ helpprojectwriter.h \ htmlgenerator.h \ + jscodemarker.h \ location.h \ node.h \ openedlist.h \ @@ -66,6 +67,7 @@ SOURCES += atom.cpp \ generator.cpp \ helpprojectwriter.cpp \ htmlgenerator.cpp \ + jscodemarker.cpp \ location.cpp \ main.cpp \ node.cpp \ -- cgit v0.12 From b02cf26c0c236679439826cb8093f6dd6d3b2fec Mon Sep 17 00:00:00 2001 From: Christopher Ham Date: Fri, 3 Dec 2010 16:20:58 +1000 Subject: borderImage should not support setting sourceSize SIGNAL sourceSizeChanged is properly called. Setting the sourceSize for borderImage in QML returns a warning. Auto tests were added to check that sourceSize remains consistent. Reviewed-by: Joona Petrell --- src/declarative/graphicsitems/qdeclarativeborderimage.cpp | 10 ++++++++++ src/declarative/graphicsitems/qdeclarativeborderimage_p.h | 2 ++ .../qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index c770a85..0bf09ad 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -246,6 +246,12 @@ void QDeclarativeBorderImage::setSource(const QUrl &url) load(); } +void QDeclarativeBorderImage::setSourceSize(const QSize& size) +{ + Q_UNUSED(size); + qmlInfo(this) << "Setting sourceSize for borderImage not supported"; +} + void QDeclarativeBorderImage::load() { Q_D(QDeclarativeBorderImage); @@ -315,6 +321,7 @@ void QDeclarativeBorderImage::load() d->progress = 1.0; emit statusChanged(d->status); emit progressChanged(d->progress); + requestFinished(); update(); } } @@ -475,6 +482,9 @@ void QDeclarativeBorderImage::requestFinished() setImplicitWidth(impsize.width()); setImplicitHeight(impsize.height()); + if (d->sourcesize.width() != d->pix.width() || d->sourcesize.height() != d->pix.height()) + emit sourceSizeChanged(); + d->progress = 1.0; emit statusChanged(d->status); emit progressChanged(1.0); diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h index 9944cbe..7cf24f2 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h +++ b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h @@ -80,6 +80,8 @@ public: void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); void setSource(const QUrl &url); + void setSourceSize(const QSize&); + Q_SIGNALS: void horizontalTileModeChanged(); void verticalTileModeChanged(); diff --git a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp index 2f00f60..5478145 100644 --- a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp +++ b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp @@ -153,6 +153,8 @@ void tst_qdeclarativeborderimage::imageSource() QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Ready); QCOMPARE(obj->width(), 120.); QCOMPARE(obj->height(), 120.); + QCOMPARE(obj->sourceSize().width(), 120); + QCOMPARE(obj->sourceSize().height(), 120); QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch); QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch); } else { @@ -192,6 +194,8 @@ void tst_qdeclarativeborderimage::resized() QVERIFY(obj != 0); QCOMPARE(obj->width(), 300.); QCOMPARE(obj->height(), 300.); + QCOMPARE(obj->sourceSize().width(), 120); + QCOMPARE(obj->sourceSize().height(), 120); QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch); QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch); -- cgit v0.12 From 6f1e732ff0838461be262fa0b86697fab5d8f5b2 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 3 Dec 2010 14:39:30 +0100 Subject: Minor housekeeping changes. --- tools/qdoc3/jscodemarker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/jscodemarker.cpp b/tools/qdoc3/jscodemarker.cpp index e3a0ff1..8b6a31d 100644 --- a/tools/qdoc3/jscodemarker.cpp +++ b/tools/qdoc3/jscodemarker.cpp @@ -107,7 +107,7 @@ QString JsCodeMarker::markedUpCode(const QString &code, QString JsCodeMarker::addMarkUp(const QString &code, const Node * /* relative */, - const QString &dirPath) + const QString & /* dirPath */) { QDeclarativeJS::Engine engine; QDeclarativeJS::Lexer lexer(&engine); -- cgit v0.12 From be41c140594ccea16ce17ccca7251d614cc75e1e Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 6 Dec 2010 08:47:32 +0100 Subject: Propegate fullscreen screen size back to toplevel widgets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed by: Jørgen Lind --- src/plugins/platforms/eglfs/qeglfswindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index d0e15d3..b5b7e05 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -62,6 +62,9 @@ void QEglFSWindow::setGeometry(const QRect &) QRect rect(m_screen->availableGeometry()); QWindowSystemInterface::handleGeometryChange(this->widget(), rect); + // Since toplevels are fullscreen, propegate the screen size back to the widget + widget()->setGeometry(rect); + QPlatformWindow::setGeometry(rect); } -- cgit v0.12 From b5915ef3a6d0417440ad82e9369d6679505b953e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 6 Dec 2010 15:34:19 +0100 Subject: qdoc: Fixed some reported bugs in the XML. --- tools/qdoc3/ditaxmlgenerator.cpp | 69 +++++++++++++++++------------------- tools/qdoc3/test/qt-ditaxml.qdocconf | 8 ++++- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index d4285a8..b4a42ab 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -714,27 +714,24 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::Code: { - xmlWriter().writeStartElement("pre"); - xmlWriter().writeAttribute("outputclass","highlightedcode"); + xmlWriter().writeStartElement("codeblock"); QString chars = trimmedTrailing(atom->string()); writeText(chars, marker, relative); - xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } break; case Atom::Qml: - xmlWriter().writeStartElement("pre"); - xmlWriter().writeAttribute("outputclass","highlightedcode"); + xmlWriter().writeStartElement("codeblock"); writeText(trimmedTrailing(atom->string()), marker, relative); - xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // break; case Atom::CodeNew: xmlWriter().writeStartElement("p"); xmlWriter().writeCharacters("you can rewrite it as"); xmlWriter().writeEndElement(); //

    - xmlWriter().writeStartElement("pre"); - xmlWriter().writeAttribute("outputclass","highlightedcode"); + xmlWriter().writeStartElement("codeblock"); writeText(trimmedTrailing(atom->string()), marker, relative); - xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // break; case Atom::CodeOld: xmlWriter().writeStartElement("p"); @@ -742,10 +739,9 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeEndElement(); //

    // fallthrough case Atom::CodeBad: - xmlWriter().writeStartElement("pre"); - xmlWriter().writeAttribute("outputclass","highlightedcode"); - xmlWriter().writeCharacters(trimmedTrailing(protectEnc(plainCode(atom->string())))); - xmlWriter().writeEndElement(); // + xmlWriter().writeStartElement("codeblock"); + xmlWriter().writeCharacters(trimmedTrailing(plainCode(atom->string()))); + xmlWriter().writeEndElement(); // break; case Atom::FootnoteLeft: // ### For now @@ -1043,30 +1039,30 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (atom->next() != 0) text = atom->next()->string(); if (fileName.isEmpty()) { - xmlWriter().writeStartElement("b"); - xmlWriter().writeAttribute("outputclass","error"); - xmlWriter().writeCharacters("[Missing image: "); - xmlWriter().writeCharacters(protectEnc(atom->string())); - xmlWriter().writeEndElement(); // + /* + Don't bother outputting an error message. + Just output the href as if the image is in + the images directory... + */ + fileName = QLatin1String("images/") + protectEnc(atom->string()); } + + xmlWriter().writeStartElement("fig"); + xmlWriter().writeStartElement("image"); + xmlWriter().writeAttribute("href",protectEnc(fileName)); + if (atom->type() == Atom::InlineImage) + xmlWriter().writeAttribute("placement","inline"); else { - xmlWriter().writeStartElement("fig"); - xmlWriter().writeStartElement("image"); - xmlWriter().writeAttribute("href",protectEnc(fileName)); - if (atom->type() == Atom::InlineImage) - xmlWriter().writeAttribute("placement","inline"); - else { - xmlWriter().writeAttribute("placement","break"); - xmlWriter().writeAttribute("align","center"); - } - if (!text.isEmpty()) { - xmlWriter().writeStartElement("alt"); - xmlWriter().writeCharacters(protectEnc(text)); - xmlWriter().writeEndElement(); // - } - xmlWriter().writeEndElement(); // - xmlWriter().writeEndElement(); // + xmlWriter().writeAttribute("placement","break"); + xmlWriter().writeAttribute("align","center"); + } + if (!text.isEmpty()) { + xmlWriter().writeStartElement("alt"); + xmlWriter().writeCharacters(protectEnc(text)); + xmlWriter().writeEndElement(); // } + xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } break; case Atom::ImageText: @@ -2263,10 +2259,9 @@ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker) void DitaXmlGenerator::generateIncludes(const InnerNode* inner, CodeMarker* marker) { if (!inner->includes().isEmpty()) { - xmlWriter().writeStartElement("pre"); - xmlWriter().writeAttribute("outputclass","highlightedcode"); + xmlWriter().writeStartElement("codeblock"); writeText(marker->markedUpIncludes(inner->includes()), marker, inner); - xmlWriter().writeEndElement(); // + xmlWriter().writeEndElement(); // } } diff --git a/tools/qdoc3/test/qt-ditaxml.qdocconf b/tools/qdoc3/test/qt-ditaxml.qdocconf index 63baead..1feb2b2 100644 --- a/tools/qdoc3/test/qt-ditaxml.qdocconf +++ b/tools/qdoc3/test/qt-ditaxml.qdocconf @@ -2,7 +2,8 @@ include(qt.qdocconf) imagedirs = $QTDIR/doc/src/images \ $QTDIR/examples \ - $QTDIR/doc/src/template/images + $QTDIR/doc/src/declarative/pics \ + $QTDIR/doc/src/template/images outputdir = $QTDIR/doc/ditaxml outputformats = DITAXML @@ -40,3 +41,8 @@ macro.begincomment = "\\c{/*}" macro.endcomment = "\\c{*/}" macro.uuml.DITAXML = "ü" macro.mdash.DITAXML = "—" + +macro.beginfloatleft.HTML = " " +macro.beginfloatright.HTML = " " +macro.endfloat.HTML = " " +macro.clearfloat.HTML = " " -- cgit v0.12 From 94cccc8b971eda3e0330950111c7988f3dd87309 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 6 Dec 2010 18:48:51 +0100 Subject: Removed QDebug includes. --- tools/qdoc3/helpprojectwriter.cpp | 2 -- tools/qdoc3/tokenizer.cpp | 1 - tools/qdoc3/tree.cpp | 1 - 3 files changed, 4 deletions(-) diff --git a/tools/qdoc3/helpprojectwriter.cpp b/tools/qdoc3/helpprojectwriter.cpp index 63e8df7..6253c58 100644 --- a/tools/qdoc3/helpprojectwriter.cpp +++ b/tools/qdoc3/helpprojectwriter.cpp @@ -41,7 +41,6 @@ #include #include -//#include #include "atom.h" #include "helpprojectwriter.h" @@ -49,7 +48,6 @@ #include "config.h" #include "node.h" #include "tree.h" -#include QT_BEGIN_NAMESPACE diff --git a/tools/qdoc3/tokenizer.cpp b/tools/qdoc3/tokenizer.cpp index 05ad5ee..6e7da20 100644 --- a/tools/qdoc3/tokenizer.cpp +++ b/tools/qdoc3/tokenizer.cpp @@ -42,7 +42,6 @@ #include "config.h" #include "tokenizer.h" -#include #include #include #include diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index 20c1373..ceb1f0f 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -54,7 +54,6 @@ #include "tree.h" #include -#include QT_BEGIN_NAMESPACE -- cgit v0.12 From 6834727fff1f74e15b2c9f25af1845e7f529afaa Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 6 Dec 2010 18:49:17 +0100 Subject: Forced the \qml command to use the QML code marker. --- tools/qdoc3/doc.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index 4152207..f153dfb 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -549,7 +549,7 @@ void DocParser::parse(const QString& source, #ifdef QDOC_QML case CMD_QML: leavePara(); - append(Atom::Qml, getCode(CMD_QML, marker)); + append(Atom::Qml, getCode(CMD_QML, CodeMarker::markerForLanguage(QLatin1String("QML")))); break; case CMD_QMLTEXT: append(Atom::QmlText); @@ -2252,7 +2252,8 @@ QString DocParser::getCode(int cmd, CodeMarker *marker) if (indent < minIndent) minIndent = indent; code = unindent(minIndent, code); - marker = CodeMarker::markerForCode(code); + if (!marker) + marker = CodeMarker::markerForCode(code); return marker->markedUpCode(code, 0, ""); } -- cgit v0.12 From bb6d5d9eb2a40de14ab3a41fbdaf4092c1a3b4e8 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 6 Dec 2010 18:52:38 +0100 Subject: Added missing qmlcodemarker.cpp and qmlcodemarker.h files. Added code to remove pragmas before parsing and add them to the output. The extractPragmas() function was copied into both qmlcodeparser.cpp and qmlcodemarker.cpp from src/declarative/qml/qdeclarativescriptparser.cpp, and was modified to return either nothing (for the API parser) or a list of removed pragmas (for the code marker). --- tools/qdoc3/jscodemarker.cpp | 14 +- tools/qdoc3/qmlcodemarker.cpp | 287 +++++++++++++++++++++++++++++++++++++++ tools/qdoc3/qmlcodemarker.h | 85 ++++++++++++ tools/qdoc3/qmlcodeparser.cpp | 71 +++++++++- tools/qdoc3/qmlcodeparser.h | 3 + tools/qdoc3/qmlmarkupvisitor.cpp | 75 +++++++--- tools/qdoc3/qmlmarkupvisitor.h | 13 +- 7 files changed, 523 insertions(+), 25 deletions(-) create mode 100644 tools/qdoc3/qmlcodemarker.cpp create mode 100644 tools/qdoc3/qmlcodemarker.h diff --git a/tools/qdoc3/jscodemarker.cpp b/tools/qdoc3/jscodemarker.cpp index 8b6a31d..84a28c6 100644 --- a/tools/qdoc3/jscodemarker.cpp +++ b/tools/qdoc3/jscodemarker.cpp @@ -75,7 +75,10 @@ bool JsCodeMarker::recognizeCode(const QString &code) QDeclarativeJS::Lexer lexer(&engine); QDeclarativeJS::Parser parser(&engine); QDeclarativeJS::NodePool m_nodePool("", &engine); - lexer.setCode(code, 1); + + QString newCode = code; + QList pragmas = extractPragmas(newCode); + lexer.setCode(newCode, 1); return parser.parseProgram(); } @@ -111,7 +114,10 @@ QString JsCodeMarker::addMarkUp(const QString &code, { QDeclarativeJS::Engine engine; QDeclarativeJS::Lexer lexer(&engine); - lexer.setCode(code, 1); + + QString newCode = code; + QList pragmas = extractPragmas(newCode); + lexer.setCode(newCode, 1); QDeclarativeJS::Parser parser(&engine); QDeclarativeJS::NodePool m_nodePool("", &engine); @@ -119,7 +125,9 @@ QString JsCodeMarker::addMarkUp(const QString &code, if (parser.parseProgram()) { QDeclarativeJS::AST::Node *ast = parser.rootNode(); - QmlMarkupVisitor visitor(code, &engine); + // Pass the unmodified code to the visitor so that pragmas and other + // unhandled source text can be output. + QmlMarkupVisitor visitor(code, pragmas, &engine); QDeclarativeJS::AST::Node::accept(ast, &visitor); output = visitor.markedUpCode(); } diff --git a/tools/qdoc3/qmlcodemarker.cpp b/tools/qdoc3/qmlcodemarker.cpp new file mode 100644 index 0000000..1e4ad1e --- /dev/null +++ b/tools/qdoc3/qmlcodemarker.cpp @@ -0,0 +1,287 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + qmlcodemarker.cpp +*/ + +#include "private/qdeclarativejsast_p.h" +#include "private/qdeclarativejsastfwd_p.h" +#include "private/qdeclarativejsengine_p.h" +#include "private/qdeclarativejslexer_p.h" +#include "private/qdeclarativejsnodepool_p.h" +#include "private/qdeclarativejsparser_p.h" + +#include "atom.h" +#include "node.h" +#include "qmlcodemarker.h" +#include "qmlmarkupvisitor.h" +#include "text.h" +#include "tree.h" + +QT_BEGIN_NAMESPACE + +QmlCodeMarker::QmlCodeMarker() +{ +} + +QmlCodeMarker::~QmlCodeMarker() +{ +} + +/*! + Returns true if the \a code is recognized by the parser. + */ +bool QmlCodeMarker::recognizeCode(const QString &code) +{ + QDeclarativeJS::Engine engine; + QDeclarativeJS::Lexer lexer(&engine); + QDeclarativeJS::Parser parser(&engine); + QDeclarativeJS::NodePool m_nodePool("", &engine); + + QString newCode = code; + extractPragmas(newCode); + lexer.setCode(newCode, 1); + + return parser.parse(); +} + +/*! + Returns true if \a ext is any of a list of file extensions + for the QML language. + */ +bool QmlCodeMarker::recognizeExtension(const QString &ext) +{ + return ext == "qml"; +} + +/*! + Returns true if the \a language is recognized. Only "QML" is + recognized by this marker. + */ +bool QmlCodeMarker::recognizeLanguage(const QString &language) +{ + return language == "QML"; +} + +/*! + Returns the name of the \a node. Method names include are returned with a + trailing set of parentheses. + */ +QString QmlCodeMarker::plainName(const Node *node) +{ + QString name = node->name(); + if (node->type() == Node::QmlMethod) + name += "()"; + return name; +} + +QString QmlCodeMarker::plainFullName(const Node *node, const Node *relative) +{ + if (node->name().isEmpty()) { + return "global"; + } + else { + QString fullName; + while (node) { + fullName.prepend(plainName(node)); + if (node->parent() == relative || node->parent()->name().isEmpty()) + break; + fullName.prepend("::"); + node = node->parent(); + } + return fullName; + } +} + +QString QmlCodeMarker::markedUpCode(const QString &code, + const Node *relative, + const QString &dirPath) +{ + return addMarkUp(code, relative, dirPath); +} + +QString QmlCodeMarker::markedUpName(const Node *node) +{ + QString name = linkTag(node, taggedNode(node)); + if (node->type() == Node::QmlMethod) + name += "()"; + return name; +} + +QString QmlCodeMarker::markedUpFullName(const Node *node, const Node *relative) +{ + if (node->name().isEmpty()) { + return "global"; + } + else { + QString fullName; + for (;;) { + fullName.prepend(markedUpName(node)); + if (node->parent() == relative || node->parent()->name().isEmpty()) + break; + fullName.prepend("<@op>::"); + node = node->parent(); + } + return fullName; + } +} + +QString QmlCodeMarker::markedUpIncludes(const QStringList& includes) +{ + QString code; + + QStringList::ConstIterator inc = includes.begin(); + while (inc != includes.end()) { + code += "import " + *inc + "\n"; + ++inc; + } + return protect(addMarkUp(code, 0, "")); +} + +QString QmlCodeMarker::functionBeginRegExp(const QString& funcName) +{ + return "^" + QRegExp::escape("function " + funcName) + "$"; + +} + +QString QmlCodeMarker::functionEndRegExp(const QString& /* funcName */) +{ + return "^\\}$"; +} + +QString QmlCodeMarker::addMarkUp(const QString &code, + const Node * /* relative */, + const QString & /* dirPath */) +{ + QDeclarativeJS::Engine engine; + QDeclarativeJS::Lexer lexer(&engine); + + QString newCode = code; + QList pragmas = extractPragmas(newCode); + lexer.setCode(newCode, 1); + + QDeclarativeJS::Parser parser(&engine); + QDeclarativeJS::NodePool m_nodePool("", &engine); + QString output; + + if (parser.parse()) { + QDeclarativeJS::AST::UiProgram *ast = parser.ast(); + // Pass the unmodified code to the visitor so that pragmas and other + // unhandled source text can be output. + QmlMarkupVisitor visitor(code, pragmas, &engine); + QDeclarativeJS::AST::Node::accept(ast, &visitor); + output = visitor.markedUpCode(); + } + return output; +} + +/* +Copied and pasted from src/declarative/qml/qdeclarativescriptparser.cpp. +*/ +static void replaceWithSpace(QString &str, int idx, int n) +{ + QChar *data = str.data() + idx; + const QChar space(QLatin1Char(' ')); + for (int ii = 0; ii < n; ++ii) + *data++ = space; +} + +/* +Copied and pasted from src/declarative/qml/qdeclarativescriptparser.cpp then +modified to return a list of removed pragmas. + +Searches for ".pragma " declarations within \a script. Currently supported pragmas +are: + library +*/ +QList QmlCodeMarker::extractPragmas(QString &script) +{ + const QString pragma(QLatin1String("pragma")); + const QString library(QLatin1String("library")); + QList removed; + + QDeclarativeJS::Lexer l(0); + l.setCode(script, 0); + + int token = l.lex(); + + while (true) { + if (token != QDeclarativeJSGrammar::T_DOT) + return removed; + + int startOffset = l.tokenOffset(); + int startLine = l.currentLineNo(); + int startColumn = l.currentColumnNo(); + + token = l.lex(); + + if (token != QDeclarativeJSGrammar::T_IDENTIFIER || + l.currentLineNo() != startLine || + script.mid(l.tokenOffset(), l.tokenLength()) != pragma) + return removed; + + token = l.lex(); + + if (token != QDeclarativeJSGrammar::T_IDENTIFIER || + l.currentLineNo() != startLine) + return removed; + + QString pragmaValue = script.mid(l.tokenOffset(), l.tokenLength()); + int endOffset = l.tokenLength() + l.tokenOffset(); + + token = l.lex(); + if (l.currentLineNo() == startLine) + return removed; + + if (pragmaValue == QLatin1String("library")) { + replaceWithSpace(script, startOffset, endOffset - startOffset); + removed.append( + QDeclarativeJS::AST::SourceLocation( + startOffset, endOffset - startOffset, + startLine, startColumn)); + } else + return removed; + } + return removed; +} + +QT_END_NAMESPACE diff --git a/tools/qdoc3/qmlcodemarker.h b/tools/qdoc3/qmlcodemarker.h new file mode 100644 index 0000000..68e6753 --- /dev/null +++ b/tools/qdoc3/qmlcodemarker.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + qmlcodemarker.h +*/ + +#ifndef QMLCODEMARKER_H +#define QMLCODEMARKER_H + +#include "private/qdeclarativejsastfwd_p.h" +#include "cppcodemarker.h" + +QT_BEGIN_NAMESPACE + +class QmlCodeMarker : public CppCodeMarker +{ +public: + QmlCodeMarker(); + ~QmlCodeMarker(); + + virtual bool recognizeCode(const QString &code); + virtual bool recognizeExtension(const QString &ext); + virtual bool recognizeLanguage(const QString &language); + virtual QString plainName(const Node *node); + virtual QString plainFullName(const Node *node, const Node *relative); + virtual QString markedUpCode(const QString &code, + const Node *relative, + const QString &dirPath); + + virtual QString markedUpName(const Node *node); + virtual QString markedUpFullName(const Node *node, const Node *relative); + virtual QString markedUpIncludes(const QStringList &includes); + virtual QString functionBeginRegExp(const QString &funcName); + virtual QString functionEndRegExp(const QString &funcName); + + /* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */ + QList extractPragmas(QString &script); + +private: + QString addMarkUp(const QString &code, const Node * /* relative */, + const QString & /* dirPath */); +}; + +QT_END_NAMESPACE + +#endif diff --git a/tools/qdoc3/qmlcodeparser.cpp b/tools/qdoc3/qmlcodeparser.cpp index 329912c..9c1d4ee 100644 --- a/tools/qdoc3/qmlcodeparser.cpp +++ b/tools/qdoc3/qmlcodeparser.cpp @@ -118,7 +118,10 @@ void QmlCodeParser::parseSourceFile(const Location& location, in.close(); Location fileLocation(filePath); - lexer->setCode(document, 1); + + QString newCode = document; + extractPragmas(newCode); + lexer->setCode(newCode, 1); QSet topicCommandsAllowed = topicCommands(); QSet otherMetacommandsAllowed = otherMetaCommands(); @@ -129,7 +132,7 @@ void QmlCodeParser::parseSourceFile(const Location& location, if (parser->parse()) { QDeclarativeJS::AST::UiProgram *ast = parser->ast(); - QmlDocVisitor visitor(filePath, document, &engine, tree, metacommandsAllowed); + QmlDocVisitor visitor(filePath, newCode, &engine, tree, metacommandsAllowed); QDeclarativeJS::AST::Node::accept(ast, &visitor); } } @@ -165,4 +168,68 @@ QSet QmlCodeParser::otherMetaCommands() << COMMAND_QMLDEFAULT; } +/* +Copied and pasted from src/declarative/qml/qdeclarativescriptparser.cpp. +*/ +static void replaceWithSpace(QString &str, int idx, int n) +{ + QChar *data = str.data() + idx; + const QChar space(QLatin1Char(' ')); + for (int ii = 0; ii < n; ++ii) + *data++ = space; +} + +/* +Copied and pasted from src/declarative/qml/qdeclarativescriptparser.cpp then +modified to return no values. + +Searches for ".pragma " declarations within \a script. Currently supported pragmas +are: + library +*/ +void QmlCodeParser::extractPragmas(QString &script) +{ + const QString pragma(QLatin1String("pragma")); + const QString library(QLatin1String("library")); + + QDeclarativeJS::Lexer l(0); + l.setCode(script, 0); + + int token = l.lex(); + + while (true) { + if (token != QDeclarativeJSGrammar::T_DOT) + return; + + int startOffset = l.tokenOffset(); + int startLine = l.currentLineNo(); + + token = l.lex(); + + if (token != QDeclarativeJSGrammar::T_IDENTIFIER || + l.currentLineNo() != startLine || + script.mid(l.tokenOffset(), l.tokenLength()) != pragma) + return; + + token = l.lex(); + + if (token != QDeclarativeJSGrammar::T_IDENTIFIER || + l.currentLineNo() != startLine) + return; + + QString pragmaValue = script.mid(l.tokenOffset(), l.tokenLength()); + int endOffset = l.tokenLength() + l.tokenOffset(); + + token = l.lex(); + if (l.currentLineNo() == startLine) + return; + + if (pragmaValue == QLatin1String("library")) + replaceWithSpace(script, startOffset, endOffset - startOffset); + else + return; + } + return; +} + QT_END_NAMESPACE diff --git a/tools/qdoc3/qmlcodeparser.h b/tools/qdoc3/qmlcodeparser.h index a99e8a3..bbacd72 100644 --- a/tools/qdoc3/qmlcodeparser.h +++ b/tools/qdoc3/qmlcodeparser.h @@ -75,6 +75,9 @@ public: const QString& filePath, Tree *tree); virtual void doneParsingSourceFiles(Tree *tree); + /* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */ + void extractPragmas(QString &script); + protected: virtual QSet topicCommands(); virtual QSet otherMetaCommands(); diff --git a/tools/qdoc3/qmlmarkupvisitor.cpp b/tools/qdoc3/qmlmarkupvisitor.cpp index 907b95d..6bede96 100644 --- a/tools/qdoc3/qmlmarkupvisitor.cpp +++ b/tools/qdoc3/qmlmarkupvisitor.cpp @@ -49,12 +49,42 @@ QT_BEGIN_NAMESPACE -QmlMarkupVisitor::QmlMarkupVisitor(const QString &source, QDeclarativeJS::Engine *engine) +QmlMarkupVisitor::QmlMarkupVisitor(const QString &source, + const QList &pragmas, + QDeclarativeJS::Engine *engine) { this->source = source; this->engine = engine; + cursor = 0; - commentIndex = 0; + extraIndex = 0; + + // Merge the lists of locations of pragmas and comments in the source code. + int i = 0; + int j = 0; + while (i < engine->comments().length() && j < pragmas.length()) { + if (engine->comments()[i].offset < pragmas[j].offset) { + extraTypes.append(Comment); + extraLocations.append(engine->comments()[i]); + ++i; + } else { + extraTypes.append(Pragma); + extraLocations.append(engine->comments()[j]); + ++j; + } + } + + while (i < engine->comments().length()) { + extraTypes.append(Comment); + extraLocations.append(engine->comments()[i]); + ++i; + } + + while (j < pragmas.length()) { + extraTypes.append(Pragma); + extraLocations.append(pragmas[j]); + ++j; + } } QmlMarkupVisitor::~QmlMarkupVisitor() @@ -96,7 +126,7 @@ QString QmlMarkupVisitor::markedUpCode() void QmlMarkupVisitor::addExtra(quint32 start, quint32 finish) { - if (commentIndex >= engine->comments().length()) { + if (extraIndex >= extraLocations.length()) { QString extra = source.mid(start, finish - start); if (extra.trimmed().isEmpty()) output += extra; @@ -107,28 +137,37 @@ void QmlMarkupVisitor::addExtra(quint32 start, quint32 finish) return; } - while (commentIndex < engine->comments().length()) { - if (engine->comments()[commentIndex].offset - 2 >= start) - break; - commentIndex++; + while (extraIndex < extraLocations.length()) { + if (extraTypes[extraIndex] == Comment) { + if (extraLocations[extraIndex].offset - 2 >= start) + break; + } else { + if (extraLocations[extraIndex].offset >= start) + break; + } + extraIndex++; } quint32 i = start; - while (i < finish && commentIndex < engine->comments().length()) { - quint32 j = engine->comments()[commentIndex].offset - 2; + while (i < finish && extraIndex < extraLocations.length()) { + quint32 j = extraLocations[extraIndex].offset - 2; if (i <= j && j < finish) { if (i < j) output += protect(source.mid(i, j - i)); - quint32 l = engine->comments()[commentIndex].length; - if (source.mid(j, 2) == QLatin1String("/*")) - l += 4; - else - l += 2; - output += QLatin1String("<@comment>"); - output += protect(source.mid(j, l)); - output += QLatin1String(""); - commentIndex++; + quint32 l = extraLocations[extraIndex].length; + if (extraTypes[extraIndex] == Comment) { + if (source.mid(j, 2) == QLatin1String("/*")) + l += 4; + else + l += 2; + output += QLatin1String("<@comment>"); + output += protect(source.mid(j, l)); + output += QLatin1String(""); + } else + output += protect(source.mid(j, l)); + + extraIndex++; i = j + l; } else break; diff --git a/tools/qdoc3/qmlmarkupvisitor.h b/tools/qdoc3/qmlmarkupvisitor.h index 35f1b5bc..7a9ff22 100644 --- a/tools/qdoc3/qmlmarkupvisitor.h +++ b/tools/qdoc3/qmlmarkupvisitor.h @@ -52,7 +52,14 @@ QT_BEGIN_NAMESPACE class QmlMarkupVisitor : public QDeclarativeJS::AST::Visitor { public: - QmlMarkupVisitor(const QString &code, QDeclarativeJS::Engine *engine); + enum ExtraType{ + Comment, + Pragma + }; + + QmlMarkupVisitor(const QString &code, + const QList &pragmas, + QDeclarativeJS::Engine *engine); virtual ~QmlMarkupVisitor(); QString markedUpCode(); @@ -160,10 +167,12 @@ private: QString sourceText(QDeclarativeJS::AST::SourceLocation &location); QDeclarativeJS::Engine *engine; + QList extraTypes; + QList extraLocations; QString source; QString output; quint32 cursor; - quint32 commentIndex; + int extraIndex; }; QT_END_NAMESPACE -- cgit v0.12 From 3b9674c720a8aca2558a344e9ca08219687afc91 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 6 Dec 2010 19:03:14 +0100 Subject: Added an intermediate version of the QML code marker. --- tools/qdoc3/qmlcodemarker.cpp | 378 ++++++++++++++++++++++++++++++++++++++++++ tools/qdoc3/qmlcodemarker.h | 79 +++++++++ 2 files changed, 457 insertions(+) create mode 100644 tools/qdoc3/qmlcodemarker.cpp create mode 100644 tools/qdoc3/qmlcodemarker.h diff --git a/tools/qdoc3/qmlcodemarker.cpp b/tools/qdoc3/qmlcodemarker.cpp new file mode 100644 index 0000000..6a69136 --- /dev/null +++ b/tools/qdoc3/qmlcodemarker.cpp @@ -0,0 +1,378 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + qmlcodemarker.cpp +*/ + +#include "node.h" +#include "qmlcodemarker.h" + +QT_BEGIN_NAMESPACE + +QmlCodeMarker::QmlCodeMarker() +{ +} + +QmlCodeMarker::~QmlCodeMarker() +{ +} + +bool QmlCodeMarker::recognizeCode( const QString& /* code */ ) +{ + return true; +} + +bool QmlCodeMarker::recognizeExtension( const QString& ext ) +{ + return ext == "qml"; +} + +bool QmlCodeMarker::recognizeLanguage( const QString& lang ) +{ + return lang == "QML"; +} + +QString QmlCodeMarker::plainName( const Node *node ) +{ + QString name = node->name(); + if ( node->type() == Node::Function ) + name += "()"; + return name; +} + +QString QmlCodeMarker::plainFullName( const Node *node, const Node * /* relative */ ) +{ + QString fullName; + for ( ;; ) { + fullName.prepend( plainName(node) ); + if ( node->parent()->name().isEmpty() ) + break; + node = node->parent(); + fullName.prepend("."); + } + return fullName; +} + +QString QmlCodeMarker::markedUpCode( const QString& code, + const Node * /* relative */, + const QString& /* dirPath */ ) +{ + return protect( code ); +} + +QString QmlCodeMarker::markedUpSynopsis( const Node *node, + const Node * /* relative */, + SynopsisStyle style ) +{ + QString synopsis; + QStringList extras; + QString name; + + name = taggedNode( node ); + if ( style != Detailed ) + name = linkTag( node, name ); + name = "<@name>" + name + ""; + + if ( style == Detailed && !node->parent()->name().isEmpty() && + node->type() != Node::Enum ) + name.prepend( taggedNode(node->parent()) + "." ); + + switch ( node->type() ) { + case Node::Class: + synopsis = "class " + name; + break; + case Node::Function: + { + const FunctionNode *func = (const FunctionNode *) node; + + synopsis = name; + + if ( style == SeparateList ) { + synopsis += "()"; + } else { + synopsis += " ("; + if ( !func->parameters().isEmpty() ) { + synopsis += " "; + int numOptional = 0; + QList::ConstIterator p = func->parameters().begin(); + while ( p != func->parameters().end() ) { + if ( !(*p).defaultValue().isEmpty() ) { + if ( p == func->parameters().begin() ) { + synopsis += "[ "; + } else { + synopsis += " [ , "; + } + numOptional++; + } else { + if ( p != func->parameters().begin() ) + synopsis += ", "; + } + if ( !(*p).name().isEmpty() ) + synopsis += "<@param>" + protect( (*p).name() ) + + " : "; + synopsis += protect( (*p).leftType() ); + ++p; + } + for ( int i = 0; i < numOptional; i++ ) + synopsis += " ]"; + synopsis += " "; + } + synopsis += ")"; + } + + if ( style != SeparateList && !func->returnType().isEmpty() ) + synopsis += " : " + protect( func->returnType() ); + + if ( style == Detailed && func->metaness() == FunctionNode::Signal ) + extras << "[signal]"; + } + break; + case Node::Property: + { + const PropertyNode *property = (const PropertyNode *) node; + + synopsis = name; + if ( style != SeparateList ) + synopsis += " : " + property->dataType(); + if ( style == Detailed && property->setters().isEmpty() ) + extras << "[read only]"; + } + break; + case Node::Enum: + { + /* + The letters A to F and X (upper- and lower-case) can + appear in a hexadecimal constant (e.g. 0x3F). + */ + QRegExp letterRegExp( "[G-WYZg-wyz_]" ); + const EnumNode *enume = (const EnumNode *) node; + + synopsis = name; + if ( style == Summary && !enume->items().isEmpty() ) { + synopsis += " : "; + QString comma; + QList::ConstIterator it = enume->items().begin(); + while ( it != enume->items().end() ) { + if ( enume->itemAccess((*it).name()) == Node::Public ) { + synopsis += comma; + synopsis += (*it).name(); + if ( (*it).value().indexOf(letterRegExp) != -1 ) + synopsis += " = " + (*it).value(); + comma = ", "; + } + ++it; + } + } + } + break; + case Node::Namespace: + case Node::Typedef: + default: + synopsis = name; + } + + if ( style == Summary ) { + if ( node->status() == Node::Preliminary ) { + extras << "(preliminary)"; + } else if ( node->status() == Node::Deprecated ) { + extras << "(deprecated)"; + } else if ( node->status() == Node::Obsolete ) { + extras << "(obsolete)"; + } + } + + QString extra; + if ( !extras.isEmpty() ) + extra = "<@extra>" + extras.join(" ") + ""; + return synopsis + extra; +} + +QString QmlCodeMarker::markedUpName( const Node *node ) +{ + QString name = linkTag( node, taggedNode(node) ); + if ( node->type() == Node::Function ) + name += "()"; + return name; +} + +QString QmlCodeMarker::markedUpFullName( const Node *node, + const Node * /* relative */ ) +{ + QString fullName; + for ( ;; ) { + fullName.prepend( markedUpName(node) ); + if ( node->parent()->name().isEmpty() ) + break; + node = node->parent(); + fullName.prepend( "<@op>." ); + } + return fullName; +} + +QString QmlCodeMarker::markedUpEnumValue(const QString & /* enumValue */, + const Node * /* relative */) +{ + return QString(); +} + +QString QmlCodeMarker::markedUpIncludes( const QStringList& /* includes */ ) +{ + return QString(); +} + +QString QmlCodeMarker::functionBeginRegExp( const QString& funcName ) +{ + return "^function[ \t].*\\b" + QRegExp::escape( funcName ); +} + +QString QmlCodeMarker::functionEndRegExp( const QString& /* funcName */ ) +{ + return "^}"; +} + +QList
    QmlCodeMarker::sections( const InnerNode *inner, SynopsisStyle style, Status status ) +{ + QList
    sections; + + if (inner->type() != Node::Class) + return sections; + + const ClassNode *classe = static_cast(inner); + + if ( style == Summary ) { + FastSection enums(classe, "Enums", "", "enum", "enums"); + FastSection functions(classe, "Functions", "", "function", "functions"); + FastSection readOnlyProperties(classe, "", "Read-Only Properties", "property", "properties"); + FastSection signalz(classe, "Signals", "", "signal", "signals"); + FastSection writableProperties(classe, "", "Writable Properties", "property", "properties"); + + QStack stack; + stack.push( classe ); + + while ( !stack.isEmpty() ) { + const ClassNode *ancestorClass = stack.pop(); + + NodeList::ConstIterator c = ancestorClass->childNodes().begin(); + while ( c != ancestorClass->childNodes().end() ) { + if ( (*c)->access() == Node::Public ) { + if ( (*c)->type() == Node::Enum ) { + insert( enums, *c, style, status ); + } else if ( (*c)->type() == Node::Function ) { + const FunctionNode *func = (const FunctionNode *) *c; + if ( func->metaness() == FunctionNode::Signal ) { + insert( signalz, *c, style, status ); + } else { + insert( functions, *c, style, status ); + } + } else if ( (*c)->type() == Node::Property ) { + const PropertyNode *property = + (const PropertyNode *) *c; + if ( property->setters().isEmpty() ) { + insert( readOnlyProperties, *c, style, status ); + } else { + insert( writableProperties, *c, style, status ); + } + } + } + ++c; + } + + QList::ConstIterator r = ancestorClass->baseClasses().begin(); + while ( r != ancestorClass->baseClasses().end() ) { + stack.prepend( (*r).node ); + ++r; + } + } + append( sections, enums ); + append( sections, writableProperties ); + append( sections, readOnlyProperties ); + append( sections, functions ); + append( sections, signalz ); + } else if ( style == Detailed ) { + FastSection enums( classe, "Enum Documentation", "", "member", "members"); + FastSection functionsAndSignals( classe, "Function and Signal Documentation", "", "member", "members"); + FastSection properties( classe, "Property Documentation", "", "member", "members"); + + NodeList::ConstIterator c = classe->childNodes().begin(); + while ( c != classe->childNodes().end() ) { + if ( (*c)->access() == Node::Public ) { + if ( (*c)->type() == Node::Enum ) { + insert( enums, *c, style, status ); + } else if ( (*c)->type() == Node::Function ) { + insert( functionsAndSignals, *c, style, status ); + } else if ( (*c)->type() == Node::Property ) { + insert( properties, *c, style, status ); + } + } + ++c; + } + append( sections, enums ); + append( sections, properties ); + append( sections, functionsAndSignals ); + } else { // ( style == SeparateList ) + FastSection all(classe, "", "", "member", "members"); + + QStack stack; + stack.push( classe ); + + while ( !stack.isEmpty() ) { + const ClassNode *ancestorClass = stack.pop(); + + NodeList::ConstIterator c = ancestorClass->childNodes().begin(); + while ( c != ancestorClass->childNodes().end() ) { + if ( (*c)->access() == Node::Public ) + insert( all, *c, style, status ); + ++c; + } + + QList::ConstIterator r = ancestorClass->baseClasses().begin(); + while ( r != ancestorClass->baseClasses().end() ) { + stack.prepend( (*r).node ); + ++r; + } + } + append( sections, all ); + } + return sections; +} + +QT_END_NAMESPACE diff --git a/tools/qdoc3/qmlcodemarker.h b/tools/qdoc3/qmlcodemarker.h new file mode 100644 index 0000000..bc46209 --- /dev/null +++ b/tools/qdoc3/qmlcodemarker.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + qmlcodemarker.h +*/ + +#ifndef QMLCODEMARKER_H +#define QMLCODEMARKER_H + +#include "codemarker.h" + +QT_BEGIN_NAMESPACE + +class QmlCodeMarker : public CodeMarker +{ +public: + QmlCodeMarker(); + ~QmlCodeMarker(); + + bool recognizeCode( const QString& code ); + bool recognizeExtension( const QString& ext ); + bool recognizeLanguage( const QString& lang ); + QString plainName(const Node *node); + QString plainFullName(const Node *node, const Node *relative); + QString markedUpCode( const QString& code, const Node *relative, + const QString& dirPath ); + QString markedUpSynopsis( const Node *node, const Node *relative, + SynopsisStyle style ); + QString markedUpName( const Node *node ); + QString markedUpFullName( const Node *node, const Node *relative ); + QString markedUpEnumValue(const QString &enumValue, const Node *relative); + QString markedUpIncludes( const QStringList& includes ); + QList
    sections(const InnerNode *innerNode, SynopsisStyle style, Status status); + QString functionBeginRegExp( const QString& funcName ); + QString functionEndRegExp( const QString& funcName ); +}; + +QT_END_NAMESPACE + +#endif -- cgit v0.12 From 076bba6c901e292b61fffb7a91020075dcd84919 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 7 Dec 2010 14:42:50 +0100 Subject: Doc: Added new style colors, increased the contrast of existing colors. --- doc/src/template/style/style.css | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 16bc9ed..03bc9a9 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -179,12 +179,27 @@ span.comment { - color: #8B0000; - font-style: italic; + color: #008B00; } span.string, span.char { - color: #254117; + color: #000084; + } + span.number + { + color: #a46200; + } + span.operator + { + color: black; + } + span.keyword + { + color: #840000; + } + span.name + { + color: black } -- cgit v0.12 From cac82fa92665c21abc8568b3287a50eb3dfc8349 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 7 Dec 2010 15:57:34 +0100 Subject: Updated the DITA generator to use the modified generator API. --- tools/qdoc3/ditaxmlgenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index c7fc2a9..f46b663 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -573,7 +573,7 @@ void DitaXmlGenerator::generateTree(const Tree *tree) findAllNamespaces(tree->root()); findAllSince(tree->root()); - PageGenerator::generateTree(tree, marker); + PageGenerator::generateTree(tree); writeDitaMap(); } -- cgit v0.12 From 327c95f6ce1c2f2ae2e4da8ca89d5ef0b2595af3 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 7 Dec 2010 16:35:32 +0100 Subject: Updated the DITA configuration to use the new configuration structure. --- tools/qdoc3/test/qt-ditaxml.qdocconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/test/qt-ditaxml.qdocconf b/tools/qdoc3/test/qt-ditaxml.qdocconf index 1feb2b2..cc2937a 100644 --- a/tools/qdoc3/test/qt-ditaxml.qdocconf +++ b/tools/qdoc3/test/qt-ditaxml.qdocconf @@ -1,4 +1,4 @@ -include(qt.qdocconf) +include(qt-project.qdocconf) imagedirs = $QTDIR/doc/src/images \ $QTDIR/examples \ -- cgit v0.12 From 32292a7bdd3764aad917f7df1ea4a791f0b1528f Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 8 Dec 2010 12:13:53 +0100 Subject: qdoc: Fixed the double escaping problem. It's sort of ugly, because it just removes the escapeing that the code marker puts in so the XML stream writer can put the escaping back in again. It doesn't seem to slow it down at all, which is wierd. --- tools/qdoc3/ditaxmlgenerator.cpp | 230 ++++++++++++++++++++------------------- tools/qdoc3/ditaxmlgenerator.h | 1 + 2 files changed, 120 insertions(+), 111 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index b4a42ab..378800c 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -308,6 +308,21 @@ QString DitaXmlGenerator::sinceTitles[] = static bool showBrokenLinks = false; /*! + Quick, dirty, and very ugly. Unescape \a text + so QXmlStreamWriter::writeCharacters() can put + the escapes back in again! + */ +void DitaXmlGenerator::writeCharacters(const QString& text) +{ + QString t = text; + t = t.replace("<","<"); + t = t.replace(">",">"); + t = t.replace("&","&"); + t = t.replace(""","\""); + xmlWriter().writeCharacters(t); +} + +/*! Appends an element to the current XML stream with the \a href attribute and the \a text. */ @@ -317,11 +332,11 @@ void DitaXmlGenerator::addLink(const QString& href, if (!href.isEmpty()) { xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href", href); - xmlWriter().writeCharacters(text.toString()); + writeCharacters(text.toString()); xmlWriter().writeEndElement(); // } else { - xmlWriter().writeCharacters(text.toString()); + writeCharacters(text.toString()); } } @@ -644,11 +659,11 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, endLink(); } else { - xmlWriter().writeCharacters(protectEnc(atom->string())); + writeCharacters(protectEnc(atom->string())); } } else { - xmlWriter().writeCharacters(protectEnc(atom->string())); + writeCharacters(protectEnc(atom->string())); } break; case Atom::BaseName: @@ -673,13 +688,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeCharacters("property"); else if (relative->type() == Node::Variable) xmlWriter().writeCharacters("variable"); - QStringList words = str.split(" "); - if (!(words.first() == "contains" || words.first() == "specifies" - || words.first() == "describes" || words.first() == "defines" - || words.first() == "holds" || words.first() == "determines")) - xmlWriter().writeCharacters(" holds "); - else - xmlWriter().writeCharacters(" "); + xmlWriter().writeCharacters(" holds "); } if (noLinks) { atom = atom->next(); @@ -690,12 +699,11 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, skipAhead++; atom = atom->next(); } - str[0] = str[0].toLower(); - if (str.right(1) == ".") - str.truncate(str.length() - 1); - str[0] = str[0].toUpper(); - xmlWriter().writeCharacters(str + "."); } + str[0] = str[0].toLower(); + if (str.right(1) == ".") + str.truncate(str.length() - 1); + writeCharacters(str + "."); break; case Atom::BriefRight: // if (relative->type() != Node::Fake) @@ -705,7 +713,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::C: xmlWriter().writeStartElement(formattingLeftMap()[ATOM_FORMATTING_TELETYPE]); if (inLink) { - xmlWriter().writeCharacters(protectEnc(plainCode(atom->string()))); + writeCharacters(protectEnc(plainCode(atom->string()))); } else { writeText(atom->string(), marker, relative); @@ -740,7 +748,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, // fallthrough case Atom::CodeBad: xmlWriter().writeStartElement("codeblock"); - xmlWriter().writeCharacters(trimmedTrailing(plainCode(atom->string()))); + writeCharacters(trimmedTrailing(plainCode(atom->string()))); xmlWriter().writeEndElement(); // break; case Atom::FootnoteLeft: @@ -986,7 +994,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeStartElement("p"); writeGuidAttribute(Doc::canonicalTitle((*s).name)); xmlWriter().writeAttribute("outputclass","h3"); - xmlWriter().writeCharacters(protectEnc((*s).name)); + writeCharacters(protectEnc((*s).name)); xmlWriter().writeEndElement(); //

    if (idx == Class) generateCompactList(0, marker, ncmap.value(), false, QString("Q")); @@ -1012,7 +1020,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href",linkForNode(pmap.key(), 0)); QStringList pieces = fullName(pmap.key(), 0, marker).split("::"); - xmlWriter().writeCharacters(protectEnc(pieces.last())); + writeCharacters(protectEnc(pieces.last())); xmlWriter().writeEndElement(); // xmlWriter().writeCharacters(":"); xmlWriter().writeEndElement(); //

    @@ -1058,7 +1066,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } if (!text.isEmpty()) { xmlWriter().writeStartElement("alt"); - xmlWriter().writeCharacters(protectEnc(text)); + writeCharacters(protectEnc(text)); xmlWriter().writeEndElement(); // } xmlWriter().writeEndElement(); // @@ -1184,8 +1192,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeStartElement("strow"); xmlWriter().writeStartElement("stentry"); xmlWriter().writeStartElement("tt"); - xmlWriter().writeCharacters(protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(), - relative)))); + writeCharacters(protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(), + relative)))); xmlWriter().writeEndElement(); //
    xmlWriter().writeEndElement(); // xmlWriter().writeStartElement("stentry"); @@ -1200,7 +1208,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, xmlWriter().writeCharacters("?"); else { xmlWriter().writeStartElement("tt"); - xmlWriter().writeCharacters(protectEnc(itemValue)); + writeCharacters(protectEnc(itemValue)); xmlWriter().writeEndElement(); // } skipAhead = 1; @@ -1278,11 +1286,11 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (atom->string() == " ") break; if (atom->string().startsWith("&")) - xmlWriter().writeCharacters(atom->string()); + writeCharacters(atom->string()); else { xmlWriter().writeStartElement("pre"); xmlWriter().writeAttribute("outputclass","raw-html"); - xmlWriter().writeCharacters(atom->string()); + writeCharacters(atom->string()); xmlWriter().writeEndElement(); // } break; @@ -1323,7 +1331,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, generateLink(atom, relative, marker); } else { - xmlWriter().writeCharacters(protectEnc(atom->string())); + writeCharacters(protectEnc(atom->string())); } break; case Atom::TableLeft: @@ -1467,13 +1475,13 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::UnhandledFormat: xmlWriter().writeStartElement("b"); xmlWriter().writeAttribute("outputclass","error"); - xmlWriter().writeCharacters("<Missing DITAXML>"); + xmlWriter().writeCharacters(""); xmlWriter().writeEndElement(); // break; case Atom::UnknownCommand: xmlWriter().writeStartElement("b"); xmlWriter().writeAttribute("outputclass","error unknown-command"); - xmlWriter().writeCharacters(protectEnc(atom->string())); + writeCharacters(protectEnc(atom->string())); xmlWriter().writeEndElement(); // break; case Atom::QmlText: @@ -1553,7 +1561,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc((*s).name)); + writeCharacters(protectEnc((*s).name)); xmlWriter().writeEndElement(); // generateSection(s->members, inner, marker, CodeMarker::Summary); generateSectionInheritedList(*s, inner, marker); @@ -1566,7 +1574,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc(name)); + writeCharacters(protectEnc(name)); xmlWriter().writeEndElement(); // generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); generateSectionInheritedList(*s, inner, marker); @@ -1692,7 +1700,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc((*s).name)); + writeCharacters(protectEnc((*s).name)); xmlWriter().writeEndElement(); // generateSection(s->members, inner, marker, CodeMarker::Summary); generateSectionInheritedList(*s, inner, marker); @@ -1705,7 +1713,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc(name)); + writeCharacters(protectEnc(name)); xmlWriter().writeEndElement(); // generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); generateSectionInheritedList(*s, inner, marker); @@ -1812,7 +1820,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc((*s).name)); + writeCharacters(protectEnc((*s).name)); xmlWriter().writeEndElement(); // generateSection(s->members, inner, marker, CodeMarker::Summary); generateSectionInheritedList(*s, inner, marker); @@ -1825,7 +1833,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc(name)); + writeCharacters(protectEnc(name)); xmlWriter().writeEndElement(); // generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); generateSectionInheritedList(*s, inner, marker); @@ -1928,7 +1936,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc((*s).name)); + writeCharacters(protectEnc((*s).name)); xmlWriter().writeEndElement(); // generateQmlSummary(*s,qcn,marker); //generateSection(s->members, inner, marker, CodeMarker::Summary); @@ -1954,7 +1962,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeAttribute("outputclass",attr); xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(protectEnc((*s).name)); + writeCharacters(protectEnc((*s).name)); xmlWriter().writeEndElement(); // NodeList::ConstIterator m = (*s).members.begin(); while (m != (*s).members.end()) { @@ -1981,7 +1989,7 @@ void DitaXmlGenerator::writeXrefListItem(const QString& link, const QString& tex xmlWriter().writeStartElement("li"); xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href",link); - xmlWriter().writeCharacters(text); + writeCharacters(text); xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // } @@ -2088,7 +2096,7 @@ void DitaXmlGenerator::writeLink(const Node* node, xmlWriter().writeAttribute("href", link); xmlWriter().writeAttribute("role", role); xmlWriter().writeStartElement("linktext"); - xmlWriter().writeCharacters(text); + writeCharacters(text); xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // } @@ -2237,7 +2245,7 @@ void DitaXmlGenerator::generateHeader(const Node* node, if (!outputclass.isEmpty()) xmlWriter().writeAttribute("outputclass",outputclass); xmlWriter().writeStartElement(nameElement); // or <apiName> - xmlWriter().writeCharacters(name); + writeCharacters(name); xmlWriter().writeEndElement(); // or } @@ -2605,7 +2613,7 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative, else { xmlWriter().writeStartElement("entry"); xmlWriter().writeStartElement("p"); - xmlWriter().writeCharacters(protectEnc(node->doc().briefText().toString())); // zzz + writeCharacters(protectEnc(node->doc().briefText().toString())); // zzz xmlWriter().writeEndElement(); //

    xmlWriter().writeEndElement(); // } @@ -3030,7 +3038,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative, CodeMarker* /* xmlWriter().writeAttribute("outputclass","h3"); xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href",linkForNode(groupNode, relative)); - xmlWriter().writeCharacters(protectEnc(groupNode->fullTitle())); + writeCharacters(protectEnc(groupNode->fullTitle())); xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); //

    if (fakeNodeMap[groupNode].count() == 0) @@ -3044,7 +3052,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative, CodeMarker* /* xmlWriter().writeStartElement("li"); xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href",linkForNode(fakeNode, relative)); - xmlWriter().writeCharacters(protectEnc(title)); + writeCharacters(protectEnc(title)); xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // } @@ -3065,7 +3073,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative, CodeMarker* /* xmlWriter().writeStartElement("li"); xmlWriter().writeStartElement("xref"); xmlWriter().writeAttribute("href",linkForNode(fakeNode, relative)); - xmlWriter().writeCharacters(protectEnc(title)); + writeCharacters(protectEnc(title)); xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // } @@ -3120,14 +3128,14 @@ void DitaXmlGenerator::generateSectionInheritedList(const Section& section, else text += section.pluralMember; text += " inherited from "; - xmlWriter().writeCharacters(text); + writeCharacters(text); xmlWriter().writeStartElement("xref"); // zzz text = fileName((*p).first) + "#"; text += DitaXmlGenerator::cleanRef(section.name.toLower()); xmlWriter().writeAttribute("href",text); text = protectEnc(marker->plainFullName((*p).first, relative)); - xmlWriter().writeCharacters(text); + writeCharacters(text); xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // ++p; @@ -3269,7 +3277,7 @@ void DitaXmlGenerator::writeText(const QString& markedCode, const Node* n = 0; if (k == 0) { // <@link> if (!html.isEmpty()) { - xmlWriter().writeCharacters(html); + writeCharacters(html); html.clear(); } n = CodeMarker::nodeForString(par1.toString()); @@ -3278,25 +3286,25 @@ void DitaXmlGenerator::writeText(const QString& markedCode, } else if (k == 4) { // <@param> if (!html.isEmpty()) { - xmlWriter().writeCharacters(html); + writeCharacters(html); html.clear(); } xmlWriter().writeStartElement("i"); - xmlWriter().writeCharacters(arg.toString()); + writeCharacters(arg.toString()); xmlWriter().writeEndElement(); // } else if (k == 5) { // <@extra> if (!html.isEmpty()) { - xmlWriter().writeCharacters(html); + writeCharacters(html); html.clear(); } xmlWriter().writeStartElement("tt"); - xmlWriter().writeCharacters(arg.toString()); + writeCharacters(arg.toString()); xmlWriter().writeEndElement(); // } else { if (!html.isEmpty()) { - xmlWriter().writeCharacters(html); + writeCharacters(html); html.clear(); } par1 = QStringRef(); @@ -3328,7 +3336,7 @@ void DitaXmlGenerator::writeText(const QString& markedCode, } if (!html.isEmpty()) { - xmlWriter().writeCharacters(html); + writeCharacters(html); } } @@ -3341,7 +3349,7 @@ void DitaXmlGenerator::generateLink(const Atom* atom, if (funcLeftParen.indexIn(atom->string()) != -1 && marker->recognizeLanguage("Cpp")) { // hack for C++: move () outside of link int k = funcLeftParen.pos(1); - xmlWriter().writeCharacters(protectEnc(atom->string().left(k))); + writeCharacters(protectEnc(atom->string().left(k))); if (link.isEmpty()) { if (showBrokenLinks) xmlWriter().writeEndElement(); // @@ -3349,7 +3357,7 @@ void DitaXmlGenerator::generateLink(const Atom* atom, else xmlWriter().writeEndElement(); // inLink = false; - xmlWriter().writeCharacters(protectEnc(atom->string().mid(k))); + writeCharacters(protectEnc(atom->string().mid(k))); } else if (marker->recognizeLanguage("Java")) { // hack for Java: remove () and use when appropriate @@ -3358,13 +3366,13 @@ void DitaXmlGenerator::generateLink(const Atom* atom, if (tt) xmlWriter().writeStartElement("tt"); if (func) - xmlWriter().writeCharacters(protectEnc(atom->string().left(atom->string().length() - 2))); + writeCharacters(protectEnc(atom->string().left(atom->string().length() - 2))); else - xmlWriter().writeCharacters(protectEnc(atom->string())); + writeCharacters(protectEnc(atom->string())); xmlWriter().writeEndElement(); // } else - xmlWriter().writeCharacters(protectEnc(atom->string())); + writeCharacters(protectEnc(atom->string())); } QString DitaXmlGenerator::cleanRef(const QString& ref) @@ -3699,7 +3707,7 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode, xmlWriter().writeStartElement("xref"); QString href = linkForNode(actualNode, relative); xmlWriter().writeAttribute("href",href); - xmlWriter().writeCharacters(protectEnc(fullName(apparentNode, relative, marker))); + writeCharacters(protectEnc(fullName(apparentNode, relative, marker))); xmlWriter().writeEndElement(); // } @@ -4417,7 +4425,7 @@ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker) xmlWriter().writeStartElement(CXXCLASSBASECLASS); QString attr = fileName((*r).node) + "#" + (*r).node->guid(); xmlWriter().writeAttribute("href",attr); - xmlWriter().writeCharacters(marker->plainFullName((*r).node)); + writeCharacters(marker->plainFullName((*r).node)); xmlWriter().writeEndElement(); // // not included: or @@ -4529,7 +4537,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, xmlWriter().writeAttribute("class","signal"); else if (fn->metaness() == FunctionNode::Slot) xmlWriter().writeAttribute("class","slot"); - xmlWriter().writeCharacters(fn->name()); + writeCharacters(fn->name()); xmlWriter().writeEndElement(); // generateBrief(fn,marker); @@ -4589,7 +4597,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, } else { xmlWriter().writeStartElement(CXXFUNCTIONDECLAREDTYPE); - xmlWriter().writeCharacters(fn->returnType()); + writeCharacters(fn->returnType()); xmlWriter().writeEndElement(); // } @@ -4598,11 +4606,11 @@ void DitaXmlGenerator::writeFunctions(const Section& s, QString fq = fullQualification(fn); if (!fq.isEmpty()) { xmlWriter().writeStartElement(CXXFUNCTIONSCOPEDNAME); - xmlWriter().writeCharacters(fq); + writeCharacters(fq); xmlWriter().writeEndElement(); // } xmlWriter().writeStartElement(CXXFUNCTIONPROTOTYPE); - xmlWriter().writeCharacters(fn->signature(true)); + writeCharacters(fn->signature(true)); xmlWriter().writeEndElement(); // QString fnl = fn->signature(false); @@ -4613,7 +4621,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, ++idx; fnl = fn->parent()->name() + "::" + fnl.mid(idx); xmlWriter().writeStartElement(CXXFUNCTIONNAMELOOKUP); - xmlWriter().writeCharacters(fnl); + writeCharacters(fnl); xmlWriter().writeEndElement(); // if (!fn->isInternal() && fn->isReimp() && fn->reimplementedFrom() != 0) { @@ -4621,7 +4629,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, if (rfn && !rfn->isInternal()) { xmlWriter().writeStartElement(CXXFUNCTIONREIMPLEMENTED); xmlWriter().writeAttribute("href",rfn->ditaXmlHref()); - xmlWriter().writeCharacters(marker->plainFullName(rfn)); + writeCharacters(marker->plainFullName(rfn)); xmlWriter().writeEndElement(); // } } @@ -4658,19 +4666,19 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn) while (p != parameters.end()) { xmlWriter().writeStartElement(CXXFUNCTIONPARAMETER); xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERDECLAREDTYPE); - xmlWriter().writeCharacters((*p).leftType()); + writeCharacters((*p).leftType()); if (!(*p).rightType().isEmpty()) - xmlWriter().writeCharacters((*p).rightType()); + writeCharacters((*p).rightType()); xmlWriter().writeEndElement(); // xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERDECLARATIONNAME); - xmlWriter().writeCharacters((*p).name()); + writeCharacters((*p).name()); xmlWriter().writeEndElement(); // // not included: if (!(*p).defaultValue().isEmpty()) { xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERDEFAULTVALUE); - xmlWriter().writeCharacters((*p).defaultValue()); + writeCharacters((*p).defaultValue()); xmlWriter().writeEndElement(); // } @@ -4699,7 +4707,7 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, if (!attribute.isEmpty()) xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); - xmlWriter().writeCharacters(en->name()); + writeCharacters(en->name()); xmlWriter().writeEndElement(); // generateBrief(en,marker); @@ -4714,20 +4722,20 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, QString fq = fullQualification(en); if (!fq.isEmpty()) { xmlWriter().writeStartElement(CXXENUMERATIONSCOPEDNAME); - xmlWriter().writeCharacters(fq); + writeCharacters(fq); xmlWriter().writeEndElement(); // } const QList& items = en->items(); if (!items.isEmpty()) { xmlWriter().writeStartElement(CXXENUMERATIONPROTOTYPE); - xmlWriter().writeCharacters(en->name()); + writeCharacters(en->name()); xmlWriter().writeCharacters(" = { "); QList::ConstIterator i = items.begin(); while (i != items.end()) { - xmlWriter().writeCharacters((*i).name()); + writeCharacters((*i).name()); if (!(*i).value().isEmpty()) { xmlWriter().writeCharacters(" = "); - xmlWriter().writeCharacters((*i).value()); + writeCharacters((*i).value()); } ++i; if (i != items.end()) @@ -4738,7 +4746,7 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, } xmlWriter().writeStartElement(CXXENUMERATIONNAMELOOKUP); - xmlWriter().writeCharacters(en->parent()->name() + "::" + en->name()); + writeCharacters(en->parent()->name() + "::" + en->name()); xmlWriter().writeEndElement(); // // not included: @@ -4749,20 +4757,20 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, while (i != items.end()) { xmlWriter().writeStartElement(CXXENUMERATOR); xmlWriter().writeStartElement("apiName"); - xmlWriter().writeCharacters((*i).name()); + writeCharacters((*i).name()); xmlWriter().writeEndElement(); // QString fq = fullQualification(en->parent()); if (!fq.isEmpty()) { xmlWriter().writeStartElement(CXXENUMERATORSCOPEDNAME); - xmlWriter().writeCharacters(fq + "::" + (*i).name()); + writeCharacters(fq + "::" + (*i).name()); xmlWriter().writeEndElement(); // } xmlWriter().writeStartElement(CXXENUMERATORPROTOTYPE); - xmlWriter().writeCharacters((*i).name()); + writeCharacters((*i).name()); xmlWriter().writeEndElement(); // xmlWriter().writeStartElement(CXXENUMERATORNAMELOOKUP); - xmlWriter().writeCharacters(en->parent()->name() + "::" + (*i).name()); + writeCharacters(en->parent()->name() + "::" + (*i).name()); xmlWriter().writeEndElement(); // if (!(*i).value().isEmpty()) { @@ -4818,7 +4826,7 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, if (!attribute.isEmpty()) xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); - xmlWriter().writeCharacters(tn->name()); + writeCharacters(tn->name()); xmlWriter().writeEndElement(); // generateBrief(tn,marker); @@ -4835,14 +4843,14 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, QString fq = fullQualification(tn); if (!fq.isEmpty()) { xmlWriter().writeStartElement(CXXTYPEDEFSCOPEDNAME); - xmlWriter().writeCharacters(fq); + writeCharacters(fq); xmlWriter().writeEndElement(); // } // not included: xmlWriter().writeStartElement(CXXTYPEDEFNAMELOOKUP); - xmlWriter().writeCharacters(tn->parent()->name() + "::" + tn->name()); + writeCharacters(tn->parent()->name() + "::" + tn->name()); xmlWriter().writeEndElement(); // // not included: @@ -4881,7 +4889,7 @@ void DitaXmlGenerator::writeProperties(const Section& s, if (!attribute.isEmpty()) xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); - xmlWriter().writeCharacters(pn->name()); + writeCharacters(pn->name()); xmlWriter().writeEndElement(); // generateBrief(pn,marker); @@ -4900,21 +4908,21 @@ void DitaXmlGenerator::writeProperties(const Section& s, if (!pn->qualifiedDataType().isEmpty()) { xmlWriter().writeStartElement(CXXVARIABLEDECLAREDTYPE); - xmlWriter().writeCharacters(pn->qualifiedDataType()); + writeCharacters(pn->qualifiedDataType()); xmlWriter().writeEndElement(); // } QString fq = fullQualification(pn); if (!fq.isEmpty()) { xmlWriter().writeStartElement(CXXVARIABLESCOPEDNAME); - xmlWriter().writeCharacters(fq); + writeCharacters(fq); xmlWriter().writeEndElement(); // } xmlWriter().writeStartElement(CXXVARIABLEPROTOTYPE); xmlWriter().writeCharacters("Q_PROPERTY("); - xmlWriter().writeCharacters(pn->qualifiedDataType()); + writeCharacters(pn->qualifiedDataType()); xmlWriter().writeCharacters(" "); - xmlWriter().writeCharacters(pn->name()); + writeCharacters(pn->name()); writePropertyParameter("READ",pn->getters()); writePropertyParameter("WRITE",pn->setters()); writePropertyParameter("RESET",pn->resetters()); @@ -4922,14 +4930,14 @@ void DitaXmlGenerator::writeProperties(const Section& s, if (pn->isDesignable() != pn->designableDefault()) { xmlWriter().writeCharacters(" DESIGNABLE "); if (!pn->runtimeDesignabilityFunction().isEmpty()) - xmlWriter().writeCharacters(pn->runtimeDesignabilityFunction()); + writeCharacters(pn->runtimeDesignabilityFunction()); else xmlWriter().writeCharacters(pn->isDesignable() ? "true" : "false"); } if (pn->isScriptable() != pn->scriptableDefault()) { xmlWriter().writeCharacters(" SCRIPTABLE "); if (!pn->runtimeScriptabilityFunction().isEmpty()) - xmlWriter().writeCharacters(pn->runtimeScriptabilityFunction()); + writeCharacters(pn->runtimeScriptabilityFunction()); else xmlWriter().writeCharacters(pn->isScriptable() ? "true" : "false"); } @@ -4949,14 +4957,14 @@ void DitaXmlGenerator::writeProperties(const Section& s, xmlWriter().writeEndElement(); // xmlWriter().writeStartElement(CXXVARIABLENAMELOOKUP); - xmlWriter().writeCharacters(pn->parent()->name() + "::" + pn->name()); + writeCharacters(pn->parent()->name() + "::" + pn->name()); xmlWriter().writeEndElement(); // if (pn->overriddenFrom() != 0) { PropertyNode* opn = (PropertyNode*)pn->overriddenFrom(); xmlWriter().writeStartElement(CXXVARIABLEREIMPLEMENTED); xmlWriter().writeAttribute("href",opn->ditaXmlHref()); - xmlWriter().writeCharacters(marker->plainFullName(opn)); + writeCharacters(marker->plainFullName(opn)); xmlWriter().writeEndElement(); // } @@ -4993,7 +5001,7 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, if (!attribute.isEmpty()) xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); - xmlWriter().writeCharacters(vn->name()); + writeCharacters(vn->name()); xmlWriter().writeEndElement(); // generateBrief(vn,marker); @@ -5018,28 +5026,28 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, // , xmlWriter().writeStartElement(CXXVARIABLEDECLAREDTYPE); - xmlWriter().writeCharacters(vn->leftType()); + writeCharacters(vn->leftType()); if (!vn->rightType().isEmpty()) - xmlWriter().writeCharacters(vn->rightType()); + writeCharacters(vn->rightType()); xmlWriter().writeEndElement(); // QString fq = fullQualification(vn); if (!fq.isEmpty()) { xmlWriter().writeStartElement(CXXVARIABLESCOPEDNAME); - xmlWriter().writeCharacters(fq); + writeCharacters(fq); xmlWriter().writeEndElement(); // } xmlWriter().writeStartElement(CXXVARIABLEPROTOTYPE); - xmlWriter().writeCharacters(vn->leftType() + " "); - //xmlWriter().writeCharacters(vn->parent()->name() + "::" + vn->name()); - xmlWriter().writeCharacters(vn->name()); + writeCharacters(vn->leftType() + " "); + //writeCharacters(vn->parent()->name() + "::" + vn->name()); + writeCharacters(vn->name()); if (!vn->rightType().isEmpty()) - xmlWriter().writeCharacters(vn->rightType()); + writeCharacters(vn->rightType()); xmlWriter().writeEndElement(); // xmlWriter().writeStartElement(CXXVARIABLENAMELOOKUP); - xmlWriter().writeCharacters(vn->parent()->name() + "::" + vn->name()); + writeCharacters(vn->parent()->name() + "::" + vn->name()); xmlWriter().writeEndElement(); // // not included: @@ -5078,7 +5086,7 @@ void DitaXmlGenerator::writeMacros(const Section& s, if (!attribute.isEmpty()) xmlWriter().writeAttribute("outputclass",attribute); xmlWriter().writeStartElement("apiName"); - xmlWriter().writeCharacters(fn->name()); + writeCharacters(fn->name()); xmlWriter().writeEndElement(); // generateBrief(fn,marker); @@ -5092,7 +5100,7 @@ void DitaXmlGenerator::writeMacros(const Section& s, xmlWriter().writeStartElement(CXXDEFINEPROTOTYPE); xmlWriter().writeCharacters("#define "); - xmlWriter().writeCharacters(fn->name()); + writeCharacters(fn->name()); if (fn->metaness() == FunctionNode::MacroWithParams) { QStringList params = fn->parameterNames(); if (!params.isEmpty()) { @@ -5101,7 +5109,7 @@ void DitaXmlGenerator::writeMacros(const Section& s, if (params[i].isEmpty()) xmlWriter().writeCharacters("..."); else - xmlWriter().writeCharacters(params[i]); + writeCharacters(params[i]); if ((i+1) < params.size()) xmlWriter().writeCharacters(", "); } @@ -5111,14 +5119,14 @@ void DitaXmlGenerator::writeMacros(const Section& s, xmlWriter().writeEndElement(); // xmlWriter().writeStartElement(CXXDEFINENAMELOOKUP); - xmlWriter().writeCharacters(fn->name()); + writeCharacters(fn->name()); xmlWriter().writeEndElement(); // if (fn->reimplementedFrom() != 0) { FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom(); xmlWriter().writeStartElement(CXXDEFINEREIMPLEMENTED); xmlWriter().writeAttribute("href",rfn->ditaXmlHref()); - xmlWriter().writeCharacters(marker->plainFullName(rfn)); + writeCharacters(marker->plainFullName(rfn)); xmlWriter().writeEndElement(); // } @@ -5129,7 +5137,7 @@ void DitaXmlGenerator::writeMacros(const Section& s, for (int i = 0; i < params.size(); ++i) { xmlWriter().writeStartElement(CXXDEFINEPARAMETER); xmlWriter().writeStartElement(CXXDEFINEPARAMETERDECLARATIONNAME); - xmlWriter().writeCharacters(params[i]); + writeCharacters(params[i]); xmlWriter().writeEndElement(); // // not included: @@ -5168,9 +5176,9 @@ void DitaXmlGenerator::writePropertyParameter(const QString& tag, const NodeList NodeList::const_iterator n = nlist.begin(); while (n != nlist.end()) { xmlWriter().writeCharacters(" "); - xmlWriter().writeCharacters(tag); + writeCharacters(tag); xmlWriter().writeCharacters(" "); - xmlWriter().writeCharacters((*n)->name()); + writeCharacters((*n)->name()); ++n; } } @@ -5255,7 +5263,7 @@ void DitaXmlGenerator::writeDetailedDescription(const Node* node, xmlWriter().writeAttribute("outputclass","details"); xmlWriter().writeStartElement("title"); xmlWriter().writeAttribute("outputclass","h2"); - xmlWriter().writeCharacters(title); + writeCharacters(title); xmlWriter().writeEndElement(); // } else { @@ -5294,7 +5302,7 @@ void DitaXmlGenerator::writeNestedClasses(const Section& s, QString link = linkForNode((*m), n); xmlWriter().writeAttribute("href", link); QString name = n->name() + "::" + (*m)->name(); - xmlWriter().writeCharacters(name); + writeCharacters(name); xmlWriter().writeEndElement(); // } ++m; diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index b13fa49..c077b53 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -112,6 +112,7 @@ class DitaXmlGenerator : public PageGenerator void writeXrefListItem(const QString& link, const QString& text); QString fullQualification(const Node* n); + void writeCharacters(const QString& text); void writeDerivations(const ClassNode* cn, CodeMarker* marker); void writeLocation(const Node* n); void writeFunctions(const Section& s, -- cgit v0.12 From bcdfd348e433f21f18711a1b6f7fee8248de767f Mon Sep 17 00:00:00 2001 From: miniak Date: Wed, 8 Dec 2010 12:32:44 +0100 Subject: Cleanup unused QAccessWidget Merge-request: 2519 Reviewed-by: Thierry Bastian --- src/gui/widgets/qeffects.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/gui/widgets/qeffects.cpp b/src/gui/widgets/qeffects.cpp index a56d093..b875aa4 100644 --- a/src/gui/widgets/qeffects.cpp +++ b/src/gui/widgets/qeffects.cpp @@ -55,19 +55,6 @@ QT_BEGIN_NAMESPACE /* - Internal class to get access to protected QWidget-members -*/ - -class QAccessWidget : public QWidget -{ - friend class QAlphaWidget; - friend class QRollEffect; -public: - QAccessWidget(QWidget* parent=0, Qt::WindowFlags f = 0) - : QWidget(parent, f) {} -}; - -/* Internal class QAlphaWidget. The QAlphaWidget is shown while the animation lasts @@ -98,7 +85,7 @@ private: QImage backImage; QImage frontImage; QImage mixedImage; - QPointer widget; + QPointer widget; int duration; int elapsed; bool showWidget; @@ -119,7 +106,7 @@ QAlphaWidget::QAlphaWidget(QWidget* w, Qt::WindowFlags f) setEnabled(false); #endif setAttribute(Qt::WA_NoSystemBackground, true); - widget = (QAccessWidget*)w; + widget = w; windowOpacity = w->windowOpacity(); alpha = 0; } @@ -370,7 +357,7 @@ private slots: void scroll(); private: - QPointer widget; + QPointer widget; int currentHeight; int currentWidth; @@ -401,7 +388,7 @@ QRollEffect::QRollEffect(QWidget* w, Qt::WindowFlags f, DirFlags orient) setEnabled(false); #endif - widget = (QAccessWidget*) w; + widget = w; Q_ASSERT(widget); setAttribute(Qt::WA_NoSystemBackground, true); -- cgit v0.12 From 50fc438d989fe9e4ecb431e2f6a5e4d1ccafbeac Mon Sep 17 00:00:00 2001 From: miniak Date: Wed, 8 Dec 2010 12:32:50 +0100 Subject: fix qFadeEffect windowOpacity issue on Windows Merge-request: 2519 Reviewed-by: Thierry Bastian --- src/gui/widgets/qeffects.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/widgets/qeffects.cpp b/src/gui/widgets/qeffects.cpp index b875aa4..77d5257 100644 --- a/src/gui/widgets/qeffects.cpp +++ b/src/gui/widgets/qeffects.cpp @@ -91,7 +91,6 @@ private: bool showWidget; QTimer anim; QElapsedTimer checkTime; - double windowOpacity; }; static QAlphaWidget* q_blend = 0; @@ -107,7 +106,6 @@ QAlphaWidget::QAlphaWidget(QWidget* w, Qt::WindowFlags f) #endif setAttribute(Qt::WA_NoSystemBackground, true); widget = w; - windowOpacity = w->windowOpacity(); alpha = 0; } @@ -116,7 +114,7 @@ QAlphaWidget::~QAlphaWidget() #if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) // Restore user-defined opacity value if (widget) - widget->setWindowOpacity(windowOpacity); + widget->setWindowOpacity(1); #endif } @@ -255,10 +253,10 @@ void QAlphaWidget::render() alpha = 1; #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - if (alpha >= windowOpacity || !showWidget) { + if (alpha >= 1 || !showWidget) { anim.stop(); qApp->removeEventFilter(this); - widget->setWindowOpacity(windowOpacity); + widget->setWindowOpacity(1); q_blend = 0; deleteLater(); } else { -- cgit v0.12 From 4db69b5c116412bbcdb032affe9fa2c73e61abb1 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 8 Dec 2010 17:50:59 +0100 Subject: Updated the build files to use config files not command line options. --- doc/doc.pri | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/doc.pri b/doc/doc.pri index a5db3c7..3cdac61 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -19,8 +19,8 @@ $$unixstyle { QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && set QT_BUILD_TREE=$$QT_BUILD_TREE&& set QT_SOURCE_TREE=$$QT_SOURCE_TREE&& $$QT_BUILD_TREE/bin/qdoc3.exe $$DOCS_GENERATION_DEFINES QDOC = $$replace(QDOC, "/", "\\") } -ADP_DOCS_QDOCCONF_FILE = -online qt-build-docs.qdocconf -QT_DOCUMENTATION = ($$QDOC -creator qt-api-only.qdocconf assistant.qdocconf designer.qdocconf \ +ADP_DOCS_QDOCCONF_FILE = qt-build-docs-online.qdocconf +QT_DOCUMENTATION = ($$QDOC qt-api-only.qdocconf assistant.qdocconf designer.qdocconf \ linguist.qdocconf qmake.qdocconf qdeclarative.qdocconf) && \ (cd $$QT_BUILD_TREE && \ $$GENERATOR doc-build/html-qt/qt.qhp -o doc/qch/qt.qch && \ -- cgit v0.12 From 0ffdc7556920564fce899ccd4bb4e7ce68a5c4d2 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 8 Dec 2010 17:52:42 +0100 Subject: Use the same style of qmake variable referencing used elsewhere in Qt. --- tools/qdoc3/qdoc3.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 4bc6bca..2fedc0f 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -86,9 +86,9 @@ SOURCES += atom.cpp \ tree.cpp \ yyindent.cpp -INCLUDEPATH += $$(QT_BUILD_TREE)/include/QtDeclarative +INCLUDEPATH += $$QT_BUILD_TREE/include/QtDeclarative -include($$(QT_SOURCE_TREE)/src/declarative/qml/parser/parser.pri) +include($$QT_SOURCE_TREE/src/declarative/qml/parser/parser.pri) ### Documentation for qdoc3 ### -- cgit v0.12 From 185ad65aedeb45ee3739a4377c44f8d56a3bb4f5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 9 Dec 2010 09:53:01 +0100 Subject: qdoc: Updated signature of generateInnerNode() in the XML generator. --- tools/qdoc3/ditaxmlgenerator.cpp | 17 +++++++++++------ tools/qdoc3/ditaxmlgenerator.h | 2 +- tools/qdoc3/qdoc3.pro | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 6b7d1fb..abe247b 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -699,11 +699,11 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, skipAhead++; atom = atom->next(); } + str[0] = str[0].toLower(); + if (str.right(1) == ".") + str.truncate(str.length() - 1); + writeCharacters(str + "."); } - str[0] = str[0].toLower(); - if (str.right(1) == ".") - str.truncate(str.length() - 1); - writeCharacters(str + "."); break; case Atom::BriefRight: // if (relative->type() != Node::Fake) @@ -5315,7 +5315,7 @@ void DitaXmlGenerator::writeNestedClasses(const Section& s, Recursive writing of DITA XML files from the root \a node. */ void -DitaXmlGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) +DitaXmlGenerator::generateInnerNode(const InnerNode* node) { if (!node->url().isNull()) return; @@ -5334,6 +5334,11 @@ DitaXmlGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) } } + /* + Obtain a code marker for the source file. + */ + CodeMarker *marker = CodeMarker::markerForFileName(node->location().filePath()); + if (node->parent() != 0) { beginSubPage(node->location(), fileName(node)); if (node->type() == Node::Namespace || node->type() == Node::Class) { @@ -5353,7 +5358,7 @@ DitaXmlGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) NodeList::ConstIterator c = node->childNodes().begin(); while (c != node->childNodes().end()) { if ((*c)->isInnerNode() && (*c)->access() != Node::Private) - generateInnerNode((const InnerNode*) *c, marker); + generateInnerNode((const InnerNode*) *c); ++c; } } diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 6075a86..1a42e5f 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -252,7 +252,7 @@ class DitaXmlGenerator : public PageGenerator GuidMap* lookupGuidMap(const QString& fileName); virtual void beginSubPage(const Location& location, const QString& fileName); virtual void endSubPage(); - virtual void generateInnerNode(const InnerNode* node, CodeMarker* marker); + virtual void generateInnerNode(const InnerNode* node); QXmlStreamWriter& xmlWriter(); void writeDetailedDescription(const Node* node, CodeMarker* marker, diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 4bc6bca..50c20ec 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -86,7 +86,7 @@ SOURCES += atom.cpp \ tree.cpp \ yyindent.cpp -INCLUDEPATH += $$(QT_BUILD_TREE)/include/QtDeclarative +INCLUDEPATH += $$(QT_SOURCE_TREE)/include/QtDeclarative include($$(QT_SOURCE_TREE)/src/declarative/qml/parser/parser.pri) -- cgit v0.12 From 7cfb008dd0aa1908464f071b1661e40e6117aba8 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 9 Dec 2010 10:13:34 +0100 Subject: doc: Removed some empty \row commands from a table. --- doc/src/platforms/platform-notes.qdoc | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index 177d3f6..b745867 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -81,14 +81,11 @@ \header \o \o Concurrent \o XmlPatterns \o WebKit(*) \o CLucene \o Phonon \row \o g++ 3.3 \o \o \bold{X} \o \o \bold{X} \o \bold{X} \row \o g++ 3.4 and up \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} - \row \row \o SunCC 5.5 \o \o \o \o \bold{X} \o \bold{X} - \row \row \o aCC series 3 \o \o \o \o \bold{X} \o \bold{X} \row \o aCC series 6 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \row \o xlC 6 \o \o \o \o \bold{X} \o \bold{X} \row \o Intel CC 10 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} - \row \row \o MSVC 2003 \o \bold{X} \o \bold{X} \o \o \bold{X} \o \bold{X} \row \o MSVC 2005 and up \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \endtable -- cgit v0.12 From 3ee5edeff7890c3fc1099029320f0fb038e7f81d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 9 Dec 2010 12:56:47 +0100 Subject: doc: Removed the \hr macro from the DITA XML qdocconf file. This eliminates some "raw-html" cases. --- tools/qdoc3/test/qt-ditaxml.qdocconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/test/qt-ditaxml.qdocconf b/tools/qdoc3/test/qt-ditaxml.qdocconf index cc2937a..bc32149 100644 --- a/tools/qdoc3/test/qt-ditaxml.qdocconf +++ b/tools/qdoc3/test/qt-ditaxml.qdocconf @@ -20,7 +20,7 @@ macro.BR.DITAXML = " " macro.copyright.DITAXML = "©" macro.eacute.DITAXML = "é" macro.gui = "\\bold" -macro.hr.DITAXML = "
    " +macro.hr.DITAXML = " " macro.iacute.DITAXML = "í" macro.key = "\\bold" macro.menu = "\\bold" -- cgit v0.12 From bdaab918e08f244bf397b1179358d5a54553b4c9 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 9 Dec 2010 13:16:48 +0100 Subject: doc: Fixed the \raisedaster macro to write the element. But only for the special case of "*". Still, it got rid of a lot of raw-html cases. More to come here. --- tools/qdoc3/ditaxmlgenerator.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index abe247b..57a6e8d 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1287,6 +1287,11 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; if (atom->string().startsWith("&")) writeCharacters(atom->string()); + else if (atom->string() == "*") { + xmlWriter().writeStartElement("sup"); + writeCharacters("*"); + xmlWriter().writeEndElement(); // + } else { xmlWriter().writeStartElement("pre"); xmlWriter().writeAttribute("outputclass","raw-html"); -- cgit v0.12 From 61a5cc5fcde2de0c3639e20104ff58ca91cf793b Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Thu, 9 Dec 2010 14:31:10 +0100 Subject: QmlDebugger: avoid deferring properties when compiling in a debug environment Reviewed-by: Kai Koehne --- src/declarative/qml/qdeclarativecompiler.cpp | 6 +- .../qdeclarativedebug/tst_qdeclarativedebug.cpp | 97 +++++++++++++++++++++- 2 files changed, 100 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 4749bf8..b375b27 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -65,6 +65,7 @@ #include "private/qdeclarativebinding_p.h" #include "private/qdeclarativecompiledbindings_p.h" #include "private/qdeclarativeglobalscriptclass_p.h" +#include "private/qdeclarativedebugservice_p.h" #include #include @@ -754,7 +755,10 @@ bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt) QList customProps; // Fetch the list of deferred properties - QStringList deferredList = deferredProperties(obj); + QStringList deferredList; + if (!QDeclarativeDebugService::isDebuggingEnabled()) { + deferredList = deferredProperties(obj); + } // Must do id property first. This is to ensure that the id given to any // id reference created matches the order in which the objects are diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp index 53471bf..20a3fa6 100644 --- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp +++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp @@ -114,6 +114,7 @@ private slots: void tst_QDeclarativeDebugPropertyReference(); void setMethodBody(); + void queryObjectTree(); }; QDeclarativeDebugObjectReference tst_QDeclarativeDebug::findRootObject(int context) @@ -308,6 +309,34 @@ void tst_QDeclarativeDebug::initTestCase() "function myMethodIndirect() { myMethod(3); }\n" "}"; + // and a fourth to test states + qml << "import QtQuick 1.0\n" + "Rectangle {\n" + "id:rootRect\n" + "width:100\n" + "states: [\n" + "State {\n" + "name:\"state1\"\n" + "PropertyChanges {\n" + "target:rootRect\n" + "width:200\n" + "}\n" + "}\n" + "]\n" + "transitions: [\n" + "Transition {\n" + "from:\"*\"\n" + "to:\"state1\"\n" + "PropertyAnimation {\n" + "target:rootRect\n" + "property:\"width\"\n" + "duration:100\n" + "}\n" + "}\n" + "]\n" + "}\n" + ; + for (int i=0; iobjectName()); - QCOMPARE(context.objects().count(), 3); // 3 qml component objects created for context in main() + QCOMPARE(context.objects().count(), 4); // 4 qml component objects created for context in main() // root context query sends only root object data - it doesn't fill in // the children or property info QCOMPARE(context.objects()[0].properties().count(), 0); QCOMPARE(context.objects()[0].children().count(), 0); - QCOMPARE(context.contexts().count(), 4); + QCOMPARE(context.contexts().count(), 5); QVERIFY(context.contexts()[0].debugId() >= 0); QCOMPARE(context.contexts()[0].name(), QString("tst_QDeclarativeDebug_childContext")); @@ -897,6 +926,70 @@ void tst_QDeclarativeDebug::tst_QDeclarativeDebugPropertyReference() compareProperties(r, ref); } +void tst_QDeclarativeDebug::queryObjectTree() +{ + const int sourceIndex = 3; + + // Check if states/transitions are initialized when fetching root item + QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); + waitForQuery(q_engines); + + QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); + waitForQuery(q_context); + + QVERIFY(q_context->rootContext().objects().count() > sourceIndex); + QDeclarativeDebugObjectReference rootObject = q_context->rootContext().objects()[sourceIndex]; + + QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObjectRecursive(rootObject, this); + waitForQuery(q_obj); + + QDeclarativeDebugObjectReference obj = q_obj->object(); + + delete q_engines; + delete q_context; + delete q_obj; + + QVERIFY(obj.debugId() != -1); + QVERIFY(obj.children().count() >= 2); + + + + // check state + QDeclarativeDebugObjectReference state = obj.children()[0]; + QCOMPARE(state.className(), QString("State")); + QVERIFY(state.children().count() > 0); + + QDeclarativeDebugObjectReference propertyChange = state.children()[0]; + QVERIFY(propertyChange.debugId() != -1); + + QDeclarativeDebugPropertyReference propertyChangeTarget = findProperty(propertyChange.properties(),"target"); + QCOMPARE(propertyChangeTarget.objectDebugId(), propertyChange.debugId()); + + QDeclarativeDebugObjectReference targetReference = qvariant_cast(propertyChangeTarget.value()); + QVERIFY(targetReference.debugId() != -1); + + + + // check transition + QDeclarativeDebugObjectReference transition = obj.children()[1]; + QCOMPARE(transition.className(), QString("Transition")); + QCOMPARE(findProperty(transition.properties(),"from").value().toString(), QString("*")); + QCOMPARE(findProperty(transition.properties(),"to").value(), findProperty(state.properties(),"name").value()); + QVERIFY(transition.children().count() > 0); + + QDeclarativeDebugObjectReference animation = transition.children()[0]; + QVERIFY(animation.debugId() != -1); + + QDeclarativeDebugPropertyReference animationTarget = findProperty(animation.properties(),"target"); + QCOMPARE(animationTarget.objectDebugId(), animation.debugId()); + + targetReference = qvariant_cast(animationTarget.value()); + QVERIFY(targetReference.debugId() != -1); + + QCOMPARE(findProperty(animation.properties(),"property").value().toString(), QString("width")); + QCOMPARE(findProperty(animation.properties(),"duration").value().toInt(), 100); +} + int main(int argc, char *argv[]) { int _argc = argc + 1; -- cgit v0.12 From 05f330b96deaec54c4cfd7c1a190e7d90d77a54d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 9 Dec 2010 16:00:56 +0100 Subject: Used a different style class for areas containing QML markup. --- tools/qdoc3/htmlgenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 456654f..ba36d9c 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -489,7 +489,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, break; #ifdef QDOC_QML case Atom::Qml: - out() << "
    "
    +        out() << "
    "
                   << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
                                                      marker,relative))
                   << "
    \n"; -- cgit v0.12 From 32292ebabf620200708d40fa8bfa43fc6562d716 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 9 Dec 2010 16:02:22 +0100 Subject: Removed redundant style information and images. --- tools/qdoc3/test/qt-html-default-styles.qdocconf | 26 ++++------------------ tools/qdoc3/test/qt-html-online-styles.qdocconf | 11 +++------ tools/qdoc3/test/qt-html-templates-online.qdocconf | 6 +---- tools/qdoc3/test/qt-html-templates.qdocconf | 20 ++--------------- 4 files changed, 10 insertions(+), 53 deletions(-) diff --git a/tools/qdoc3/test/qt-html-default-styles.qdocconf b/tools/qdoc3/test/qt-html-default-styles.qdocconf index 30c28cb..c9c02ea 100644 --- a/tools/qdoc3/test/qt-html-default-styles.qdocconf +++ b/tools/qdoc3/test/qt-html-default-styles.qdocconf @@ -4,43 +4,25 @@ HTML.templatedir = $QT_SOURCE_TREE/doc/src/template -HTML.stylesheets = style/style.css \ - style/narrow.css +HTML.stylesheets = style/style.css HTML.scripts = # Files not referenced in any qdoc file (last four needed by qtdemo) # See also qhp.Qt.extraFiles -extraimages.HTML = qt-logo \ - trolltech-logo \ - bg_l.png \ - bg_l_blank.png \ - bg_ll_blank.png \ - bg_ul_blank.png \ - header_bg.png \ - bg_r.png \ - box_bg.png \ +extraimages.HTML = qt-logo.png \ + arrow_down.png \ breadcrumb.png \ bullet_gt.png \ bullet_dn.png \ bullet_sq.png \ bullet_up.png \ - arrow_down.png \ - feedbackground.png \ horBar.png \ - page.png \ - page_bg.png \ - sprites-combined.png \ - spinner.gif \ - stylesheet-coffee-plastique.png \ - taskmenuextension-example.png \ - coloreditorfactoryimage.png \ - dynamiclayouts-example.png + sprites-combined.png # Include the style sheets and scripts used. HTML.headerstyles = \ - " \n" \ " \n" HTML.headerscripts = diff --git a/tools/qdoc3/test/qt-html-online-styles.qdocconf b/tools/qdoc3/test/qt-html-online-styles.qdocconf index 06f8964..6db3491 100644 --- a/tools/qdoc3/test/qt-html-online-styles.qdocconf +++ b/tools/qdoc3/test/qt-html-online-styles.qdocconf @@ -18,10 +18,9 @@ HTML.scripts = scripts/functions.js \ scripts/jquery.js -# Files not referenced in any qdoc file (last four needed by qtdemo) +# Files not referenced in any qdoc file. # See also qhp.Qt.extraFiles -extraimages.HTML = qt-logo \ - trolltech-logo \ +extraimages.HTML = qt-logo.png \ bg_l.png \ bg_l_blank.png \ bg_ll_blank.png \ @@ -40,11 +39,7 @@ extraimages.HTML = qt-logo \ page.png \ page_bg.png \ sprites-combined.png \ - spinner.gif \ - stylesheet-coffee-plastique.png \ - taskmenuextension-example.png \ - coloreditorfactoryimage.png \ - dynamiclayouts-example.png + spinner.gif # Include the style sheets and scripts used. diff --git a/tools/qdoc3/test/qt-html-templates-online.qdocconf b/tools/qdoc3/test/qt-html-templates-online.qdocconf index 1d55cee..bc7dbd2 100644 --- a/tools/qdoc3/test/qt-html-templates-online.qdocconf +++ b/tools/qdoc3/test/qt-html-templates-online.qdocconf @@ -198,7 +198,7 @@ HTML.footer = \ " \n" -# Files not referenced in any qdoc file (last four are needed by qtdemo) +# Files not referenced in any qdoc file. # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ images/bg_l.png \ @@ -220,10 +220,6 @@ qhp.Qt.extraFiles = index.html \ images/page_bg.png \ images/sprites-combined.png \ images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ scripts/functions.js \ scripts/jquery.js \ scripts/narrow.js \ diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 67ce95a..8241fa0 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -47,31 +47,15 @@ HTML.footer = \ " as published by the Free Software Foundation.

    \n" \ "
    \n" \ -# Files not referenced in any qdoc file (last four are needed by qtdemo) +# Files not referenced in any qdoc file. # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ul_blank.png \ - images/header_bg.png \ - images/bg_r.png \ - images/box_bg.png \ + images/arrow_down.png \ images/breadcrumb.png \ images/bullet_gt.png \ images/bullet_dn.png \ images/bullet_sq.png \ images/bullet_up.png \ - images/arrow_down.png \ - images/feedbackground.png \ images/horBar.png \ - images/page.png \ - images/page_bg.png \ images/sprites-combined.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - style/narrow.css \ style/style.css -- cgit v0.12 From 77f069df4dcfd40a3d009f40e074ce1a5ac132c1 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 9 Dec 2010 19:38:01 +0100 Subject: Added hack to remove markup for opened comments at the end of snippets. --- tools/qdoc3/quoter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/qdoc3/quoter.cpp b/tools/qdoc3/quoter.cpp index 6dc7894..84c6fb1 100644 --- a/tools/qdoc3/quoter.cpp +++ b/tools/qdoc3/quoter.cpp @@ -235,10 +235,14 @@ QString Quoter::quoteSnippet(const Location &docLocation, const QString &identif QString lastLine = getLine(); int dIndex = lastLine.indexOf(delimiter); if (dIndex > 0) { + // The delimiter might be preceded on the line by other + // delimeters, so look for the first comment on the line. QString leading = lastLine.left(dIndex); dIndex = leading.indexOf(comment); if (dIndex != -1) leading = leading.left(dIndex); + if (leading.endsWith(QLatin1String("<@comment>"))) + leading.chop(10); if (!leading.trimmed().isEmpty()) t += leading; } -- cgit v0.12 From 297da17b94df6cd4a3b0c4ade56baf55310939e8 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 9 Dec 2010 19:39:35 +0100 Subject: Ensured that object definition identifiers are marked up as links. It may be worthwhile extending this to other UiQualifiedId nodes. --- tools/qdoc3/qmlmarkupvisitor.cpp | 14 +++++++++++--- tools/qdoc3/qmlmarkupvisitor.h | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/qmlmarkupvisitor.cpp b/tools/qdoc3/qmlmarkupvisitor.cpp index 6bede96..9916be2 100644 --- a/tools/qdoc3/qmlmarkupvisitor.cpp +++ b/tools/qdoc3/qmlmarkupvisitor.cpp @@ -183,7 +183,8 @@ void QmlMarkupVisitor::addExtra(quint32 start, quint32 finish) } void QmlMarkupVisitor::addMarkedUpToken( - QDeclarativeJS::AST::SourceLocation &location, const QString &tagName) + QDeclarativeJS::AST::SourceLocation &location, const QString &tagName, + const QHash &attributes) { if (!location.isValid()) return; @@ -193,7 +194,10 @@ void QmlMarkupVisitor::addMarkedUpToken( else if (cursor > location.offset) return; - output += QString(QLatin1String("<@%1>%2")).arg(tagName, protect(sourceText(location)), tagName); + output += QString(QLatin1String("<@%1")).arg(tagName); + foreach (const QString &key, attributes) + output += QString(QLatin1String(" %1=\"%2\"")).arg(key).arg(attributes[key]); + output += QString(QLatin1String(">%2")).arg(protect(sourceText(location)), tagName); cursor += location.length; } @@ -853,9 +857,13 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DebuggerStatement *statement) return true; } +// Elements and items are represented by UiObjectDefinition nodes. + bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition) { - QDeclarativeJS::AST::Node::accept(definition->qualifiedTypeNameId, this); + QHash attributes; + attributes[QLatin1String("node")] = sourceText(definition->qualifiedTypeNameId->identifierToken); + addMarkedUpToken(definition->qualifiedTypeNameId->identifierToken, QLatin1String("link"), attributes); QDeclarativeJS::AST::Node::accept(definition->initializer, this); return false; } diff --git a/tools/qdoc3/qmlmarkupvisitor.h b/tools/qdoc3/qmlmarkupvisitor.h index 7a9ff22..60bc336 100644 --- a/tools/qdoc3/qmlmarkupvisitor.h +++ b/tools/qdoc3/qmlmarkupvisitor.h @@ -161,7 +161,8 @@ protected: private: void addExtra(quint32 start, quint32 finish); void addMarkedUpToken(QDeclarativeJS::AST::SourceLocation &location, - const QString &text); + const QString &text, + const QHash &attributes = QHash()); void addVerbatim(QDeclarativeJS::AST::SourceLocation first, QDeclarativeJS::AST::SourceLocation last = QDeclarativeJS::AST::SourceLocation()); QString sourceText(QDeclarativeJS::AST::SourceLocation &location); -- cgit v0.12 From 4b8b0321828bd1175534ff3b883956c5b97f9399 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 9 Dec 2010 19:41:10 +0100 Subject: Doc: Temporarily used \qml...\endqml markup for the QML introduction. --- doc/src/declarative/qdeclarativeintro.qdoc | 75 +++++++++++++----------------- 1 file changed, 32 insertions(+), 43 deletions(-) diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc index 4e41fda..299ec73 100644 --- a/doc/src/declarative/qdeclarativeintro.qdoc +++ b/doc/src/declarative/qdeclarativeintro.qdoc @@ -45,7 +45,7 @@ technologies like HTML and CSS, but it's not required. QML looks like this: -\code +\qml import QtQuick 1.0 Rectangle { @@ -58,7 +58,7 @@ Rectangle { anchors.centerIn: parent } } -\endcode +\endqml Objects are specified by their type, followed by a pair of braces. Object types always begin with a capital letter. In the above example, there are @@ -71,18 +71,18 @@ value \c "pics/logo.png". The property and its value are separated by a colon. Properties can be specified one-per-line: -\code +\qml Rectangle { width: 100 height: 100 } -\endcode +\endqml or you can put multiple properties on a single line: -\code +\qml Rectangle { width: 100; height: 100 } -\endcode +\endqml When multiple property/value pairs are specified on a single line, they must be separated by a semicolon. @@ -96,17 +96,17 @@ and \l Image elements would not be available. In addition to assigning values to properties, you can also assign expressions written in JavaScript. -\code +\qml Rotation { angle: 360 * 3 } -\endcode +\endqml These expressions can include references to other objects and properties, in which case a \e binding is established: when the value of the expression changes, the property the expression has been assigned to is automatically updated to that value. -\code +\qml Item { Text { id: text1 @@ -117,7 +117,7 @@ Item { text: text1.text } } -\endcode +\endqml In the example above, the \c text2 object will display the same text as \c text1. If \c text1 is changed, \c text2 is automatically changed to the same value. @@ -142,12 +142,12 @@ your QML files. Comments can also be used to prevent the execution of code, which is sometimes useful for tracking down problems. -\code +\qml Text { text: "Hello world!" //opacity: 0.5 } -\endcode +\endqml In the above example, the Text object will have normal opacity, since the line opacity: 0.5 has been turned into a comment. @@ -164,14 +164,14 @@ Properties begin with a lowercase letter (with the exception of \l{Attached Prop QML supports properties of many types (see \l{QML Basic Types}). The basic types include int, real, bool, string, color, and lists. -\code +\qml Item { x: 10.5 // a 'real' property - ... + // ... state: "details" // a 'string' property focus: true // a 'bool' property } -\endcode +\endqml QML properties are what is known as \e type-safe. That is, they only allow you to assign a value that matches the property type. For example, the \c x property of item is a real, and if you try to assign @@ -193,7 +193,7 @@ The first Rectangle element below has an \e id, "myRect". The second Rectangle e own width by referring to \tt myRect.width, which means it will have the same \tt width value as the first Rectangle element. -\code +\qml Item { Rectangle { id: myRect @@ -205,7 +205,7 @@ Item { height: 200 } } -\endcode +\endqml Note that an \e id must begin with a lower-case letter or an underscore, and cannot contain characters other than letters, numbers and underscores. @@ -214,24 +214,24 @@ Note that an \e id must begin with a lower-case letter or an underscore, and can List properties look like this: -\code +\qml Item { children: [ Image {}, Text {} ] } -\endcode +\endqml The list is enclosed in square brackets, with a comma separating the list elements. In cases where you are only assigning a single item to a list, you can omit the square brackets: -\code +\qml Image { children: Rectangle {} } -\endcode +\endqml Items in the list can be accessed by index. See the \l{list}{list type} documentation for more details about list properties and their available operations. @@ -243,23 +243,23 @@ Each object type can specify one of its list or object properties as its default If a property has been declared as the default property, the property tag can be omitted. For example this code: -\code +\qml State { changes: [ PropertyChanges {}, PropertyChanges {} ] } -\endcode +\endqml can be simplified to: -\code +\qml State { PropertyChanges {} PropertyChanges {} } -\endcode +\endqml because \c changes is the default property of the \c State type. @@ -294,18 +294,7 @@ are of the form \e {Type.property} where \e Type is the type of the element that attaches \e property. For example: -\code -Component { - id: myDelegate - Text { - text: "Hello" - color: ListView.isCurrentItem ? "red" : "blue" - } -} -ListView { - delegate: myDelegate -} -\endcode +\snippet doc/src/snippets/declarative/introduction-qml/attachedproperties1.qml component and list view The \l ListView element attaches the \e ListView.isCurrentItem property to each delegate it creates. @@ -314,12 +303,12 @@ Another example of attached properties is the \l Keys element which attaches properties for handling key presses to any visual Item, for example: -\code +\qml Item { focus: true Keys.onSelectPressed: console.log("Selected") } -\endcode +\endqml \section2 Signal Handlers @@ -327,23 +316,23 @@ Signal handlers allow actions to be taken in response to an event. For instance the \l MouseArea element has signal handlers to handle mouse press, release and click: -\code +\qml MouseArea { onPressed: console.log("mouse button pressed") } -\endcode +\endqml All signal handlers begin with \e "on". Some signal handlers include an optional parameter, for example the MouseArea onPressed signal handler has a \e mouse parameter: -\code +\qml MouseArea { acceptedButtons: Qt.LeftButton | Qt.RightButton onPressed: if (mouse.button == Qt.RightButton) console.log("Right mouse button pressed") } -\endcode +\endqml */ -- cgit v0.12 From f2eca0c0380a0e06ccc7f98c8d112549ac9fa085 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Fri, 10 Dec 2010 11:24:49 +1000 Subject: Add 'mirror' property to Image element. Setting mirror to true will horizontally invert an image. This feature is part of the task to support RTL in QML (see QTBUG-11042). Task-number: QTBUG-15878 Reviewed-by: Joona Petrell --- .../graphicsitems/qdeclarativeanimatedimage.cpp | 12 ++- .../graphicsitems/qdeclarativeborderimage.cpp | 19 ++++ .../graphicsitems/qdeclarativeimage.cpp | 103 +++++++++++---------- .../graphicsitems/qdeclarativeimagebase.cpp | 20 ++++ .../graphicsitems/qdeclarativeimagebase_p.h | 5 + .../graphicsitems/qdeclarativeimagebase_p_p.h | 4 +- .../qdeclarativeanimatedimage/data/hearts.gif | Bin 0 -> 6524 bytes .../qdeclarativeanimatedimage/data/hearts.qml | 6 ++ .../tst_qdeclarativeanimatedimage.cpp | 103 +++++++++++++++++++++ .../qdeclarativeborderimage/data/heart200.png | Bin 0 -> 7943 bytes .../tst_qdeclarativeborderimage.cpp | 34 +++++++ .../qdeclarativeimage/tst_qdeclarativeimage.cpp | 86 +++++++++++++++++ 12 files changed, 343 insertions(+), 49 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gif create mode 100644 tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml create mode 100644 tests/auto/declarative/qdeclarativeborderimage/data/heart200.png diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp index 12a820f..abdfdfa 100644 --- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp @@ -86,6 +86,16 @@ QT_BEGIN_NAMESPACE \sa BorderImage, Image */ +/*! + \qmlproperty bool AnimatedImage::mirror + \since Quick 1.1 + + This property holds whether the image should be horizontally inverted + (effectively displaying a mirrored image). + + The default value is false. +*/ + QDeclarativeAnimatedImage::QDeclarativeAnimatedImage(QDeclarativeItem *parent) : QDeclarativeImage(*(new QDeclarativeAnimatedImagePrivate), parent) { @@ -126,7 +136,7 @@ void QDeclarativeAnimatedImage::setPaused(bool pause) \qmlproperty bool AnimatedImage::playing This property holds whether the animated image is playing. - By defaults, this property is true, meaning that the animation + By default, this property is true, meaning that the animation will start playing immediately. */ bool QDeclarativeAnimatedImage::isPlaying() const diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index 0bf09ad..a25074a 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -200,6 +200,16 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage() */ /*! + \qmlproperty bool BorderImage::mirror + \since Quick 1.1 + + This property holds whether the image should be horizontally inverted + (effectively displaying a mirrored image). + + The default value is false. +*/ + +/*! \qmlproperty url BorderImage::source This property holds the URL that refers to the source image. @@ -534,8 +544,15 @@ void QDeclarativeBorderImage::paint(QPainter *p, const QStyleOptionGraphicsItem bool oldAA = p->testRenderHint(QPainter::Antialiasing); bool oldSmooth = p->testRenderHint(QPainter::SmoothPixmapTransform); + QTransform oldTransform; if (d->smooth) p->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth); + if (d->mirror) { + oldTransform = p->transform(); + QTransform mirror; + mirror.translate(d->width(), 0).scale(-1, 1.0); + p->setWorldTransform(mirror * oldTransform); + } const QDeclarativeScaleGrid *border = d->getScaleGrid(); int left = border->left(); @@ -561,6 +578,8 @@ void QDeclarativeBorderImage::paint(QPainter *p, const QStyleOptionGraphicsItem p->setRenderHint(QPainter::Antialiasing, oldAA); p->setRenderHint(QPainter::SmoothPixmapTransform, oldSmooth); } + if (d->mirror) + p->setWorldTransform(oldTransform); } QT_END_NAMESPACE diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index e07292b..68a1ecb 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -467,84 +467,93 @@ QRectF QDeclarativeImage::boundingRect() const to make sure that they aren't cached at the expense of small 'ui element' images. */ +/*! + \qmlproperty bool Image::mirror + \since Quick 1.1 + + This property holds whether the image should be horizontally inverted + (effectively displaying a mirrored image). + + The default value is false. +*/ + + void QDeclarativeImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) { Q_D(QDeclarativeImage); if (d->pix.pixmap().isNull() ) return; - bool oldAA = p->testRenderHint(QPainter::Antialiasing); - bool oldSmooth = p->testRenderHint(QPainter::SmoothPixmapTransform); - if (d->smooth) - p->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth); + int drawWidth = width(); + int drawHeight = height(); + bool doClip = false; + QTransform transform; + qreal widthScale = width() / qreal(d->pix.width()); + qreal heightScale = height() / qreal(d->pix.height()); if (width() != d->pix.width() || height() != d->pix.height()) { if (d->fillMode >= Tile) { - if (d->fillMode == Tile) { - p->drawTiledPixmap(QRectF(0,0,width(),height()), d->pix); - } else { - qreal widthScale = width() / qreal(d->pix.width()); - qreal heightScale = height() / qreal(d->pix.height()); - - QTransform scale; - if (d->fillMode == TileVertically) { - scale.scale(widthScale, 1.0); - QTransform old = p->transform(); - p->setWorldTransform(scale * old); - p->drawTiledPixmap(QRectF(0,0,d->pix.width(),height()), d->pix); - p->setWorldTransform(old); - } else { - scale.scale(1.0, heightScale); - QTransform old = p->transform(); - p->setWorldTransform(scale * old); - p->drawTiledPixmap(QRectF(0,0,width(),d->pix.height()), d->pix); - p->setWorldTransform(old); - } + if (d->fillMode == TileVertically) { + transform.scale(widthScale, 1.0); + drawWidth = d->pix.width(); + } else if (d->fillMode == TileHorizontally) { + transform.scale(1.0, heightScale); + drawHeight = d->pix.height(); } } else { - qreal widthScale = width() / qreal(d->pix.width()); - qreal heightScale = height() / qreal(d->pix.height()); - - QTransform scale; - if (d->fillMode == PreserveAspectFit) { if (widthScale <= heightScale) { heightScale = widthScale; - scale.translate(0, (height() - heightScale * d->pix.height()) / 2); + transform.translate(0, (height() - heightScale * d->pix.height()) / 2); } else if(heightScale < widthScale) { widthScale = heightScale; - scale.translate((width() - widthScale * d->pix.width()) / 2, 0); + transform.translate((width() - widthScale * d->pix.width()) / 2, 0); } } else if (d->fillMode == PreserveAspectCrop) { if (widthScale < heightScale) { widthScale = heightScale; - scale.translate((width() - widthScale * d->pix.width()) / 2, 0); + transform.translate((width() - widthScale * d->pix.width()) / 2, 0); } else if(heightScale < widthScale) { heightScale = widthScale; - scale.translate(0, (height() - heightScale * d->pix.height()) / 2); + transform.translate(0, (height() - heightScale * d->pix.height()) / 2); } } - if (clip()) { - p->save(); - p->setClipRect(QRectF(0, 0, d->mWidth, d->mHeight), Qt::IntersectClip); - } - scale.scale(widthScale, heightScale); - QTransform old = p->transform(); - p->setWorldTransform(scale * old); - p->drawPixmap(0, 0, d->pix); - p->setWorldTransform(old); - if (clip()) { - p->restore(); - } + transform.scale(widthScale, heightScale); + drawWidth = d->pix.width(); + drawHeight = d->pix.height(); + doClip = clip(); } - } else { - p->drawPixmap(0, 0, d->pix); } + QTransform oldTransform; + bool oldAA = p->testRenderHint(QPainter::Antialiasing); + bool oldSmooth = p->testRenderHint(QPainter::SmoothPixmapTransform); + if (d->smooth) + p->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth); + if (doClip) { + p->save(); + p->setClipRect(QRectF(0, 0, d->mWidth, d->mHeight), Qt::IntersectClip); + } + if (d->mirror) + transform.translate(drawWidth, 0).scale(-1.0, 1.0); + if (!transform.isIdentity()) { + oldTransform = p->transform(); + p->setWorldTransform(transform * oldTransform); + } + + if (d->fillMode >= Tile) + p->drawTiledPixmap(QRectF(0, 0, drawWidth, drawHeight), d->pix); + else + p->drawPixmap(QRectF(0, 0, drawWidth, drawHeight), d->pix, QRectF(0, 0, drawWidth, drawHeight)); + if (d->smooth) { p->setRenderHint(QPainter::Antialiasing, oldAA); p->setRenderHint(QPainter::SmoothPixmapTransform, oldSmooth); } + if (doClip) + p->restore(); + if (!transform.isIdentity()) + p->setWorldTransform(oldTransform); } void QDeclarativeImage::pixmapChange() diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp index 37b0734..c745635 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp @@ -146,6 +146,26 @@ void QDeclarativeImageBase::setCached(bool cached) load(); } +void QDeclarativeImageBase::setMirror(bool mirror) +{ + Q_D(QDeclarativeImageBase); + if (mirror == d->mirror) + return; + + d->mirror = mirror; + + if (isComponentComplete()) + update(); + + emit mirrorChanged(); +} + +bool QDeclarativeImageBase::mirror() const +{ + Q_D(const QDeclarativeImageBase); + return d->mirror; +} + void QDeclarativeImageBase::load() { Q_D(QDeclarativeImageBase); diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h index d25f7c3..b6e55ec 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h +++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h @@ -60,6 +60,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeImageBase : public QDeclarativeItem Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged) Q_PROPERTY(bool cached READ cached WRITE setCached NOTIFY cachedChanged) // ### VERSIONING: Only in QtQuick 1.1 Q_PROPERTY(QSize sourceSize READ sourceSize WRITE setSourceSize NOTIFY sourceSizeChanged) + Q_PROPERTY(bool mirror READ mirror WRITE setMirror NOTIFY mirrorChanged) // ### VERSIONING: Only in QtQuick 1.1 public: ~QDeclarativeImageBase(); @@ -79,6 +80,9 @@ public: virtual void setSourceSize(const QSize&); QSize sourceSize() const; + virtual void setMirror(bool mirror); + bool mirror() const; + Q_SIGNALS: void sourceChanged(const QUrl &); void sourceSizeChanged(); @@ -86,6 +90,7 @@ Q_SIGNALS: void progressChanged(qreal progress); void asynchronousChanged(); void cachedChanged(); + void mirrorChanged(); protected: virtual void load(); diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h index a539649..950914f 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h @@ -71,7 +71,8 @@ public: progress(0.0), explicitSourceSize(false), async(false), - cached(true) + cached(true), + mirror(false) { QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents; } @@ -84,6 +85,7 @@ public: bool explicitSourceSize : 1; bool async : 1; bool cached : 1; + bool mirror: 1; }; QT_END_NAMESPACE diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gif b/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gif new file mode 100644 index 0000000..cfb55f2 Binary files /dev/null and b/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gif differ diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml new file mode 100644 index 0000000..8729dd2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml @@ -0,0 +1,6 @@ +import QtQuick 1.0 + +AnimatedImage { + source: "hearts.gif" + playing: false +} diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp index 8cbe813..bd701e7 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp +++ b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include "../shared/testhttpserver.h" #include "../../../shared/util.h" @@ -66,13 +67,28 @@ private slots: void stopped(); void setFrame(); void frameCount(); + void mirror_running(); + void mirror_notRunning(); + void mirror_notRunning_data(); void remote(); void remote_data(); void sourceSize(); void sourceSizeReadOnly(); void invalidSource(); + +private: + QPixmap grabScene(QGraphicsScene *scene, int width, int height); }; +QPixmap tst_qdeclarativeanimatedimage::grabScene(QGraphicsScene *scene, int width, int height) +{ + QPixmap screenshot(width, height); + screenshot.fill(); + QPainter p_screenshot(&screenshot); + scene->render(&p_screenshot, QRect(0, 0, width, height), QRect(0, 0, width, height)); + return screenshot; +} + void tst_qdeclarativeanimatedimage::play() { QDeclarativeEngine engine; @@ -132,6 +148,93 @@ void tst_qdeclarativeanimatedimage::frameCount() delete anim; } +void tst_qdeclarativeanimatedimage::mirror_running() +{ + // test where mirror is set to true after animation has started + + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/hearts.qml")); + QDeclarativeAnimatedImage *anim = qobject_cast(component.create()); + QVERIFY(anim); + + QGraphicsScene scene; + int width = anim->property("width").toInt(); + int height = anim->property("height").toInt(); + scene.addItem(qobject_cast(anim)); + + QCOMPARE(anim->currentFrame(), 0); + QPixmap frame0 = grabScene(&scene, width, height); + anim->setCurrentFrame(1); + QPixmap frame1 = grabScene(&scene, width, height); + + anim->setCurrentFrame(0); + + QSignalSpy spy(anim, SIGNAL(frameChanged())); + anim->setPlaying(true); + + QTRY_VERIFY(spy.count() == 1); spy.clear(); + anim->setProperty("mirror", true); + + QCOMPARE(anim->currentFrame(), 1); + QPixmap frame1_flipped = grabScene(&scene, width, height); + + QTRY_VERIFY(spy.count() == 1); spy.clear(); + QCOMPARE(anim->currentFrame(), 0); // animation only has 2 frames, should cycle back to first + QPixmap frame0_flipped = grabScene(&scene, width, height); + + QTransform transform; + transform.translate(width, 0).scale(-1, 1.0); + QPixmap frame0_expected = frame0.transformed(transform); + QPixmap frame1_expected = frame1.transformed(transform); + + QCOMPARE(frame0_flipped, frame0_expected); + QCOMPARE(frame1_flipped, frame1_expected); +} + +void tst_qdeclarativeanimatedimage::mirror_notRunning() +{ + QFETCH(QUrl, fileUrl); + + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, fileUrl); + QDeclarativeAnimatedImage *anim = qobject_cast(component.create()); + QVERIFY(anim); + + QGraphicsScene scene; + int width = anim->property("width").toInt(); + int height = anim->property("height").toInt(); + scene.addItem(qobject_cast(anim)); + QPixmap screenshot = grabScene(&scene, width, height); + + QTransform transform; + transform.translate(width, 0).scale(-1, 1.0); + QPixmap expected = screenshot.transformed(transform); + + int frame = anim->currentFrame(); + bool playing = anim->isPlaying(); + bool paused = anim->isPlaying(); + + anim->setProperty("mirror", true); + screenshot = grabScene(&scene, width, height); + + QCOMPARE(screenshot, expected); + + // mirroring should not change the current frame or playing status + QCOMPARE(anim->currentFrame(), frame); + QCOMPARE(anim->isPlaying(), playing); + QCOMPARE(anim->isPaused(), paused); + + delete anim; +} + +void tst_qdeclarativeanimatedimage::mirror_notRunning_data() +{ + QTest::addColumn("fileUrl"); + + QTest::newRow("paused") << QUrl::fromLocalFile(SRCDIR "/data/stickmanpause.qml"); + QTest::newRow("stopped") << QUrl::fromLocalFile(SRCDIR "/data/stickmanstopped.qml"); +} + void tst_qdeclarativeanimatedimage::remote() { QFETCH(QString, fileName); diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/heart200.png b/tests/auto/declarative/qdeclarativeborderimage/data/heart200.png new file mode 100644 index 0000000..5a31ae8 Binary files /dev/null and b/tests/auto/declarative/qdeclarativeborderimage/data/heart200.png differ diff --git a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp index 5478145..c22cde2 100644 --- a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp +++ b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp @@ -43,6 +43,8 @@ #include #include #include +#include +#include #include #include @@ -77,6 +79,7 @@ private slots: void clearSource(); void resized(); void smooth(); + void mirror(); void tileModes(); void sciSource(); void sciSource_data(); @@ -218,6 +221,37 @@ void tst_qdeclarativeborderimage::smooth() delete obj; } +void tst_qdeclarativeborderimage::mirror() +{ + QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/heart200.png\"; smooth: true; width: 300; height: 300; border { top: 50; right: 50; bottom: 50; left: 50 } }"; + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeBorderImage *obj = qobject_cast(component.create()); + QVERIFY(obj != 0); + + int width = obj->property("width").toInt(); + int height = obj->property("height").toInt(); + + QGraphicsScene scene; + scene.addItem(qobject_cast(obj)); + QPixmap screenshot(width, height); + screenshot.fill(); + QPainter p_screenshot(&screenshot); + scene.render(&p_screenshot, QRect(0, 0, width, height), QRect(0, 0, width, height)); + + QTransform transform; + transform.translate(width, 0).scale(-1, 1.0); + QPixmap expected = screenshot.transformed(transform); + + obj->setProperty("mirror", true); + p_screenshot.fillRect(QRect(0, 0, width, height), Qt::white); + scene.render(&p_screenshot, QRect(0, 0, width, height), QRect(0, 0, width, height)); + + QCOMPARE(screenshot, expected); + + delete obj; +} + void tst_qdeclarativeborderimage::tileModes() { { diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index c811f62..27c7964 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -79,6 +79,8 @@ private slots: void resized(); void preserveAspectRatio(); void smooth(); + void mirror(); + void mirror_data(); void svg(); void geometry(); void geometry_data(); @@ -270,6 +272,90 @@ void tst_qdeclarativeimage::smooth() delete obj; } +void tst_qdeclarativeimage::mirror() +{ + QFETCH(int, fillMode); + + qreal width = 300; + qreal height = 250; + + QString src = QUrl::fromLocalFile(SRCDIR "/data/heart200.png").toString(); + QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; }"; + + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeImage *obj = qobject_cast(component.create()); + QVERIFY(obj != 0); + + obj->setProperty("width", width); + obj->setProperty("height", height); + obj->setFillMode((QDeclarativeImage::FillMode)fillMode); + obj->setProperty("mirror", true); + + QGraphicsScene scene; + scene.addItem(qobject_cast(obj)); + QPixmap screenshot(width, height); + screenshot.fill(); + QPainter p_screenshot(&screenshot); + scene.render(&p_screenshot, QRect(0, 0, width, height), QRect(0, 0, width, height)); + + QPixmap srcPixmap; + QVERIFY(srcPixmap.load(SRCDIR "/data/heart200.png")); + + QPixmap expected(width, height); + expected.fill(); + QPainter p_e(&expected); + QTransform transform; + transform.translate(width, 0).scale(-1, 1.0); + p_e.setTransform(transform); + + switch (fillMode) { + case QDeclarativeImage::Stretch: + p_e.drawPixmap(QRect(0, 0, width, height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height())); + break; + case QDeclarativeImage::PreserveAspectFit: + p_e.drawPixmap(QRect(25, 0, width / (width/height), height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height())); + break; + case QDeclarativeImage::PreserveAspectCrop: + { + qreal ratio = width/srcPixmap.width(); // width is the longer side + QRect rect(0, 0, srcPixmap.width()*ratio, srcPixmap.height()*ratio); + rect.moveCenter(QRect(0, 0, width, height).center()); + p_e.drawPixmap(rect, srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height())); + break; + } + case QDeclarativeImage::Tile: + p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap); + break; + case QDeclarativeImage::TileVertically: + transform.scale(width / srcPixmap.width(), 1.0); + p_e.setTransform(transform); + p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap); + break; + case QDeclarativeImage::TileHorizontally: + transform.scale(1.0, height / srcPixmap.height()); + p_e.setTransform(transform); + p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap); + break; + } + + QCOMPARE(screenshot, expected); + + delete obj; +} + +void tst_qdeclarativeimage::mirror_data() +{ + QTest::addColumn("fillMode"); + + QTest::newRow("Stretch") << int(QDeclarativeImage::Stretch); + QTest::newRow("PreserveAspectFit") << int(QDeclarativeImage::PreserveAspectFit); + QTest::newRow("PreserveAspectCrop") << int(QDeclarativeImage::PreserveAspectCrop); + QTest::newRow("Tile") << int(QDeclarativeImage::Tile); + QTest::newRow("TileVertically") << int(QDeclarativeImage::TileVertically); + QTest::newRow("TileHorizontally") << int(QDeclarativeImage::TileHorizontally); +} + void tst_qdeclarativeimage::svg() { QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.svg").toString(); -- cgit v0.12 From a32728ce8cf4fa1d1dc1001b1fadc66e9c86e025 Mon Sep 17 00:00:00 2001 From: Christopher Ham Date: Fri, 10 Dec 2010 13:03:59 +1000 Subject: The sourceSize property for borderImage should be read only Trying the sourceSize property from QML should emit a read-only warning. Task-number: QTBUG-15703 Reviewed-by: Bea Lam --- src/declarative/graphicsitems/qdeclarativeborderimage.cpp | 6 ------ src/declarative/graphicsitems/qdeclarativeborderimage_p.h | 6 ++++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index a25074a..d9ba2bd 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -256,12 +256,6 @@ void QDeclarativeBorderImage::setSource(const QUrl &url) load(); } -void QDeclarativeBorderImage::setSourceSize(const QSize& size) -{ - Q_UNUSED(size); - qmlInfo(this) << "Setting sourceSize for borderImage not supported"; -} - void QDeclarativeBorderImage::load() { Q_D(QDeclarativeBorderImage); diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h index 7cf24f2..d9db0ac 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h +++ b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h @@ -63,6 +63,9 @@ class Q_AUTOTEST_EXPORT QDeclarativeBorderImage : public QDeclarativeImageBase Q_PROPERTY(TileMode horizontalTileMode READ horizontalTileMode WRITE setHorizontalTileMode NOTIFY horizontalTileModeChanged) Q_PROPERTY(TileMode verticalTileMode READ verticalTileMode WRITE setVerticalTileMode NOTIFY verticalTileModeChanged) + // read-only for BorderImage + Q_PROPERTY(QSize sourceSize READ sourceSize NOTIFY sourceSizeChanged) + public: QDeclarativeBorderImage(QDeclarativeItem *parent=0); ~QDeclarativeBorderImage(); @@ -80,11 +83,10 @@ public: void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); void setSource(const QUrl &url); - void setSourceSize(const QSize&); - Q_SIGNALS: void horizontalTileModeChanged(); void verticalTileModeChanged(); + void sourceSizeChanged(); protected: virtual void load(); -- cgit v0.12 From 5710cc981ae39a018d4c30b2c77f6623713a5bf1 Mon Sep 17 00:00:00 2001 From: Christopher Ham Date: Fri, 10 Dec 2010 13:19:03 +1000 Subject: KeyNavigation skips disabled or invisible items When using KeyNavigation, if the "visible" or "enabled" property of the item set in the KeyNavigation handler is false, an attempt will be made to skip this item and setFocus to the following item. Task-number: QTBUG-15862 Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativeitem.cpp | 46 ++++++++++--- src/declarative/graphicsitems/qdeclarativeitem_p.h | 1 + .../qdeclarativeitem/tst_qdeclarativeitem.cpp | 79 ++++++++++++++++++++++ 3 files changed, 118 insertions(+), 8 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 9d6fe12..cf12688 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -444,6 +444,11 @@ void QDeclarativeItemKeyFilter::componentComplete() \c KeyNavigation.BeforeItem allows the event to be used for key navigation before the item, rather than after. + If item to which the focus is switching is not enabled or visible, an attempt will + be made to skip this item and focus on the next. This is possible if there are + a chain of items with the same KeyNavigation handler. If multiple items in a row are not enabled + or visible, they will also be skipped. + \sa {Keys}{Keys attached property} */ @@ -452,10 +457,12 @@ void QDeclarativeItemKeyFilter::componentComplete() \qmlproperty Item KeyNavigation::right \qmlproperty Item KeyNavigation::up \qmlproperty Item KeyNavigation::down + \qmlproperty Item KeyNavigation::tab + \qmlproperty Item KeyNavigation::backtab These properties hold the item to assign focus to - when Key_Left, Key_Right, Key_Up or Key_Down are - pressed. + when Key_Left, Key_Right, Key_Up, Key_Down, Key_Tab or Key_BackTab + are pressed. */ QDeclarativeKeyNavigationAttached::QDeclarativeKeyNavigationAttached(QObject *parent) @@ -603,37 +610,37 @@ void QDeclarativeKeyNavigationAttached::keyPressed(QKeyEvent *event, bool post) switch(event->key()) { case Qt::Key_Left: if (d->left) { - d->left->setFocus(true); + setFocusNavigation(d->left, "left"); event->accept(); } break; case Qt::Key_Right: if (d->right) { - d->right->setFocus(true); + setFocusNavigation(d->right, "right"); event->accept(); } break; case Qt::Key_Up: if (d->up) { - d->up->setFocus(true); + setFocusNavigation(d->up, "up"); event->accept(); } break; case Qt::Key_Down: if (d->down) { - d->down->setFocus(true); + setFocusNavigation(d->down, "down"); event->accept(); } break; case Qt::Key_Tab: if (d->tab) { - d->tab->setFocus(true); + setFocusNavigation(d->tab, "tab"); event->accept(); } break; case Qt::Key_Backtab: if (d->backtab) { - d->backtab->setFocus(true); + setFocusNavigation(d->backtab, "backtab"); event->accept(); } break; @@ -692,6 +699,29 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post) if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyReleased(event, post); } +void QDeclarativeKeyNavigationAttached::setFocusNavigation(QDeclarativeItem *currentItem, const char *dir) +{ + QDeclarativeItem *initialItem = currentItem; + bool isNextItem = false; + do { + isNextItem = false; + if (currentItem->isVisible() && currentItem->isEnabled()) { + currentItem->setFocus(true); + } else { + QObject *attached = + qmlAttachedPropertiesObject(currentItem, false); + if (attached) { + QDeclarativeItem *tempItem = qvariant_cast(attached->property(dir)); + if (tempItem) { + currentItem = tempItem; + isNextItem = true; + } + } + } + } + while (currentItem != initialItem && isNextItem); +} + /*! \qmlclass Keys QDeclarativeKeysAttached \ingroup qml-basic-interaction-elements diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h index d8635b9..402554b 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem_p.h +++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h @@ -411,6 +411,7 @@ Q_SIGNALS: private: virtual void keyPressed(QKeyEvent *event, bool post); virtual void keyReleased(QKeyEvent *event, bool post); + void setFocusNavigation(QDeclarativeItem *currentItem, const char *dir); }; class QDeclarativeKeysAttachedPrivate : public QObjectPrivate diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp index 711bf00..9587254 100644 --- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp +++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp @@ -65,6 +65,7 @@ private slots: void keys(); void keysProcessingOrder(); void keyNavigation(); + void keyNavigation_skipNotVisible(); void smooth(); void clip(); void mapCoordinates(); @@ -450,6 +451,84 @@ void tst_QDeclarativeItem::keyNavigation() delete canvas; } +void tst_QDeclarativeItem::keyNavigation_skipNotVisible() +{ + QDeclarativeView *canvas = new QDeclarativeView(0); + canvas->setFixedSize(240,320); + + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keynavigationtest.qml")); + canvas->show(); + qApp->processEvents(); + + QEvent wa(QEvent::WindowActivate); + QApplication::sendEvent(canvas, &wa); + QFocusEvent fe(QEvent::FocusIn); + QApplication::sendEvent(canvas, &fe); + + QDeclarativeItem *item = findItem(canvas->rootObject(), "item1"); + QVERIFY(item); + QVERIFY(item->hasActiveFocus()); + + // Set item 2 to not visible + item = findItem(canvas->rootObject(), "item2"); + QVERIFY(item); + item->setVisible(false); + QVERIFY(!item->isVisible()); + + // right + QKeyEvent key(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + + item = findItem(canvas->rootObject(), "item1"); + QVERIFY(item); + QVERIFY(item->hasActiveFocus()); + + // tab + key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + + item = findItem(canvas->rootObject(), "item3"); + QVERIFY(item); + QVERIFY(item->hasActiveFocus()); + + // backtab + key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + + item = findItem(canvas->rootObject(), "item1"); + QVERIFY(item); + QVERIFY(item->hasActiveFocus()); + + //Set item 3 to not visible + item = findItem(canvas->rootObject(), "item3"); + QVERIFY(item); + item->setVisible(false); + QVERIFY(!item->isVisible()); + + // tab + key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + + item = findItem(canvas->rootObject(), "item4"); + QVERIFY(item); + QVERIFY(item->hasActiveFocus()); + + // backtab + key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + + item = findItem(canvas->rootObject(), "item1"); + QVERIFY(item); + QVERIFY(item->hasActiveFocus()); + + delete canvas; +} + void tst_QDeclarativeItem::smooth() { QDeclarativeComponent component(&engine); -- cgit v0.12 From 6541562252cecd102788257022d3cf159954cae8 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Fri, 10 Dec 2010 11:47:43 +0100 Subject: QmlDebugger: Instantiation of deferred objects moved to the debugger engine Reviewed-by: Kai Koehne --- src/declarative/qml/qdeclarativecompiler.cpp | 6 +----- src/declarative/qml/qdeclarativeenginedebug.cpp | 22 ++++++++++++++++------ src/declarative/qml/qdeclarativeenginedebug_p.h | 1 + 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index b375b27..4749bf8 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -65,7 +65,6 @@ #include "private/qdeclarativebinding_p.h" #include "private/qdeclarativecompiledbindings_p.h" #include "private/qdeclarativeglobalscriptclass_p.h" -#include "private/qdeclarativedebugservice_p.h" #include #include @@ -755,10 +754,7 @@ bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt) QList customProps; // Fetch the list of deferred properties - QStringList deferredList; - if (!QDeclarativeDebugService::isDebuggingEnabled()) { - deferredList = deferredProperties(obj); - } + QStringList deferredList = deferredProperties(obj); // Must do id property first. This is to ensure that the id given to any // id reference created matches the order in which the objects are diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index bffe681..5f338db 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -192,11 +192,6 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message, { message << objectData(object); - // Some children aren't added to an object until particular properties are read - // - e.g. child state objects aren't added until the 'states' property is read - - // but this should only affect internal objects that aren't shown by the - // debugger anyway. - QObjectList children = object->children(); int childrenCount = children.count(); @@ -257,6 +252,18 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message, message << fakeProperties[ii]; } +void QDeclarativeEngineDebugServer::prepareDeferredObjects(QObject *obj) +{ + qmlExecuteDeferred(obj); + + QObjectList children = obj->children(); + for (int ii = 0; ii < children.count(); ++ii) { + QObject *child = children.at(ii); + prepareDeferredObjects(child); + } + +} + void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message, QDeclarativeContext *ctxt) { QDeclarativeContextData *p = QDeclarativeContextData::get(ctxt); @@ -393,8 +400,11 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message) QDataStream rs(&reply, QIODevice::WriteOnly); rs << QByteArray("FETCH_OBJECT_R") << queryId; - if (object) + if (object) { + if (recurse) + prepareDeferredObjects(object); buildObjectDump(rs, object, recurse, dumpProperties); + } sendMessage(reply); } else if (type == "WATCH_OBJECT") { diff --git a/src/declarative/qml/qdeclarativeenginedebug_p.h b/src/declarative/qml/qdeclarativeenginedebug_p.h index 97b8121..dc8bc85 100644 --- a/src/declarative/qml/qdeclarativeenginedebug_p.h +++ b/src/declarative/qml/qdeclarativeenginedebug_p.h @@ -105,6 +105,7 @@ private Q_SLOTS: void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value); private: + void prepareDeferredObjects(QObject *); void buildObjectList(QDataStream &, QDeclarativeContext *); void buildObjectDump(QDataStream &, QObject *, bool, bool); QDeclarativeObjectData objectData(QObject *); -- cgit v0.12 From 3006bdd1eab665d3a0e666975246d2fb20b578af Mon Sep 17 00:00:00 2001 From: Christopher Ham Date: Mon, 13 Dec 2010 09:34:04 +1000 Subject: Adding documentation for borderImage Documentation describing the read-only behaviour of property sourceSize Task-number: QTBUG-15703 Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativeborderimage.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index d9ba2bd..63b2b9a 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -236,6 +236,16 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage() \sa QDeclarativeImageProvider */ + +/*! + \qmlproperty QSize BorderImage::sourceSize + + This property holds the actual width and height of the loaded image. + + In BorderImage, this property is read-only. + + \sa Image::sourceSize +*/ void QDeclarativeBorderImage::setSource(const QUrl &url) { Q_D(QDeclarativeBorderImage); -- cgit v0.12 From 409f60f0f6fd2c2bad6125d0463c812ba1b1180a Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Mon, 13 Dec 2010 15:34:23 +1000 Subject: Document TextInput property maximumLength Task-number: Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 0deacf8..2fb7ace 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -361,6 +361,14 @@ void QDeclarativeTextInput::setReadOnly(bool ro) emit readOnlyChanged(ro); } +/*! + \qmlproperty int TextInput::maximumLength + The maximum permitted length of the text in the TextInput. + + If the text is too long, it is truncated at the limit. + + By default, this property contains a value of 32767. +*/ int QDeclarativeTextInput::maxLength() const { Q_D(const QDeclarativeTextInput); -- cgit v0.12 From b3666a5ac8ee295adc86d8d20f5452eaad3063aa Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Mon, 13 Dec 2010 17:05:45 +1000 Subject: Revert "Add mirroring-positioners.qml example" that was accidentally pushed This reverts commit 18b940539d0633f30ae055feedb48aeb15969814. --- .../positioners/mirroring-positioners.qml | 70 ---------------------- 1 file changed, 70 deletions(-) delete mode 100644 examples/declarative/positioners/mirroring-positioners.qml diff --git a/examples/declarative/positioners/mirroring-positioners.qml b/examples/declarative/positioners/mirroring-positioners.qml deleted file mode 100644 index 0db95dd..0000000 --- a/examples/declarative/positioners/mirroring-positioners.qml +++ /dev/null @@ -1,70 +0,0 @@ -import QtQuick 1.0 - -Rectangle { - width: column.width+10 - height: column.height+10 - property bool arabic: false - Column { - id: column - spacing: 10 - anchors.centerIn: parent - Text { - text: "Row" - anchors.horizontalCenter: parent.horizontalCenter - } - Row { - flow: arabic ? Row.RightToLeft : Row.LeftToRight - spacing: 10 - Repeater { - model: 4 - Loader { - property int value: index - sourceComponent: delegate - } - } - } - Text { - text: "Grid" - anchors.horizontalCenter: parent.horizontalCenter - } - Grid { - flow: arabic ? Grid.RightToLeft : Grid.LeftToRight - spacing: 10; columns: 4 - Repeater { - model: 11 - Loader { - property int value: index - sourceComponent: delegate - } - } - } - Rectangle { - height: 50; width: parent.width - color: mouseArea.pressed ? "black" : "gray" - Text { - text: arabic ? "RTL" : "LTR" - color: "white" - font.pixelSize: 20 - anchors.centerIn: parent - } - MouseArea { - id: mouseArea - onClicked: arabic = !arabic - anchors.fill: parent - } - } - } - Component { - id: delegate - Rectangle { - width: 50; height: 50 - color: Qt.rgba(0.8/(parent.value+1),0.8/(parent.value+1),0.8/(parent.value+1),1.0) - Text { - text: parent.parent.value+1 - color: "white" - font.pixelSize: 20 - anchors.centerIn: parent - } - } - } -} -- cgit v0.12 From db13511196f94e61c8c679448b6182f09b6ce539 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 13 Dec 2010 10:16:07 +0100 Subject: doc: Eliminated some "raw-html" cases. More to come. --- doc/src/widgets-and-layouts/gallery-cde.qdoc | 427 ++++++--------------------- 1 file changed, 91 insertions(+), 336 deletions(-) diff --git a/doc/src/widgets-and-layouts/gallery-cde.qdoc b/doc/src/widgets-and-layouts/gallery-cde.qdoc index c783399..69287b9 100644 --- a/doc/src/widgets-and-layouts/gallery-cde.qdoc +++ b/doc/src/widgets-and-layouts/gallery-cde.qdoc @@ -34,345 +34,100 @@ This page shows some of the widgets available in Qt when configured to use the "cde" style. -\raw HTML -

    Buttons

    +\section2 Buttons - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage cde-pushbutton.png -\raw HTML - -\endraw -\inlineimage cde-toolbutton.png -\raw HTML -
    -\endraw -The QPushButton widget provides a command button. -\raw HTML - -\endraw -\raw HTML -
    -\endraw -\inlineimage cde-checkbox.png -\raw HTML - -\endraw -\inlineimage cde-radiobutton.png -\raw HTML -
    -\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
    -\endraw -\raw HTML -

    Containers

    +\table 100% +\row +\o \image cde-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image cde-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\o \image cde-pushbutton.png + \image cde-toolbutton.png + \caption The QPushButton widget provides a command button. +\endtable - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage cde-groupbox.png -\raw HTML - -\endraw -\inlineimage cde-tabwidget.png -\raw HTML -
    -\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
    -\endraw -\inlineimage cde-frame.png -\raw HTML - -\endraw -\inlineimage cde-toolbox.png -\raw HTML -
    -\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
    -\endraw -\raw HTML -

    Item Views

    +\section2 Containers - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage cde-listview.png -\raw HTML - -\endraw -\inlineimage cde-treeview.png -\raw HTML -
    -\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
    -\endraw -\inlineimage cde-tableview.png -\raw HTML -
    -\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
    -\endraw -\raw HTML -

    Display Widgets

    +\table 100% +\row +\o \image cde-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image cde-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image cde-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image cde-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage cde-progressbar.png -\raw HTML - -\endraw -\inlineimage cde-lcdnumber.png -\raw HTML -
    -\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
    -\endraw -\inlineimage cde-label.png -\raw HTML -
    -\endraw -The QLabel widget provides a text or image display.\raw HTML -
    -\endraw -\raw HTML -

    Input Widgets

    +\section2 Item Views + +\table 100% +\row +\o \image cde-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image cde-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image cde-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image cde-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image cde-label.png + The QLabel widget provides a text or image display. +\o \image cde-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image cde-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image cde-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image cde-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image cde-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image cde-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image cde-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image cde-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image cde-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image cde-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image cde-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image cde-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image cde-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image cde-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage cde-slider.png -\raw HTML - -\endraw -\inlineimage cde-lineedit.png -\raw HTML -
    -\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
    -\endraw -\inlineimage cde-combobox.png -\raw HTML - -\endraw -\inlineimage cde-doublespinbox.png -\raw HTML -
    -\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
    -\endraw -\inlineimage cde-spinbox.png -\raw HTML - -\endraw -\inlineimage cde-timeedit.png -\raw HTML -
    -\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
    -\endraw -\inlineimage cde-dateedit.png -\raw HTML - -\endraw -\inlineimage cde-datetimeedit.png -\raw HTML -
    -\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
    -\endraw -\inlineimage cde-textedit.png -\raw HTML - -\endraw -\inlineimage cde-horizontalscrollbar.png -\raw HTML -
    -\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
    -\endraw -\inlineimage cde-dial.png -\raw HTML - -\endraw -\inlineimage cde-calendarwidget.png -\raw HTML -
    -\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
    -\endraw -\inlineimage cde-fontcombobox.png -\raw HTML -
    -\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
    -\endraw */ -- cgit v0.12 From ba8e841523f005bddca581d70ef0883c5a26f47a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 13 Dec 2010 11:34:49 +0100 Subject: doc: Replaced some \raw and \endraw uses with \table and \endtable In DITA XML, there is no straightforward way to translate raw html into DITA XML, because the XML stream writer automagically escapes all the raw html elements. So I am beginning to replace uses of the \raw command with \table, which gets output correctly. The problem is the XML stream writer must see each XML element start and end, because it keeps them on a stack. When you output XML elements with the writeCharacters() function, it escapes the '<' and '>' of any XML elements the character string contains. --- .../widgets-and-layouts/gallery-cleanlooks.qdoc | 432 +++++--------------- doc/src/widgets-and-layouts/gallery-gtk.qdoc | 436 +++++---------------- doc/src/widgets-and-layouts/gallery-macintosh.qdoc | 432 +++++--------------- doc/src/widgets-and-layouts/gallery-motif.qdoc | 432 +++++--------------- doc/src/widgets-and-layouts/gallery-plastique.qdoc | 432 +++++--------------- doc/src/widgets-and-layouts/gallery-windows.qdoc | 432 +++++--------------- .../widgets-and-layouts/gallery-windowsvista.qdoc | 432 +++++--------------- doc/src/widgets-and-layouts/gallery-windowsxp.qdoc | 432 +++++--------------- 8 files changed, 768 insertions(+), 2692 deletions(-) diff --git a/doc/src/widgets-and-layouts/gallery-cleanlooks.qdoc b/doc/src/widgets-and-layouts/gallery-cleanlooks.qdoc index d03adc8..59e2934 100644 --- a/doc/src/widgets-and-layouts/gallery-cleanlooks.qdoc +++ b/doc/src/widgets-and-layouts/gallery-cleanlooks.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "cleanlooks" style. -\raw HTML -

    Buttons

    +\section2 Buttons - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage cleanlooks-pushbutton.png -\raw HTML - -\endraw -\inlineimage cleanlooks-toolbutton.png -\raw HTML -
    -\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
    -\endraw -\inlineimage cleanlooks-checkbox.png -\raw HTML - -\endraw -\inlineimage cleanlooks-radiobutton.png -\raw HTML -
    -\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
    -\endraw -\raw HTML -

    Containers

    +\table 100% +\row +\o \image cleanlooks-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image cleanlooks-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage cleanlooks-groupbox.png -\raw HTML - -\endraw -\inlineimage cleanlooks-tabwidget.png -\raw HTML -
    -\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
    -\endraw -\inlineimage cleanlooks-frame.png -\raw HTML - -\endraw -\inlineimage cleanlooks-toolbox.png -\raw HTML -
    -\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
    -\endraw -\raw HTML -

    Item Views

    +\table 100% +\row +\o \image cleanlooks-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image cleanlooks-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage cleanlooks-listview.png -\raw HTML - -\endraw -\inlineimage cleanlooks-treeview.png -\raw HTML -
    -\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
    -\endraw -\inlineimage cleanlooks-tableview.png -\raw HTML -
    -\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
    -\endraw -\raw HTML -

    Display Widgets

    +\section2 Containers - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage cleanlooks-progressbar.png -\raw HTML - -\endraw -\inlineimage cleanlooks-lcdnumber.png -\raw HTML -
    -\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
    -\endraw -\inlineimage cleanlooks-label.png -\raw HTML -
    -\endraw -The QLabel widget provides a text or image display.\raw HTML -
    -\endraw -\raw HTML -

    Input Widgets

    +\table 100% +\row +\o \image cleanlooks-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image cleanlooks-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image cleanlooks-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image cleanlooks-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage cleanlooks-slider.png -\raw HTML - -\endraw -\inlineimage cleanlooks-lineedit.png -\raw HTML -
    -\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
    -\endraw -\inlineimage cleanlooks-combobox.png -\raw HTML - -\endraw -\inlineimage cleanlooks-doublespinbox.png -\raw HTML -
    -\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
    -\endraw -\inlineimage cleanlooks-spinbox.png -\raw HTML - -\endraw -\inlineimage cleanlooks-timeedit.png -\raw HTML -
    -\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
    -\endraw -\inlineimage cleanlooks-dateedit.png -\raw HTML - -\endraw -\inlineimage cleanlooks-datetimeedit.png -\raw HTML -
    -\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
    -\endraw -\inlineimage cleanlooks-textedit.png -\raw HTML - -\endraw -\inlineimage cleanlooks-horizontalscrollbar.png -\raw HTML -
    -\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
    -\endraw -\inlineimage cleanlooks-dial.png -\raw HTML - -\endraw -\inlineimage cleanlooks-calendarwidget.png -\raw HTML -
    -\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
    -\endraw -\inlineimage cleanlooks-fontcombobox.png -\raw HTML -
    -\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
    -\endraw +\section2 Item Views + +\table 100% +\row +\o \image cleanlooks-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image cleanlooks-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image cleanlooks-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image cleanlooks-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image cleanlooks-label.png + The QLabel widget provides a text or image display. +\o \image cleanlooks-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image cleanlooks-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image cleanlooks-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image cleanlooks-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image cleanlooks-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image cleanlooks-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image cleanlooks-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image cleanlooks-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image cleanlooks-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image cleanlooks-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image cleanlooks-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image cleanlooks-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image cleanlooks-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image cleanlooks-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-gtk.qdoc b/doc/src/widgets-and-layouts/gallery-gtk.qdoc index b3a6372..b2f8458 100644 --- a/doc/src/widgets-and-layouts/gallery-gtk.qdoc +++ b/doc/src/widgets-and-layouts/gallery-gtk.qdoc @@ -37,349 +37,105 @@ Take a look at the \l{Qt Widget Gallery} to see how Qt applications appear in other styles. -\raw HTML -

    Buttons

    +\section2 Buttons - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage gtk-pushbutton.png -\raw HTML - -\endraw -\inlineimage gtk-toolbutton.png -\raw HTML -
    -\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
    -\endraw -\inlineimage gtk-checkbox.png -\raw HTML - -\endraw -\inlineimage gtk-radiobutton.png -\raw HTML -
    -\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
    -\endraw -\raw HTML -

    Containers

    +\table 100% +\row +\o \image gtk-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image gtk-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage gtk-groupbox.png -\raw HTML - -\endraw -\inlineimage gtk-tabwidget.png -\raw HTML -
    -\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
    -\endraw -\inlineimage gtk-toolbox.png -\raw HTML - -\endraw -\inlineimage gtk-frame.png -\raw HTML -
    -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML - -\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML -
    -\endraw -\raw HTML -

    Item Views

    +\table 100% +\row +\o \image gtk-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image gtk-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage gtk-listview.png -\raw HTML - -\endraw -\inlineimage gtk-treeview.png -\raw HTML -
    -\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
    -\endraw -\inlineimage gtk-tableview.png -\raw HTML -
    -\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML - -\endraw -\raw HTML -
    -\endraw -\raw HTML -

    Display Widgets

    +\section2 Containers - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage gtk-progressbar.png -\raw HTML - -\endraw -\inlineimage gtk-lcdnumber.png -\raw HTML -
    -\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
    -\endraw -\inlineimage gtk-label.png -\raw HTML -
    -\endraw -The QLabel widget provides a text or image display.\raw HTML -
    -\endraw -\raw HTML -

    Input Widgets

    +\table 100% +\row +\o \image gtk-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image gtk-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image gtk-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image gtk-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage gtk-slider.png -\raw HTML - -\endraw -\inlineimage gtk-lineedit.png -\raw HTML -
    -\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
    -\endraw -\inlineimage gtk-combobox.png -\raw HTML - -\endraw -\inlineimage gtk-doublespinbox.png -\raw HTML -
    -\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
    -\endraw -\inlineimage gtk-spinbox.png -\raw HTML - -\endraw -\inlineimage gtk-timeedit.png -\raw HTML -
    -\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
    -\endraw -\inlineimage gtk-dateedit.png -\raw HTML - -\endraw -\inlineimage gtk-datetimeedit.png -\raw HTML -
    -\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
    -\endraw -\inlineimage gtk-textedit.png -\raw HTML - -\endraw -\inlineimage gtk-horizontalscrollbar.png -\raw HTML -
    -\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
    -\endraw -\inlineimage gtk-dial.png -\raw HTML - -\endraw -\inlineimage gtk-calendarwidget.png -\raw HTML -
    -\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
    -\endraw -\inlineimage gtk-fontcombobox.png -\raw HTML -
    -\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
    -\endraw +\section2 Item Views + +\table 100% +\row +\o \image gtk-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image gtk-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image gtk-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image gtk-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image gtk-label.png + The QLabel widget provides a text or image display. +\o \image gtk-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image gtk-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image gtk-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image gtk-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image gtk-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image gtk-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image gtk-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image gtk-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image gtk-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image gtk-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image gtk-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image gtk-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image gtk-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image gtk-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-macintosh.qdoc b/doc/src/widgets-and-layouts/gallery-macintosh.qdoc index 30a78ca..44d7eb9 100644 --- a/doc/src/widgets-and-layouts/gallery-macintosh.qdoc +++ b/doc/src/widgets-and-layouts/gallery-macintosh.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "macintosh" style. -\raw HTML -

    Buttons

    +\section2 Buttons - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage macintosh-pushbutton.png -\raw HTML - -\endraw -\inlineimage macintosh-toolbutton.png -\raw HTML -
    -\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
    -\endraw -\inlineimage macintosh-checkbox.png -\raw HTML - -\endraw -\inlineimage macintosh-radiobutton.png -\raw HTML -
    -\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
    -\endraw -\raw HTML -

    Containers

    +\table 100% +\row +\o \image macintosh-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image macintosh-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage macintosh-groupbox.png -\raw HTML - -\endraw -\inlineimage macintosh-tabwidget.png -\raw HTML -
    -\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
    -\endraw -\inlineimage macintosh-frame.png -\raw HTML - -\endraw -\inlineimage macintosh-toolbox.png -\raw HTML -
    -\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
    -\endraw -\raw HTML -

    Item Views

    +\table 100% +\row +\o \image macintosh-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image macintosh-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage macintosh-listview.png -\raw HTML - -\endraw -\inlineimage macintosh-treeview.png -\raw HTML -
    -\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
    -\endraw -\inlineimage macintosh-tableview.png -\raw HTML -
    -\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
    -\endraw -\raw HTML -

    Display Widgets

    +\section2 Containers - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage macintosh-progressbar.png -\raw HTML - -\endraw -\inlineimage macintosh-lcdnumber.png -\raw HTML -
    -\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
    -\endraw -\inlineimage macintosh-label.png -\raw HTML -
    -\endraw -The QLabel widget provides a text or image display.\raw HTML -
    -\endraw -\raw HTML -

    Input Widgets

    +\table 100% +\row +\o \image macintosh-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image macintosh-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image macintosh-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image macintosh-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage macintosh-slider.png -\raw HTML - -\endraw -\inlineimage macintosh-lineedit.png -\raw HTML -
    -\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
    -\endraw -\inlineimage macintosh-combobox.png -\raw HTML - -\endraw -\inlineimage macintosh-doublespinbox.png -\raw HTML -
    -\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
    -\endraw -\inlineimage macintosh-spinbox.png -\raw HTML - -\endraw -\inlineimage macintosh-timeedit.png -\raw HTML -
    -\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
    -\endraw -\inlineimage macintosh-dateedit.png -\raw HTML - -\endraw -\inlineimage macintosh-datetimeedit.png -\raw HTML -
    -\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
    -\endraw -\inlineimage macintosh-textedit.png -\raw HTML - -\endraw -\inlineimage macintosh-horizontalscrollbar.png -\raw HTML -
    -\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
    -\endraw -\inlineimage macintosh-dial.png -\raw HTML - -\endraw -\inlineimage macintosh-calendarwidget.png -\raw HTML -
    -\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
    -\endraw -\inlineimage macintosh-fontcombobox.png -\raw HTML -
    -\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
    -\endraw +\section2 Item Views + +\table 100% +\row +\o \image macintosh-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image macintosh-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image macintosh-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image macintosh-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image macintosh-label.png + The QLabel widget provides a text or image display. +\o \image macintosh-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image macintosh-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image macintosh-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image macintosh-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image macintosh-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image macintosh-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image macintosh-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image macintosh-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image macintosh-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image macintosh-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image macintosh-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image macintosh-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image macintosh-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image macintosh-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-motif.qdoc b/doc/src/widgets-and-layouts/gallery-motif.qdoc index 861c22a..b9c95c8 100644 --- a/doc/src/widgets-and-layouts/gallery-motif.qdoc +++ b/doc/src/widgets-and-layouts/gallery-motif.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "motif" style. -\raw HTML -

    Buttons

    +\section2 Buttons - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage motif-pushbutton.png -\raw HTML - -\endraw -\inlineimage motif-toolbutton.png -\raw HTML -
    -\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
    -\endraw -\inlineimage motif-checkbox.png -\raw HTML - -\endraw -\inlineimage motif-radiobutton.png -\raw HTML -
    -\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
    -\endraw -\raw HTML -

    Containers

    +\table 100% +\row +\o \image motif-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image motif-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage motif-groupbox.png -\raw HTML - -\endraw -\inlineimage motif-tabwidget.png -\raw HTML -
    -\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
    -\endraw -\inlineimage motif-frame.png -\raw HTML - -\endraw -\inlineimage motif-toolbox.png -\raw HTML -
    -\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
    -\endraw -\raw HTML -

    Item Views

    +\table 100% +\row +\o \image motif-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image motif-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage motif-listview.png -\raw HTML - -\endraw -\inlineimage motif-treeview.png -\raw HTML -
    -\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
    -\endraw -\inlineimage motif-tableview.png -\raw HTML -
    -\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
    -\endraw -\raw HTML -

    Display Widgets

    +\section2 Containers - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage motif-progressbar.png -\raw HTML - -\endraw -\inlineimage motif-lcdnumber.png -\raw HTML -
    -\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
    -\endraw -\inlineimage motif-label.png -\raw HTML -
    -\endraw -The QLabel widget provides a text or image display.\raw HTML -
    -\endraw -\raw HTML -

    Input Widgets

    +\table 100% +\row +\o \image motif-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image motif-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image motif-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image motif-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage motif-slider.png -\raw HTML - -\endraw -\inlineimage motif-lineedit.png -\raw HTML -
    -\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
    -\endraw -\inlineimage motif-combobox.png -\raw HTML - -\endraw -\inlineimage motif-doublespinbox.png -\raw HTML -
    -\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
    -\endraw -\inlineimage motif-spinbox.png -\raw HTML - -\endraw -\inlineimage motif-timeedit.png -\raw HTML -
    -\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
    -\endraw -\inlineimage motif-dateedit.png -\raw HTML - -\endraw -\inlineimage motif-datetimeedit.png -\raw HTML -
    -\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
    -\endraw -\inlineimage motif-textedit.png -\raw HTML - -\endraw -\inlineimage motif-horizontalscrollbar.png -\raw HTML -
    -\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
    -\endraw -\inlineimage motif-dial.png -\raw HTML - -\endraw -\inlineimage motif-calendarwidget.png -\raw HTML -
    -\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
    -\endraw -\inlineimage motif-fontcombobox.png -\raw HTML -
    -\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
    -\endraw +\section2 Item Views + +\table 100% +\row +\o \image motif-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image motif-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image motif-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image motif-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image motif-label.png + The QLabel widget provides a text or image display. +\o \image motif-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image motif-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image motif-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image motif-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image motif-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image motif-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image motif-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image motif-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image motif-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image motif-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image motif-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image motif-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image motif-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image motif-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-plastique.qdoc b/doc/src/widgets-and-layouts/gallery-plastique.qdoc index 0ea62ee..5f2a1ec 100644 --- a/doc/src/widgets-and-layouts/gallery-plastique.qdoc +++ b/doc/src/widgets-and-layouts/gallery-plastique.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "plastique" style. -\raw HTML -

    Buttons

    +\section2 Buttons - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage plastique-pushbutton.png -\raw HTML - -\endraw -\inlineimage plastique-toolbutton.png -\raw HTML -
    -\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
    -\endraw -\inlineimage plastique-checkbox.png -\raw HTML - -\endraw -\inlineimage plastique-radiobutton.png -\raw HTML -
    -\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
    -\endraw -\raw HTML -

    Containers

    +\table 100% +\row +\o \image plastique-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image plastique-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage plastique-groupbox.png -\raw HTML - -\endraw -\inlineimage plastique-tabwidget.png -\raw HTML -
    -\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
    -\endraw -\inlineimage plastique-frame.png -\raw HTML - -\endraw -\inlineimage plastique-toolbox.png -\raw HTML -
    -\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
    -\endraw -\raw HTML -

    Item Views

    +\table 100% +\row +\o \image plastique-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image plastique-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage plastique-listview.png -\raw HTML - -\endraw -\inlineimage plastique-treeview.png -\raw HTML -
    -\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
    -\endraw -\inlineimage plastique-tableview.png -\raw HTML -
    -\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
    -\endraw -\raw HTML -

    Display Widgets

    +\section2 Containers - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage plastique-progressbar.png -\raw HTML - -\endraw -\inlineimage plastique-lcdnumber.png -\raw HTML -
    -\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
    -\endraw -\inlineimage plastique-label.png -\raw HTML -
    -\endraw -The QLabel widget provides a text or image display.\raw HTML -
    -\endraw -\raw HTML -

    Input Widgets

    +\table 100% +\row +\o \image plastique-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image plastique-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image plastique-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image plastique-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage plastique-slider.png -\raw HTML - -\endraw -\inlineimage plastique-lineedit.png -\raw HTML -
    -\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
    -\endraw -\inlineimage plastique-combobox.png -\raw HTML - -\endraw -\inlineimage plastique-doublespinbox.png -\raw HTML -
    -\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
    -\endraw -\inlineimage plastique-spinbox.png -\raw HTML - -\endraw -\inlineimage plastique-timeedit.png -\raw HTML -
    -\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
    -\endraw -\inlineimage plastique-dateedit.png -\raw HTML - -\endraw -\inlineimage plastique-datetimeedit.png -\raw HTML -
    -\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
    -\endraw -\inlineimage plastique-textedit.png -\raw HTML - -\endraw -\inlineimage plastique-horizontalscrollbar.png -\raw HTML -
    -\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
    -\endraw -\inlineimage plastique-dial.png -\raw HTML - -\endraw -\inlineimage plastique-calendarwidget.png -\raw HTML -
    -\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
    -\endraw -\inlineimage plastique-fontcombobox.png -\raw HTML -
    -\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
    -\endraw +\section2 Item Views + +\table 100% +\row +\o \image plastique-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image plastique-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image plastique-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image plastique-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image plastique-label.png + The QLabel widget provides a text or image display. +\o \image plastique-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image plastique-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image plastique-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image plastique-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image plastique-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image plastique-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image plastique-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image plastique-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image plastique-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image plastique-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image plastique-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image plastique-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image plastique-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image plastique-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-windows.qdoc b/doc/src/widgets-and-layouts/gallery-windows.qdoc index d3464a0..fe38745 100644 --- a/doc/src/widgets-and-layouts/gallery-windows.qdoc +++ b/doc/src/widgets-and-layouts/gallery-windows.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "windows" style. -\raw HTML -

    Buttons

    +\section2 Buttons - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windows-pushbutton.png -\raw HTML - -\endraw -\inlineimage windows-toolbutton.png -\raw HTML -
    -\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
    -\endraw -\inlineimage windows-checkbox.png -\raw HTML - -\endraw -\inlineimage windows-radiobutton.png -\raw HTML -
    -\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
    -\endraw -\raw HTML -

    Containers

    +\table 100% +\row +\o \image windows-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image windows-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windows-groupbox.png -\raw HTML - -\endraw -\inlineimage windows-tabwidget.png -\raw HTML -
    -\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
    -\endraw -\inlineimage windows-frame.png -\raw HTML - -\endraw -\inlineimage windows-toolbox.png -\raw HTML -
    -\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
    -\endraw -\raw HTML -

    Item Views

    +\table 100% +\row +\o \image windows-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image windows-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windows-listview.png -\raw HTML - -\endraw -\inlineimage windows-treeview.png -\raw HTML -
    -\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
    -\endraw -\inlineimage windows-tableview.png -\raw HTML -
    -\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
    -\endraw -\raw HTML -

    Display Widgets

    +\section2 Containers - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windows-progressbar.png -\raw HTML - -\endraw -\inlineimage windows-lcdnumber.png -\raw HTML -
    -\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
    -\endraw -\inlineimage windows-label.png -\raw HTML -
    -\endraw -The QLabel widget provides a text or image display.\raw HTML -
    -\endraw -\raw HTML -

    Input Widgets

    +\table 100% +\row +\o \image windows-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image windows-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image windows-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image windows-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windows-slider.png -\raw HTML - -\endraw -\inlineimage windows-lineedit.png -\raw HTML -
    -\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
    -\endraw -\inlineimage windows-combobox.png -\raw HTML - -\endraw -\inlineimage windows-doublespinbox.png -\raw HTML -
    -\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
    -\endraw -\inlineimage windows-spinbox.png -\raw HTML - -\endraw -\inlineimage windows-timeedit.png -\raw HTML -
    -\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
    -\endraw -\inlineimage windows-dateedit.png -\raw HTML - -\endraw -\inlineimage windows-datetimeedit.png -\raw HTML -
    -\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
    -\endraw -\inlineimage windows-textedit.png -\raw HTML - -\endraw -\inlineimage windows-horizontalscrollbar.png -\raw HTML -
    -\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
    -\endraw -\inlineimage windows-dial.png -\raw HTML - -\endraw -\inlineimage windows-calendarwidget.png -\raw HTML -
    -\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
    -\endraw -\inlineimage windows-fontcombobox.png -\raw HTML -
    -\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
    -\endraw +\section2 Item Views + +\table 100% +\row +\o \image windows-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image windows-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image windows-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image windows-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image windows-label.png + The QLabel widget provides a text or image display. +\o \image windows-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image windows-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image windows-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image windows-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image windows-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image windows-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image windows-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image windows-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image windows-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image windows-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image windows-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image windows-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image windows-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image windows-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-windowsvista.qdoc b/doc/src/widgets-and-layouts/gallery-windowsvista.qdoc index 00afd52..e017a2c 100644 --- a/doc/src/widgets-and-layouts/gallery-windowsvista.qdoc +++ b/doc/src/widgets-and-layouts/gallery-windowsvista.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "windowsvista" style. -\raw HTML -

    Buttons

    +\section2 Buttons - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windowsvista-pushbutton.png -\raw HTML - -\endraw -\inlineimage windowsvista-toolbutton.png -\raw HTML -
    -\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
    -\endraw -\inlineimage windowsvista-checkbox.png -\raw HTML - -\endraw -\inlineimage windowsvista-radiobutton.png -\raw HTML -
    -\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
    -\endraw -\raw HTML -

    Containers

    +\table 100% +\row +\o \image windowsvista-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image windowsvista-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windowsvista-groupbox.png -\raw HTML - -\endraw -\inlineimage windowsvista-tabwidget.png -\raw HTML -
    -\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
    -\endraw -\inlineimage windowsvista-frame.png -\raw HTML - -\endraw -\inlineimage windowsvista-toolbox.png -\raw HTML -
    -\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
    -\endraw -\raw HTML -

    Item Views

    +\table 100% +\row +\o \image windowsvista-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image windowsvista-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windowsvista-listview.png -\raw HTML - -\endraw -\inlineimage windowsvista-treeview.png -\raw HTML -
    -\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
    -\endraw -\inlineimage windowsvista-tableview.png -\raw HTML -
    -\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
    -\endraw -\raw HTML -

    Display Widgets

    +\section2 Containers - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windowsvista-progressbar.png -\raw HTML - -\endraw -\inlineimage windowsvista-lcdnumber.png -\raw HTML -
    -\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
    -\endraw -\inlineimage windowsvista-label.png -\raw HTML -
    -\endraw -The QLabel widget provides a text or image display.\raw HTML -
    -\endraw -\raw HTML -

    Input Widgets

    +\table 100% +\row +\o \image windowsvista-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image windowsvista-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image windowsvista-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image windowsvista-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windowsvista-slider.png -\raw HTML - -\endraw -\inlineimage windowsvista-lineedit.png -\raw HTML -
    -\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
    -\endraw -\inlineimage windowsvista-combobox.png -\raw HTML - -\endraw -\inlineimage windowsvista-doublespinbox.png -\raw HTML -
    -\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
    -\endraw -\inlineimage windowsvista-spinbox.png -\raw HTML - -\endraw -\inlineimage windowsvista-timeedit.png -\raw HTML -
    -\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
    -\endraw -\inlineimage windowsvista-dateedit.png -\raw HTML - -\endraw -\inlineimage windowsvista-datetimeedit.png -\raw HTML -
    -\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
    -\endraw -\inlineimage windowsvista-textedit.png -\raw HTML - -\endraw -\inlineimage windowsvista-horizontalscrollbar.png -\raw HTML -
    -\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
    -\endraw -\inlineimage windowsvista-dial.png -\raw HTML - -\endraw -\inlineimage windowsvista-calendarwidget.png -\raw HTML -
    -\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
    -\endraw -\inlineimage windowsvista-fontcombobox.png -\raw HTML -
    -\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
    -\endraw +\section2 Item Views + +\table 100% +\row +\o \image windowsvista-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image windowsvista-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image windowsvista-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image windowsvista-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image windowsvista-label.png + The QLabel widget provides a text or image display. +\o \image windowsvista-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image windowsvista-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image windowsvista-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image windowsvista-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image windowsvista-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image windowsvista-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image windowsvista-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image windowsvista-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image windowsvista-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image windowsvista-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image windowsvista-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image windowsvista-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image windowsvista-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image windowsvista-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-windowsxp.qdoc b/doc/src/widgets-and-layouts/gallery-windowsxp.qdoc index 60c8ff0..f3c53ee 100644 --- a/doc/src/widgets-and-layouts/gallery-windowsxp.qdoc +++ b/doc/src/widgets-and-layouts/gallery-windowsxp.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "windowsxp" style. -\raw HTML -

    Buttons

    +\section2 Buttons - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windowsxp-pushbutton.png -\raw HTML - -\endraw -\inlineimage windowsxp-toolbutton.png -\raw HTML -
    -\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
    -\endraw -\inlineimage windowsxp-checkbox.png -\raw HTML - -\endraw -\inlineimage windowsxp-radiobutton.png -\raw HTML -
    -\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
    -\endraw -\raw HTML -

    Containers

    +\table 100% +\row +\o \image windowsxp-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image windowsxp-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windowsxp-groupbox.png -\raw HTML - -\endraw -\inlineimage windowsxp-tabwidget.png -\raw HTML -
    -\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
    -\endraw -\inlineimage windowsxp-frame.png -\raw HTML - -\endraw -\inlineimage windowsxp-toolbox.png -\raw HTML -
    -\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
    -\endraw -\raw HTML -

    Item Views

    +\table 100% +\row +\o \image windowsxp-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image windowsxp-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windowsxp-listview.png -\raw HTML - -\endraw -\inlineimage windowsxp-treeview.png -\raw HTML -
    -\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
    -\endraw -\inlineimage windowsxp-tableview.png -\raw HTML -
    -\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
    -\endraw -\raw HTML -

    Display Widgets

    +\section2 Containers - -- - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windowsxp-progressbar.png -\raw HTML - -\endraw -\inlineimage windowsxp-lcdnumber.png -\raw HTML -
    -\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
    -\endraw -\inlineimage windowsxp-label.png -\raw HTML -
    -\endraw -The QLabel widget provides a text or image display.\raw HTML -
    -\endraw -\raw HTML -

    Input Widgets

    +\table 100% +\row +\o \image windowsxp-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image windowsxp-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image windowsxp-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image windowsxp-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -\endraw -\inlineimage windowsxp-slider.png -\raw HTML - -\endraw -\inlineimage windowsxp-lineedit.png -\raw HTML -
    -\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
    -\endraw -\inlineimage windowsxp-combobox.png -\raw HTML - -\endraw -\inlineimage windowsxp-doublespinbox.png -\raw HTML -
    -\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
    -\endraw -\inlineimage windowsxp-spinbox.png -\raw HTML - -\endraw -\inlineimage windowsxp-timeedit.png -\raw HTML -
    -\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
    -\endraw -\inlineimage windowsxp-dateedit.png -\raw HTML - -\endraw -\inlineimage windowsxp-datetimeedit.png -\raw HTML -
    -\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
    -\endraw -\inlineimage windowsxp-textedit.png -\raw HTML - -\endraw -\inlineimage windowsxp-horizontalscrollbar.png -\raw HTML -
    -\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
    -\endraw -\inlineimage windowsxp-dial.png -\raw HTML - -\endraw -\inlineimage windowsxp-calendarwidget.png -\raw HTML -
    -\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
    -\endraw -\inlineimage windowsxp-fontcombobox.png -\raw HTML -
    -\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
    -\endraw +\section2 Item Views + +\table 100% +\row +\o \image windowsxp-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image windowsxp-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image windowsxp-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image windowsxp-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image windowsxp-label.png + The QLabel widget provides a text or image display. +\o \image windowsxp-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image windowsxp-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image windowsxp-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image windowsxp-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image windowsxp-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image windowsxp-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image windowsxp-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image windowsxp-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image windowsxp-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image windowsxp-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image windowsxp-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image windowsxp-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image windowsxp-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image windowsxp-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ -- cgit v0.12 From 53dc4de29913356e9521ac433fb13b36d2b5ab8b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 13 Dec 2010 12:23:29 +0100 Subject: doc: Replaced some \raw and \endraw uses with \table and \endtable In DITA XML, there is no straightforward way to translate raw html into DITA XML, because the XML stream writer automagically escapes all the raw html elements. So I am beginning to replace uses of the \raw command with \table, which gets output correctly. The problem is the XML stream writer must see each XML element start and end, because it keeps them on a stack. When you output XML elements with the writeCharacters() function, it escapes the '<' and '>' of any XML elements the character string contains. --- doc/src/widgets-and-layouts/gallery.qdoc | 112 +++++++++---------------------- 1 file changed, 30 insertions(+), 82 deletions(-) diff --git a/doc/src/widgets-and-layouts/gallery.qdoc b/doc/src/widgets-and-layouts/gallery.qdoc index 201817b..d11d9c8 100644 --- a/doc/src/widgets-and-layouts/gallery.qdoc +++ b/doc/src/widgets-and-layouts/gallery.qdoc @@ -34,103 +34,51 @@ with the native desktop enviroment. Below, you can find links to the various widget styles that are supplied with Qt 4. - \raw HTML - - - - - - - - - - - - - - - - - - - - - - - - -
    - \endraw - \image plastique-tabwidget.png Plastique Style Widget Gallery - - \bold{\l{Plastique Style Widget Gallery}} + \table + \row + \o \image plastique-tabwidget.png Plastique Style Widget Gallery + \caption \l{Plastique Style Widget Gallery} The Plastique style is provided by QPlastiqueStyle. - \raw HTML - - \endraw - \image windowsxp-tabwidget.png Windows XP Style Widget Gallery - - \bold{\l{Windows XP Style Widget Gallery}} + \o \image windowsxp-tabwidget.png Windows XP Style Widget Gallery + \caption \l{Windows XP Style Widget Gallery} The Windows XP style is provided by QWindowsXPStyle. - \raw HTML -
    - \endraw - \image gtk-tabwidget.png GTK Style Widget Gallery + \o \image windows-tabwidget.png Windows Style Widget Gallery + \caption \l{Windows Style Widget Gallery} - \bold{\l{GTK Style Widget Gallery}} - - The GTK style is provided by QGtkStyle. - \raw HTML - - \endraw - \image macintosh-tabwidget.png Macintosh Style Widget Gallery + The Windows style is provided by QWindowsStyle. + \endtable - \bold{\l{Macintosh Style Widget Gallery}} + \table + \row + \o \image macintosh-tabwidget.png Macintosh Style Widget Gallery + \caption \l{Macintosh Style Widget Gallery} The Macintosh style is provided by QMacStyle. - \raw HTML -
    - \endraw - \image cleanlooks-tabwidget.png Cleanlooks Style Widget Gallery - - \bold{\l{Cleanlooks Style Widget Gallery}} + \o \image cleanlooks-tabwidget.png Cleanlooks Style Widget Gallery + \caption \l{Cleanlooks Style Widget Gallery} The Cleanlooks style is provided by QCleanlooksStyle. - \raw HTML - - \endraw - \image windowsvista-tabwidget.png Windows Vista Style Widget Gallery - - \bold{\l{Windows Vista Style Widget Gallery}} + \o \image windowsvista-tabwidget.png Windows Vista Style Widget Gallery + \caption \l{Windows Vista Style Widget Gallery} The Windows Vista style is provided by QWindowsVistaStyle. - \raw HTML -
    - \endraw - \image motif-tabwidget.png Motif Style Widget Gallery + \endtable - \bold{\l{Motif Style Widget Gallery}} + \table + \row + \o \image gtk-tabwidget.png GTK Style Widget Gallery + \caption \l{GTK Style Widget Gallery} - The Motif style is provided by QMotifStyle. - \raw HTML - - \endraw - \image windows-tabwidget.png Windows Style Widget Gallery - - \bold{\l{Windows Style Widget Gallery}} - - The Windows style is provided by QWindowsStyle. - \raw HTML -
    - \endraw - \image cde-tabwidget.png CDE Style Widget Gallery + The GTK style is provided by QGtkStyle. + \o \image motif-tabwidget.png Motif Style Widget Gallery + \caption \l{Motif Style Widget Gallery} - \bold{\l{CDE Style Widget Gallery}} + The Motif style is provided by QMotifStyle. + \o \image cde-tabwidget.png CDE Style Widget Gallery + \caption \l{CDE Style Widget Gallery} The Common Desktop Environment style is provided by QCDEStyle. - \raw HTML -
    - \endraw + \endtable */ -- cgit v0.12 From 7618adbd60f0aaeac63a1ac65e733fc8962a1cd9 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Mon, 13 Dec 2010 13:26:56 +0100 Subject: QmlDebugger: setting bindings in states Reviewied-by: Kai Koehne --- src/declarative/qml/qdeclarativeenginedebug.cpp | 110 +++++++++++++++++---- src/declarative/qml/qdeclarativeenginedebug_p.h | 5 + .../qdeclarativedebug/tst_qdeclarativedebug.cpp | 101 ++++++++++++++++++- 3 files changed, 196 insertions(+), 20 deletions(-) diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index 5f338db..4d6e50c 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -52,6 +52,7 @@ #include "private/qdeclarativevaluetype_p.h" #include "private/qdeclarativevmemetaobject_p.h" #include "private/qdeclarativeexpression_p.h" +#include "private/qdeclarativepropertychanges_p.h" #include #include @@ -304,6 +305,35 @@ void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message, QDecla } } +void QDeclarativeEngineDebugServer::buildStatesList(QDeclarativeContext *ctxt, bool cleanList=false) +{ + if (cleanList) + m_allStates.clear(); + + QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(ctxt); + for (int ii = 0; ii < ctxtPriv->instances.count(); ++ii) { + buildStatesList(ctxtPriv->instances.at(ii)); + } + + QDeclarativeContextData *child = QDeclarativeContextData::get(ctxt)->childContexts; + while (child) { + buildStatesList(child->asQDeclarativeContext()); + child = child->nextChild; + } +} + +void QDeclarativeEngineDebugServer::buildStatesList(QObject *obj) +{ + if (QDeclarativeState *state = dynamic_cast(obj)) { + m_allStates.append(state); + } + + QObjectList children = obj->children(); + for (int ii = 0; ii < children.count(); ++ii) { + buildStatesList(children.at(ii)); + } +} + QDeclarativeEngineDebugServer::QDeclarativeObjectData QDeclarativeEngineDebugServer::objectData(QObject *object) { @@ -382,8 +412,10 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message) QDataStream rs(&reply, QIODevice::WriteOnly); rs << QByteArray("LIST_OBJECTS_R") << queryId; - if (engine) + if (engine) { buildObjectList(rs, engine->rootContext()); + buildStatesList(engine->rootContext(), true); + } sendMessage(reply); } else if (type == "FETCH_OBJECT") { @@ -504,26 +536,66 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId, { QObject *object = objectForId(objectId); QDeclarativeContext *context = qmlContext(object); + QByteArray propertyNameArray = propertyName.toUtf8(); if (object && context) { - QDeclarativeProperty property(object, propertyName, context); - if (isLiteralValue) { - property.write(expression); - } else if (hasValidSignal(object, propertyName)) { - QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString()); - QDeclarativeExpression *oldExpression = QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression); - declarativeExpression->setSourceLocation(oldExpression->sourceFile(), oldExpression->lineNumber()); - } else if (property.isProperty()) { - QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context); - binding->setTarget(property); - binding->setNotifyOnValueChanged(true); - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding); - if (oldBinding) - oldBinding->destroy(); - binding->update(); + if (property.isValid()) { + + bool inBaseState = true; + + foreach(QWeakPointer statePointer, m_allStates) { + if (QDeclarativeState *state = statePointer.data()) { + // here we assume that the revert list on itself defines the base state + if ( state->isStateActive() && state->containsPropertyInRevertList(object, propertyNameArray) ) { + inBaseState = false; + + QDeclarativeBinding *newBinding = 0; + if (!isLiteralValue) { + newBinding = new QDeclarativeBinding(expression.toString(), object, context); + newBinding->setTarget(property); + newBinding->setNotifyOnValueChanged(true); + } + + state->changeBindingInRevertList(object,propertyNameArray, newBinding); + + if (isLiteralValue) + state->changeValueInRevertList(object, propertyNameArray, expression); + } + } + } + + if (inBaseState) { + if (isLiteralValue) { + property.write(expression); + } else if (hasValidSignal(object, propertyName)) { + QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString()); + QDeclarativeExpression *oldExpression = QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression); + declarativeExpression->setSourceLocation(oldExpression->sourceFile(), oldExpression->lineNumber()); + } else if (property.isProperty()) { + QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context); + binding->setTarget(property); + binding->setNotifyOnValueChanged(true); + QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding); + if (oldBinding) + oldBinding->destroy(); + binding->update(); + } else { + qWarning() << "QDeclarativeEngineDebugServer::setBinding: unable to set property" << propertyName << "on object" << object; + } + } + } else { - qWarning() << "QDeclarativeEngineDebugServer::setBinding: unable to set property" << propertyName << "on object" << object; + // not a valid property + if (QDeclarativePropertyChanges *propertyChanges = dynamic_cast(object)) { + if (isLiteralValue) { + propertyChanges->changeValue(propertyName.toUtf8(),expression); + } else { + propertyChanges->changeExpression(propertyName.toUtf8(),expression.toString()); + } + } else { + qWarning() << "QDeclarativeEngineDebugServer::setBinding: unable to set property" << propertyName << "on object" << object; + } } } } @@ -546,6 +618,10 @@ void QDeclarativeEngineDebugServer::resetBinding(int objectId, const QString &pr property.reset(); } } + } else { + if (QDeclarativePropertyChanges *propertyChanges = dynamic_cast(object)) { + propertyChanges->removeProperty(propertyName.toUtf8()); + } } } } diff --git a/src/declarative/qml/qdeclarativeenginedebug_p.h b/src/declarative/qml/qdeclarativeenginedebug_p.h index dc8bc85..65eb1ff 100644 --- a/src/declarative/qml/qdeclarativeenginedebug_p.h +++ b/src/declarative/qml/qdeclarativeenginedebug_p.h @@ -57,6 +57,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -64,6 +65,7 @@ class QDeclarativeEngine; class QDeclarativeContext; class QDeclarativeWatcher; class QDataStream; +class QDeclarativeState; class QDeclarativeEngineDebugServer : public QDeclarativeDebugService { @@ -108,6 +110,8 @@ private: void prepareDeferredObjects(QObject *); void buildObjectList(QDataStream &, QDeclarativeContext *); void buildObjectDump(QDataStream &, QObject *, bool, bool); + void buildStatesList(QDeclarativeContext *, bool); + void buildStatesList(QObject *obj); QDeclarativeObjectData objectData(QObject *); QDeclarativeObjectProperty propertyData(QObject *, int); QVariant valueContents(const QVariant &defaultValue) const; @@ -117,6 +121,7 @@ private: QList m_engines; QDeclarativeWatcher *m_watch; + QList > m_allStates; }; Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugServer::QDeclarativeObjectData &); Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugServer::QDeclarativeObjectData &); diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp index 20a3fa6..fac32d7 100644 --- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp +++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp @@ -72,7 +72,7 @@ class tst_QDeclarativeDebug : public QObject Q_OBJECT private: - QDeclarativeDebugObjectReference findRootObject(int context = 0); + QDeclarativeDebugObjectReference findRootObject(int context = 0, bool recursive = false); QDeclarativeDebugPropertyReference findProperty(const QList &props, const QString &name) const; void waitForQuery(QDeclarativeDebugQuery *query); @@ -115,9 +115,10 @@ private slots: void setMethodBody(); void queryObjectTree(); + void setBindingInStates(); }; -QDeclarativeDebugObjectReference tst_QDeclarativeDebug::findRootObject(int context) +QDeclarativeDebugObjectReference tst_QDeclarativeDebug::findRootObject(int context, bool recursive) { QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); waitForQuery(q_engines); @@ -129,7 +130,9 @@ QDeclarativeDebugObjectReference tst_QDeclarativeDebug::findRootObject(int conte if (q_context->rootContext().objects().count() == 0) return QDeclarativeDebugObjectReference(); - QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().objects()[context], this); + QDeclarativeDebugObjectQuery *q_obj = recursive ? + m_dbg->queryObjectRecursive(q_context->rootContext().objects()[context], this) : + m_dbg->queryObject(q_context->rootContext().objects()[context], this); waitForQuery(q_obj); QDeclarativeDebugObjectReference result = q_obj->object(); @@ -926,6 +929,98 @@ void tst_QDeclarativeDebug::tst_QDeclarativeDebugPropertyReference() compareProperties(r, ref); } +void tst_QDeclarativeDebug::setBindingInStates() +{ + // Check if changing bindings of propertychanges works + + const int sourceIndex = 3; + + QDeclarativeDebugObjectReference obj = findRootObject(sourceIndex); + + QVERIFY(obj.debugId() != -1); + QVERIFY(obj.children().count() >= 2); + + // We are going to switch state a couple of times, we need to get rid of the transition before + QDeclarativeDebugExpressionQuery *q_deleteTransition = m_dbg->queryExpressionResult(obj.debugId(),QString("transitions = []"),this); + waitForQuery(q_deleteTransition); + delete q_deleteTransition; + + + // check initial value of the property that is changing + QDeclarativeDebugExpressionQuery *q_setState; + q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"state1\""),this); + waitForQuery(q_setState); + delete q_setState; + + obj = findRootObject(sourceIndex); + QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),200); + + + q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"\""),this); + waitForQuery(q_setState); + delete q_setState; + + + obj = findRootObject(sourceIndex, true); + QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),100); + + + // change the binding + QDeclarativeDebugObjectReference state = obj.children()[0]; + QCOMPARE(state.className(), QString("State")); + QVERIFY(state.children().count() > 0); + + QDeclarativeDebugObjectReference propertyChange = state.children()[0]; + QVERIFY(propertyChange.debugId() != -1); + + QVERIFY( m_dbg->setBindingForObject(propertyChange.debugId(), "width",QVariant(300),true) ); + + // check properties changed in state + obj = findRootObject(sourceIndex); + QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),100); + + + q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"state1\""),this); + waitForQuery(q_setState); + delete q_setState; + + obj = findRootObject(sourceIndex); + QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),300); + + // check changing properties of base state from within a state + QVERIFY(m_dbg->setBindingForObject(obj.debugId(),"width","height*2",false)); + QVERIFY(m_dbg->setBindingForObject(obj.debugId(),"height","200",true)); + + obj = findRootObject(sourceIndex); + QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),300); + + q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"\""),this); + waitForQuery(q_setState); + delete q_setState; + + obj = findRootObject(sourceIndex); + QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 400); + + // reset binding while in a state + q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"state1\""),this); + waitForQuery(q_setState); + delete q_setState; + + obj = findRootObject(sourceIndex); + QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 300); + + m_dbg->resetBindingForObject(propertyChange.debugId(), "width"); + + obj = findRootObject(sourceIndex); + QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 400); + + // re-add binding + m_dbg->setBindingForObject(propertyChange.debugId(), "width", "300", true); + + obj = findRootObject(sourceIndex); + QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 300); +} + void tst_QDeclarativeDebug::queryObjectTree() { const int sourceIndex = 3; -- cgit v0.12 From 485ac91fd7e1243fad8809c0664130b52c5fa0bb Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 13 Dec 2010 14:07:05 +0100 Subject: Removed trailing whitespace. --- tools/qdoc3/atom.h | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h index 70fbae9..5b7da31 100644 --- a/tools/qdoc3/atom.h +++ b/tools/qdoc3/atom.h @@ -56,20 +56,20 @@ class Atom { public: enum Type { - AbstractLeft, - AbstractRight, + AbstractLeft, + AbstractRight, AnnotatedList, AutoLink, - BaseName, + BaseName, BriefLeft, - BriefRight, + BriefRight, C, - CaptionLeft, + CaptionLeft, CaptionRight, - Code, - CodeBad, - CodeNew, - CodeOld, + Code, + CodeBad, + CodeNew, + CodeOld, CodeQuoteArgument, CodeQuoteCommand, #ifdef QDOC_QML @@ -77,42 +77,42 @@ class Atom #endif FootnoteLeft, FootnoteRight, - FormatElse, + FormatElse, FormatEndif, FormatIf, FormattingLeft, FormattingRight, GeneratedList, - Image, + Image, ImageText, InlineImage, LegaleseLeft, LegaleseRight, - LineBreak, - Link, + LineBreak, + Link, LinkNode, - ListLeft, + ListLeft, ListItemNumber, ListTagLeft, ListTagRight, ListItemLeft, - ListItemRight, - ListRight, - Nop, + ListItemRight, + ListRight, + Nop, ParaLeft, - ParaRight, + ParaRight, #ifdef QDOC_QML Qml, QmlText, #endif - QuotationLeft, + QuotationLeft, QuotationRight, RawString, SectionLeft, SectionRight, SectionHeadingLeft, SectionHeadingRight, - SidebarLeft, + SidebarLeft, SidebarRight, SinceList, SnippetCommand, @@ -120,18 +120,18 @@ class Atom SnippetLocation, String, TableLeft, - TableRight, + TableRight, TableHeaderLeft, TableHeaderRight, TableRowLeft, - TableRowRight, - TableItemLeft, + TableRowRight, + TableItemLeft, TableItemRight, TableOfContents, Target, - UnhandledFormat, + UnhandledFormat, UnknownCommand, - Last = UnknownCommand + Last = UnknownCommand }; Atom(Type type, const QString &string = "") -- cgit v0.12 From c4e5d784609533e26ee9ea6459cd315bd9c3c0a4 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 13 Dec 2010 19:47:23 +0100 Subject: Fixed macro argument handling. Fixed macro definition parsing that confused someone into thinking that single backslashes would appear in macro definitions instead of control codes. Fixed a bug that caused only arguments in general macros to be handled. Enabled arguments in HTML macros. --- tools/qdoc3/doc.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index f153dfb..a6e42c6 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -374,6 +374,7 @@ class DocParser void leaveTableRow(); CodeMarker *quoteFromFile(); void expandMacro(const QString& name, const QString& def, int numParams); + QString expandMacroToString(const QString &name, const QString &def, int numParams); Doc::SectioningUnit getSectioningUnit(); QString getArgument(bool verbatim = false); QString getOptionalArgument(); @@ -1228,7 +1229,7 @@ void DocParser::parse(const QString& source, } else { location().push(macro.defaultDefLocation.filePath()); - in.insert(pos, macro.defaultDef); + in.insert(pos, expandMacroToString(cmdStr, macro.defaultDef, macro.numParams)); len = in.length(); openedInputs.push(pos + macro.defaultDef.length()); } @@ -1968,15 +1969,14 @@ void DocParser::expandMacro(const QString &name, int j = 0; while (j < def.size()) { int paramNo; - if ((def[j] == '\\') && (j < def.size() - 1) && - ((paramNo = def[j + 1].digitValue()) >= 1) && + if (((paramNo = def[j].unicode()) >= 1) && (paramNo <= numParams)) { if (!rawString.isEmpty()) { append(Atom::RawString, rawString); rawString = ""; } append(Atom::String, args[paramNo - 1]); - j += 2; + j += 1; } else { rawString += def[j++]; @@ -1987,6 +1987,43 @@ void DocParser::expandMacro(const QString &name, } } +QString DocParser::expandMacroToString(const QString &name, const QString &def, int numParams) +{ + if (numParams == 0) { + return def; + } + else { + QStringList args; + QString rawString; + + for (int i = 0; i < numParams; i++) { + if (numParams == 1 || isLeftBraceAhead()) { + args << getArgument(true); + } + else { + location().warning(tr("Macro '\\%1' invoked with too few" + " arguments (expected %2, got %3)") + .arg(name).arg(numParams).arg(i)); + break; + } + } + + int j = 0; + while (j < def.size()) { + int paramNo; + if (((paramNo = def[j].unicode()) >= 1) && + (paramNo <= numParams)) { + rawString += args[paramNo - 1]; + j += 1; + } + else { + rawString += def[j++]; + } + } + return rawString; + } +} + Doc::SectioningUnit DocParser::getSectioningUnit() { QString name = getOptionalArgument(); @@ -2866,7 +2903,7 @@ void Doc::initialize(const Config& config) QString def = config.getString(macroDotName + Config::dot + *f); if (!def.isEmpty()) { macro.otherDefs.insert(*f, def); - int m = Config::numParams(macro.defaultDef); + int m = Config::numParams(def); if (macro.numParams == -1) { macro.numParams = m; } -- cgit v0.12 From b0ee435866b65c22338bfb6c878352ff69d868da Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 13 Dec 2010 19:52:01 +0100 Subject: Added macros for floating images and floating images with alt text. Ideally, these would be HTML-only macros, but the macro system doesn't know whether macro arguments used in pure HTML are file names, so the necessary files are not included. By using qdoc commands, we ensure the files are copied into the generated documentation's images directory. --- tools/qdoc3/test/macros.qdocconf | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tools/qdoc3/test/macros.qdocconf b/tools/qdoc3/test/macros.qdocconf index 510a8b3..712d5e4 100644 --- a/tools/qdoc3/test/macros.qdocconf +++ b/tools/qdoc3/test/macros.qdocconf @@ -30,6 +30,38 @@ macro.endcomment = "\\c{*/}" macro.uuml.HTML = "ü" macro.mdash.HTML = "—" +# Macros for floating images and floating images with alt text. +# Ideally, these would be HTML-only macros. + +macro.floatleft = "\\raw HTML\n" \ + "
    " \ + "\\endraw\n" \ + "\\inlineimage \1\n" \ + "\\raw HTML\n" \ + "
    \n" \ + "\\endraw\n" +macro.figureleft = "\\raw HTML\n" \ + "
    " \ + "\\endraw\n" \ + "\\inlineimage \1 \2\n" \ + "\\raw HTML\n" \ + "
    \n" \ + "\\endraw\n" +macro.floatright = "\\raw HTML\n" \ + "
    \n" \ + "\\endraw\n" \ + "\\inlineimage \1\n" \ + "\\raw HTML\n" \ + "
    \n" \ + "\\endraw\n" +macro.figureright = "\\raw HTML\n" \ + "
    " \ + "\\endraw\n" \ + "\\inlineimage \1 \2\n" \ + "\\raw HTML\n" \ + "
    \n" \ + "\\endraw\n" + macro.beginfloatleft.HTML = "
    " macro.beginfloatright.HTML = "
    " macro.endfloat.HTML = "
    " -- cgit v0.12 From 95d30d54ca0771a31bf687dac885f02fc1244fc8 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 13 Dec 2010 19:54:33 +0100 Subject: Doc: Whitespace fix. --- doc/src/template/style/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 03bc9a9..04d8c05 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -281,7 +281,7 @@ color: #4c0033; text-decoration: none; } - .content a:visited:hover + .content a:visited:hover { color: #4c0033; text-decoration: underline; -- cgit v0.12 From 38ac76c159044117c1faba7dbfa3e0ee65c487ed Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 13 Dec 2010 19:55:08 +0100 Subject: Doc: Fixed non-well-formed XHTML. --- doc/src/declarative/qmlinuse.qdoc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/src/declarative/qmlinuse.qdoc b/doc/src/declarative/qmlinuse.qdoc index 1127b4c..a1be46c 100644 --- a/doc/src/declarative/qmlinuse.qdoc +++ b/doc/src/declarative/qmlinuse.qdoc @@ -72,7 +72,7 @@
    -
    +
    @@ -100,7 +100,7 @@
    -
    +
    @@ -140,7 +140,7 @@
    -
    +
    @@ -185,7 +185,7 @@
    -
    +
    @@ -198,7 +198,7 @@
    -

    QML Interaction Elements

    +

    QML Interaction Elements

    These elements define basic interactions such as touch movements and focus management.

    Elements: @@ -216,7 +216,7 @@
    -
    +
    @@ -243,7 +243,7 @@
    -
    +
    @@ -276,7 +276,7 @@
    -
    +
    @@ -307,7 +307,7 @@
    -
    +
    @@ -334,7 +334,7 @@
    -
    +
    @@ -372,7 +372,7 @@
    -
    +
    @@ -410,7 +410,7 @@
    -
    +
    @@ -441,7 +441,7 @@
    -
    +
    @@ -468,7 +468,7 @@
    -
    +
    -- cgit v0.12 From 5cb2226ddf96555417f08c9bfe35addfc93f6acd Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 13 Dec 2010 19:57:01 +0100 Subject: Doc: Changed floating images to use the new float qdoc macros. --- doc/src/declarative/positioners.qdoc | 22 ++++++---------------- doc/src/declarative/qdeclarativemodels.qdoc | 4 +--- doc/src/getting-started/how-to-learn-qt.qdoc | 4 +--- doc/src/zh_CN/getting-started/how-to-learn-qt.qdoc | 4 +--- .../graphicsitems/qdeclarativeflickable.cpp | 4 +--- .../graphicsitems/qdeclarativegridview.cpp | 8 ++------ .../graphicsitems/qdeclarativemousearea.cpp | 4 +--- .../graphicsitems/qdeclarativerectangle.cpp | 20 +++++--------------- src/declarative/util/qdeclarativelistmodel.cpp | 8 ++------ src/gui/graphicsview/qgraphicsanchorlayout.cpp | 4 +--- 10 files changed, 21 insertions(+), 61 deletions(-) diff --git a/doc/src/declarative/positioners.qdoc b/doc/src/declarative/positioners.qdoc index 9265732..ed320a1 100644 --- a/doc/src/declarative/positioners.qdoc +++ b/doc/src/declarative/positioners.qdoc @@ -53,9 +53,7 @@ graphical elements: \section2 Column -\beginfloatright -\image qml-column.png -\endfloat +\floatright qml-column.png \l Column items are used to vertically arrange items. The following example uses a Column item to arrange three \l Rectangle items in an area defined @@ -70,9 +68,7 @@ must be added to a parent Rectangle, if desired. \section2 Row -\beginfloatright -\image qml-row.png -\endfloat +\floatright qml-row.png \l Row items are used to horizontally arrange items. The following example uses a Row item to arrange three rounded \l Rectangle items in an area defined @@ -87,9 +83,7 @@ left around the edges of the horizontally centered Row item. \section2 Grid -\beginfloatright -\image qml-grid-spacing.png -\endfloat +\floatright qml-grid-spacing.png \l Grid items are used to place items in a grid or table arrangement. The following example uses a Grid item to place four \l Rectangle items @@ -108,10 +102,8 @@ at the appropriate places in the Grid definition. \section2 Flow -\beginfloatright -\image qml-flow-text1.png -\image qml-flow-text2.png -\endfloat +\floatright qml-flow-text1.png +\floatright qml-flow-text2.png \l Flow items are used to place items like words on a page, with rows or columns of non-overlapping items. @@ -137,9 +129,7 @@ control of spacing between items and between lines of items. \section1 Repeaters -\beginfloatright -\image qml-repeater-grid-index.png -\endfloat +\floatright qml-repeater-grid-index.png Repeaters create items from a template for use with positioners, using data from a model. Combining repeaters and positioners is an easy way to lay out diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc index e11cd56..a61b115 100644 --- a/doc/src/declarative/qdeclarativemodels.qdoc +++ b/doc/src/declarative/qdeclarativemodels.qdoc @@ -504,9 +504,7 @@ a Web browser. \l ListView shows a classic list of items with horizontal or vertical placing of items. -\beginfloatright -\inlineimage qml-listview-snippet.png -\endfloat +\floatright qml-listview-snippet.png The following example shows a minimal ListView displaying a sequence of numbers (using an \l{QML Data Models#An Integer}{integer as a model}). diff --git a/doc/src/getting-started/how-to-learn-qt.qdoc b/doc/src/getting-started/how-to-learn-qt.qdoc index e9f462c..e5f1ff9 100644 --- a/doc/src/getting-started/how-to-learn-qt.qdoc +++ b/doc/src/getting-started/how-to-learn-qt.qdoc @@ -51,9 +51,7 @@ key overviews to deepen your understanding of Qt: The Qt \l{Object Model} and \l{Signals and Slots}. - \beginfloatleft - \inlineimage qtdemo-small.png - \endfloat + \floatleft qtdemo-small.png \section1 Getting an Overview diff --git a/doc/src/zh_CN/getting-started/how-to-learn-qt.qdoc b/doc/src/zh_CN/getting-started/how-to-learn-qt.qdoc index d942ee6..598cbea 100644 --- a/doc/src/zh_CN/getting-started/how-to-learn-qt.qdoc +++ b/doc/src/zh_CN/getting-started/how-to-learn-qt.qdoc @@ -41,9 +41,7 @@ 现在您已经编写了一些小型可用的应用程序,并对 Qt 编程有更加广泛的了解。您可以直接着手做自己的项目,但我们建议您阅读以下一些关键简介以加深您对 Qt 的了解:\l{Qt Object Model}Qt 对象模型}和\l{Signals and Slots}{信号和槽}。 - \beginfloatleft - \inlineimage qtdemo-small.png - \endfloat + \floatleft qtdemo-small.png \section1 了解概况 diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 377f3b5..1899a39 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -373,9 +373,7 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd() \section1 Example Usage - \beginfloatright - \inlineimage flickable.gif - \endfloat + \floatright flickable.gif The following example shows a small view onto a large image in which the user can drag or flick the image in order to view different parts of it. diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 1615b0f..c7517f4 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1095,9 +1095,7 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m \snippet doc/src/snippets/declarative/gridview/ContactModel.qml 0 - \beginfloatright - \inlineimage gridview-simple.png - \endfloat + \floatright gridview-simple.png This model can be referenced as \c ContactModel in other QML files. See \l{QML Modules} for more information about creating reusable components like this. @@ -1111,9 +1109,7 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m \codeline \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs simple - \beginfloatright - \inlineimage gridview-highlight.png - \endfloat + \floatright gridview-highlight.png The view will create a new delegate for each item in the model. Note that the delegate is able to access the model's \c name and \c portrait data directly. diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 0a043a7..56e5c6b 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -216,9 +216,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate() \section1 Example Usage - \beginfloatright - \inlineimage qml-mousearea-snippet.png - \endfloat + \floatright qml-mousearea-snippet.png The following example uses a MouseArea in a \l Rectangle that changes the \l Rectangle color to red when clicked: diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index 99b36a8..969027e 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -131,9 +131,7 @@ void QDeclarativeGradientStop::updateGradient() \section1 Example Usage - \beginfloatright - \inlineimage qml-gradient.png - \endfloat + \floatright qml-gradient.png The following example declares a \l Rectangle item with a gradient starting with red, blending to yellow at one third of the height of the rectangle, @@ -217,9 +215,7 @@ void QDeclarativeGradient::doUpdate() \section1 Example Usage - \beginfloatright - \inlineimage declarative-rect.png - \endfloat + \floatright declarative-rect.png The following example shows the effects of some of the common properties on a Rectangle item, which in this case is used to create a square: @@ -269,9 +265,7 @@ void QDeclarativeRectangle::doUpdate() rectangle (as documented for QRect rendering). This can cause unintended effects if \c border.width is 1 and the rectangle is \l{Item::clip}{clipped} by a parent item: - \beginfloatright - \inlineimage rect-border-width.png - \endfloat + \floatright rect-border-width.png \snippet doc/src/snippets/declarative/rectangle/rect-border-width.qml 0 @@ -293,9 +287,7 @@ QDeclarativePen *QDeclarativeRectangle::border() This property allows for the construction of simple vertical gradients. Other gradients may by formed by adding rotation to the rectangle. - \beginfloatleft - \inlineimage declarative-rect_gradient.png - \endfloat + \floatleft declarative-rect_gradient.png \snippet doc/src/snippets/declarative/rectangle/rectangle-gradient.qml rectangles \clearfloat @@ -361,9 +353,7 @@ void QDeclarativeRectangle::setRadius(qreal radius) The default color is white. - \beginfloatright - \inlineimage rect-color.png - \endfloat + \floatright rect-color.png The following example shows rectangles with colors specified using hexadecimal and named color notation: diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 398480e..52e563b 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -108,9 +108,7 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM The following example shows a ListModel containing three elements, with the roles "name" and "cost". - \beginfloatright - \inlineimage listmodel.png - \endfloat + \floatright listmodel.png \snippet doc/src/snippets/declarative/listmodel.qml 0 @@ -133,9 +131,7 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM The delegate displays all the fruit attributes: - \beginfloatright - \inlineimage listmodel-nested.png - \endfloat + \floatright listmodel-nested.png \snippet doc/src/snippets/declarative/listmodel-nested.qml delegate diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index 539826b..1d1d257 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -56,9 +56,7 @@ Items that are anchored are automatically added to the layout, and if items are removed, all their anchors will be automatically removed. - \beginfloatleft - \inlineimage simpleanchorlayout-example.png Using an anchor layout to align simple colored widgets. - \endfloat + \figureleft{simpleanchorlayout-example.png}{Using an anchor layout to align simple colored widgets.} Anchors are always set up between edges of an item, where the "center" is also considered to be an edge. Consider the following example: -- cgit v0.12 From 0fe36ac832abf8f8d438b21fce0177b65b3bbf3a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 14 Dec 2010 13:22:12 +0100 Subject: qdoc: Changed index.qdoc to use new \div command This is necessary for the Mimir project, but it is also useful for writing html output in that now you can write the index page (and other such pages) using pure qdoc commands. i.e. you don't need to use raw html for this sort of thing anymore. --- doc/src/index.qdoc | 166 ++++++++++++++++++----------------- tools/qdoc3/atom.cpp | 3 + tools/qdoc3/atom.h | 2 + tools/qdoc3/ditaxmlgenerator.cpp | 8 ++ tools/qdoc3/doc.cpp | 23 +++-- tools/qdoc3/htmlgenerator.cpp | 12 ++- tools/qdoc3/test/macros.qdocconf | 1 + tools/qdoc3/test/qt-ditaxml.qdocconf | 1 + 8 files changed, 131 insertions(+), 85 deletions(-) diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 57fc18a..aefbea1 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -29,83 +29,91 @@ \page index.html \keyword Qt Reference Documentation - \raw HTML -
    -
    - Qt Developer Guide
    -
    -
    -
    -

    Qt is a cross-platform application and UI framework. Using Qt, you can write web-enabled applications once and deploy them across desktop, mobile and embedded operating systems without rewriting the source code.

    -
    - -
    -
    - -
    -
    - Qt Tools
    -
    -
    -
    -

    Qt offers a selection of development tools for different tasks. Use Qt Creator for - project and code management as well as building powerfull UIs.

    -
    - -
    -
    - \endraw + \div {indexbox guide} + \div {heading} + Qt Developer Guide + \enddiv + \div {indexboxcont indexboxbar} + \div {section indexIcon} \emptyspan + \enddiv + \div {section} + Qt is a cross-platform application and UI + framework. Using Qt, you can write web-enabled + applications once and deploy them across desktop, + mobile and embedded operating systems without + rewriting the source code. + \enddiv + \div {section sectionlist} + \list + \o \l{Getting Started Guides}{Getting started} + \o \l{Installation}{Installation} + \o \l{how-to-learn-qt.html}{How to learn Qt} + \o \l{tutorials.html}{Tutorials} + \o \l{Qt Examples}{Examples} + \o \l{qt4-7-intro.html}{What's new in Qt 4.7} + \endlist + \enddiv + \enddiv + \enddiv + \div {indexbox api} + \div {heading} + Qt API + \enddiv + \div {indexboxcont indexboxbar } + \div {sectionlist tricol} + \list + \o \l{All Classes}{All Classes} + \o \l{All Functions}{All Functions} + \o \l{All Modules}{All Modules} + \o \l{All Namespaces}{All Namespaces} + \o \l{Global Qt Declarations}{Global Declarations} + \o \l{Qt Licenses and Credits}{Licenses and Credits} + \endlist + \enddiv + \div {sectionlist tricol} + \list + \o \l{qt-basic-concepts.html}{Programming with Qt} + \o \l{qt-gui-concepts.html}{UI Design with Qt} + \o \l{developing-with-qt.html}{Cross-platform and Platform-specific} + \o \l{technology-apis.html}{Qt and Key Technologies} + \o \l{best-practices.html}{Best Practices Guides} + \endlist + \enddiv + \div {sectionlist} + \list + \o \l{qtquick.html}{Qt Quick} + \o \l{qdeclarativeintroduction.html}{Introduction to QML} + \o \l{qdeclarativeelements.html}{QML Elements} + \o \l{qdeclarativeexamples.html}{QML Examples and Demos} + \endlist + \enddiv + \enddiv + \enddiv + \div {indexbox tools} + \div {heading} + Qt Tools + \enddiv + \div {indexboxcont} + \div {section indexIcon} \emptyspan + \enddiv + \div {section} + Qt offers a selection of development tools for + different tasks. Use Qt Creator for project and code + management as well as building powerfull UIs. + \enddiv + \div {section sectionlist} + \list + \o \l{http://doc.qt.nokia.com/qtcreator-2.0/index.html}{Qt Creator} + \o \l{designer-manual.html}{Qt Designer} + \o \l{linguist-manual.html}{Qt Linguist} + \o \l{assistant-manual.html}{Qt Assistant} + \o \l{qmake-manual.html}{Qt qmake} + \o \l{http://doc.qt.nokia.com/qtsimulator-1.0/index.html}{Qt Simulator} + \o \l{http://qt.nokia.com/developer/eclipse-integration}{Eclipse Integration} + \o \l{http://qt.nokia.com/products/appdev}{Add-On Products and Services} + \o \l{qvfb.html}{Virtual Framebuffer} + \endlist + \enddiv + \enddiv + \enddiv */ diff --git a/tools/qdoc3/atom.cpp b/tools/qdoc3/atom.cpp index d18c3c4..301244d 100644 --- a/tools/qdoc3/atom.cpp +++ b/tools/qdoc3/atom.cpp @@ -107,6 +107,7 @@ QString Atom::UPPERROMAN_ ("upperroman"); \value CodeOld \value CodeQuoteArgument \value CodeQuoteCommand + \value Div \value EndQmlText \value FormatElse \value FormatEndif @@ -179,6 +180,8 @@ static const struct { { "CodeOld", Atom::CodeOld }, { "CodeQuoteArgument", Atom::CodeQuoteArgument }, { "CodeQuoteCommand", Atom::CodeQuoteCommand }, + { "Div", Atom::Div }, + { "EndDiv", Atom::EndDiv }, #ifdef QDOC_QML { "EndQmlText", Atom::EndQmlText }, #endif diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h index 4639711..fe85aec 100644 --- a/tools/qdoc3/atom.h +++ b/tools/qdoc3/atom.h @@ -72,7 +72,9 @@ class Atom CodeOld, CodeQuoteArgument, CodeQuoteCommand, + Div, #ifdef QDOC_QML + EndDiv, EndQmlText, #endif FootnoteLeft, diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 57a6e8d..7b40886 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -751,6 +751,14 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writeCharacters(trimmedTrailing(plainCode(atom->string()))); xmlWriter().writeEndElement(); // break; + case Atom::Div: + xmlWriter().writeStartElement("bodydiv"); + if (!atom->string().isEmpty()) + xmlWriter().writeAttribute("outputclass", atom->string()); + break; + case Atom::EndDiv: + xmlWriter().writeEndElement(); // + break; case Atom::FootnoteLeft: // ### For now if (in_para) { diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index 9a154f8..1c72f54 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -74,11 +74,11 @@ struct Macro enum { CMD_A, CMD_ABSTRACT, CMD_ANNOTATEDLIST, CMD_BADCODE, CMD_BASENAME, CMD_BOLD, CMD_BRIEF, CMD_C, CMD_CAPTION, - CMD_CHAPTER, CMD_CODE, CMD_CODELINE, CMD_DOTS, CMD_ELSE, - CMD_ENDABSTRACT, CMD_ENDCHAPTER, CMD_ENDCODE, - CMD_ENDFOOTNOTE, CMD_ENDIF, CMD_ENDLEGALESE, CMD_ENDLINK, - CMD_ENDLIST, CMD_ENDOMIT, CMD_ENDPART, CMD_ENDQUOTATION, - CMD_ENDRAW, CMD_ENDSECTION1, CMD_ENDSECTION2, + CMD_CHAPTER, CMD_CODE, CMD_CODELINE, CMD_DIV, CMD_DOTS, + CMD_ELSE, CMD_ENDABSTRACT, CMD_ENDCHAPTER, CMD_ENDCODE, + CMD_ENDDIV, CMD_ENDFOOTNOTE, CMD_ENDIF, CMD_ENDLEGALESE, + CMD_ENDLINK, CMD_ENDLIST, CMD_ENDOMIT, CMD_ENDPART, + CMD_ENDQUOTATION, CMD_ENDRAW, CMD_ENDSECTION1, CMD_ENDSECTION2, CMD_ENDSECTION3, CMD_ENDSECTION4, CMD_ENDSIDEBAR, CMD_ENDTABLE, CMD_EXPIRE, CMD_FOOTNOTE, CMD_GENERATELIST, CMD_GRANULARITY, CMD_HEADER, CMD_I, CMD_IF, CMD_IMAGE, @@ -117,11 +117,13 @@ static struct { { "chapter", CMD_CHAPTER, 0 }, { "code", CMD_CODE, 0 }, { "codeline", CMD_CODELINE, 0}, + { "div", CMD_DIV, 0 }, { "dots", CMD_DOTS, 0 }, { "else", CMD_ELSE, 0 }, { "endabstract", CMD_ENDABSTRACT, 0 }, { "endchapter", CMD_ENDCHAPTER, 0 }, { "endcode", CMD_ENDCODE, 0 }, + { "enddiv", CMD_ENDDIV, 0 }, { "endfootnote", CMD_ENDFOOTNOTE, 0 }, { "endif", CMD_ENDIF, 0 }, { "endlegalese", CMD_ENDLEGALESE, 0 }, @@ -555,6 +557,11 @@ void DocParser::parse(const QString& source, append(Atom::QmlText); break; #endif + case CMD_DIV: + leavePara(); + x = getArgument(true); + append(Atom::Div, x); + break; case CMD_CODELINE: { if (!quoting) { @@ -622,6 +629,10 @@ void DocParser::parse(const QString& source, case CMD_ENDCODE: closeCommand(cmd); break; + case CMD_ENDDIV: + append(Atom::EndDiv); + closeCommand(cmd); + break; #ifdef QDOC_QML case CMD_ENDQML: closeCommand(cmd); @@ -2348,6 +2359,8 @@ int DocParser::endCmdFor(int cmd) return CMD_ENDCHAPTER; case CMD_CODE: return CMD_ENDCODE; + case CMD_DIV: + return CMD_ENDDIV; #ifdef QDOC_QML case CMD_QML: return CMD_ENDQML; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index b5295c8..40cfba3 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -211,13 +211,13 @@ static void addLink(const QString &linkTarget, HtmlGenerator::HtmlGenerator() : helpProjectWriter(0), inLink(false), + inObsoleteLink(false), inContents(false), inSectionHeading(false), inTableHeader(false), numTableRows(0), threeColumnEnumValueTable(true), funcLeftParen("\\S(\\()"), - inObsoleteLink(false), myTree(0), slow(false), obsoleteLinks(false) @@ -511,6 +511,13 @@ int HtmlGenerator::generateAtom(const Atom *atom, << trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string())))) << "\n"; break; + case Atom::Div: + out() << "string().isEmpty()) + out() << " class=\"" << atom->string() << "\">"; + else + out() << ">"; + break; case Atom::FootnoteLeft: // ### For now if (in_para) { @@ -1129,6 +1136,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "\\" << protectEnc(atom->string()) << ""; break; + case Atom::EndDiv: + out() << "
    "; + break; #ifdef QDOC_QML case Atom::QmlText: case Atom::EndQmlText: diff --git a/tools/qdoc3/test/macros.qdocconf b/tools/qdoc3/test/macros.qdocconf index 510a8b3..2262daa 100644 --- a/tools/qdoc3/test/macros.qdocconf +++ b/tools/qdoc3/test/macros.qdocconf @@ -34,3 +34,4 @@ macro.beginfloatleft.HTML = "
    " macro.beginfloatright.HTML = "
    " macro.endfloat.HTML = "
    " macro.clearfloat.HTML = "
    " +macro.emptyspan.HTML = "" diff --git a/tools/qdoc3/test/qt-ditaxml.qdocconf b/tools/qdoc3/test/qt-ditaxml.qdocconf index bc32149..211bdb2 100644 --- a/tools/qdoc3/test/qt-ditaxml.qdocconf +++ b/tools/qdoc3/test/qt-ditaxml.qdocconf @@ -46,3 +46,4 @@ macro.beginfloatleft.HTML = " " macro.beginfloatright.HTML = " " macro.endfloat.HTML = " " macro.clearfloat.HTML = " " +macro.emptyspan.DITAXML = " " -- cgit v0.12 From a8fb1076935a0eb58f803477ed246dc237624370 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 14 Dec 2010 16:03:40 +0100 Subject: Removed macros for figures and floats. We'll use \div...\enddiv instead. --- tools/qdoc3/test/macros.qdocconf | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/tools/qdoc3/test/macros.qdocconf b/tools/qdoc3/test/macros.qdocconf index 39986fc..2262daa 100644 --- a/tools/qdoc3/test/macros.qdocconf +++ b/tools/qdoc3/test/macros.qdocconf @@ -30,38 +30,6 @@ macro.endcomment = "\\c{*/}" macro.uuml.HTML = "ü" macro.mdash.HTML = "—" -# Macros for floating images and floating images with alt text. -# Ideally, these would be HTML-only macros. - -macro.floatleft = "\\raw HTML\n" \ - "
    " \ - "\\endraw\n" \ - "\\inlineimage \1\n" \ - "\\raw HTML\n" \ - "
    \n" \ - "\\endraw\n" -macro.figureleft = "\\raw HTML\n" \ - "
    " \ - "\\endraw\n" \ - "\\inlineimage \1 \2\n" \ - "\\raw HTML\n" \ - "
    \n" \ - "\\endraw\n" -macro.floatright = "\\raw HTML\n" \ - "
    \n" \ - "\\endraw\n" \ - "\\inlineimage \1\n" \ - "\\raw HTML\n" \ - "
    \n" \ - "\\endraw\n" -macro.figureright = "\\raw HTML\n" \ - "
    " \ - "\\endraw\n" \ - "\\inlineimage \1 \2\n" \ - "\\raw HTML\n" \ - "
    \n" \ - "\\endraw\n" - macro.beginfloatleft.HTML = "
    " macro.beginfloatright.HTML = "
    " macro.endfloat.HTML = "
    " -- cgit v0.12 From bf835c2e69b3bc37145e572f68554bf771eeec3f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 14 Dec 2010 16:05:30 +0100 Subject: Treat div elements like paragraphs. --- tools/qdoc3/doc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index 8d4d0ee..ce9e30d 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -562,6 +562,8 @@ void DocParser::parse(const QString& source, leavePara(); x = getArgument(true); append(Atom::Div, x); + openedCommands.push(cmd); + enterPara(); break; case CMD_CODELINE: { @@ -631,6 +633,7 @@ void DocParser::parse(const QString& source, closeCommand(cmd); break; case CMD_ENDDIV: + leavePara(); append(Atom::EndDiv); closeCommand(cmd); break; -- cgit v0.12 From cbfeb79c80a774166e016e7c879bba465ffc0496 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 14 Dec 2010 16:07:48 +0100 Subject: Doc: Used div elements for floats, updated the style sheet. --- doc/src/declarative/positioners.qdoc | 22 ++++++++++++++++------ doc/src/declarative/qdeclarativemodels.qdoc | 4 +++- doc/src/getting-started/how-to-learn-qt.qdoc | 4 +++- doc/src/template/style/style.css | 11 ++++++++++- doc/src/zh_CN/getting-started/how-to-learn-qt.qdoc | 4 +++- .../graphicsitems/qdeclarativeflickable.cpp | 4 +++- .../graphicsitems/qdeclarativegridview.cpp | 4 +++- .../graphicsitems/qdeclarativemousearea.cpp | 4 +++- .../graphicsitems/qdeclarativerectangle.cpp | 20 +++++++++++++++----- src/declarative/util/qdeclarativelistmodel.cpp | 8 ++++++-- src/gui/graphicsview/qgraphicsanchorlayout.cpp | 4 +++- 11 files changed, 68 insertions(+), 21 deletions(-) diff --git a/doc/src/declarative/positioners.qdoc b/doc/src/declarative/positioners.qdoc index ed320a1..d97acbd 100644 --- a/doc/src/declarative/positioners.qdoc +++ b/doc/src/declarative/positioners.qdoc @@ -53,7 +53,9 @@ graphical elements: \section2 Column -\floatright qml-column.png +\div{float-right} +\inlineimage qml-column.png +\enddiv \l Column items are used to vertically arrange items. The following example uses a Column item to arrange three \l Rectangle items in an area defined @@ -68,7 +70,9 @@ must be added to a parent Rectangle, if desired. \section2 Row -\floatright qml-row.png +\div{float-right} +\inlineimage qml-row.png +\enddiv \l Row items are used to horizontally arrange items. The following example uses a Row item to arrange three rounded \l Rectangle items in an area defined @@ -83,7 +87,9 @@ left around the edges of the horizontally centered Row item. \section2 Grid -\floatright qml-grid-spacing.png +\div{float-right} +\inlineimage qml-grid-spacing.png +\enddiv \l Grid items are used to place items in a grid or table arrangement. The following example uses a Grid item to place four \l Rectangle items @@ -102,8 +108,10 @@ at the appropriate places in the Grid definition. \section2 Flow -\floatright qml-flow-text1.png -\floatright qml-flow-text2.png +\div{float-right} +\inlineimage qml-flow-text1.png +\inlineimage qml-flow-text2.png +\enddiv \l Flow items are used to place items like words on a page, with rows or columns of non-overlapping items. @@ -129,7 +137,9 @@ control of spacing between items and between lines of items. \section1 Repeaters -\floatright qml-repeater-grid-index.png +\div{float-right} +\inlineimage qml-repeater-grid-index.png +\enddiv Repeaters create items from a template for use with positioners, using data from a model. Combining repeaters and positioners is an easy way to lay out diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc index a61b115..495b3bd 100644 --- a/doc/src/declarative/qdeclarativemodels.qdoc +++ b/doc/src/declarative/qdeclarativemodels.qdoc @@ -504,7 +504,9 @@ a Web browser. \l ListView shows a classic list of items with horizontal or vertical placing of items. -\floatright qml-listview-snippet.png +\div{float-right} +\inlineimage qml-listview-snippet.png +\enddiv The following example shows a minimal ListView displaying a sequence of numbers (using an \l{QML Data Models#An Integer}{integer as a model}). diff --git a/doc/src/getting-started/how-to-learn-qt.qdoc b/doc/src/getting-started/how-to-learn-qt.qdoc index e5f1ff9..0d5fd0a 100644 --- a/doc/src/getting-started/how-to-learn-qt.qdoc +++ b/doc/src/getting-started/how-to-learn-qt.qdoc @@ -51,7 +51,9 @@ key overviews to deepen your understanding of Qt: The Qt \l{Object Model} and \l{Signals and Slots}. - \floatleft qtdemo-small.png + \div{float-left} + \inlineimage qtdemo-small.png + \enddiv \section1 Getting an Overview diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 04d8c05..d623bd4 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -176,7 +176,16 @@ { /* background-color: #E6E6E6;*/ /* disabled until further notice */ } - + + div.float-left + { + float: left; margin-right: 2em + } + div.float-right + { + float: right; margin-left: 2em + } + span.comment { color: #008B00; diff --git a/doc/src/zh_CN/getting-started/how-to-learn-qt.qdoc b/doc/src/zh_CN/getting-started/how-to-learn-qt.qdoc index 598cbea..e74c84c 100644 --- a/doc/src/zh_CN/getting-started/how-to-learn-qt.qdoc +++ b/doc/src/zh_CN/getting-started/how-to-learn-qt.qdoc @@ -41,7 +41,9 @@ 现在您已经编写了一些小型可用的应用程序,并对 Qt 编程有更加广泛的了解。您可以直接着手做自己的项目,但我们建议您阅读以下一些关键简介以加深您对 Qt 的了解:\l{Qt Object Model}Qt 对象模型}和\l{Signals and Slots}{信号和槽}。 - \floatleft qtdemo-small.png + \div {float-left} + \inlineimage qtdemo-small.png + \enddiv \section1 了解概况 diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 1899a39..cd770d4 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -373,7 +373,9 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd() \section1 Example Usage - \floatright flickable.gif + \div {float-right} + \inlineimage flickable.gif + \enddiv The following example shows a small view onto a large image in which the user can drag or flick the image in order to view different parts of it. diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index c7517f4..ba66aba 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1095,7 +1095,9 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m \snippet doc/src/snippets/declarative/gridview/ContactModel.qml 0 - \floatright gridview-simple.png + \div {float-right} + \inlineimage gridview-simple.png + \enddiv This model can be referenced as \c ContactModel in other QML files. See \l{QML Modules} for more information about creating reusable components like this. diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 56e5c6b..3d5c29f 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -216,7 +216,9 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate() \section1 Example Usage - \floatright qml-mousearea-snippet.png + \div {float-right} + \inlineimage qml-mousearea-snippet.png + \enddiv The following example uses a MouseArea in a \l Rectangle that changes the \l Rectangle color to red when clicked: diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index 969027e..7bb6afb 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -131,7 +131,9 @@ void QDeclarativeGradientStop::updateGradient() \section1 Example Usage - \floatright qml-gradient.png + \div {float-right} + \inlineimage qml-gradient.png + \enddiv The following example declares a \l Rectangle item with a gradient starting with red, blending to yellow at one third of the height of the rectangle, @@ -215,7 +217,9 @@ void QDeclarativeGradient::doUpdate() \section1 Example Usage - \floatright declarative-rect.png + \div {float-right} + \inlineimage declarative-rect.png + \enddiv The following example shows the effects of some of the common properties on a Rectangle item, which in this case is used to create a square: @@ -265,7 +269,9 @@ void QDeclarativeRectangle::doUpdate() rectangle (as documented for QRect rendering). This can cause unintended effects if \c border.width is 1 and the rectangle is \l{Item::clip}{clipped} by a parent item: - \floatright rect-border-width.png + \div {float-right} + \inlineimage rect-border-width.png + \enddiv \snippet doc/src/snippets/declarative/rectangle/rect-border-width.qml 0 @@ -287,7 +293,9 @@ QDeclarativePen *QDeclarativeRectangle::border() This property allows for the construction of simple vertical gradients. Other gradients may by formed by adding rotation to the rectangle. - \floatleft declarative-rect_gradient.png + \div {float-left} + \inlineimage declarative-rect_gradient.png + \enddiv \snippet doc/src/snippets/declarative/rectangle/rectangle-gradient.qml rectangles \clearfloat @@ -353,7 +361,9 @@ void QDeclarativeRectangle::setRadius(qreal radius) The default color is white. - \floatright rect-color.png + \div {float-right} + \inlineimage rect-color.png + \enddiv The following example shows rectangles with colors specified using hexadecimal and named color notation: diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 52e563b..0f117f5 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -108,7 +108,9 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM The following example shows a ListModel containing three elements, with the roles "name" and "cost". - \floatright listmodel.png + \div {float-right} + \inlineimage listmodel.png + \enddiv \snippet doc/src/snippets/declarative/listmodel.qml 0 @@ -131,7 +133,9 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM The delegate displays all the fruit attributes: - \floatright listmodel-nested.png + \div {float-right} + \inlineimage listmodel-nested.png + \enddiv \snippet doc/src/snippets/declarative/listmodel-nested.qml delegate diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index 1d1d257..fe0ad86 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -56,7 +56,9 @@ Items that are anchored are automatically added to the layout, and if items are removed, all their anchors will be automatically removed. - \figureleft{simpleanchorlayout-example.png}{Using an anchor layout to align simple colored widgets.} + \div {float-left} + \inlineimage simpleanchorlayout-example.png Using an anchor layout to align simple colored widgets. + \enddiv Anchors are always set up between edges of an item, where the "center" is also considered to be an edge. Consider the following example: -- cgit v0.12 From cace8e6a9f00ee478dfe63a7fa6959056cfe7e8a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 15 Dec 2010 13:51:23 +0100 Subject: Doc: Fixed an old-style float. --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index ba66aba..264f12c 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1111,7 +1111,9 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m \codeline \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs simple - \floatright gridview-highlight.png + \div {float-right} + \inlineimage gridview-highlight.png + \enddiv The view will create a new delegate for each item in the model. Note that the delegate is able to access the model's \c name and \c portrait data directly. -- cgit v0.12 From 867a421ed539040bd197c13f6c98f313e232cdf3 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 16 Dec 2010 11:37:13 +0100 Subject: qdoc: Added typedef to help the OSX compiler accept a template. --- tools/qdoc3/qmlmarkupvisitor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/qmlmarkupvisitor.h b/tools/qdoc3/qmlmarkupvisitor.h index 60bc336..709a858 100644 --- a/tools/qdoc3/qmlmarkupvisitor.h +++ b/tools/qdoc3/qmlmarkupvisitor.h @@ -159,10 +159,11 @@ protected: QString protect(const QString &string); private: + typedef QHash StringHash; void addExtra(quint32 start, quint32 finish); void addMarkedUpToken(QDeclarativeJS::AST::SourceLocation &location, const QString &text, - const QHash &attributes = QHash()); + const StringHash &attributes = StringHash()); void addVerbatim(QDeclarativeJS::AST::SourceLocation first, QDeclarativeJS::AST::SourceLocation last = QDeclarativeJS::AST::SourceLocation()); QString sourceText(QDeclarativeJS::AST::SourceLocation &location); -- cgit v0.12 From d1139664012718f9bbf54e283ef7c370d98c48a8 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Thu, 16 Dec 2010 12:33:21 +0100 Subject: QmlDebugger: reset properties to default value Reviewed-by: Kai Koehne --- src/declarative/qml/qdeclarativeenginedebug.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index 4d6e50c..6c013de 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -613,9 +613,25 @@ void QDeclarativeEngineDebugServer::resetBinding(int objectId, const QString &pr QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, 0); if (oldBinding) oldBinding->destroy(); + } + if (property.isResettable()) { + // Note: this will reset the property in any case, without regard to states + // Right now almost no QDeclarativeItem has reset methods for its properties (with the + // notable exception of QDeclarativeAnchors), so this is not a big issue + // later on, setBinding does take states into account + property.reset(); } else { - if (property.isResettable()) { - property.reset(); + // overwrite with default value + if (QDeclarativeType *objType = QDeclarativeMetaType::qmlType(object->metaObject())) { + if (QObject *emptyObject = objType->create()) { + if (emptyObject->property(propertyName.toLatin1()).isValid()) { + QVariant defaultValue = QDeclarativeProperty(emptyObject, propertyName).read(); + if (defaultValue.isValid()) { + setBinding(objectId, propertyName, defaultValue, true); + } + } + delete emptyObject; + } } } } else { -- cgit v0.12 From c54443507edf98832c67d727746ae4a130a14571 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 17 Dec 2010 15:55:50 +1000 Subject: Support for justification in Text and TextEdit elements. Task-number: QTBUG-13242 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativetext.cpp | 11 +++++++---- src/declarative/graphicsitems/qdeclarativetext_p.h | 3 ++- .../graphicsitems/qdeclarativetextedit.cpp | 1 + .../graphicsitems/qdeclarativetextedit_p.h | 3 ++- .../qdeclarativetext/align/data-MAC/justify.0.png | Bin 0 -> 7233 bytes .../qdeclarativetext/align/data-MAC/justify.qml | 11 +++++++++++ .../qmlvisual/qdeclarativetext/align/justify.qml | 22 +++++++++++++++++++++ .../qdeclarativetextedit/data-MAC/justify.0.png | Bin 0 -> 7233 bytes .../qdeclarativetextedit/data-MAC/justify.qml | 11 +++++++++++ .../qmlvisual/qdeclarativetextedit/justify.qml | 22 +++++++++++++++++++++ 10 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.0.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.qml create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetext/align/justify.qml create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.0.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.qml create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextedit/justify.qml diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 303b21c..cf11be6 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -297,6 +297,8 @@ QSize QDeclarativeTextPrivate::setupTextLayout() lineWidth = q->width(); QTextOption textOption = layout.textOption(); + if (hAlign == QDeclarativeText::AlignJustify) + textOption.setAlignment(Qt::Alignment(hAlign)); textOption.setWrapMode(QTextOption::WrapMode(wrapMode)); layout.setTextOption(textOption); @@ -325,7 +327,7 @@ QSize QDeclarativeTextPrivate::setupTextLayout() height += line.height(); if (!cacheAllTextAsImage) { - if (hAlign == QDeclarativeText::AlignLeft) { + if ((hAlign == QDeclarativeText::AlignLeft) || (hAlign == QDeclarativeText::AlignJustify)) { x = 0; } else if (hAlign == QDeclarativeText::AlignRight) { x = layoutWidth - line.naturalTextWidth(); @@ -351,7 +353,7 @@ QPixmap QDeclarativeTextPrivate::textLayoutImage(bool drawStyle) qreal x = 0; for (int i = 0; i < layout.lineCount(); ++i) { QTextLine line = layout.lineAt(i); - if (hAlign == QDeclarativeText::AlignLeft) { + if ((hAlign == QDeclarativeText::AlignLeft) || (hAlign == QDeclarativeText::AlignJustify)) { x = 0; } else if (hAlign == QDeclarativeText::AlignRight) { x = size.width() - line.naturalTextWidth(); @@ -898,8 +900,8 @@ void QDeclarativeText::setStyleColor(const QColor &color) Sets the horizontal and vertical alignment of the text within the Text items width and height. By default, the text is top-left aligned. - The valid values for \c horizontalAlignment are \c Text.AlignLeft, \c Text.AlignRight and - \c Text.AlignHCenter. The valid values for \c verticalAlignment are \c Text.AlignTop, \c Text.AlignBottom + The valid values for \c horizontalAlignment are \c Text.AlignLeft, \c Text.AlignRight, \c Text.AlignHCenter and + \c Text.AlignJustify. The valid values for \c verticalAlignment are \c Text.AlignTop, \c Text.AlignBottom and \c Text.AlignVCenter. Note that for a single line of text, the size of the text is the area of the text. In this common case, @@ -1117,6 +1119,7 @@ QRectF QDeclarativeText::boundingRect() const switch (d->hAlign) { case AlignLeft: + case AlignJustify: x = 0; break; case AlignRight: diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h index 51434d5..49bff14 100644 --- a/src/declarative/graphicsitems/qdeclarativetext_p.h +++ b/src/declarative/graphicsitems/qdeclarativetext_p.h @@ -82,7 +82,8 @@ public: enum HAlignment { AlignLeft = Qt::AlignLeft, AlignRight = Qt::AlignRight, - AlignHCenter = Qt::AlignHCenter }; + AlignHCenter = Qt::AlignHCenter, + AlignJustify = Qt::AlignJustify }; // ### VERSIONING: Only in QtQuick 1.1 enum VAlignment { AlignTop = Qt::AlignTop, AlignBottom = Qt::AlignBottom, AlignVCenter = Qt::AlignVCenter }; diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index e05f4e4..f37fa62 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -442,6 +442,7 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color) \o TextEdit.AlignLeft (default) \o TextEdit.AlignRight \o TextEdit.AlignHCenter + \o TextEdit.AlignJustify \endlist Valid values for \c verticalAlignment are: diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h index 68fde3d..7f12c85 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h @@ -97,7 +97,8 @@ public: enum HAlignment { AlignLeft = Qt::AlignLeft, AlignRight = Qt::AlignRight, - AlignHCenter = Qt::AlignHCenter + AlignHCenter = Qt::AlignHCenter, + AlignJustify = Qt::AlignJustify // ### VERSIONING: Only in QtQuick 1.1 }; enum VAlignment { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.0.png new file mode 100644 index 0000000..74c6934 Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.0.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.qml new file mode 100644 index 0000000..e4dbeb1 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "justify.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/justify.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/justify.qml new file mode 100644 index 0000000..c3a7aaa --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/justify.qml @@ -0,0 +1,22 @@ +import QtQuick 1.0 +import "../../shared" 1.0 + +Rectangle { + width: 450 + height: 250 + + TestText { + anchors.fill: parent + anchors { leftMargin: 10; rightMargin: 10; topMargin:10; bottomMargin: 10 } + wrapMode: Text.Wrap + horizontalAlignment: Text.AlignJustify + + text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a aliquet massa. Integer id velit a nibh imperdiet sagittis. Cras fringilla enim non nulla porta bibendum. Integer risus urna, hendrerit non interdum ut, dapibus id velit. Nullam fermentum viverra pellentesque. In molestie scelerisque lorem molestie ultrices. Curabitur dolor arcu, tristique in sodales in, varius sed diam. Quisque magna velit, tincidunt sed ullamcorper sit amet, ornare adipiscing ligula. In hac habitasse platea dictumst. Ut tincidunt urna vel mauris fermentum ornare quis a ligula. Suspendisse cursus volutpat sapien eget cursus." + + Rectangle { + anchors.fill: parent + color: "transparent" + border.color: "red" + } + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.0.png new file mode 100644 index 0000000..74c6934 Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.0.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.qml new file mode 100644 index 0000000..e4dbeb1 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.qml @@ -0,0 +1,11 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "justify.0.png" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/justify.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/justify.qml new file mode 100644 index 0000000..4aeb58c --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/justify.qml @@ -0,0 +1,22 @@ +import QtQuick 1.0 +import "../shared" 1.0 + +Rectangle { + width: 450 + height: 250 + + TestTextEdit { + anchors.fill: parent + anchors { leftMargin: 10; rightMargin: 10; topMargin:10; bottomMargin: 10 } + wrapMode: Text.Wrap + horizontalAlignment: Text.AlignJustify + + text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a aliquet massa. Integer id velit a nibh imperdiet sagittis. Cras fringilla enim non nulla porta bibendum. Integer risus urna, hendrerit non interdum ut, dapibus id velit. Nullam fermentum viverra pellentesque. In molestie scelerisque lorem molestie ultrices. Curabitur dolor arcu, tristique in sodales in, varius sed diam. Quisque magna velit, tincidunt sed ullamcorper sit amet, ornare adipiscing ligula. In hac habitasse platea dictumst. Ut tincidunt urna vel mauris fermentum ornare quis a ligula. Suspendisse cursus volutpat sapien eget cursus." + + Rectangle { + anchors.fill: parent + color: "transparent" + border.color: "red" + } + } +} -- cgit v0.12 From cdd9209590f9c970ea6f9e0c734f0729610ede2a Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 14 Dec 2010 08:54:25 +1000 Subject: Optimization for photoviewer demo. --- demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml index 856a2c7..6248745 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml @@ -61,7 +61,7 @@ Package { BorderImage { anchors { - fill: border.visible ? border : placeHolder + fill: originalImage.status == Image.Ready ? border : placeHolder leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 } source: 'images/box-shadow.png'; smooth: true -- cgit v0.12 From 139ecc0e74af2795faa55cfd532aeb10c631049e Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 14 Dec 2010 10:20:57 +1000 Subject: Optimize construction of QDeclarativeProperty in state operations. Reviewed-by: Martin Jones --- src/declarative/util/qdeclarativestate.cpp | 2 +- .../util/qdeclarativestateoperations.cpp | 63 ++++++++++++---------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp index 3915485..6925e03 100644 --- a/src/declarative/util/qdeclarativestate.cpp +++ b/src/declarative/util/qdeclarativestate.cpp @@ -66,7 +66,7 @@ QDeclarativeAction::QDeclarativeAction() QDeclarativeAction::QDeclarativeAction(QObject *target, const QString &propertyName, const QVariant &value) : restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false), - property(target, propertyName), toValue(value), + property(target, propertyName, qmlEngine(target)), toValue(value), fromBinding(0), event(0), specifiedObject(target), specifiedProperty(propertyName) { diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index d1d7822..82360b2 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -367,16 +367,18 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() a.event = this; actions << a; + QDeclarativeContext *ctxt = qmlContext(this); + if (d->xString.isValid()) { bool ok = false; QString script = d->xString.value.script(); qreal x = script.toFloat(&ok); if (ok) { - QDeclarativeAction xa(d->target, QLatin1String("x"), x); + QDeclarativeAction xa(d->target, QLatin1String("x"), ctxt, x); actions << xa; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("x"))); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("x"), ctxt)); QDeclarativeAction xa; xa.property = newBinding->property(); xa.toBinding = newBinding; @@ -391,11 +393,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() QString script = d->yString.value.script(); qreal y = script.toFloat(&ok); if (ok) { - QDeclarativeAction ya(d->target, QLatin1String("y"), y); + QDeclarativeAction ya(d->target, QLatin1String("y"), ctxt, y); actions << ya; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("y"))); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("y"), ctxt)); QDeclarativeAction ya; ya.property = newBinding->property(); ya.toBinding = newBinding; @@ -410,11 +412,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() QString script = d->scaleString.value.script(); qreal scale = script.toFloat(&ok); if (ok) { - QDeclarativeAction sa(d->target, QLatin1String("scale"), scale); + QDeclarativeAction sa(d->target, QLatin1String("scale"), ctxt, scale); actions << sa; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("scale"))); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("scale"), ctxt)); QDeclarativeAction sa; sa.property = newBinding->property(); sa.toBinding = newBinding; @@ -429,11 +431,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() QString script = d->rotationString.value.script(); qreal rotation = script.toFloat(&ok); if (ok) { - QDeclarativeAction ra(d->target, QLatin1String("rotation"), rotation); + QDeclarativeAction ra(d->target, QLatin1String("rotation"), ctxt, rotation); actions << ra; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("rotation"))); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("rotation"), ctxt)); QDeclarativeAction ra; ra.property = newBinding->property(); ra.toBinding = newBinding; @@ -448,11 +450,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() QString script = d->widthString.value.script(); qreal width = script.toFloat(&ok); if (ok) { - QDeclarativeAction wa(d->target, QLatin1String("width"), width); + QDeclarativeAction wa(d->target, QLatin1String("width"), ctxt, width); actions << wa; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("width"))); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("width"), ctxt)); QDeclarativeAction wa; wa.property = newBinding->property(); wa.toBinding = newBinding; @@ -467,11 +469,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() QString script = d->heightString.value.script(); qreal height = script.toFloat(&ok); if (ok) { - QDeclarativeAction ha(d->target, QLatin1String("height"), height); + QDeclarativeAction ha(d->target, QLatin1String("height"), ctxt, height); actions << ha; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("height"))); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("height"), ctxt)); QDeclarativeAction ha; ha.property = newBinding->property(); ha.toBinding = newBinding; @@ -1075,32 +1077,34 @@ QDeclarativeAnchorChanges::ActionList QDeclarativeAnchorChanges::actions() d->vCenterProp = QDeclarativeProperty(d->target, QLatin1String("anchors.verticalCenter")); d->baselineProp = QDeclarativeProperty(d->target, QLatin1String("anchors.baseline")); + QDeclarativeContext *ctxt = qmlContext(this); + if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::LeftAnchor) { - d->leftBinding = new QDeclarativeBinding(d->anchorSet->d_func()->leftScript.script(), d->target, qmlContext(this)); + d->leftBinding = new QDeclarativeBinding(d->anchorSet->d_func()->leftScript.script(), d->target, ctxt); d->leftBinding->setTarget(d->leftProp); } if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::RightAnchor) { - d->rightBinding = new QDeclarativeBinding(d->anchorSet->d_func()->rightScript.script(), d->target, qmlContext(this)); + d->rightBinding = new QDeclarativeBinding(d->anchorSet->d_func()->rightScript.script(), d->target, ctxt); d->rightBinding->setTarget(d->rightProp); } if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::HCenterAnchor) { - d->hCenterBinding = new QDeclarativeBinding(d->anchorSet->d_func()->hCenterScript.script(), d->target, qmlContext(this)); + d->hCenterBinding = new QDeclarativeBinding(d->anchorSet->d_func()->hCenterScript.script(), d->target, ctxt); d->hCenterBinding->setTarget(d->hCenterProp); } if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::TopAnchor) { - d->topBinding = new QDeclarativeBinding(d->anchorSet->d_func()->topScript.script(), d->target, qmlContext(this)); + d->topBinding = new QDeclarativeBinding(d->anchorSet->d_func()->topScript.script(), d->target, ctxt); d->topBinding->setTarget(d->topProp); } if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::BottomAnchor) { - d->bottomBinding = new QDeclarativeBinding(d->anchorSet->d_func()->bottomScript.script(), d->target, qmlContext(this)); + d->bottomBinding = new QDeclarativeBinding(d->anchorSet->d_func()->bottomScript.script(), d->target, ctxt); d->bottomBinding->setTarget(d->bottomProp); } if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::VCenterAnchor) { - d->vCenterBinding = new QDeclarativeBinding(d->anchorSet->d_func()->vCenterScript.script(), d->target, qmlContext(this)); + d->vCenterBinding = new QDeclarativeBinding(d->anchorSet->d_func()->vCenterScript.script(), d->target, ctxt); d->vCenterBinding->setTarget(d->vCenterProp); } if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::BaselineAnchor) { - d->baselineBinding = new QDeclarativeBinding(d->anchorSet->d_func()->baselineScript.script(), d->target, qmlContext(this)); + d->baselineBinding = new QDeclarativeBinding(d->anchorSet->d_func()->baselineScript.script(), d->target, ctxt); d->baselineBinding->setTarget(d->baselineProp); } @@ -1380,24 +1384,25 @@ QList QDeclarativeAnchorChanges::additionalActions() bool vChange = combined & QDeclarativeAnchors::Vertical_Mask; if (d->target) { + QDeclarativeContext *ctxt = qmlContext(this); QDeclarativeAction a; if (hChange && d->fromX != d->toX) { - a.property = QDeclarativeProperty(d->target, QLatin1String("x")); + a.property = QDeclarativeProperty(d->target, QLatin1String("x"), ctxt); a.toValue = d->toX; extra << a; } if (vChange && d->fromY != d->toY) { - a.property = QDeclarativeProperty(d->target, QLatin1String("y")); + a.property = QDeclarativeProperty(d->target, QLatin1String("y"), ctxt); a.toValue = d->toY; extra << a; } if (hChange && d->fromWidth != d->toWidth) { - a.property = QDeclarativeProperty(d->target, QLatin1String("width")); + a.property = QDeclarativeProperty(d->target, QLatin1String("width"), ctxt); a.toValue = d->toWidth; extra << a; } if (vChange && d->fromHeight != d->toHeight) { - a.property = QDeclarativeProperty(d->target, QLatin1String("height")); + a.property = QDeclarativeProperty(d->target, QLatin1String("height"), ctxt); a.toValue = d->toHeight; extra << a; } -- cgit v0.12 From 488e616b50707e5b37162e6d0cfc71a1ffdf9bef Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 15 Dec 2010 12:08:13 +1000 Subject: Rewrite/cache bindings created by PropertyChanges. This provides a significant optimization for initial evaluation of bindings specified in a PropertyChanges. Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarativebinding.cpp | 14 +++++++++++ src/declarative/qml/qdeclarativebinding_p.h | 3 +++ src/declarative/qml/qdeclarativecompiler.cpp | 29 ++++++++++++++++++++++ src/declarative/qml/qdeclarativecompiler_p.h | 1 + src/declarative/qml/qdeclarativecontext_p.h | 1 - src/declarative/qml/qdeclarativecustomparser.cpp | 9 +++++++ src/declarative/qml/qdeclarativecustomparser_p.h | 3 +++ .../util/qdeclarativepropertychanges.cpp | 26 ++++++++++++++++--- 8 files changed, 82 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index 309d372..1ead6ce 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -46,6 +46,7 @@ #include "qdeclarativecontext.h" #include "qdeclarativeinfo.h" #include "private/qdeclarativecontext_p.h" +#include "private/qdeclarativecompiler_p.h" #include "private/qdeclarativedata_p.h" #include "private/qdeclarativestringconverters_p.h" #include "private/qdeclarativestate_p_p.h" @@ -233,6 +234,19 @@ QDeclarativeBinding::QDeclarativeBinding(void *data, QDeclarativeRefCount *rc, Q setNotifyOnValueChanged(true); } +QDeclarativeBinding * +QDeclarativeBinding::createBinding(Identifier id, QObject *obj, QDeclarativeContext *ctxt, + const QString &url, int lineNumber, QObject *parent) +{ + QDeclarativeContextData *ctxtdata = QDeclarativeContextData::get(ctxt); + + QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(qmlEngine(obj)); + QDeclarativeCompiledData *cdata = 0; + if (engine && ctxtdata && !ctxtdata->url.isEmpty()) + cdata = engine->typeLoader.get(ctxtdata->url)->compiledData(); + return cdata ? new QDeclarativeBinding((void*)cdata->datas.at(id).constData(), cdata, obj, ctxtdata, url, lineNumber, parent) : 0; +} + QDeclarativeBinding::QDeclarativeBinding(const QString &str, QObject *obj, QDeclarativeContext *ctxt, QObject *parent) : QDeclarativeExpression(QDeclarativeContextData::get(ctxt), obj, str, *new QDeclarativeBindingPrivate) diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h index 7823a3d..787a3b9 100644 --- a/src/declarative/qml/qdeclarativebinding_p.h +++ b/src/declarative/qml/qdeclarativebinding_p.h @@ -162,6 +162,9 @@ public: virtual void update(QDeclarativePropertyPrivate::WriteFlags flags); virtual QString expression() const; + typedef int Identifier; + static QDeclarativeBinding *createBinding(Identifier, QObject *, QDeclarativeContext *, const QString &, int, QObject *parent=0); + public Q_SLOTS: void update() { update(QDeclarativePropertyPrivate::DontRemoveBinding); } diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 4749bf8..4f4ad3f 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -2262,6 +2262,35 @@ const QMetaObject *QDeclarativeCompiler::resolveType(const QByteArray& name) con return qmltype->metaObject(); } +// similar to logic of completeComponentBuild, but also sticks data +// into datas at the end +int QDeclarativeCompiler::rewriteBinding(const QString& expression, const QByteArray& name) +{ + QDeclarativeRewrite::RewriteBinding rewriteBinding; + rewriteBinding.setName('$' + name); + bool isSharable = false; + QString rewrite = rewriteBinding(expression, 0, &isSharable); + + quint32 length = rewrite.length(); + quint32 pc; + + if (isSharable) { + pc = output->cachedClosures.count(); + pc |= 0x80000000; + output->cachedClosures.append(0); + } else { + pc = output->cachedPrograms.length(); + output->cachedPrograms.append(0); + } + + QByteArray compiledData = + QByteArray((const char *)&pc, sizeof(quint32)) + + QByteArray((const char *)&length, sizeof(quint32)) + + QByteArray((const char *)rewrite.constData(), + rewrite.length() * sizeof(QChar)); + + return output->indexForByteArray(compiledData); +} // Ensures that the dynamic meta specification on obj is valid bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj) diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h index 7d76ad9..bface8f 100644 --- a/src/declarative/qml/qdeclarativecompiler_p.h +++ b/src/declarative/qml/qdeclarativecompiler_p.h @@ -161,6 +161,7 @@ public: int evaluateEnum(const QByteArray& script) const; // for QDeclarativeCustomParser::evaluateEnum const QMetaObject *resolveType(const QByteArray& name) const; // for QDeclarativeCustomParser::resolveType + int rewriteBinding(const QString& expression, const QByteArray& name); // for QDeclarativeCustomParser::rewriteBinding private: static void reset(QDeclarativeCompiledData *); diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h index 6c14feb..6b71381 100644 --- a/src/declarative/qml/qdeclarativecontext_p.h +++ b/src/declarative/qml/qdeclarativecontext_p.h @@ -77,7 +77,6 @@ class QDeclarativeEngine; class QDeclarativeExpression; class QDeclarativeExpressionPrivate; class QDeclarativeAbstractExpression; -class QDeclarativeBinding_Id; class QDeclarativeCompiledBindings; class QDeclarativeContextData; diff --git a/src/declarative/qml/qdeclarativecustomparser.cpp b/src/declarative/qml/qdeclarativecustomparser.cpp index 97a6a00..58ffc56 100644 --- a/src/declarative/qml/qdeclarativecustomparser.cpp +++ b/src/declarative/qml/qdeclarativecustomparser.cpp @@ -304,5 +304,14 @@ const QMetaObject *QDeclarativeCustomParser::resolveType(const QByteArray& name) return compiler->resolveType(name); } +/*! + Rewrites \a expression and returns an identifier that can be + used to construct the binding later. \a name + is used as the name of the rewritten function. +*/ +QDeclarativeBinding::Identifier QDeclarativeCustomParser::rewriteBinding(const QString& expression, const QByteArray& name) +{ + return compiler->rewriteBinding(expression, name); +} QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativecustomparser_p.h b/src/declarative/qml/qdeclarativecustomparser_p.h index c3f9dd2..9b419c2 100644 --- a/src/declarative/qml/qdeclarativecustomparser_p.h +++ b/src/declarative/qml/qdeclarativecustomparser_p.h @@ -56,6 +56,7 @@ #include "private/qdeclarativemetatype_p.h" #include "qdeclarativeerror.h" #include "private/qdeclarativeparser_p.h" +#include "private/qdeclarativebinding_p.h" #include #include @@ -140,6 +141,8 @@ protected: const QMetaObject *resolveType(const QByteArray&) const; + QDeclarativeBinding::Identifier rewriteBinding(const QString&, const QByteArray&); + private: QList exceptions; QDeclarativeCompiler *compiler; diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index 8d01b80..400803e 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -42,6 +42,9 @@ #include "private/qdeclarativepropertychanges_p.h" #include "private/qdeclarativeopenmetaobject_p.h" +#include "private/qdeclarativerewrite_p.h" +#include "private/qdeclarativeengine_p.h" +#include "private/qdeclarativecompiler_p.h" #include #include @@ -219,6 +222,7 @@ public: QList > properties; QList > expressions; + QList ids; QList signalReplacements; QDeclarativeProperty property(const QByteArray &); @@ -267,6 +271,7 @@ QDeclarativePropertyChangesParser::compile(const QList(data.at(ii).second); QVariant var; bool isScript = v.isScript(); + QDeclarativeBinding::Identifier id; switch(v.type()) { case QDeclarativeParser::Variant::Boolean: var = QVariant(v.asBoolean()); @@ -280,10 +285,17 @@ QDeclarativePropertyChangesParser::compile(const QList> name; ds >> isScript; ds >> data; + if (isScript) + ds >> id; QDeclarativeProperty prop = property(name); //### better way to check for signal property? if (prop.type() & QDeclarativeProperty::SignalProperty) { @@ -323,6 +338,7 @@ void QDeclarativePropertyChangesPrivate::decode() if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) expression->setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); expressions << qMakePair(name, expression); + ids << id; } else { properties << qMakePair(name, data); } @@ -452,10 +468,14 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() a.toValue = d->expressions.at(ii).second->evaluate(); } else { QDeclarativeExpression *e = d->expressions.at(ii).second; - QDeclarativeBinding *newBinding = - new QDeclarativeBinding(e->expression(), object(), qmlContext(this)); + + QDeclarativeBinding::Identifier id = d->ids.at(ii); + QDeclarativeBinding *newBinding = QDeclarativeBinding::createBinding(id, object(), qmlContext(this), e->sourceFile(), e->lineNumber()); + if (!newBinding) { + newBinding = new QDeclarativeBinding(e->expression(), object(), qmlContext(this)); + newBinding->setSourceLocation(e->sourceFile(), e->lineNumber()); + } newBinding->setTarget(prop); - newBinding->setSourceLocation(e->sourceFile(), e->lineNumber()); a.toBinding = newBinding; a.deletableToBinding = true; } -- cgit v0.12 From 24b8dcee5bd51784c341acc708ce3985d85d430a Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 16 Dec 2010 14:54:28 +1000 Subject: ParentChange optimizations. The QDeclarativeScriptStrings used for the properties are unlikely to change, so we immediately attempt to convert to a real value, rather than converting every time actions() is called. Task-number: QTBUG-15331 Reviewed-by: Martin Jones --- .../util/qdeclarativestateoperations.cpp | 77 ++++++++++++---------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 82360b2..b606ff3 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -83,6 +83,13 @@ public: QDeclarativeNullableValue scaleString; QDeclarativeNullableValue rotationString; + QDeclarativeNullableValue x; + QDeclarativeNullableValue y; + QDeclarativeNullableValue width; + QDeclarativeNullableValue height; + QDeclarativeNullableValue scale; + QDeclarativeNullableValue rotation; + void doChange(QDeclarativeItem *targetParent, QDeclarativeItem *stackBefore = 0); }; @@ -213,10 +220,21 @@ QDeclarativeScriptString QDeclarativeParentChange::x() const return d->xString.value; } +void tryReal(QDeclarativeNullableValue &value, const QString &string) +{ + bool ok = false; + qreal realValue = string.toFloat(&ok); + if (ok) + value = realValue; + else + value.invalidate(); +} + void QDeclarativeParentChange::setX(QDeclarativeScriptString x) { Q_D(QDeclarativeParentChange); d->xString = x; + tryReal(d->x, x.script()); } bool QDeclarativeParentChange::xIsSet() const @@ -235,6 +253,7 @@ void QDeclarativeParentChange::setY(QDeclarativeScriptString y) { Q_D(QDeclarativeParentChange); d->yString = y; + tryReal(d->y, y.script()); } bool QDeclarativeParentChange::yIsSet() const @@ -253,6 +272,7 @@ void QDeclarativeParentChange::setWidth(QDeclarativeScriptString width) { Q_D(QDeclarativeParentChange); d->widthString = width; + tryReal(d->width, width.script()); } bool QDeclarativeParentChange::widthIsSet() const @@ -271,6 +291,7 @@ void QDeclarativeParentChange::setHeight(QDeclarativeScriptString height) { Q_D(QDeclarativeParentChange); d->heightString = height; + tryReal(d->height, height.script()); } bool QDeclarativeParentChange::heightIsSet() const @@ -289,6 +310,7 @@ void QDeclarativeParentChange::setScale(QDeclarativeScriptString scale) { Q_D(QDeclarativeParentChange); d->scaleString = scale; + tryReal(d->scale, scale.script()); } bool QDeclarativeParentChange::scaleIsSet() const @@ -307,6 +329,7 @@ void QDeclarativeParentChange::setRotation(QDeclarativeScriptString rotation) { Q_D(QDeclarativeParentChange); d->rotationString = rotation; + tryReal(d->rotation, rotation.script()); } bool QDeclarativeParentChange::rotationIsSet() const @@ -370,14 +393,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() QDeclarativeContext *ctxt = qmlContext(this); if (d->xString.isValid()) { - bool ok = false; - QString script = d->xString.value.script(); - qreal x = script.toFloat(&ok); - if (ok) { - QDeclarativeAction xa(d->target, QLatin1String("x"), ctxt, x); + if (d->x.isValid()) { + QDeclarativeAction xa(d->target, QLatin1String("x"), ctxt, d->x.value); actions << xa; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->xString.value.script(), d->target, ctxt); newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("x"), ctxt)); QDeclarativeAction xa; xa.property = newBinding->property(); @@ -389,14 +409,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() } if (d->yString.isValid()) { - bool ok = false; - QString script = d->yString.value.script(); - qreal y = script.toFloat(&ok); - if (ok) { - QDeclarativeAction ya(d->target, QLatin1String("y"), ctxt, y); + if (d->y.isValid()) { + QDeclarativeAction ya(d->target, QLatin1String("y"), ctxt, d->y.value); actions << ya; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->yString.value.script(), d->target, ctxt); newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("y"), ctxt)); QDeclarativeAction ya; ya.property = newBinding->property(); @@ -408,14 +425,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() } if (d->scaleString.isValid()) { - bool ok = false; - QString script = d->scaleString.value.script(); - qreal scale = script.toFloat(&ok); - if (ok) { - QDeclarativeAction sa(d->target, QLatin1String("scale"), ctxt, scale); + if (d->scale.isValid()) { + QDeclarativeAction sa(d->target, QLatin1String("scale"), ctxt, d->scale.value); actions << sa; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->scaleString.value.script(), d->target, ctxt); newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("scale"), ctxt)); QDeclarativeAction sa; sa.property = newBinding->property(); @@ -427,14 +441,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() } if (d->rotationString.isValid()) { - bool ok = false; - QString script = d->rotationString.value.script(); - qreal rotation = script.toFloat(&ok); - if (ok) { - QDeclarativeAction ra(d->target, QLatin1String("rotation"), ctxt, rotation); + if (d->rotation.isValid()) { + QDeclarativeAction ra(d->target, QLatin1String("rotation"), ctxt, d->rotation.value); actions << ra; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->rotationString.value.script(), d->target, ctxt); newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("rotation"), ctxt)); QDeclarativeAction ra; ra.property = newBinding->property(); @@ -446,14 +457,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() } if (d->widthString.isValid()) { - bool ok = false; - QString script = d->widthString.value.script(); - qreal width = script.toFloat(&ok); - if (ok) { - QDeclarativeAction wa(d->target, QLatin1String("width"), ctxt, width); + if (d->width.isValid()) { + QDeclarativeAction wa(d->target, QLatin1String("width"), ctxt, d->width.value); actions << wa; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->widthString.value.script(), d->target, ctxt); newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("width"), ctxt)); QDeclarativeAction wa; wa.property = newBinding->property(); @@ -465,14 +473,11 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions() } if (d->heightString.isValid()) { - bool ok = false; - QString script = d->heightString.value.script(); - qreal height = script.toFloat(&ok); - if (ok) { - QDeclarativeAction ha(d->target, QLatin1String("height"), ctxt, height); + if (d->height.isValid()) { + QDeclarativeAction ha(d->target, QLatin1String("height"), ctxt, d->height.value); actions << ha; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, ctxt); + QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->heightString.value.script(), d->target, ctxt); newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("height"), ctxt)); QDeclarativeAction ha; ha.property = newBinding->property(); -- cgit v0.12 From 9536b35d63716e88482baeed34d11509ed724606 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 17 Dec 2010 16:32:24 +1000 Subject: Fix PropertyChange's binding rewriting for 'dot' properties. For cases like PropertyChanges { font.pixelSize: myPixelSize } it was attempting to rewrite the function name as font.pixelSize, which is not syntactically correct. We now rewrite the function name as pixelSize. --- src/declarative/qml/qdeclarativecompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 4f4ad3f..b2b0990 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -2267,7 +2267,7 @@ const QMetaObject *QDeclarativeCompiler::resolveType(const QByteArray& name) con int QDeclarativeCompiler::rewriteBinding(const QString& expression, const QByteArray& name) { QDeclarativeRewrite::RewriteBinding rewriteBinding; - rewriteBinding.setName('$' + name); + rewriteBinding.setName('$' + name.mid(name.lastIndexOf('.') + 1)); bool isSharable = false; QString rewrite = rewriteBinding(expression, 0, &isSharable); -- cgit v0.12 From 84456ce081fa3c2e2f10b5162c70566f98124b0f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 18 Nov 2010 10:32:36 +0100 Subject: QDeclarativeDebug: Rename member variable 'client' points to the QDeclarativeDebugConnection object, so better name it 'connection' then. Reviewed-by: Christiaan Janssen --- .../debugger/qdeclarativedebugclient.cpp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebugclient.cpp b/src/declarative/debugger/qdeclarativedebugclient.cpp index f5c5751..204ca4f 100644 --- a/src/declarative/debugger/qdeclarativedebugclient.cpp +++ b/src/declarative/debugger/qdeclarativedebugclient.cpp @@ -61,7 +61,7 @@ public: QDeclarativeDebugClientPrivate(); QString name; - QDeclarativeDebugConnection *client; + QDeclarativeDebugConnection *connection; }; class QDeclarativeDebugConnectionPrivate : public QObject @@ -202,7 +202,7 @@ QDeclarativeDebugConnection::~QDeclarativeDebugConnection() { QHash::iterator iter = d->plugins.begin(); for (; iter != d->plugins.end(); ++iter) { - iter.value()->d_func()->client = 0; + iter.value()->d_func()->connection = 0; iter.value()->statusChanged(QDeclarativeDebugClient::NotConnected); } } @@ -213,7 +213,7 @@ bool QDeclarativeDebugConnection::isConnected() const } QDeclarativeDebugClientPrivate::QDeclarativeDebugClientPrivate() -: client(0) +: connection(0) { } @@ -223,26 +223,26 @@ QDeclarativeDebugClient::QDeclarativeDebugClient(const QString &name, { Q_D(QDeclarativeDebugClient); d->name = name; - d->client = parent; + d->connection = parent; - if (!d->client) + if (!d->connection) return; - if (d->client->d->plugins.contains(name)) { + if (d->connection->d->plugins.contains(name)) { qWarning() << "QDeclarativeDebugClient: Conflicting plugin name" << name; - d->client = 0; + d->connection = 0; } else { - d->client->d->plugins.insert(name, this); - d->client->d->advertisePlugins(); + d->connection->d->plugins.insert(name, this); + d->connection->d->advertisePlugins(); } } QDeclarativeDebugClient::~QDeclarativeDebugClient() { Q_D(const QDeclarativeDebugClient); - if (d->client && d->client->d) { - d->client->d->plugins.remove(d->name); - d->client->d->advertisePlugins(); + if (d->connection && d->connection->d) { + d->connection->d->plugins.remove(d->name); + d->connection->d->advertisePlugins(); } } @@ -255,12 +255,12 @@ QString QDeclarativeDebugClient::name() const QDeclarativeDebugClient::Status QDeclarativeDebugClient::status() const { Q_D(const QDeclarativeDebugClient); - if (!d->client - || !d->client->isConnected() - || !d->client->d->gotHello) + if (!d->connection + || !d->connection->isConnected() + || !d->connection->d->gotHello) return NotConnected; - if (d->client->d->serverPlugins.contains(d->name)) + if (d->connection->d->serverPlugins.contains(d->name)) return Enabled; return Unavailable; @@ -275,8 +275,8 @@ void QDeclarativeDebugClient::sendMessage(const QByteArray &message) QPacket pack; pack << d->name << message; - d->client->d->protocol->send(pack); - d->client->d->q->flush(); + d->connection->d->protocol->send(pack); + d->connection->d->q->flush(); } void QDeclarativeDebugClient::statusChanged(Status) -- cgit v0.12 From 5d251ef253065d68967ae3263b3cf7f1d93d7a00 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 18 Nov 2010 14:54:24 +0100 Subject: QDeclarativeDebug: Decouple QDDServer, QDDService classes Move QDeclarativeDebugServer class into it's own files and make the classes less interdependent. --- src/declarative/debugger/debugger.pri | 7 +- .../debugger/qdeclarativedebugserver.cpp | 366 +++++++++++++++++++++ .../debugger/qdeclarativedebugserver_p.h | 89 +++++ .../debugger/qdeclarativedebugservice.cpp | 319 +----------------- .../debugger/qdeclarativedebugservice_p_p.h | 71 ++++ 5 files changed, 541 insertions(+), 311 deletions(-) create mode 100644 src/declarative/debugger/qdeclarativedebugserver.cpp create mode 100644 src/declarative/debugger/qdeclarativedebugserver_p.h create mode 100644 src/declarative/debugger/qdeclarativedebugservice_p_p.h diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 25f7687..144d896 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -7,13 +7,16 @@ SOURCES += \ $$PWD/qdeclarativedebugclient.cpp \ $$PWD/qdeclarativedebug.cpp \ $$PWD/qdeclarativedebugtrace.cpp \ - $$PWD/qdeclarativedebughelper.cpp + $$PWD/qdeclarativedebughelper.cpp \ + $$PWD/qdeclarativedebugserver.cpp HEADERS += \ $$PWD/qdeclarativedebuggerstatus_p.h \ $$PWD/qpacketprotocol_p.h \ $$PWD/qdeclarativedebugservice_p.h \ + $$PWD/qdeclarativedebugservice_p_p.h \ $$PWD/qdeclarativedebugclient_p.h \ $$PWD/qdeclarativedebug_p.h \ $$PWD/qdeclarativedebugtrace_p.h \ - $$PWD/qdeclarativedebughelper_p.h + $$PWD/qdeclarativedebughelper_p.h \ + $$PWD/qdeclarativedebugserver_p.h diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp new file mode 100644 index 0000000..4bb4e2c --- /dev/null +++ b/src/declarative/debugger/qdeclarativedebugserver.cpp @@ -0,0 +1,366 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "private/qdeclarativedebugserver_p.h" +#include "private/qdeclarativedebugservice_p.h" +#include "private/qdeclarativedebugservice_p_p.h" +#include "private/qdeclarativeengine_p.h" + +#include "private/qpacketprotocol_p.h" + +#include + +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +/* + QDeclarativeDebug Protocol (Version 1): + + handshake: + 1. Client sends + "QDeclarativeDebugServer" 0 version pluginNames + version: an int representing the highest protocol version the client knows + pluginNames: plugins available on client side + 2. Server sends + "QDeclarativeDebugClient" 0 version pluginNames + version: an int representing the highest protocol version the client & server know + pluginNames: plugins available on server side. plugins both in the client and server message are enabled. + client plugin advertisement + 1. Client sends + "QDeclarativeDebugServer" 1 pluginNames + server plugin advertisement + 1. Server sends + "QDeclarativeDebugClient" 1 pluginNames + plugin communication: + Everything send with a header different to "QDeclarativeDebugServer" is sent to the appropriate plugin. + */ + +const int protocolVersion = 1; + + +class QDeclarativeDebugServerPrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QDeclarativeDebugServer) +public: + QDeclarativeDebugServerPrivate(); + + void advertisePlugins(); + + int port; + QTcpSocket *connection; + QPacketProtocol *protocol; + QHash plugins; + QStringList clientPlugins; + QTcpServer *tcpServer; + bool gotHello; +}; + +QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() +: connection(0), protocol(0), gotHello(false) +{ +} + +void QDeclarativeDebugServerPrivate::advertisePlugins() +{ + if (!connection + || connection->state() != QTcpSocket::ConnectedState + || !gotHello) + return; + + QPacket pack; + pack << QString(QLatin1String("QDeclarativeDebugClient")) << 1 << plugins.keys(); + protocol->send(pack); + connection->flush(); +} + +void QDeclarativeDebugServer::listen() +{ + Q_D(QDeclarativeDebugServer); + + d->tcpServer = new QTcpServer(this); + QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); + if (d->tcpServer->listen(QHostAddress::Any, d->port)) + qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port); + else + qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port); +} + +void QDeclarativeDebugServer::waitForConnection() +{ + Q_D(QDeclarativeDebugServer); + d->tcpServer->waitForNewConnection(-1); +} + +void QDeclarativeDebugServer::newConnection() +{ + Q_D(QDeclarativeDebugServer); + + if (d->connection) { + qWarning("QDeclarativeDebugServer error: another client is already connected"); + QTcpSocket *faultyConnection = d->tcpServer->nextPendingConnection(); + delete faultyConnection; + return; + } + + d->connection = d->tcpServer->nextPendingConnection(); + d->connection->setParent(this); + d->protocol = new QPacketProtocol(d->connection, this); + QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); +} + +bool QDeclarativeDebugServer::hasDebuggingClient() const +{ + Q_D(const QDeclarativeDebugServer); + return d->connection + && (d->connection->state() == QTcpSocket::ConnectedState) + && d->gotHello; +} + +QDeclarativeDebugServer *QDeclarativeDebugServer::instance() +{ + static bool commandLineTested = false; + static QDeclarativeDebugServer *server = 0; + + if (!commandLineTested) { + commandLineTested = true; + +#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL + QApplicationPrivate *appD = static_cast(QObjectPrivate::get(qApp)); + // ### remove port definition when protocol is changed + int port = 0; + bool block = false; + bool ok = false; + + // format: qmljsdebugger=port:3768[,block] + if (!appD->qmljsDebugArgumentsString().isEmpty()) { + if (!QDeclarativeEnginePrivate::qml_debugging_enabled) { + const QString message = + QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " + "Debugging has not been enabled.").arg( + appD->qmljsDebugArgumentsString()); + qWarning("%s", qPrintable(message)); + return 0; + } + + if (appD->qmljsDebugArgumentsString().indexOf(QLatin1String("port:")) == 0) { + int separatorIndex = appD->qmljsDebugArgumentsString().indexOf(QLatin1Char(',')); + port = appD->qmljsDebugArgumentsString().mid(5, separatorIndex - 5).toInt(&ok); + } + block = appD->qmljsDebugArgumentsString().contains(QLatin1String("block")); + + if (ok) { + server = new QDeclarativeDebugServer(port); + server->listen(); + if (block) { + server->waitForConnection(); + } + } else { + qWarning(QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " + "Format is -qmljsdebugger=port:[,block]").arg( + appD->qmljsDebugArgumentsString()).toAscii().constData()); + } + } +#endif + } + + return server; +} + +QDeclarativeDebugServer::QDeclarativeDebugServer(int port) +: QObject(*(new QDeclarativeDebugServerPrivate)) +{ + Q_D(QDeclarativeDebugServer); + d->port = port; +} + +void QDeclarativeDebugServer::readyRead() +{ + Q_D(QDeclarativeDebugServer); + + if (!d->gotHello) { + QPacket hello = d->protocol->read(); + + QString name; + int op; + hello >> name >> op; + + if (name != QLatin1String("QDeclarativeDebugServer") + || op != 0) { + qWarning("QDeclarativeDebugServer: Invalid hello message"); + QObject::disconnect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); + d->protocol->deleteLater(); + d->protocol = 0; + d->connection->deleteLater(); + d->connection = 0; + return; + } + + int version; + hello >> version >> d->clientPlugins; + + QHash::Iterator iter = d->plugins.begin(); + for (; iter != d->plugins.end(); ++iter) { + QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable; + if (d->clientPlugins.contains(iter.key())) + newStatus = QDeclarativeDebugService::Enabled; + iter.value()->d_func()->status = newStatus; + iter.value()->statusChanged(newStatus); + } + + QPacket helloAnswer; + helloAnswer << QString(QLatin1String("QDeclarativeDebugClient")) << 0 << protocolVersion << d->plugins.keys(); + d->protocol->send(helloAnswer); + d->connection->flush(); + + d->gotHello = true; + qWarning("QDeclarativeDebugServer: Connection established"); + } + + QString debugServer(QLatin1String("QDeclarativeDebugServer")); + + while (d->protocol->packetsAvailable()) { + QPacket pack = d->protocol->read(); + + QString name; + pack >> name; + + if (name == debugServer) { + int op = -1; + pack >> op; + + if (op == 1) { + // Service Discovery + QStringList oldClientPlugins = d->clientPlugins; + pack >> d->clientPlugins; + + QHash::Iterator iter = d->plugins.begin(); + for (; iter != d->plugins.end(); ++iter) { + const QString pluginName = iter.key(); + QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable; + if (d->clientPlugins.contains(pluginName)) + newStatus = QDeclarativeDebugService::Enabled; + + if (oldClientPlugins.contains(pluginName) + != d->clientPlugins.contains(pluginName)) { + iter.value()->d_func()->status = newStatus; + iter.value()->statusChanged(newStatus); + } + } + } else { + qWarning("QDeclarativeDebugServer: Invalid control message %d", op); + } + } else { + QByteArray message; + pack >> message; + + QHash::Iterator iter = + d->plugins.find(name); + if (iter == d->plugins.end()) { + qWarning() << "QDeclarativeDebugServer: Message received for missing plugin" << name; + } else { + (*iter)->messageReceived(message); + } + } + } +} + + +QList QDeclarativeDebugServer::services() const +{ + const Q_D(QDeclarativeDebugServer); + return d->plugins.values(); +} + +QStringList QDeclarativeDebugServer::serviceNames() const +{ + const Q_D(QDeclarativeDebugServer); + return d->plugins.keys(); +} + +bool QDeclarativeDebugServer::addService(QDeclarativeDebugService *service) +{ + Q_D(QDeclarativeDebugServer); + if (!service || d->plugins.contains(service->name())) + return false; + + d->plugins.insert(service->name(), service); + d->advertisePlugins(); + + QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable; + if (d->clientPlugins.contains(service->name())) + newStatus = QDeclarativeDebugService::Enabled; + service->d_func()->status = newStatus; + service->statusChanged(newStatus); + return true; +} + +bool QDeclarativeDebugServer::removeService(QDeclarativeDebugService *service) +{ + Q_D(QDeclarativeDebugServer); + if (!service || !d->plugins.contains(service->name())) + return false; + + d->plugins.remove(service->name()); + d->advertisePlugins(); + + QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::NotConnected; + service->d_func()->server = 0; + service->d_func()->status = newStatus; + service->statusChanged(newStatus); + return true; +} + +void QDeclarativeDebugServer::sendMessage(QDeclarativeDebugService *service, + const QByteArray &message) +{ + Q_D(QDeclarativeDebugServer); + QPacket pack; + pack << service->name() << message; + d->protocol->send(pack); + d->connection->flush(); +} + +QT_END_NAMESPACE diff --git a/src/declarative/debugger/qdeclarativedebugserver_p.h b/src/declarative/debugger/qdeclarativedebugserver_p.h new file mode 100644 index 0000000..6840d63 --- /dev/null +++ b/src/declarative/debugger/qdeclarativedebugserver_p.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEDEBUGSERVER_H +#define QDECLARATIVEDEBUGSERVER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeDebugService; + +class QDeclarativeDebugServerPrivate; +class QDeclarativeDebugServer : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QDeclarativeDebugServer) + Q_DISABLE_COPY(QDeclarativeDebugServer) +public: + static QDeclarativeDebugServer *instance(); + void listen(); + void waitForConnection(); + bool hasDebuggingClient() const; + + QList services() const; + QStringList serviceNames() const; + + bool addService(QDeclarativeDebugService *service); + bool removeService(QDeclarativeDebugService *service); + + void sendMessage(QDeclarativeDebugService *service, const QByteArray &message); + +private Q_SLOTS: + void readyRead(); + void newConnection(); + +private: + friend class QDeclarativeDebugService; + friend class QDeclarativeDebugServicePrivate; + QDeclarativeDebugServer(int); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDECLARATIVEDEBUGSERVICE_H diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp index 849df73..9d321da 100644 --- a/src/declarative/debugger/qdeclarativedebugservice.cpp +++ b/src/declarative/debugger/qdeclarativedebugservice.cpp @@ -40,301 +40,14 @@ ****************************************************************************/ #include "private/qdeclarativedebugservice_p.h" +#include "private/qdeclarativedebugservice_p_p.h" +#include "private/qdeclarativedebugserver_p.h" -#include "private/qpacketprotocol_p.h" -#include "private/qdeclarativeengine_p.h" - -#include -#include -#include -#include - -#include -#include -#include +#include +#include QT_BEGIN_NAMESPACE -/* - QDeclarativeDebug Protocol (Version 1): - - handshake: - 1. Client sends - "QDeclarativeDebugServer" 0 version pluginNames - version: an int representing the highest protocol version the client knows - pluginNames: plugins available on client side - 2. Server sends - "QDeclarativeDebugClient" 0 version pluginNames - version: an int representing the highest protocol version the client & server know - pluginNames: plugins available on server side. plugins both in the client and server message are enabled. - client plugin advertisement - 1. Client sends - "QDeclarativeDebugServer" 1 pluginNames - server plugin advertisement - 1. Server sends - "QDeclarativeDebugClient" 1 pluginNames - plugin communication: - Everything send with a header different to "QDeclarativeDebugServer" is sent to the appropriate plugin. - */ - -const int protocolVersion = 1; - -class QDeclarativeDebugServerPrivate; -class QDeclarativeDebugServer : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeDebugServer) - Q_DISABLE_COPY(QDeclarativeDebugServer) -public: - static QDeclarativeDebugServer *instance(); - void listen(); - void waitForConnection(); - bool hasDebuggingClient() const; - -private Q_SLOTS: - void readyRead(); - void newConnection(); - -private: - friend class QDeclarativeDebugService; - friend class QDeclarativeDebugServicePrivate; - QDeclarativeDebugServer(int); -}; - -class QDeclarativeDebugServerPrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QDeclarativeDebugServer) -public: - QDeclarativeDebugServerPrivate(); - - void advertisePlugins(); - - int port; - QTcpSocket *connection; - QPacketProtocol *protocol; - QHash plugins; - QStringList clientPlugins; - QTcpServer *tcpServer; - bool gotHello; -}; - -class QDeclarativeDebugServicePrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QDeclarativeDebugService) -public: - QDeclarativeDebugServicePrivate(); - - QString name; - QDeclarativeDebugServer *server; -}; - -QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() -: connection(0), protocol(0), gotHello(false) -{ -} - -void QDeclarativeDebugServerPrivate::advertisePlugins() -{ - if (!connection - || connection->state() != QTcpSocket::ConnectedState - || !gotHello) - return; - - QPacket pack; - pack << QString(QLatin1String("QDeclarativeDebugClient")) << 1 << plugins.keys(); - protocol->send(pack); - connection->flush(); -} - -void QDeclarativeDebugServer::listen() -{ - Q_D(QDeclarativeDebugServer); - - d->tcpServer = new QTcpServer(this); - QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); - if (d->tcpServer->listen(QHostAddress::Any, d->port)) - qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port); - else - qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port); -} - -void QDeclarativeDebugServer::waitForConnection() -{ - Q_D(QDeclarativeDebugServer); - d->tcpServer->waitForNewConnection(-1); -} - -void QDeclarativeDebugServer::newConnection() -{ - Q_D(QDeclarativeDebugServer); - - if (d->connection) { - qWarning("QDeclarativeDebugServer error: another client is already connected"); - QTcpSocket *faultyConnection = d->tcpServer->nextPendingConnection(); - delete faultyConnection; - return; - } - - d->connection = d->tcpServer->nextPendingConnection(); - d->connection->setParent(this); - d->protocol = new QPacketProtocol(d->connection, this); - QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); -} - -bool QDeclarativeDebugServer::hasDebuggingClient() const -{ - Q_D(const QDeclarativeDebugServer); - return d->connection - && (d->connection->state() == QTcpSocket::ConnectedState) - && d->gotHello; -} - -QDeclarativeDebugServer *QDeclarativeDebugServer::instance() -{ - static bool commandLineTested = false; - static QDeclarativeDebugServer *server = 0; - - if (!commandLineTested) { - commandLineTested = true; - -#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL - QApplicationPrivate *appD = static_cast(QObjectPrivate::get(qApp)); - // ### remove port definition when protocol is changed - int port = 0; - bool block = false; - bool ok = false; - - // format: qmljsdebugger=port:3768[,block] - if (!appD->qmljsDebugArgumentsString().isEmpty()) { - if (!QDeclarativeEnginePrivate::qml_debugging_enabled) { - qWarning() << QString::fromLatin1("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " - "Debugging has not been enabled.").arg( - appD->qmljsDebugArgumentsString()).toAscii().constData(); - return 0; - } - - if (appD->qmljsDebugArgumentsString().indexOf(QLatin1String("port:")) == 0) { - int separatorIndex = appD->qmljsDebugArgumentsString().indexOf(QLatin1Char(',')); - port = appD->qmljsDebugArgumentsString().mid(5, separatorIndex - 5).toInt(&ok); - } - block = appD->qmljsDebugArgumentsString().contains(QLatin1String("block")); - - if (ok) { - server = new QDeclarativeDebugServer(port); - server->listen(); - if (block) { - server->waitForConnection(); - } - } else { - const QString message = - QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " - "Format is -qmljsdebugger=port:[,block]"). - arg(appD->qmljsDebugArgumentsString()); - qWarning("%s", qPrintable(message)); - } - } -#endif - } - - return server; -} - -QDeclarativeDebugServer::QDeclarativeDebugServer(int port) -: QObject(*(new QDeclarativeDebugServerPrivate)) -{ - Q_D(QDeclarativeDebugServer); - d->port = port; -} - -void QDeclarativeDebugServer::readyRead() -{ - Q_D(QDeclarativeDebugServer); - - if (!d->gotHello) { - QPacket hello = d->protocol->read(); - - QString name; - int op; - hello >> name >> op; - - if (name != QLatin1String("QDeclarativeDebugServer") - || op != 0) { - qWarning("QDeclarativeDebugServer: Invalid hello message"); - QObject::disconnect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); - d->protocol->deleteLater(); - d->protocol = 0; - d->connection->deleteLater(); - d->connection = 0; - return; - } - - int version; - hello >> version >> d->clientPlugins; - - QHash::Iterator iter = d->plugins.begin(); - for (; iter != d->plugins.end(); ++iter) { - QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable; - if (d->clientPlugins.contains(iter.key())) - newStatus = QDeclarativeDebugService::Enabled; - iter.value()->statusChanged(newStatus); - } - - QPacket helloAnswer; - helloAnswer << QString(QLatin1String("QDeclarativeDebugClient")) << 0 << protocolVersion << d->plugins.keys(); - d->protocol->send(helloAnswer); - d->connection->flush(); - - d->gotHello = true; - qWarning("QDeclarativeDebugServer: Connection established"); - } - - QString debugServer(QLatin1String("QDeclarativeDebugServer")); - - while (d->protocol->packetsAvailable()) { - QPacket pack = d->protocol->read(); - - QString name; - pack >> name; - - if (name == debugServer) { - int op = -1; - pack >> op; - - if (op == 1) { - // Service Discovery - QStringList oldClientPlugins = d->clientPlugins; - pack >> d->clientPlugins; - - QHash::Iterator iter = d->plugins.begin(); - for (; iter != d->plugins.end(); ++iter) { - const QString pluginName = iter.key(); - QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable; - if (d->clientPlugins.contains(pluginName)) - newStatus = QDeclarativeDebugService::Enabled; - - if (oldClientPlugins.contains(pluginName) - != d->clientPlugins.contains(pluginName)) { - iter.value()->statusChanged(newStatus); - } - } - } else { - qWarning("QDeclarativeDebugServer: Invalid control message %d", op); - } - } else { - QByteArray message; - pack >> message; - - QHash::Iterator iter = - d->plugins.find(name); - if (iter == d->plugins.end()) { - qWarning() << "QDeclarativeDebugServer: Message received for missing plugin" << name; - } else { - (*iter)->messageReceived(message); - } - } - } -} - QDeclarativeDebugServicePrivate::QDeclarativeDebugServicePrivate() : server(0) { @@ -346,16 +59,16 @@ QDeclarativeDebugService::QDeclarativeDebugService(const QString &name, QObject Q_D(QDeclarativeDebugService); d->name = name; d->server = QDeclarativeDebugServer::instance(); + d->status = QDeclarativeDebugService::NotConnected; if (!d->server) return; - if (d->server->d_func()->plugins.contains(name)) { + if (d->server->serviceNames().contains(name)) { qWarning() << "QDeclarativeDebugService: Conflicting plugin name" << name; d->server = 0; } else { - d->server->d_func()->plugins.insert(name, this); - d->server->d_func()->advertisePlugins(); + d->server->addService(this); } } @@ -363,8 +76,7 @@ QDeclarativeDebugService::~QDeclarativeDebugService() { Q_D(const QDeclarativeDebugService); if (d->server) { - d->server->d_func()->plugins.remove(d->name); - d->server->d_func()->advertisePlugins(); + d->server->removeService(this); } } @@ -377,13 +89,7 @@ QString QDeclarativeDebugService::name() const QDeclarativeDebugService::Status QDeclarativeDebugService::status() const { Q_D(const QDeclarativeDebugService); - if (!d->server - || !d->server->hasDebuggingClient()) - return NotConnected; - if (d->server->d_func()->clientPlugins.contains(d->name)) - return Enabled; - - return Unavailable; + return d->status; } namespace { @@ -500,10 +206,7 @@ void QDeclarativeDebugService::sendMessage(const QByteArray &message) if (status() != Enabled) return; - QPacket pack; - pack << d->name << message; - d->server->d_func()->protocol->send(pack); - d->server->d_func()->connection->flush(); + d->server->sendMessage(this, message); } void QDeclarativeDebugService::statusChanged(Status) @@ -515,5 +218,3 @@ void QDeclarativeDebugService::messageReceived(const QByteArray &) } QT_END_NAMESPACE - -#include diff --git a/src/declarative/debugger/qdeclarativedebugservice_p_p.h b/src/declarative/debugger/qdeclarativedebugservice_p_p.h new file mode 100644 index 0000000..d2c8dda --- /dev/null +++ b/src/declarative/debugger/qdeclarativedebugservice_p_p.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEDEBUGSERVICE_P_H +#define QDECLARATIVEDEBUGSERVICE_P_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeDebugServer; + +class QDeclarativeDebugServicePrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QDeclarativeDebugService) +public: + QDeclarativeDebugServicePrivate(); + + QString name; + QDeclarativeDebugServer *server; + QDeclarativeDebugService::Status status; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDECLARATIVEDEBUGSERVICE_P_H -- cgit v0.12 From 5336e1838a95d97d34863b668ff797582c226e79 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 24 Nov 2010 19:50:09 +0100 Subject: QDeclarativeDebug: Move networking code out of QDeclarativeDebugServer Move socket handling code out of QDeclarativeDebugServer into a QDeclarativeDebugServer(Tcp)Connection class. Reviewed-by: Christiaan Janssen --- src/declarative/debugger/debugger.pri | 8 +- .../debugger/qdeclarativedebugserver.cpp | 131 ++++++----------- .../debugger/qdeclarativedebugserver_p.h | 13 +- .../debugger/qdeclarativedebugserverconnection_p.h | 68 +++++++++ .../debugger/qdeclarativedebugserverplugin_p.h | 0 .../qdeclarativedebugservertcpconnection.cpp | 163 +++++++++++++++++++++ .../qdeclarativedebugservertcpconnection_p.h | 86 +++++++++++ src/declarative/debugger/qpacketprotocol.cpp | 8 + src/declarative/debugger/qpacketprotocol_p.h | 1 + 9 files changed, 383 insertions(+), 95 deletions(-) create mode 100644 src/declarative/debugger/qdeclarativedebugserverconnection_p.h create mode 100644 src/declarative/debugger/qdeclarativedebugserverplugin_p.h create mode 100644 src/declarative/debugger/qdeclarativedebugservertcpconnection.cpp create mode 100644 src/declarative/debugger/qdeclarativedebugservertcpconnection_p.h diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 144d896..e7354dc 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -8,7 +8,8 @@ SOURCES += \ $$PWD/qdeclarativedebug.cpp \ $$PWD/qdeclarativedebugtrace.cpp \ $$PWD/qdeclarativedebughelper.cpp \ - $$PWD/qdeclarativedebugserver.cpp + $$PWD/qdeclarativedebugserver.cpp \ + $$PWD/qdeclarativedebugservertcpconnection.cpp HEADERS += \ $$PWD/qdeclarativedebuggerstatus_p.h \ @@ -19,4 +20,7 @@ HEADERS += \ $$PWD/qdeclarativedebug_p.h \ $$PWD/qdeclarativedebugtrace_p.h \ $$PWD/qdeclarativedebughelper_p.h \ - $$PWD/qdeclarativedebugserver_p.h + $$PWD/qdeclarativedebugserverplugin_p.h \ + $$PWD/qdeclarativedebugserver_p.h \ + $$PWD/qdeclarativedebugservertcpconnection_p.h \ + debugger/qdeclarativedebugserverconnection_p.h diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp index 4bb4e2c..6085e3e 100644 --- a/src/declarative/debugger/qdeclarativedebugserver.cpp +++ b/src/declarative/debugger/qdeclarativedebugserver.cpp @@ -42,15 +42,11 @@ #include "private/qdeclarativedebugserver_p.h" #include "private/qdeclarativedebugservice_p.h" #include "private/qdeclarativedebugservice_p_p.h" +#include "private/qdeclarativedebugservertcpconnection_p.h" #include "private/qdeclarativeengine_p.h" -#include "private/qpacketprotocol_p.h" - #include -#include -#include - #include #include @@ -89,73 +85,36 @@ public: void advertisePlugins(); - int port; - QTcpSocket *connection; - QPacketProtocol *protocol; + QDeclarativeDebugServerConnection *connection; QHash plugins; QStringList clientPlugins; - QTcpServer *tcpServer; bool gotHello; }; -QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() -: connection(0), protocol(0), gotHello(false) +QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() : + connection(0), + gotHello(false) { } void QDeclarativeDebugServerPrivate::advertisePlugins() { - if (!connection - || connection->state() != QTcpSocket::ConnectedState - || !gotHello) + if (!gotHello) return; - QPacket pack; - pack << QString(QLatin1String("QDeclarativeDebugClient")) << 1 << plugins.keys(); - protocol->send(pack); - connection->flush(); -} - -void QDeclarativeDebugServer::listen() -{ - Q_D(QDeclarativeDebugServer); - - d->tcpServer = new QTcpServer(this); - QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); - if (d->tcpServer->listen(QHostAddress::Any, d->port)) - qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port); - else - qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port); -} - -void QDeclarativeDebugServer::waitForConnection() -{ - Q_D(QDeclarativeDebugServer); - d->tcpServer->waitForNewConnection(-1); -} - -void QDeclarativeDebugServer::newConnection() -{ - Q_D(QDeclarativeDebugServer); - - if (d->connection) { - qWarning("QDeclarativeDebugServer error: another client is already connected"); - QTcpSocket *faultyConnection = d->tcpServer->nextPendingConnection(); - delete faultyConnection; - return; + QByteArray message; + { + QDataStream out(&message, QIODevice::WriteOnly); + out << QString(QLatin1String("QDeclarativeDebugClient")) << 1 << plugins.keys(); } - - d->connection = d->tcpServer->nextPendingConnection(); - d->connection->setParent(this); - d->protocol = new QPacketProtocol(d->connection, this); - QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); + connection->send(message); } bool QDeclarativeDebugServer::hasDebuggingClient() const { Q_D(const QDeclarativeDebugServer); return d->connection - && (d->connection->state() == QTcpSocket::ConnectedState) + && d->connection->isConnected() && d->gotHello; } @@ -192,11 +151,17 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() block = appD->qmljsDebugArgumentsString().contains(QLatin1String("block")); if (ok) { - server = new QDeclarativeDebugServer(port); - server->listen(); + server = new QDeclarativeDebugServer(); + + QDeclarativeDebugServerTcpConnection *tcpConnection + = new QDeclarativeDebugServerTcpConnection(port, server); + + tcpConnection->listen(); if (block) { - server->waitForConnection(); + tcpConnection->waitForConnection(); } + + server->d_func()->connection = tcpConnection; } else { qWarning(QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " "Format is -qmljsdebugger=port:[,block]").arg( @@ -209,37 +174,31 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() return server; } -QDeclarativeDebugServer::QDeclarativeDebugServer(int port) +QDeclarativeDebugServer::QDeclarativeDebugServer() : QObject(*(new QDeclarativeDebugServerPrivate)) { - Q_D(QDeclarativeDebugServer); - d->port = port; } -void QDeclarativeDebugServer::readyRead() +void QDeclarativeDebugServer::receiveMessage(const QByteArray &message) { Q_D(QDeclarativeDebugServer); + QDataStream in(message); if (!d->gotHello) { - QPacket hello = d->protocol->read(); QString name; int op; - hello >> name >> op; + in >> name >> op; if (name != QLatin1String("QDeclarativeDebugServer") || op != 0) { qWarning("QDeclarativeDebugServer: Invalid hello message"); - QObject::disconnect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); - d->protocol->deleteLater(); - d->protocol = 0; - d->connection->deleteLater(); - d->connection = 0; + d->connection->disconnect(); return; } int version; - hello >> version >> d->clientPlugins; + in >> version >> d->clientPlugins; QHash::Iterator iter = d->plugins.begin(); for (; iter != d->plugins.end(); ++iter) { @@ -250,31 +209,30 @@ void QDeclarativeDebugServer::readyRead() iter.value()->statusChanged(newStatus); } - QPacket helloAnswer; - helloAnswer << QString(QLatin1String("QDeclarativeDebugClient")) << 0 << protocolVersion << d->plugins.keys(); - d->protocol->send(helloAnswer); - d->connection->flush(); + QByteArray helloAnswer; + { + QDataStream out(&helloAnswer, QIODevice::WriteOnly); + out << QString(QLatin1String("QDeclarativeDebugClient")) << 0 << protocolVersion << d->plugins.keys(); + } + d->connection->send(helloAnswer); d->gotHello = true; qWarning("QDeclarativeDebugServer: Connection established"); - } + } else { - QString debugServer(QLatin1String("QDeclarativeDebugServer")); - - while (d->protocol->packetsAvailable()) { - QPacket pack = d->protocol->read(); + QString debugServer(QLatin1String("QDeclarativeDebugServer")); QString name; - pack >> name; + in >> name; if (name == debugServer) { int op = -1; - pack >> op; + in >> op; if (op == 1) { // Service Discovery QStringList oldClientPlugins = d->clientPlugins; - pack >> d->clientPlugins; + in >> d->clientPlugins; QHash::Iterator iter = d->plugins.begin(); for (; iter != d->plugins.end(); ++iter) { @@ -294,7 +252,7 @@ void QDeclarativeDebugServer::readyRead() } } else { QByteArray message; - pack >> message; + in >> message; QHash::Iterator iter = d->plugins.find(name); @@ -307,7 +265,6 @@ void QDeclarativeDebugServer::readyRead() } } - QList QDeclarativeDebugServer::services() const { const Q_D(QDeclarativeDebugServer); @@ -357,10 +314,12 @@ void QDeclarativeDebugServer::sendMessage(QDeclarativeDebugService *service, const QByteArray &message) { Q_D(QDeclarativeDebugServer); - QPacket pack; - pack << service->name() << message; - d->protocol->send(pack); - d->connection->flush(); + QByteArray msg; + { + QDataStream out(&msg, QIODevice::WriteOnly); + out << service->name() << message; + } + d->connection->send(msg); } QT_END_NAMESPACE diff --git a/src/declarative/debugger/qdeclarativedebugserver_p.h b/src/declarative/debugger/qdeclarativedebugserver_p.h index 6840d63..93ab10b 100644 --- a/src/declarative/debugger/qdeclarativedebugserver_p.h +++ b/src/declarative/debugger/qdeclarativedebugserver_p.h @@ -43,6 +43,7 @@ #define QDECLARATIVEDEBUGSERVER_H #include +#include QT_BEGIN_HEADER @@ -60,8 +61,9 @@ class QDeclarativeDebugServer : public QObject Q_DISABLE_COPY(QDeclarativeDebugServer) public: static QDeclarativeDebugServer *instance(); - void listen(); - void waitForConnection(); + + void setConnection(QDeclarativeDebugServerConnection *connection); + bool hasDebuggingClient() const; QList services() const; @@ -71,15 +73,12 @@ public: bool removeService(QDeclarativeDebugService *service); void sendMessage(QDeclarativeDebugService *service, const QByteArray &message); - -private Q_SLOTS: - void readyRead(); - void newConnection(); + void receiveMessage(const QByteArray &message); private: friend class QDeclarativeDebugService; friend class QDeclarativeDebugServicePrivate; - QDeclarativeDebugServer(int); + QDeclarativeDebugServer(); }; QT_END_NAMESPACE diff --git a/src/declarative/debugger/qdeclarativedebugserverconnection_p.h b/src/declarative/debugger/qdeclarativedebugserverconnection_p.h new file mode 100644 index 0000000..4175126 --- /dev/null +++ b/src/declarative/debugger/qdeclarativedebugserverconnection_p.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEDEBUGSERVERCONNECTION_H +#define QDECLARATIVEDEBUGSERVERCONNECTION_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeDebugServerConnection +{ +public: + QDeclarativeDebugServerConnection() {} + virtual ~QDeclarativeDebugServerConnection() {} + + virtual bool isConnected() const = 0; + virtual void send(const QByteArray &message) = 0; + virtual void disconnect() = 0; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDECLARATIVEDEBUGSERVERCONNECTION_H diff --git a/src/declarative/debugger/qdeclarativedebugserverplugin_p.h b/src/declarative/debugger/qdeclarativedebugserverplugin_p.h new file mode 100644 index 0000000..e69de29 diff --git a/src/declarative/debugger/qdeclarativedebugservertcpconnection.cpp b/src/declarative/debugger/qdeclarativedebugservertcpconnection.cpp new file mode 100644 index 0000000..223c875 --- /dev/null +++ b/src/declarative/debugger/qdeclarativedebugservertcpconnection.cpp @@ -0,0 +1,163 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdeclarativedebugservertcpconnection_p.h" + +#include "qdeclarativedebugserver_p.h" +#include "private/qpacketprotocol_p.h" + +#include +#include + + +QT_BEGIN_NAMESPACE + +class QDeclarativeDebugServerTcpConnectionPrivate { +public: + QDeclarativeDebugServerTcpConnectionPrivate(); + + int port; + QTcpSocket *socket; + QPacketProtocol *protocol; + QTcpServer *tcpServer; + + QDeclarativeDebugServer *debugServer; +}; + +QDeclarativeDebugServerTcpConnectionPrivate::QDeclarativeDebugServerTcpConnectionPrivate() : + port(0), + socket(0), + protocol(0), + tcpServer(0), + debugServer(0) +{ +} + +QDeclarativeDebugServerTcpConnection::QDeclarativeDebugServerTcpConnection(int port, QDeclarativeDebugServer *server) : + QObject(server), + d_ptr(new QDeclarativeDebugServerTcpConnectionPrivate) +{ + Q_D(QDeclarativeDebugServerTcpConnection); + d->port = port; + d->debugServer = server; +} + +QDeclarativeDebugServerTcpConnection::~QDeclarativeDebugServerTcpConnection() +{ + delete d_ptr; +} + +bool QDeclarativeDebugServerTcpConnection::isConnected() const +{ + Q_D(const QDeclarativeDebugServerTcpConnection); + return d->socket && d->socket->state() == QTcpSocket::ConnectedState; +} + +void QDeclarativeDebugServerTcpConnection::send(const QByteArray &message) +{ + Q_D(QDeclarativeDebugServerTcpConnection); + + if (!isConnected()) + return; + + QPacket pack; + pack.writeRawData(message.data(), message.length()); + + d->protocol->send(pack); + d->socket->flush(); +} + +void QDeclarativeDebugServerTcpConnection::disconnect() +{ + Q_D(QDeclarativeDebugServerTcpConnection); + + delete d->protocol; + d->protocol = 0; + delete d->socket; + d->socket = 0; +} + +void QDeclarativeDebugServerTcpConnection::listen() +{ + Q_D(QDeclarativeDebugServerTcpConnection); + + d->tcpServer = new QTcpServer(this); + QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); + if (d->tcpServer->listen(QHostAddress::Any, d->port)) + qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port); + else + qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port); +} + +void QDeclarativeDebugServerTcpConnection::waitForConnection() +{ + Q_D(QDeclarativeDebugServerTcpConnection); + d->tcpServer->waitForNewConnection(-1); +} + +void QDeclarativeDebugServerTcpConnection::readyRead() +{ + Q_D(QDeclarativeDebugServerTcpConnection); + QPacket packet = d->protocol->read(); + + QByteArray content = packet.data(); + d->debugServer->receiveMessage(content); +} + +void QDeclarativeDebugServerTcpConnection::newConnection() +{ + Q_D(QDeclarativeDebugServerTcpConnection); + + if (d->socket) { + qWarning("QDeclarativeDebugServer error: another client is already connected"); + QTcpSocket *faultyConnection = d->tcpServer->nextPendingConnection(); + delete faultyConnection; + return; + } + + d->socket = d->tcpServer->nextPendingConnection(); + d->socket->setParent(this); + d->protocol = new QPacketProtocol(d->socket, this); + QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); +} + + +QT_END_NAMESPACE diff --git a/src/declarative/debugger/qdeclarativedebugservertcpconnection_p.h b/src/declarative/debugger/qdeclarativedebugservertcpconnection_p.h new file mode 100644 index 0000000..f1c749ef --- /dev/null +++ b/src/declarative/debugger/qdeclarativedebugservertcpconnection_p.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEDEBUGSERVERTCPCONNECTION_H +#define QDECLARATIVEDEBUGSERVERTCPCONNECTION_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +#include + +class QDeclarativeDebugServer; +class QDeclarativeDebugServerTcpConnectionPrivate; +class QDeclarativeDebugServerTcpConnection : public QObject, public QDeclarativeDebugServerConnection +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QDeclarativeDebugServerTcpConnection) + Q_DISABLE_COPY(QDeclarativeDebugServerTcpConnection) + +public: + QDeclarativeDebugServerTcpConnection(int port, QDeclarativeDebugServer *server); + ~QDeclarativeDebugServerTcpConnection(); + + bool isConnected() const; + void send(const QByteArray &message); + void disconnect(); + + void listen(); + void waitForConnection(); + +private Q_SLOTS: + void readyRead(); + void newConnection(); + +private: + QDeclarativeDebugServerTcpConnectionPrivate *d_ptr; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDECLARATIVEDEBUGSERVERTCPCONNECTION_H diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp index c2f7709..ad1e767 100644 --- a/src/declarative/debugger/qpacketprotocol.cpp +++ b/src/declarative/debugger/qpacketprotocol.cpp @@ -452,6 +452,14 @@ bool QPacket::isEmpty() const } /*! + Returns raw packet data. + */ +QByteArray QPacket::data() const +{ + return b; +} + +/*! Clears data in the packet. This is useful for reusing one writable packet. For example \code diff --git a/src/declarative/debugger/qpacketprotocol_p.h b/src/declarative/debugger/qpacketprotocol_p.h index d153833..99fded5 100644 --- a/src/declarative/debugger/qpacketprotocol_p.h +++ b/src/declarative/debugger/qpacketprotocol_p.h @@ -98,6 +98,7 @@ public: void clear(); bool isEmpty() const; + QByteArray data() const; protected: friend class QPacketProtocol; -- cgit v0.12 From 21016c3b28674029a2a205da38f54e362e3635b9 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 26 Nov 2010 16:22:47 +0100 Subject: QDeclarativeDebug: Move Tcp server to separate plugin Reviewed-by: Christiaan Janssen --- src/declarative/debugger/debugger.pri | 4 +- .../debugger/qdeclarativedebugserver.cpp | 50 +++++- .../debugger/qdeclarativedebugserver_p.h | 2 +- .../debugger/qdeclarativedebugserverconnection_p.h | 9 +- .../qdeclarativedebugservertcpconnection.cpp | 163 ------------------- .../qdeclarativedebugservertcpconnection_p.h | 86 ---------- src/declarative/debugger/qpacketprotocol_p.h | 4 +- src/plugins/plugins.pro | 3 +- src/plugins/qmldebugging/qmldebugging.pro | 4 + .../tcpserver/qtcpserverconnection.cpp | 173 +++++++++++++++++++++ .../qmldebugging/tcpserver/qtcpserverconnection.h | 84 ++++++++++ src/plugins/qmldebugging/tcpserver/tcpserver.pro | 18 +++ 12 files changed, 334 insertions(+), 266 deletions(-) delete mode 100644 src/declarative/debugger/qdeclarativedebugservertcpconnection.cpp delete mode 100644 src/declarative/debugger/qdeclarativedebugservertcpconnection_p.h create mode 100644 src/plugins/qmldebugging/qmldebugging.pro create mode 100644 src/plugins/qmldebugging/tcpserver/qtcpserverconnection.cpp create mode 100644 src/plugins/qmldebugging/tcpserver/qtcpserverconnection.h create mode 100644 src/plugins/qmldebugging/tcpserver/tcpserver.pro diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index e7354dc..9152677 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -8,8 +8,7 @@ SOURCES += \ $$PWD/qdeclarativedebug.cpp \ $$PWD/qdeclarativedebugtrace.cpp \ $$PWD/qdeclarativedebughelper.cpp \ - $$PWD/qdeclarativedebugserver.cpp \ - $$PWD/qdeclarativedebugservertcpconnection.cpp + $$PWD/qdeclarativedebugserver.cpp HEADERS += \ $$PWD/qdeclarativedebuggerstatus_p.h \ @@ -22,5 +21,4 @@ HEADERS += \ $$PWD/qdeclarativedebughelper_p.h \ $$PWD/qdeclarativedebugserverplugin_p.h \ $$PWD/qdeclarativedebugserver_p.h \ - $$PWD/qdeclarativedebugservertcpconnection_p.h \ debugger/qdeclarativedebugserverconnection_p.h diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp index 6085e3e..a269984 100644 --- a/src/declarative/debugger/qdeclarativedebugserver.cpp +++ b/src/declarative/debugger/qdeclarativedebugserver.cpp @@ -42,9 +42,10 @@ #include "private/qdeclarativedebugserver_p.h" #include "private/qdeclarativedebugservice_p.h" #include "private/qdeclarativedebugservice_p_p.h" -#include "private/qdeclarativedebugservertcpconnection_p.h" #include "private/qdeclarativeengine_p.h" +#include +#include #include #include @@ -89,6 +90,8 @@ public: QHash plugins; QStringList clientPlugins; bool gotHello; + + static QDeclarativeDebugServerConnection *loadConnectionPlugin(); }; QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() : @@ -110,6 +113,36 @@ void QDeclarativeDebugServerPrivate::advertisePlugins() connection->send(message); } +QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectionPlugin() +{ + QStringList pluginCandidates; + const QStringList paths = QCoreApplication::libraryPaths(); + foreach (const QString &libPath, paths) { + const QDir dir(libPath + QLatin1String("/qmldebugging")); + if (dir.exists()) { + QStringList plugins(dir.entryList(QDir::Files)); + foreach (const QString &pluginPath, plugins) { + pluginCandidates << dir.absoluteFilePath(pluginPath); + } + } + } + + foreach (const QString &pluginPath, pluginCandidates) { + QPluginLoader loader(pluginPath); + if (!loader.load()) { + continue; + } + QDeclarativeDebugServerConnection *connection = 0; + if (QObject *instance = loader.instance()) + connection = qobject_cast(instance); + + if (connection) + return connection; + loader.unload(); + } + return 0; +} + bool QDeclarativeDebugServer::hasDebuggingClient() const { Q_D(const QDeclarativeDebugServer); @@ -153,15 +186,18 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() if (ok) { server = new QDeclarativeDebugServer(); - QDeclarativeDebugServerTcpConnection *tcpConnection - = new QDeclarativeDebugServerTcpConnection(port, server); + QDeclarativeDebugServerConnection *connection + = QDeclarativeDebugServerPrivate::loadConnectionPlugin(); + if (connection) { + server->d_func()->connection = connection; - tcpConnection->listen(); - if (block) { - tcpConnection->waitForConnection(); + connection->setServer(server); + connection->setPort(port, block); + } else { + qWarning() << QString::fromAscii("QDeclarativeDebugServer: Ignoring\"-qmljsdebugger=%1\". " + "Remote debugger plugin has not been found.").arg(appD->qmljsDebugArgumentsString()); } - server->d_func()->connection = tcpConnection; } else { qWarning(QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " "Format is -qmljsdebugger=port:[,block]").arg( diff --git a/src/declarative/debugger/qdeclarativedebugserver_p.h b/src/declarative/debugger/qdeclarativedebugserver_p.h index 93ab10b..ec3e60f 100644 --- a/src/declarative/debugger/qdeclarativedebugserver_p.h +++ b/src/declarative/debugger/qdeclarativedebugserver_p.h @@ -54,7 +54,7 @@ QT_MODULE(Declarative) class QDeclarativeDebugService; class QDeclarativeDebugServerPrivate; -class QDeclarativeDebugServer : public QObject +class Q_DECLARATIVE_EXPORT QDeclarativeDebugServer : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QDeclarativeDebugServer) diff --git a/src/declarative/debugger/qdeclarativedebugserverconnection_p.h b/src/declarative/debugger/qdeclarativedebugserverconnection_p.h index 4175126..631da74 100644 --- a/src/declarative/debugger/qdeclarativedebugserverconnection_p.h +++ b/src/declarative/debugger/qdeclarativedebugserverconnection_p.h @@ -42,7 +42,7 @@ #ifndef QDECLARATIVEDEBUGSERVERCONNECTION_H #define QDECLARATIVEDEBUGSERVERCONNECTION_H -#include +#include QT_BEGIN_HEADER @@ -50,17 +50,22 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QDeclarativeDebugServerConnection +class QDeclarativeDebugServer; +class Q_DECLARATIVE_EXPORT QDeclarativeDebugServerConnection { public: QDeclarativeDebugServerConnection() {} virtual ~QDeclarativeDebugServerConnection() {} + virtual void setServer(QDeclarativeDebugServer *server) = 0; + virtual void setPort(int port, bool bock) = 0; virtual bool isConnected() const = 0; virtual void send(const QByteArray &message) = 0; virtual void disconnect() = 0; }; +Q_DECLARE_INTERFACE(QDeclarativeDebugServerConnection, "com.trolltech.Qt.QDeclarativeDebugServerConnection/1.0") + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/declarative/debugger/qdeclarativedebugservertcpconnection.cpp b/src/declarative/debugger/qdeclarativedebugservertcpconnection.cpp deleted file mode 100644 index 223c875..0000000 --- a/src/declarative/debugger/qdeclarativedebugservertcpconnection.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qdeclarativedebugservertcpconnection_p.h" - -#include "qdeclarativedebugserver_p.h" -#include "private/qpacketprotocol_p.h" - -#include -#include - - -QT_BEGIN_NAMESPACE - -class QDeclarativeDebugServerTcpConnectionPrivate { -public: - QDeclarativeDebugServerTcpConnectionPrivate(); - - int port; - QTcpSocket *socket; - QPacketProtocol *protocol; - QTcpServer *tcpServer; - - QDeclarativeDebugServer *debugServer; -}; - -QDeclarativeDebugServerTcpConnectionPrivate::QDeclarativeDebugServerTcpConnectionPrivate() : - port(0), - socket(0), - protocol(0), - tcpServer(0), - debugServer(0) -{ -} - -QDeclarativeDebugServerTcpConnection::QDeclarativeDebugServerTcpConnection(int port, QDeclarativeDebugServer *server) : - QObject(server), - d_ptr(new QDeclarativeDebugServerTcpConnectionPrivate) -{ - Q_D(QDeclarativeDebugServerTcpConnection); - d->port = port; - d->debugServer = server; -} - -QDeclarativeDebugServerTcpConnection::~QDeclarativeDebugServerTcpConnection() -{ - delete d_ptr; -} - -bool QDeclarativeDebugServerTcpConnection::isConnected() const -{ - Q_D(const QDeclarativeDebugServerTcpConnection); - return d->socket && d->socket->state() == QTcpSocket::ConnectedState; -} - -void QDeclarativeDebugServerTcpConnection::send(const QByteArray &message) -{ - Q_D(QDeclarativeDebugServerTcpConnection); - - if (!isConnected()) - return; - - QPacket pack; - pack.writeRawData(message.data(), message.length()); - - d->protocol->send(pack); - d->socket->flush(); -} - -void QDeclarativeDebugServerTcpConnection::disconnect() -{ - Q_D(QDeclarativeDebugServerTcpConnection); - - delete d->protocol; - d->protocol = 0; - delete d->socket; - d->socket = 0; -} - -void QDeclarativeDebugServerTcpConnection::listen() -{ - Q_D(QDeclarativeDebugServerTcpConnection); - - d->tcpServer = new QTcpServer(this); - QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); - if (d->tcpServer->listen(QHostAddress::Any, d->port)) - qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port); - else - qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port); -} - -void QDeclarativeDebugServerTcpConnection::waitForConnection() -{ - Q_D(QDeclarativeDebugServerTcpConnection); - d->tcpServer->waitForNewConnection(-1); -} - -void QDeclarativeDebugServerTcpConnection::readyRead() -{ - Q_D(QDeclarativeDebugServerTcpConnection); - QPacket packet = d->protocol->read(); - - QByteArray content = packet.data(); - d->debugServer->receiveMessage(content); -} - -void QDeclarativeDebugServerTcpConnection::newConnection() -{ - Q_D(QDeclarativeDebugServerTcpConnection); - - if (d->socket) { - qWarning("QDeclarativeDebugServer error: another client is already connected"); - QTcpSocket *faultyConnection = d->tcpServer->nextPendingConnection(); - delete faultyConnection; - return; - } - - d->socket = d->tcpServer->nextPendingConnection(); - d->socket->setParent(this); - d->protocol = new QPacketProtocol(d->socket, this); - QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); -} - - -QT_END_NAMESPACE diff --git a/src/declarative/debugger/qdeclarativedebugservertcpconnection_p.h b/src/declarative/debugger/qdeclarativedebugservertcpconnection_p.h deleted file mode 100644 index f1c749ef..0000000 --- a/src/declarative/debugger/qdeclarativedebugservertcpconnection_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEDEBUGSERVERTCPCONNECTION_H -#define QDECLARATIVEDEBUGSERVERTCPCONNECTION_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -#include - -class QDeclarativeDebugServer; -class QDeclarativeDebugServerTcpConnectionPrivate; -class QDeclarativeDebugServerTcpConnection : public QObject, public QDeclarativeDebugServerConnection -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeDebugServerTcpConnection) - Q_DISABLE_COPY(QDeclarativeDebugServerTcpConnection) - -public: - QDeclarativeDebugServerTcpConnection(int port, QDeclarativeDebugServer *server); - ~QDeclarativeDebugServerTcpConnection(); - - bool isConnected() const; - void send(const QByteArray &message); - void disconnect(); - - void listen(); - void waitForConnection(); - -private Q_SLOTS: - void readyRead(); - void newConnection(); - -private: - QDeclarativeDebugServerTcpConnectionPrivate *d_ptr; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDECLARATIVEDEBUGSERVERTCPCONNECTION_H diff --git a/src/declarative/debugger/qpacketprotocol_p.h b/src/declarative/debugger/qpacketprotocol_p.h index 99fded5..1c69cdd 100644 --- a/src/declarative/debugger/qpacketprotocol_p.h +++ b/src/declarative/debugger/qpacketprotocol_p.h @@ -59,7 +59,7 @@ class QPacket; class QPacketAutoSend; class QPacketProtocolPrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QPacketProtocol : public QObject +class Q_DECLARATIVE_EXPORT QPacketProtocol : public QObject { Q_OBJECT public: @@ -89,7 +89,7 @@ private: }; -class Q_DECLARATIVE_PRIVATE_EXPORT QPacket : public QDataStream +class Q_DECLARATIVE_EXPORT QPacket : public QDataStream { public: QPacket(); diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 722979d..07825d9 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -14,5 +14,4 @@ embedded:SUBDIRS *= gfxdrivers decorations mousedrivers kbddrivers symbian:SUBDIRS += s60 contains(QT_CONFIG, phonon): SUBDIRS *= phonon contains(QT_CONFIG, multimedia): SUBDIRS *= audio - - +contains(QT_CONFIG, declarative): SUBDIRS *= qmldebugging diff --git a/src/plugins/qmldebugging/qmldebugging.pro b/src/plugins/qmldebugging/qmldebugging.pro new file mode 100644 index 0000000..01cf1a9 --- /dev/null +++ b/src/plugins/qmldebugging/qmldebugging.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs + +SUBDIRS = tcpserver + diff --git a/src/plugins/qmldebugging/tcpserver/qtcpserverconnection.cpp b/src/plugins/qmldebugging/tcpserver/qtcpserverconnection.cpp new file mode 100644 index 0000000..69c1ef5 --- /dev/null +++ b/src/plugins/qmldebugging/tcpserver/qtcpserverconnection.cpp @@ -0,0 +1,173 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qtcpserverconnection.h" + +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +class QTcpServerConnectionPrivate { +public: + QTcpServerConnectionPrivate(); + + int port; + QTcpSocket *socket; + QPacketProtocol *protocol; + QTcpServer *tcpServer; + + QDeclarativeDebugServer *debugServer; +}; + +QTcpServerConnectionPrivate::QTcpServerConnectionPrivate() : + port(0), + socket(0), + protocol(0), + tcpServer(0), + debugServer(0) +{ +} + +QTcpServerConnection::QTcpServerConnection() : + d_ptr(new QTcpServerConnectionPrivate) +{ + +} + +QTcpServerConnection::~QTcpServerConnection() +{ + delete d_ptr; +} + +void QTcpServerConnection::setServer(QDeclarativeDebugServer *server) +{ + Q_D(QTcpServerConnection); + d->debugServer = server; +} + +bool QTcpServerConnection::isConnected() const +{ + Q_D(const QTcpServerConnection); + return d->socket && d->socket->state() == QTcpSocket::ConnectedState; +} + +void QTcpServerConnection::send(const QByteArray &message) +{ + Q_D(QTcpServerConnection); + + if (!isConnected()) + return; + + QPacket pack; + pack.writeRawData(message.data(), message.length()); + + d->protocol->send(pack); + d->socket->flush(); +} + +void QTcpServerConnection::disconnect() +{ + Q_D(QTcpServerConnection); + + delete d->protocol; + d->protocol = 0; + delete d->socket; + d->socket = 0; +} + +void QTcpServerConnection::setPort(int port, bool block) +{ + Q_D(QTcpServerConnection); + d->port = port; + + listen(); + if (block) + d->tcpServer->waitForNewConnection(-1); +} + +void QTcpServerConnection::listen() +{ + Q_D(QTcpServerConnection); + + d->tcpServer = new QTcpServer(this); + QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); + if (d->tcpServer->listen(QHostAddress::Any, d->port)) + qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port); + else + qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port); +} + + +void QTcpServerConnection::readyRead() +{ + Q_D(QTcpServerConnection); + QPacket packet = d->protocol->read(); + + QByteArray content = packet.data(); + d->debugServer->receiveMessage(content); +} + +void QTcpServerConnection::newConnection() +{ + Q_D(QTcpServerConnection); + + if (d->socket) { + qWarning("QDeclarativeDebugServer: Another client is already connected"); + QTcpSocket *faultyConnection = d->tcpServer->nextPendingConnection(); + delete faultyConnection; + return; + } + + d->socket = d->tcpServer->nextPendingConnection(); + d->socket->setParent(this); + d->protocol = new QPacketProtocol(d->socket, this); + QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); +} + + +Q_EXPORT_PLUGIN2(tcpserver, QTcpServerConnection) + +QT_END_NAMESPACE + diff --git a/src/plugins/qmldebugging/tcpserver/qtcpserverconnection.h b/src/plugins/qmldebugging/tcpserver/qtcpserverconnection.h new file mode 100644 index 0000000..a6e17e6 --- /dev/null +++ b/src/plugins/qmldebugging/tcpserver/qtcpserverconnection.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTCPSERVERCONNECTION_H +#define QTCPSERVERCONNECTION_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QDeclarativeDebugServer; +class QTcpServerConnectionPrivate; +class QTcpServerConnection : public QObject, public QDeclarativeDebugServerConnection +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QTcpServerConnection) + Q_DISABLE_COPY(QTcpServerConnection) + Q_INTERFACES(QDeclarativeDebugServerConnection) + + +public: + QTcpServerConnection(); + ~QTcpServerConnection(); + + void setServer(QDeclarativeDebugServer *server); + void setPort(int port, bool bock); + + bool isConnected() const; + void send(const QByteArray &message); + void disconnect(); + + void listen(); + void waitForConnection(); + +private Q_SLOTS: + void readyRead(); + void newConnection(); + +private: + QTcpServerConnectionPrivate *d_ptr; +}; + +QT_END_NAMESPACE + +#endif // QTCPSERVERCONNECTION_H diff --git a/src/plugins/qmldebugging/tcpserver/tcpserver.pro b/src/plugins/qmldebugging/tcpserver/tcpserver.pro new file mode 100644 index 0000000..e90fb34 --- /dev/null +++ b/src/plugins/qmldebugging/tcpserver/tcpserver.pro @@ -0,0 +1,18 @@ +TARGET = tcpserver +QT += declarative network + +include(../../qpluginbase.pri) + +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmldebugging +QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)" + +SOURCES += \ + qtcpserverconnection.cpp + +HEADERS += \ + qtcpserverconnection.h + +target.path += $$[QT_INSTALL_PLUGINS]/qmldebugging +INSTALLS += target + +symbian:TARGET.UID3=0x20031E90 \ No newline at end of file -- cgit v0.12 From 35ae0b8146bca7a61203ee347654aed27951439c Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 9 Dec 2010 13:06:08 +0100 Subject: QDeclarativeDebug: Include debugger plugin in qmlviewer.sis Developers that want to debug qml on their device have to now install qmlviewer.sis. Reviewed-by: Christiaan Janssen --- tools/qml/qml.pro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro index bdac6e3..9b07ebe 100644 --- a/tools/qml/qml.pro +++ b/tools/qml/qml.pro @@ -43,6 +43,11 @@ symbian { contains(QT_CONFIG, s60): { LIBS += -lavkon -lcone } + + # Deploy plugin for remote debugging + qmldebuggingplugin.sources = $$QT_BUILD_TREE/plugins/qmldebugging/tcpserver$${QT_LIBINFIX}.dll + qmldebuggingplugin.path = c:$$QT_PLUGINS_BASE_DIR/qmldebugging + DEPLOYMENT += qmldebuggingplugin } mac { QMAKE_INFO_PLIST=Info_mac.plist -- cgit v0.12 From 3290135e88bd8a01e20842c9d1cdca5fe569bf62 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 16 Dec 2010 14:39:15 +0100 Subject: Symbian compile fix armv5 complained that the call to QChar::category() was ambiguous, because there is a version taking an uint, and a version taking ushort as argument. Reviewed-by: Christiaan Janssen --- src/script/bridge/qscriptdeclarativeclass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp index 92248a0..13736bc 100644 --- a/src/script/bridge/qscriptdeclarativeclass.cpp +++ b/src/script/bridge/qscriptdeclarativeclass.cpp @@ -473,7 +473,7 @@ bool QScriptDeclarativeClass::startsWithUpper(const Identifier &identifier) JSC::UString::Rep *r = (JSC::UString::Rep *)identifier; if (r->size() < 1) return false; - return QChar::category(r->data()[0]) == QChar::Letter_Uppercase; + return QChar::category((ushort)(r->data()[0])) == QChar::Letter_Uppercase; } quint32 QScriptDeclarativeClass::toArrayIndex(const Identifier &identifier, bool *ok) -- cgit v0.12 From 6842743be8ad2403094e74e0cf70c9a6a325c4b2 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 17 Dec 2010 09:38:10 +0100 Subject: embed copyright information in QtAssistantClient4.dll Task-number: QT-4054 Reviewed-by: Christian Kandeler --- tools/assistant/compat/lib/lib.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/assistant/compat/lib/lib.pro b/tools/assistant/compat/lib/lib.pro index e50d470..8bf9feb 100644 --- a/tools/assistant/compat/lib/lib.pro +++ b/tools/assistant/compat/lib/lib.pro @@ -1,3 +1,5 @@ +include($$QT_SOURCE_TREE/src/qt_targets.pri) + TEMPLATE = lib QT += network TARGET = QtAssistantClient -- cgit v0.12 From 90c77df38c8168991ae69776a45aa4d08466f541 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 17 Dec 2010 14:13:46 +0100 Subject: Whitespace fixes. --- doc/src/template/style/style.css | 1086 +++++++++++----------- tools/qdoc3/test/qt-html-default-styles.qdocconf | 2 +- 2 files changed, 534 insertions(+), 554 deletions(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index d623bd4..4f9e26c 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -1,6 +1,6 @@ @media screen { - + /* basic elements */ html { @@ -20,7 +20,7 @@ fieldset, img { border: 0; - max-width:100%; + max-width:100%; } address, caption, cite, code, dfn, em, strong, th, var, optgroup { @@ -60,10 +60,10 @@ { vertical-align: baseline; } - tt, .qmlreadonly span, .qmldefault span - { - word-spacing:5px; - } + tt, .qmlreadonly span, .qmldefault span + { + word-spacing:5px; + } legend { color: #000000; @@ -88,7 +88,7 @@ font-style: italic; } - /* adding Qt theme */ + /* adding Qt theme */ html { /* background-color: #e5e5e5;*/ @@ -117,9 +117,9 @@ pre { border: 1px solid #DDDDDD; - -moz-border-radius: 7px 7px 7px 7px; - -webkit-border-radius: 7px 7px 7px 7px; - border-radius: 7px 7px 7px 7px; + -moz-border-radius: 7px 7px 7px 7px; + -webkit-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; margin: 0 20px 10px 10px; padding: 20px 15px 20px 20px; overflow-x: auto; @@ -135,14 +135,14 @@ font-size: 11px; margin-bottom: 25px; } - pre.highlightedCode { - display: block; - overflow:hidden; - } + pre.highlightedCode { + display: block; + overflow:hidden; + } thead { margin-top: 5px; - font:600 12px/1.2 Arial; + font:600 12px/1.2 Arial; } th { @@ -155,11 +155,11 @@ padding: 3px 15px 3px 20px; } tr.odd td:hover, tr.even td:hover {} - - td.rightAlign - { + + td.rightAlign + { padding: 3px 5px 3px 10px; - } + } table tr.odd { border-left: 1px solid #E6E6E6; @@ -228,10 +228,10 @@ { font-size: 13px; } - .red - { - color:red; - } + .red + { + color:red; + } /* end font style elements */ /* global settings*/ @@ -255,7 +255,7 @@ clear: both; visibility: hidden; } - + /* end global settings*/ /* header elements */ .header @@ -295,7 +295,7 @@ color: #4c0033; text-decoration: underline; } - + #nav-topright { height: 70px; @@ -428,10 +428,10 @@ { font-variant: normal; } - .shortCut-topleft-inactive span a:hover, .shortCut-topleft-active a:hover - { - text-decoration:none; - } + .shortCut-topleft-inactive span a:hover, .shortCut-topleft-active a:hover + { + text-decoration:none; + } #shortCut { padding-top: 10px; @@ -461,9 +461,9 @@ color: #44a51c; } - - -/* end header elements */ + + +/* end header elements */ /* content and sidebar elements */ .wrapper { @@ -514,17 +514,15 @@ background: url(../images/page.png) no-repeat 100% -60px; overflow: hidden; } - .navTop{ - float:right; - display:block; - padding-right:15px; + .navTop{ + float:right; + display:block; + padding-right:15px; + } - } - - -/* end content and sidebar elements */ +/* end content and sidebar elements */ /* sidebar elements */ .sidebar { @@ -553,9 +551,9 @@ .sidebar .search form { background: url(../images/sprites-combined.png) no-repeat -6px -348px; - height:21px; - padding:2px 0 0 5px; - width:167px; + height:21px; + padding:2px 0 0 5px; + width:167px; } .sidebar .search form input#pageType @@ -613,10 +611,10 @@ .sidebar .box .list { display: block; - max-height:200px; - min-height:120px; - overflow-y:auto; - overflow-x:none; + max-height:200px; + min-height:120px; + overflow-y:auto; + overflow-x:none; } .list li a:hover { @@ -624,9 +622,9 @@ } .sidebar .box ul { - padding-bottom:5px; - padding-left:10px; - padding-top:5px; + padding-bottom:5px; + padding-left:10px; + padding-top:5px; } .sidebar .box ul li { @@ -638,143 +636,143 @@ { background: url(../images/box_bg.png) repeat-x 0 bottom; } - .sidebar .box ul li.noMatch + .sidebar .box ul li.noMatch { background: none; - color:#FF2A00; - font-style:italic; + color:#FF2A00; + font-style:italic; } - .sidebar .box ul li.hit + .sidebar .box ul li.hit { background: none; - color:#AAD2F0; - font-style:italic; - } - .sidebar .search form input.loading - { - background:url("../images/spinner.gif") no-repeat scroll right center transparent; - } - - .sidebar .search form { - _height: 23px; - _width: 169px; - } - - #resultdialog { - display: none; - position: absolute; - *left: 30px; - _left: 0; - *top: 35px; - _top: 30px; - _zoom: 1; - background-color: #fff; - border: 1px solid #666; - z-index: 4; - margin-top: 5px; - _margin: 0 0 0 -20px; - padding: 10px; - width: 30%; - _width: 196px; - height: 250px; - overflow: auto; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - border-radius: .5em; - -webkit-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); - -moz-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); - box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); - font-size: 11px; - } - - #resultdialog a - { + color:#AAD2F0; + font-style:italic; + } + .sidebar .search form input.loading + { + background:url("../images/spinner.gif") no-repeat scroll right center transparent; + } + + .sidebar .search form { + _height: 23px; + _width: 169px; + } + + #resultdialog { + display: none; + position: absolute; + *left: 30px; + _left: 0; + *top: 35px; + _top: 30px; + _zoom: 1; + background-color: #fff; + border: 1px solid #666; + z-index: 4; + margin-top: 5px; + _margin: 0 0 0 -20px; + padding: 10px; + width: 30%; + _width: 196px; + height: 250px; + overflow: auto; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + border-radius: .5em; + -webkit-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + -moz-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + font-size: 11px; + } + + #resultdialog a + { color: #00732f; - } - - #resultdialog.active { - display: block; - } - - .narrow #resultdialog { - width: 60%; - _width: 360px; - } - - .narrow #resultdialog.active { - right: 10px; - *left: auto; - _left: auto; - _right: -20px; - } - - - #resultdialog #resultclose { - float: right; - } - - #resultdialog p, - #resultdialog ul { - clear: both; - margin: 3px 0; - } - - p#searchcount span { - display: none; - } - - p#searchcount.all span#resultcount, - p#searchcount.api span#apicount, - p#searchcount.article span#articlecount, - p#searchcount.example span#examplecount { - display: inline; - } - - #resultlist li { - display: none; - } - - #resultlist.api li.api, - #resultlist.article li.article, - #resultlist.example li.example, - #resultlist.all li { - display: block; - } - - #resultlinks.api a#showapiresults, - #resultlinks.api a#showapiresults:hover, - #resultlinks.article a#showarticleresults, - #resultlinks.article a#showarticleresults:hover, - #resultlinks.example a#showexampleresults, - #resultlinks.example a#showexampleresults:hover, - #resultlinks.all a#showallresults, - #resultlinks.all a#showallresults:hover { - color: #B0ADAB; - } - .floatingResult{ - z-index:1; - position:relative; - padding-top:0px; - background-color:white; - border:solid 1px black; - height:250px; - width:600px; - overflow-x:hidden; - overflow-y:auto; - } - - .floatingResult:hover{ - display:block; - } - .floatingResult:hover{ - } - + } + + #resultdialog.active { + display: block; + } + + .narrow #resultdialog { + width: 60%; + _width: 360px; + } + + .narrow #resultdialog.active { + right: 10px; + *left: auto; + _left: auto; + _right: -20px; + } + + + #resultdialog #resultclose { + float: right; + } + + #resultdialog p, + #resultdialog ul { + clear: both; + margin: 3px 0; + } + + p#searchcount span { + display: none; + } + + p#searchcount.all span#resultcount, + p#searchcount.api span#apicount, + p#searchcount.article span#articlecount, + p#searchcount.example span#examplecount { + display: inline; + } + + #resultlist li { + display: none; + } + + #resultlist.api li.api, + #resultlist.article li.article, + #resultlist.example li.example, + #resultlist.all li { + display: block; + } + + #resultlinks.api a#showapiresults, + #resultlinks.api a#showapiresults:hover, + #resultlinks.article a#showarticleresults, + #resultlinks.article a#showarticleresults:hover, + #resultlinks.example a#showexampleresults, + #resultlinks.example a#showexampleresults:hover, + #resultlinks.all a#showallresults, + #resultlinks.all a#showallresults:hover { + color: #B0ADAB; + } + .floatingResult{ + z-index:1; + position:relative; + padding-top:0px; + background-color:white; + border:solid 1px black; + height:250px; + width:600px; + overflow-x:hidden; + overflow-y:auto; + } + + .floatingResult:hover{ + display:block; + } + .floatingResult:hover{ + } + /* end sidebar elements */ /* content elements */ .wrap { margin: 0 5px 0 208px; - overflow: visible; + overflow: visible; } @@ -784,7 +782,7 @@ { background-color: #fafafa; border-bottom: 1px solid #d1d1d1; - height: 20px; + height: 20px; position: relative; } .wrap .toolbar .toolblock @@ -870,7 +868,7 @@ .wrap .content { padding: 30px; - word-wrap:break-word; + word-wrap:break-word; } .wrap .breadcrumb ul @@ -902,29 +900,29 @@ - .wrap .content ol li { - background:none; - font:normal 10pt/1.2 Verdana; + .wrap .content ol li { + background:none; + font:normal 10pt/1.2 Verdana; - margin-bottom:10px; - margin-left:12px; - /*list-style-type:disc;*/ - } + margin-bottom:10px; + margin-left:12px; + /*list-style-type:disc;*/ + } .wrap .content ol li { - background:none; - margin-bottom: 10px; - padding-left:0px; - margin-left:52px; + background:none; + margin-bottom: 10px; + padding-left:0px; + margin-left:52px; } - + .wrap .content li { background: url(../images/bullet_sq.png) no-repeat 0 5px; font: normal 400 10pt/1.2 Verdana; - margin-bottom: 10px; - padding-left:12px; + margin-bottom: 10px; + padding-left:12px; } .content li:hover {} @@ -935,16 +933,16 @@ } .wrap .content h2 { - font:600 16px/1.2 Arial; - margin-top:15px; - width:100%; + font:600 16px/1.2 Arial; + margin-top:15px; + width:100%; } .wrap .content h3 { font: bold 14px/1.2 Arial; - font:600 16px/1.2 Arial; - margin-top:15px; - width:100%; + font:600 16px/1.2 Arial; + margin-top:15px; + width:100%; } .wrap .content p { @@ -954,25 +952,25 @@ .wrap .content table p { line-height: 20px; - } + } .wrap .content ul { padding-left: 25px; padding-top: 10px; } - .wrap .content ul img { - vertical-align:middle; - } + .wrap .content ul img { + vertical-align:middle; + } a:hover { color: #4c0033; text-decoration: underline; } - descr p a + descr p a { text-decoration: underline; } - + .descr p a:visited { text-decoration: underline; @@ -993,56 +991,56 @@ color: #00732F; text-decoration: underline; } - .alphaChar{ - width:95%; - background-color:#F6F6F6; - border:1px solid #E6E6E6; - -moz-border-radius: 7px 7px 7px 7px; - border-radius: 7px 7px 7px 7px; - -webkit-border-radius: 7px 7px 7px 7px; - font-size:12pt; - padding-left:10px; - margin-top:10px; - margin-bottom:10px; - } - .flowList{ - /*vertical-align:top;*/ - /*margin:20px auto;*/ - - column-count:3; - -webkit-column-count:3; - -moz-column-count:3; + .alphaChar{ + width:95%; + background-color:#F6F6F6; + border:1px solid #E6E6E6; + -moz-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; + -webkit-border-radius: 7px 7px 7px 7px; + font-size:12pt; + padding-left:10px; + margin-top:10px; + margin-bottom:10px; + } + .flowList{ + /*vertical-align:top;*/ + /*margin:20px auto;*/ + + column-count:3; + -webkit-column-count:3; + -moz-column-count:3; /* - column-width:100%; - -webkit-column-width:200px; - -col-column-width:200px; + column-width:100%; + -webkit-column-width:200px; + -col-column-width:200px; */ - column-gap:41px; - -webkit-column-gap:41px; - -moz-column-gap:41px; - - column-rule: 1px dashed #ccc; - -webkit-column-rule: 1px dashed #ccc; - -moz-column-rule: 1px dashed #ccc; - } - - .flowList dl{ - } - .flowList dd{ - /*display:inline-block;*/ - margin-left:10px; - min-width:250px; - line-height: 1.5; - min-width:100%; - min-height:15px; - } - - .flowList dd a{ - } - - .wrap .content .flowList p{ - padding:0px; - } + column-gap:41px; + -webkit-column-gap:41px; + -moz-column-gap:41px; + + column-rule: 1px dashed #ccc; + -webkit-column-rule: 1px dashed #ccc; + -moz-column-rule: 1px dashed #ccc; + } + + .flowList dl{ + } + .flowList dd{ + /*display:inline-block;*/ + margin-left:10px; + min-width:250px; + line-height: 1.5; + min-width:100%; + min-height:15px; + } + + .flowList dd a{ + } + + .wrap .content .flowList p{ + padding:0px; + } .content .alignedsummary { @@ -1092,7 +1090,7 @@ background-color: #e6e7e8; z-index: 4; } - #feedcloseX + #feedcloseX { display: inline; padding: 5px 5px 0 0; @@ -1110,25 +1108,25 @@ height: 120px; margin: 0px 25px 10px 15px; } - #noteHead - { - font-weight:bold; - padding:10px 10px 10px 20px; - } + #noteHead + { + font-weight:bold; + padding:10px 10px 10px 20px; + } #feedsubmit { display: inline; float: right; margin: 4px 32px 0 0; } - - .note - { - font-size:7pt; - padding-bottom:3px; - padding-left:20px; - } - + + .note + { + font-size:7pt; + padding-bottom:3px; + padding-left:20px; + } + #blurpage { display: none; @@ -1160,67 +1158,67 @@ font: bold 12px/1.2 Arial; } - .generic{ - } - .generic td{ - /* padding:5px;*/ - } - .generic .alphaChar{ - margin-top:5px; - } - - .generic .odd .alphaChar{ + .generic{ + } + .generic td{ + /* padding:5px;*/ + } + .generic .alphaChar{ + margin-top:5px; + } + + .generic .odd .alphaChar{ background-color: #F6F6F6; - } - - .generic .even .alphaChar{ + } + + .generic .even .alphaChar{ background-color: #FFFFFF; - } - - .alignedsummary{} - .propsummary{} - .memItemLeft{} - .memItemRight{ - padding:3px 15px 3px 0; - } - .bottomAlign{} - .highlightedCode - { - margin:10px; - } - .LegaleseLeft{} - .valuelist{} - .annotated td{ - padding: 3px 5px 3px 5px; - } - .obsolete{} - .compat{} - .flags{} - .qmlsummary{} - .qmlitem{} - .qmlproto{} - .qmlname{} - .qmlreadonly{} - .qmldefault{} - .qmldoc{} - .qt-style{} - .redFont{} - code{} - + } + + .alignedsummary{} + .propsummary{} + .memItemLeft{} + .memItemRight{ + padding:3px 15px 3px 0; + } + .bottomAlign{} + .highlightedCode + { + margin:10px; + } + .LegaleseLeft{} + .valuelist{} + .annotated td{ + padding: 3px 5px 3px 5px; + } + .obsolete{} + .compat{} + .flags{} + .qmlsummary{} + .qmlitem{} + .qmlproto{} + .qmlname{} + .qmlreadonly{} + .qmldefault{} + .qmldoc{} + .qt-style{} + .redFont{} + code{} + .wrap .content .toc ul { padding-left: 0px; } - .wrap .content .toc h3{ - border-bottom:0px; - margin-top:0px; - } - - .wrap .content .toc h3 a:hover{ - color:#00732F; - text-decoration:none; - } + .wrap .content .toc h3{ + border-bottom:0px; + margin-top:0px; + } + + .wrap .content .toc h3 a:hover{ + color:#00732F; + text-decoration:none; + } .wrap .content .toc .level2 @@ -1258,56 +1256,55 @@ } h3.fn, span.fn { - -moz-border-radius:7px 7px 7px 7px; - -webkit-border-radius:7px 7px 7px 7px; - border-radius:7px 7px 7px 7px; + -moz-border-radius:7px 7px 7px 7px; + -webkit-border-radius:7px 7px 7px 7px; + border-radius:7px 7px 7px 7px; background-color: #F6F6F6; border-width: 1px; border-style: solid; border-color: #E6E6E6; font-weight: bold; - word-spacing:3px; - padding:3px 5px; - } - - .functionIndex { - font-size:12pt; - word-spacing:10px; - margin-bottom:10px; - background-color: #F6F6F6; - border-width: 1px; - border-style: solid; - border-color: #E6E6E6; - -moz-border-radius: 7px 7px 7px 7px; - -webkit-border-radius: 7px 7px 7px 7px; - border-radius: 7px 7px 7px 7px; - width:100%; - } - - .centerAlign - { - text-align:center; - } - - .rightAlign - { - text-align:right; - } - - - .leftAlign - { - text-align:left; - } - - .topAlign{ - vertical-align:top - } - - .functionIndex a{ - display:inline-block; - } - + word-spacing:3px; + padding:3px 5px; + } + + .functionIndex { + font-size:12pt; + word-spacing:10px; + margin-bottom:10px; + background-color: #F6F6F6; + border-width: 1px; + border-style: solid; + border-color: #E6E6E6; + -moz-border-radius: 7px 7px 7px 7px; + -webkit-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; + width:100%; + } + + .centerAlign + { + text-align:center; + } + + .rightAlign + { + text-align:right; + } + + .leftAlign + { + text-align:left; + } + + .topAlign{ + vertical-align:top + } + + .functionIndex a{ + display:inline-block; + } + /* end content elements */ /* footer elements */ @@ -1324,7 +1321,7 @@ .small { font: normal 9px/1 Verdana; - } + } /* end footer elements */ @@ -1334,7 +1331,7 @@ .indexbox { width: 100%; - display:inline-block; + display:inline-block; } .indexboxcont @@ -1354,7 +1351,7 @@ .indexboxcont .section { display: inline-block; - width: 49%; + width: 49%; *width:42%; _width:42%; padding:0 2% 0 1%; @@ -1364,7 +1361,7 @@ .indexboxcont .indexIcon { - width: 11%; + width: 11%; *width:18%; _width:18%; overflow:hidden; @@ -1383,8 +1380,8 @@ .indexboxcont .sectionlist { display: inline-block; - vertical-align:top; - width: 32.5%; + vertical-align:top; + width: 32.5%; padding: 0; } .indexboxcont .sectionlist ul @@ -1413,17 +1410,16 @@ color: #00732f; text-decoration: none; } - - .indexbox .indexIcon { - width: 11%; - } - + .indexbox .indexIcon { + width: 11%; + } + .indexbox .indexIcon span { display: block; } - + .indexbox.guide .indexIcon span { width: 96px; @@ -1431,7 +1427,7 @@ background: url(../images/sprites-combined.png) no-repeat -5px -376px; padding: 0; } - + .indexbox.tools .indexIcon span { width: 115px; @@ -1447,56 +1443,55 @@ clear: both; visibility: hidden; } - + /* start of creator spec*/ - .creator - { - margin-left:0px; - margin-right:0px; - padding-left:0px; - padding-right:0px; - } - .creator .wrap .content ol li { - list-style-type:decimal; - - } + .creator + { + margin-left:0px; + margin-right:0px; + padding-left:0px; + padding-right:0px; + } + .creator .wrap .content ol li { + list-style-type:decimal; + } .creator .header .icon, - .creator .feedback, - .creator .t_button, .creator .feedback, - .creator #feedbackBox, - .creator #feedback, - .creator #blurpage, - /*.creator .indexbox .indexIcon span,*/ - .creator .wrapper .hd, -/* .creator .indexbox .indexIcon,*/ - .creator .header #nav-logo, - .creator #offlinemenu, - .creator #offlinesearch, - .creator .header #nav-topright, + .creator .t_button, + .creator .feedback, + .creator #feedbackBox, + .creator #feedback, + .creator #blurpage, + /* .creator .indexbox .indexIcon span,*/ + .creator .wrapper .hd, + /* .creator .indexbox .indexIcon,*/ + .creator .header #nav-logo, + .creator #offlinemenu, + .creator #offlinesearch, + .creator .header #nav-topright, .creator .header #shortCut , - .creator .wrapper .hd, + .creator .wrapper .hd, .creator .wrapper .ft, - .creator .sidebar, - .creator .wrap .feedback + .creator .sidebar, + .creator .wrap .feedback { - display:none; + display:none; } - - body.creator + + body.creator { - background: none; + background: none; font: normal 13px/1.2 Verdana; color: #363534; - background-color: #FAFAFA; + background-color: #FAFAFA; } - .wrap .content ol li { - - } + .wrap .content ol li { + + } .creator .header, .creator .footer, .creator .wrapper @@ -1505,16 +1500,15 @@ margin: 0px; } - .creator .wrapper + .creator .wrapper { - position:relative; - top:5px; + position:relative; + top:5px; } .creator .wrapper .bd - { - - background:#FFFFFF; - } + { + background:#FFFFFF; + } .creator .header, .footer @@ -1532,81 +1526,76 @@ .creator .header .qtref span { - background:none; - } - + background:none; + } - - .creator .footer + .creator .footer { - border-top:1px solid #E5E5E5; + border-top:1px solid #E5E5E5; height: 50px; - margin:0px; - padding:10px; + margin:0px; + padding:10px; } - - .creator .footer p - { - text-align:justify; - max-width:900px; - } - - .creator .wrap + + .creator .footer p { + text-align:justify; + max-width:900px; + } + .creator .wrap + { padding:0 5px 0 5px; - margin: 0px; + margin: 0px; } .creator .wrap .toolbar { - - - border-bottom:1px solid #E5E5E5; - /*width:100%;*/ - margin-left:-5px; - margin-right:-5px; - } + border-bottom:1px solid #E5E5E5; + /*width:100%;*/ + margin-left:-5px; + margin-right:-5px; + } .creator .wrap .breadcrumb ul li a { /* color: #363534;*/ color: #00732F; - } - + } + .creator .wrap .content { padding: 0px; - word-wrap:break-word; + word-wrap:break-word; } - - .creator .wrap .content ol li { - background:none; - font: inherit; + + .creator .wrap .content ol li { + background:none; + font: inherit; padding-left: 0px; - } - - .creator .wrap .content .descr ol li { - margin-left: 45px; + } + .creator .wrap .content .descr ol li { + margin-left: 45px; } + .creator .content .alignedsummary { margin: 5px; - width:100%; - } - .creator .generic{ - max-width:75%; - } - .creator .generic td{ - /*padding:0;*/ - } + width:100%; + } + .creator .generic{ + max-width:75%; + } + .creator .generic td{ + /*padding:0;*/ + } .creator .indexboxbar { - border-bottom:1px solid #E5E5E5; + border-bottom:1px solid #E5E5E5; margin-bottom: 25px; - background: none; + background: none; } - - + + .creator .header { @@ -1616,17 +1605,9 @@ background-color: #ffffff; padding: 10px 0 5px 0; overflow: visible; - border-bottom: solid #E5E5E5 1px; - z-index:1; - - - - - - - - - /* position:fixed;*/ + border-bottom: solid #E5E5E5 1px; + z-index:1; + /* position:fixed;*/ } @@ -1645,17 +1626,17 @@ .creator .header .qtref:visited { color: #00732F; - } + } .creator .header .qtref:hover { color: #00732F; - text-decoration:none; - } + text-decoration:none; + } .creator .header .qtref span { background-image: none; text-indent: 0; - text-decoration:none; + text-decoration:none; } @@ -1666,7 +1647,7 @@ .creator .wrap .toolbar { display:block; - padding-top:0px; + padding-top:0px; } @@ -1682,80 +1663,80 @@ .creator .wrap .breadcrumb ul li.last a { /*color: #363534;*/ } - - .creator #narrowmenu ul - { - border-bottom:solid 1px #E5E5E5; - border-left:solid 1px #E5E5E5; - border-right:solid 1px #E5E5E5; - } + + .creator #narrowmenu ul + { + border-bottom:solid 1px #E5E5E5; + border-left:solid 1px #E5E5E5; + border-right:solid 1px #E5E5E5; + } .creator #narrowmenu li ul { margin-top:-15px; - } + } + + .creator .toc { + margin:10px 20px 10px 10px; + } - .creator .toc { - margin:10px 20px 10px 10px; - } - - .creator #narrowsearch, .creator #narrowmenu{ - display:none; - } + .creator #narrowsearch, .creator #narrowmenu{ + display:none; + } /* end of creator spec*/ - - .item { - float: left; - position: relative; - width: 100%; - overflow: hidden; - } - - - .item .primary { - margin-right: 220px; - position: relative; - } - - .item hr { - margin-left: -220px; - } - - .item .secondary { - float: right; - width: 200px; - position: relative; - } - - .item .cols { - clear: both; - display: block; - } - - .item .cols .col { - float: left; - margin-left: 1.5%; - } - - .item .cols .col.first { - margin-left: 0; - } - - .item .cols.two .col { - width: 45%; - } - - .item .box { - margin: 0 0 10px 0; - } - - .item .box h3 { - margin: 0 0 10px 0; - } - - .cols.unclear { - clear:none; - } + + .item { + float: left; + position: relative; + width: 100%; + overflow: hidden; + } + + + .item .primary { + margin-right: 220px; + position: relative; + } + + .item hr { + margin-left: -220px; + } + + .item .secondary { + float: right; + width: 200px; + position: relative; + } + + .item .cols { + clear: both; + display: block; + } + + .item .cols .col { + float: left; + margin-left: 1.5%; + } + + .item .cols .col.first { + margin-left: 0; + } + + .item .cols.two .col { + width: 45%; + } + + .item .box { + margin: 0 0 10px 0; + } + + .item .box h3 { + margin: 0 0 10px 0; + } + + .cols.unclear { + clear:none; + } } /* end of screen media */ @@ -1773,8 +1754,7 @@ { background: none; display: block; - width: 100%; margin: 0; float: none; - + width: 100%; margin: 0; float: none; } } /* end of print media */ diff --git a/tools/qdoc3/test/qt-html-default-styles.qdocconf b/tools/qdoc3/test/qt-html-default-styles.qdocconf index c9c02ea..623e4a9 100644 --- a/tools/qdoc3/test/qt-html-default-styles.qdocconf +++ b/tools/qdoc3/test/qt-html-default-styles.qdocconf @@ -19,7 +19,7 @@ extraimages.HTML = qt-logo.png \ bullet_up.png \ horBar.png \ sprites-combined.png - + # Include the style sheets and scripts used. HTML.headerstyles = \ -- cgit v0.12 From 26e9a288886978a8f38e9385d8d6011fdbfbebe7 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 17 Dec 2010 20:38:39 +0100 Subject: Doc: Fixed broken links. --- doc/src/development/developing-with-qt.qdoc | 8 +++----- doc/src/index.qdoc | 10 +++++----- doc/src/overviews.qdoc | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/doc/src/development/developing-with-qt.qdoc b/doc/src/development/developing-with-qt.qdoc index 6793abd..72073e8 100644 --- a/doc/src/development/developing-with-qt.qdoc +++ b/doc/src/development/developing-with-qt.qdoc @@ -28,7 +28,7 @@ /*! \page developing-with-qt.html - \title Cross-platform & Platform-specific Development + \title Cross-Platform and Platform-Specific Development Qt allows you to write advanced applications and UIs once, and deploy them across desktop and embedded operating systems without rewriting the source code. The top section of this page provides an overview of the tools and @@ -37,7 +37,7 @@ links to documents that describe platform-specific features provided by Qt, and discuss issues related to particular platforms and environments. - \section1 Cross-platform Development with Qt + \section1 Cross-Platform Development with Qt Qt is provided with a set of build tools to help developers automate the process of building and installing Qt applications. @@ -68,7 +68,7 @@ \endlist \endtable - \section1 Platform-specific Development with Qt + \section1 Platform-Specific Development with Qt These documents describe platform-specific features provided by Qt, and discuss issues related to particular platforms and environments. @@ -110,6 +110,4 @@ \o Collections of notes about Qt implementations on different window systems. \endlist \endtable - - */ diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index aefbea1..4aec230 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -72,11 +72,11 @@ \enddiv \div {sectionlist tricol} \list - \o \l{qt-basic-concepts.html}{Programming with Qt} - \o \l{qt-gui-concepts.html}{UI Design with Qt} - \o \l{developing-with-qt.html}{Cross-platform and Platform-specific} - \o \l{technology-apis.html}{Qt and Key Technologies} - \o \l{best-practices.html}{Best Practices Guides} + \o \l{Programming with Qt} + \o \l{UI Design with Qt} + \o \l{Cross-Platform and Platform-Specific Development} + \o \l{Qt and Key Technologies} + \o \l{Best Practice Guides} \endlist \enddiv \div {sectionlist} diff --git a/doc/src/overviews.qdoc b/doc/src/overviews.qdoc index b9bd3b4..a411aa2 100644 --- a/doc/src/overviews.qdoc +++ b/doc/src/overviews.qdoc @@ -122,9 +122,9 @@ /*! \group best-practices - \title Best Practices Guides + \title Best Practice Guides - \brief How-To Guides and Best Practices + \brief How-To and Best Practice Guides These documents provide guidelines and best practices for using Qt to solve specific technical problems. They are listed -- cgit v0.12 From 144ea56ae4c76cba0e89dc78356df2cac3783ef5 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 17 Dec 2010 20:40:45 +0100 Subject: Doc: Fixed whitespace. --- doc/src/template/style/style.css | 75 ++++++++-------------------------------- 1 file changed, 14 insertions(+), 61 deletions(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 4f9e26c..451d6bf 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -2,7 +2,7 @@ { /* basic elements */ - html + html { color: #000000; background: #FFFFFF; @@ -210,8 +210,6 @@ { color: black } - - /* end basic elements */ /* font style elements */ @@ -255,8 +253,8 @@ clear: both; visibility: hidden; } - /* end global settings*/ + /* header elements */ .header { @@ -341,7 +339,6 @@ background-position: -2px -117px; } - #nav-topright li.nav-topright-dev a { width: 30px; @@ -416,7 +413,6 @@ overflow: hidden; } - .shortCut-topleft-inactive { padding-left: 3px; @@ -460,10 +456,8 @@ { color: #44a51c; } - - - /* end header elements */ + /* content and sidebar elements */ .wrapper { @@ -477,9 +471,6 @@ overflow: hidden; } - - - .wrapper .hd span { height: 15px; @@ -493,9 +484,6 @@ position: relative; } - - - .wrapper .ft { padding-left: 216px; @@ -504,9 +492,6 @@ overflow: hidden; } - - - .wrapper .ft span { height: 15px; @@ -519,10 +504,8 @@ display:block; padding-right:15px; } - - - /* end content and sidebar elements */ + /* sidebar elements */ .sidebar { @@ -532,11 +515,6 @@ font-size: 11px; } - - - - - .sidebar .searchlabel { padding: 0 0 2px 17px; @@ -766,8 +744,8 @@ } .floatingResult:hover{ } - /* end sidebar elements */ + /* content elements */ .wrap { @@ -775,9 +753,6 @@ overflow: visible; } - - - .wrap .toolbar { background-color: #fafafa; @@ -864,7 +839,6 @@ color: #00732F; } - .wrap .content { padding: 30px; @@ -897,9 +871,6 @@ margin-left: 0; } - - - .wrap .content ol li { background:none; font:normal 10pt/1.2 Verdana; @@ -1304,11 +1275,10 @@ .functionIndex a{ display:inline-block; } - /* end content elements */ -/* footer elements */ - .footer +/* footer elements */ + .footer { min-height: 100px; color: #797775; @@ -1318,15 +1288,12 @@ background-color: #E6E7E8; margin: 0; } - .small + .small { font: normal 9px/1 Verdana; } /* end footer elements */ - - - /* start index box */ .indexbox { @@ -1356,8 +1323,7 @@ _width:42%; padding:0 2% 0 1%; vertical-align:top; - -} + } .indexboxcont .indexIcon { @@ -1365,12 +1331,11 @@ *width:18%; _width:18%; overflow:hidden; + } -} - -.indexboxcont .section { - float: left; -} + .indexboxcont .section { + float: left; + } .indexboxcont .section p { @@ -1511,7 +1476,7 @@ } - .creator .header, .footer + .creator .header, .footer { display: block; clear: both; @@ -1595,8 +1560,6 @@ background: none; } - - .creator .header { width: 100%; @@ -1610,7 +1573,6 @@ /* position:fixed;*/ } - .creator .header .content { } @@ -1639,19 +1601,12 @@ text-decoration:none; } - - - - - .creator .wrap .toolbar { display:block; padding-top:0px; } - - .creator .wrap .breadcrumb ul li { font-weight: normal; } @@ -1675,7 +1630,6 @@ margin-top:-15px; } - .creator .toc { margin:10px 20px 10px 10px; } @@ -1692,7 +1646,6 @@ overflow: hidden; } - .item .primary { margin-right: 220px; position: relative; -- cgit v0.12 From ca56f3a1797d735048fcb8b1e2b4aede75db8f89 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 17 Dec 2010 20:45:08 +0100 Subject: Updated the offline template to use a new offline style sheet. --- doc/src/template/style/offline.css | 662 +++++++++++++++++++++++ tools/qdoc3/test/qt-html-default-styles.qdocconf | 6 +- tools/qdoc3/test/qt-html-templates.qdocconf | 21 +- 3 files changed, 672 insertions(+), 17 deletions(-) create mode 100644 doc/src/template/style/offline.css diff --git a/doc/src/template/style/offline.css b/doc/src/template/style/offline.css new file mode 100644 index 0000000..4a10d0a --- /dev/null +++ b/doc/src/template/style/offline.css @@ -0,0 +1,662 @@ +@media screen +{ + +/* basic elements */ + html + { + color: #000000; + background: #FFFFFF; + } + table + { + border-collapse: collapse; + border-spacing: 0; + } + fieldset, img + { + border: 0; + max-width:100%; + } + address, caption, cite, code, dfn, em, strong, th, var, optgroup + { + font-style: inherit; + font-weight: inherit; + } + del, ins + { + text-decoration: none; + } + li + { + list-style: none; + } + ol li + { + list-style: decimal; + } + caption, th + { + text-align: left; + } + h1, h2, h3, h4, h5, h6 + { + font-size: 100%; + } + q:before, q:after + { + content: ''; + } + abbr, acronym + { + border: 0; + font-variant: normal; + } + sup, sub + { + vertical-align: baseline; + } + tt, .qmlreadonly span, .qmldefault span + { + word-spacing:0.5em; + } + legend + { + color: #000000; + } + strong + { + font-weight: bold; + } + em + { + font-style: italic; + } + + /* adding Qt theme */ + body + { + margin-left: 0.5em; + margin-right: 0.5em + } + a + { + color: #00732F; + text-decoration: none; + } + hr + { + background-color: #E6E6E6; + border: 1px solid #E6E6E6; + height: 1px; + width: 100%; + text-align: left; + margin: 1.5em 0 1.5em 0; + } + + pre + { + border: 1px solid #DDDDDD; + -moz-border-radius: 0.7em 0.7em 0.7em 0.7em; + -webkit-border-radius: 0.7em 0.7em 0.7em 0.7em; + border-radius: 0.7em 0.7em 0.7em 0.7em; + margin: 0 1.5em 1em 1em; + padding: 1em 1em 1em 1em; + overflow-x: auto; + } + table, pre + { + -moz-border-radius: 0.7em 0.7em 0.7em 0.7em; + -webkit-border-radius: 0.7em 0.7em 0.7em 0.7em; + border-radius: 0.7em 0.7em 0.7em 0.7em; + background-color: #F6F6F6; + border: 1px solid #E6E6E6; + border-collapse: separate; + font-size: 110%; + margin-bottom: 2.5em; + } + pre { + font-size: 90%; + display: block; + overflow:hidden; + } + thead + { + margin-top: 0.5em; + font-weight: bold + } + th + { + padding: 0.5em 1.5em 0.5em 1.5em; + background-color: #E1E1E1; + border-left: 1px solid #E6E6E6; + } + td + { + padding: 0.25em 1.5em 0.25em 2em; + } + + td.rightAlign + { + padding: 0.25em 0.5em 0.25em 1em; + } + table tr.odd + { + border-left: 1px solid #E6E6E6; + background-color: #F6F6F6; + color: #66666E; + } + table tr.even + { + border-left: 1px solid #E6E6E6; + background-color: #ffffff; + color: #66666E; + } + + div.float-left + { + float: left; margin-right: 2em + } + div.float-right + { + float: right; margin-left: 2em + } + + span.comment + { + color: #008B00; + } + span.string, span.char + { + color: #000084; + } + span.number + { + color: #a46200; + } + span.operator + { + color: black; + } + span.keyword + { + color: #840000; + } + span.name + { + color: black + } +/* end basic elements */ + +/* font style elements */ + .heading + { + font-weight: bold; + font-size: 160%; + } + .subtitle + { + font-size: 130% + } + .small-subtitle + { + font-size: 130% + } + .red + { + color:red; + } +/* end font style elements */ + +/* global settings*/ + .header, .footer + { + display: block; + clear: both; + overflow: hidden; + } +/* end global settings*/ + +/* header elements */ + .header .qtref + { + color: #00732F; + font-weight: bold; + font-size: 180%; + } + + .header .content + { + margin-bottom: 0.5em + } + + .naviNextPrevious + { + display: none + } + .header .breadcrumb + { + font-size: 90%; + padding: 0.5em 0 0.5em 1em; + margin: 0; + background-color: #fafafa; + height: 1.35em; + border-bottom: 1px solid #d1d1d1; + } + + .header .breadcrumb ul + { + margin: 0; + padding: 0; + } + + .header .content + { + word-wrap: break-word; + } + + .header .breadcrumb ul li + { + float: left; + background: url(../images/breadcrumb.png) no-repeat 0 3px; + padding-left: 1.5em; + margin-left: 1.5em; + } + + .header .breadcrumb ul li.last + { + font-weight: normal; + } + + .header .breadcrumb ul li a + { + color: #00732F; + } + + .header .breadcrumb ul li.first + { + background-image: none; + padding-left: 0; + margin-left: 0; + } + + .header .content ol li { + background: none; + margin-bottom: 1.0em; + margin-left: 1.2em; + padding-left: 0 + } + + .header .content li + { + background: url(../images/bullet_sq.png) no-repeat 0 5px; + margin-bottom: 1em; + padding-left: 1.2em; + } + +/* end header elements */ + +/* content elements */ + .content h1 + { + font-weight: bold; + font-size: 180% + } + + .content h2 + { + font-weight: bold; + font-size: 160%; + width: 100%; + } + .content h3 + { + font-weight: bold; + font-size: 1.4em; + width: 100%; + } + .content table p + { + margin: 0 + } + .content ul + { + padding-left: 2.5em; + } + .content li + { + padding-top: 0.25em; + padding-bottom: 0.25em; + } + .content ul img { + vertical-align: middle; + } + + .content a:visited + { + color: #4c0033; + text-decoration: none; + } + + .content a:visited:hover + { + color: #4c0033; + text-decoration: underline; + } + + a:hover + { + color: #4c0033; + text-decoration: underline; + } + descr p a + { + text-decoration: underline; + } + + .descr p a:visited + { + text-decoration: underline; + } + + .alphaChar{ + width:95%; + background-color:#F6F6F6; + border:1px solid #E6E6E6; + -moz-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; + -webkit-border-radius: 7px 7px 7px 7px; + font-size:12pt; + padding-left:10px; + margin-top:10px; + margin-bottom:10px; + } + .flowList{ + /*vertical-align:top;*/ + /*margin:20px auto;*/ + + column-count:3; + -webkit-column-count:3; + -moz-column-count:3; +/* + column-width:100%; + -webkit-column-width:200px; + -col-column-width:200px; +*/ + column-gap:41px; + -webkit-column-gap:41px; + -moz-column-gap:41px; + + column-rule: 1px dashed #ccc; + -webkit-column-rule: 1px dashed #ccc; + -moz-column-rule: 1px dashed #ccc; + } + + .flowList dl{ + } + .flowList dd{ + /*display:inline-block;*/ + margin-left:10px; + min-width:250px; + line-height: 1.5; + min-width:100%; + min-height:15px; + } + + .flowList dd a{ + } + + .content .flowList p{ + padding:0px; + } + + .content .alignedsummary + { + margin: 15px; + } + + + .qmltype + { + text-align: center; + font-size: 160%; + } + .qmlreadonly + { + padding-left: 5px; + float: right; + color: #254117; + } + + .qmldefault + { + padding-left: 5px; + float: right; + color: red; + } + + .qmldoc + { + } + + .generic .alphaChar{ + margin-top:5px; + } + + .generic .odd .alphaChar{ + background-color: #F6F6F6; + } + + .generic .even .alphaChar{ + background-color: #FFFFFF; + } + + .memItemRight{ + padding: 0.25em 1.5em 0.25em 0; + } + .highlightedCode + { + margin: 1.0em; + } + .annotated td { + padding: 0.25em 0.5em 0.25em 0.5em; + } + + .header .content .toc ul + { + padding-left: 0px; + } + + .content .toc h3 { + border-bottom: 0px; + margin-top: 0px; + } + + .content .toc h3 a:hover { + color: #00732F; + text-decoration: none; + } + + .content .toc .level2 + { + margin-left: 1.5em; + } + + .content .toc .level3 + { + margin-left: 3.0em; + } + + .content ul li + { + background: url(../images/bullet_sq.png) no-repeat 0 0.7em; + padding-left: 1em + } + + .content .toc li + { + background: url(../images/bullet_dn.png) no-repeat 0 5px; + padding-left: 1em + } + + .relpage + { + -moz-border-radius: 7px 7px 7px 7px; + -webkit-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; + border: 1px solid #DDDDDD; + padding: 25px 25px; + clear: both; + } + .relpage ul + { + float: none; + padding: 1.5em; + } + + h3.fn, span.fn + { + -moz-border-radius:7px 7px 7px 7px; + -webkit-border-radius:7px 7px 7px 7px; + border-radius:7px 7px 7px 7px; + background-color: #F6F6F6; + border-width: 1px; + border-style: solid; + border-color: #E6E6E6; + font-weight: bold; + word-spacing:3px; + padding:3px 5px; + } + + .functionIndex { + font-size:12pt; + word-spacing:10px; + margin-bottom:10px; + background-color: #F6F6F6; + border-width: 1px; + border-style: solid; + border-color: #E6E6E6; + -moz-border-radius: 7px 7px 7px 7px; + -webkit-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; + width:100%; + } + + .centerAlign + { + text-align:center; + } + + .rightAlign + { + text-align:right; + } + + .leftAlign + { + text-align:left; + } + + .topAlign{ + vertical-align:top + } + + .functionIndex a{ + display:inline-block; + } + +/* end content elements */ +/* footer elements */ + + .footer + { + color: #393735; + font-size: 0.75em; + text-align: center; + padding-top: 1.5em; + padding-bottom: 1em; + background-color: #E6E7E8; + margin: 0; + } + .footer p + { + margin: 0.25em + } + .small + { + font-size: 0.75em; + } +/* end footer elements */ + + .item { + float: left; + position: relative; + width: 100%; + overflow: hidden; + } + + + .item .primary { + margin-right: 220px; + position: relative; + } + + .item hr { + margin-left: -220px; + } + + .item .secondary { + float: right; + width: 200px; + position: relative; + } + + .item .cols { + clear: both; + display: block; + } + + .item .cols .col { + float: left; + margin-left: 1.5%; + } + + .item .cols .col.first { + margin-left: 0; + } + + .item .cols.two .col { + width: 45%; + } + + .item .box { + margin: 0 0 10px 0; + } + + .item .box h3 { + margin: 0 0 10px 0; + } + + .cols.unclear { + clear:none; + } +} + +/* end of screen media */ + +/* start of print media */ + +@media print +{ + input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft, #feedbackBox, #blurpage, .toc, .breadcrumb, .toolbar, .floatingResult + { + display: none; + background: none; + } + .content + { + background: none; + display: block; + width: 100%; margin: 0; float: none; + } +} +/* end of print media */ diff --git a/tools/qdoc3/test/qt-html-default-styles.qdocconf b/tools/qdoc3/test/qt-html-default-styles.qdocconf index 623e4a9..d37ef5d 100644 --- a/tools/qdoc3/test/qt-html-default-styles.qdocconf +++ b/tools/qdoc3/test/qt-html-default-styles.qdocconf @@ -4,7 +4,7 @@ HTML.templatedir = $QT_SOURCE_TREE/doc/src/template -HTML.stylesheets = style/style.css +HTML.stylesheets = style/offline.css HTML.scripts = @@ -23,10 +23,10 @@ extraimages.HTML = qt-logo.png \ # Include the style sheets and scripts used. HTML.headerstyles = \ - " \n" + " \n" HTML.headerscripts = HTML.endheader = \ "\n" \ - "\n" + "\n" diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 8241fa0..12588f9 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -1,26 +1,19 @@ include(qt-html-default-styles.qdocconf) HTML.postheader = \ - "
    \n" \ + "
    \n" \ "
    \n" \ - "
    \n" \ - " Home\n" \ - "
    \n" \ " Qt Reference Documentation\n" \ "
    \n" \ - "
    \n" \ - "
    \n" \ - "
    \n" \ - "
      \n" \ - "
    • Home
    • \n" \ - " \n" + "
      \n" \ + "
        \n" \ + "
      • Home
      • \n" \ + " \n" HTML.postpostheader = \ - "
      \n" \ - "
      \n" \ - "
    \n" \ + " \n" \ "
    \n" \ - "
    \n" \ + "
    \n" \ "
    \n" HTML.footer = \ -- cgit v0.12 From 02c548c7a38c627b12e84ff164a406cc478f8658 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 17 Dec 2010 20:46:11 +0100 Subject: Removed obsolete configuration options. --- tools/qdoc3/htmlgenerator.cpp | 6 ------ tools/qdoc3/htmlgenerator.h | 4 ---- 2 files changed, 10 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 948a7d6..ebc2713 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -270,12 +270,6 @@ void HtmlGenerator::initializeGenerator(const Config &config) postPostHeader = config.getString(HtmlGenerator::format() + Config::dot + HTMLGENERATOR_POSTPOSTHEADER); - creatorPostHeader = config.getString(HtmlGenerator::format() + - Config::dot + - HTMLGENERATOR_CREATORPOSTHEADER); - creatorPostPostHeader = config.getString(HtmlGenerator::format() + - Config::dot + - HTMLGENERATOR_CREATORPOSTPOSTHEADER); footer = config.getString(HtmlGenerator::format() + Config::dot + HTMLGENERATOR_FOOTER); diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 8b5c50b..f5d2427 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -269,8 +269,6 @@ class HtmlGenerator : public PageGenerator QString endHeader; QString postHeader; QString postPostHeader; - QString creatorPostHeader; - QString creatorPostPostHeader; QString footer; QString address; bool pleaseGenerateMacRef; @@ -309,8 +307,6 @@ class HtmlGenerator : public PageGenerator #define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me #define HTMLGENERATOR_POSTHEADER "postheader" #define HTMLGENERATOR_POSTPOSTHEADER "postpostheader" -#define HTMLGENERATOR_CREATORPOSTHEADER "postheader" -#define HTMLGENERATOR_CREATORPOSTPOSTHEADER "postpostheader" QT_END_NAMESPACE -- cgit v0.12 From 3fe6eab1e6e451457b9c060b6b643b86d3f82557 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Mon, 20 Dec 2010 12:07:22 +1000 Subject: Fix spelling in declarative autotests Task-number: Reviewed-by: Martin Jones --- .../qdeclarativeecmascript/data/nonExistantAttachedObject.qml | 5 ----- .../qdeclarativeecmascript/data/nonExistentAttachedObject.qml | 5 +++++ .../qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 8 ++++---- .../qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp | 2 +- .../declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/nonExistantAttachedObject.qml create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nonExistantAttachedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nonExistantAttachedObject.qml deleted file mode 100644 index f9585db..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/nonExistantAttachedObject.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - stringProperty: MyQmlContainer.prop -} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml new file mode 100644 index 0000000..f9585db --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + stringProperty: MyQmlContainer.prop +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 77fab91..4228bc4 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -105,7 +105,7 @@ private slots: void constantsOverrideBindings(); void outerBindingOverridesInnerBinding(); void aliasPropertyAndBinding(); - void nonExistantAttachedObject(); + void nonExistentAttachedObject(); void scope(); void signalParameterTypes(); void objectsCompareAsEqual(); @@ -643,7 +643,7 @@ void tst_qdeclarativeecmascript::attachedProperties() void tst_qdeclarativeecmascript::enums() { - // Existant enums + // Existent enums { QDeclarativeComponent component(&engine, TEST_FILE("enums.1.qml")); QObject *object = component.create(); @@ -785,9 +785,9 @@ Access a non-existent attached object. Tests for a regression where this used to crash. */ -void tst_qdeclarativeecmascript::nonExistantAttachedObject() +void tst_qdeclarativeecmascript::nonExistentAttachedObject() { - QDeclarativeComponent component(&engine, TEST_FILE("nonExistantAttachedObject.qml")); + QDeclarativeComponent component(&engine, TEST_FILE("nonExistentAttachedObject.qml")); QString warning = component.url().toString() + ":4: Unable to assign [undefined] to QString stringProperty"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); diff --git a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp index 4470d65..304ce61 100644 --- a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp +++ b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp @@ -512,7 +512,7 @@ void tst_qdeclarativeinstruction::dump() { QDeclarativeInstruction i; i.line = 50; - i.type = (QDeclarativeInstruction::Type)(1234); // Non-existant + i.type = (QDeclarativeInstruction::Type)(1234); // Non-existent data->bytecode << i; } diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 50463b7..6410853 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -947,7 +947,7 @@ void tst_qdeclarativelanguage::aliasProperties() object->setProperty("value", QVariant(13)); QCOMPARE(object->property("valueAlias").toInt(), 13); - // Write throught alias + // Write through alias object->setProperty("valueAlias", QVariant(19)); QCOMPARE(object->property("valueAlias").toInt(), 19); QCOMPARE(object->property("value").toInt(), 19); @@ -1109,7 +1109,7 @@ void tst_qdeclarativelanguage::aliasProperties() object->setProperty("rectProperty", QVariant(QRect(33, 12, 99, 100))); QCOMPARE(object->property("valueAlias").toRect(), QRect(33, 12, 99, 100)); - // Write throught alias + // Write through alias object->setProperty("valueAlias", QVariant(QRect(3, 3, 4, 9))); QCOMPARE(object->property("valueAlias").toRect(), QRect(3, 3, 4, 9)); QCOMPARE(object->property("rectProperty").toRect(), QRect(3, 3, 4, 9)); @@ -1129,7 +1129,7 @@ void tst_qdeclarativelanguage::aliasProperties() object->setProperty("rectProperty", QVariant(QRect(33, 8, 102, 111))); QCOMPARE(object->property("aliasProperty").toInt(), 33); - // Write throught alias + // Write through alias object->setProperty("aliasProperty", QVariant(4)); QCOMPARE(object->property("aliasProperty").toInt(), 4); QCOMPARE(object->property("rectProperty").toRect(), QRect(4, 8, 102, 111)); -- cgit v0.12 From ee4a2417950dc9b411660fa229908619eff956a2 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 20 Dec 2010 15:42:52 +1000 Subject: Add copyright header --- .../touchinteraction/pincharea/flickresize.qml | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/examples/declarative/touchinteraction/pincharea/flickresize.qml b/examples/declarative/touchinteraction/pincharea/flickresize.qml index 8034e29..8f29d6d 100644 --- a/examples/declarative/touchinteraction/pincharea/flickresize.qml +++ b/examples/declarative/touchinteraction/pincharea/flickresize.qml @@ -1,3 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + import QtQuick 1.1 Rectangle { -- cgit v0.12 From 6b37f71b318445a338c4afe5ba8a5ccaff573518 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Mon, 20 Dec 2010 17:04:41 +1000 Subject: Update Minehunt demo warning message The message was talking about a C++ plugin when the demo is nowadays in a form of a standalone executable. Task-number: Reviewed-by: Bea Lam --- demos/declarative/minehunt/minehunt.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml index eb67b06..88ecd6d 100644 --- a/demos/declarative/minehunt/minehunt.qml +++ b/demos/declarative/minehunt/minehunt.qml @@ -104,7 +104,7 @@ Item { anchors.centerIn: parent; width: parent.width - 20 horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap - text: "Minehunt will not run properly if the C++ plugin is not compiled.\n\nPlease see README." + text: "Minehunt demo has to be compiled to run.\n\nPlease see README." color: "white"; font.bold: true; font.pixelSize: 14 visible: tiles == undefined } -- cgit v0.12 From d491aee7887331e6b1207e647f4d2ee3f43efacd Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 20 Dec 2010 10:41:18 +0100 Subject: Added BSD license to snippet code. --- doc/src/snippets/declarative/focus/focusColumn.qml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/doc/src/snippets/declarative/focus/focusColumn.qml b/doc/src/snippets/declarative/focus/focusColumn.qml index eb59309..9b761dd 100644 --- a/doc/src/snippets/declarative/focus/focusColumn.qml +++ b/doc/src/snippets/declarative/focus/focusColumn.qml @@ -1,3 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ import QtQuick 1.0 Rectangle { -- cgit v0.12 From 382b359f2c014d8ce353845579508a8c54410c7f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 20 Dec 2010 16:08:57 +0100 Subject: Fixed handling of indented snippet markers. Refactored the code to remove namespace macros and snippet markers. --- tools/qdoc3/quoter.cpp | 56 +++++++++++++++++++++++--------------------------- tools/qdoc3/quoter.h | 1 + 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/tools/qdoc3/quoter.cpp b/tools/qdoc3/quoter.cpp index 84c6fb1..8e08e9a 100644 --- a/tools/qdoc3/quoter.cpp +++ b/tools/qdoc3/quoter.cpp @@ -248,21 +248,8 @@ QString Quoter::quoteSnippet(const Location &docLocation, const QString &identif } return t; } - // Remove special macros to support Qt namespacing. - if (line.startsWith("QT_BEGIN_NAMESPACE")) { - getLine(); - } else if (line.startsWith("QT_END_NAMESPACE")) { - getLine(); - t += QLatin1Char('\n'); - } else if (!line.startsWith(comment)) { - // Ordinary code - t += getLine(); - } else { - // Normal comments - if (line.contains(QLatin1Char('\n'))) - t += QLatin1Char('\n'); - getLine(); - } + + t += removeSpecialLines(line, comment); } failedAtEnd(docLocation, QString("snippet (%1)").arg(delimiter)); return t; @@ -277,21 +264,7 @@ QString Quoter::quoteTo( const Location& docLocation, const QString& command, if ( pattern.isEmpty() ) { while ( !plainLines.isEmpty() ) { QString line = plainLines.first(); - // Remove special macros to support Qt namespacing. - if (line.startsWith("QT_BEGIN_NAMESPACE")) { - getLine(); - } else if (line.startsWith("QT_END_NAMESPACE")) { - getLine(); - t += QLatin1Char('\n'); - } else if (!line.startsWith(comment)) - // Ordinary code - t += getLine(); - else { - // Normal comments - if (line.contains(QLatin1Char('\n'))) - t += QLatin1Char('\n'); - getLine(); - } + t += removeSpecialLines(line, comment); } } else { while ( !plainLines.isEmpty() ) { @@ -369,4 +342,27 @@ QString Quoter::commentForCode() const return commentHash.value(suffix, "//!"); } +QString Quoter::removeSpecialLines(const QString &line, const QString &comment) +{ + QString t; + + // Remove special macros to support Qt namespacing. + QString trimmed = line.trimmed(); + if (trimmed.startsWith("QT_BEGIN_NAMESPACE")) { + getLine(); + } else if (trimmed.startsWith("QT_END_NAMESPACE")) { + getLine(); + t += QLatin1Char('\n'); + } else if (!trimmed.startsWith(comment)) { + // Ordinary code + t += getLine(); + } else { + // Comments + if (line.contains(QLatin1Char('\n'))) + t += QLatin1Char('\n'); + getLine(); + } + return t; +} + QT_END_NAMESPACE diff --git a/tools/qdoc3/quoter.h b/tools/qdoc3/quoter.h index d984194..e1728d1 100644 --- a/tools/qdoc3/quoter.h +++ b/tools/qdoc3/quoter.h @@ -75,6 +75,7 @@ private: bool match( const Location& docLocation, const QString& pattern, const QString& line ); QString commentForCode() const; + QString removeSpecialLines(const QString &line, const QString &comment); bool silent; bool validRegExp; -- cgit v0.12 From 1476bf8d45b4f1ab6c56770939eb81c4c1b390ad Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 20 Dec 2010 14:29:19 +1000 Subject: Optimize name lookup for QDeclarativeProperty. If the property is constructed by passing in the property name (and we've verified that it is valid), we can cache that name immediately rather than reconstructing it on the first call to name(). Task-number: QTBUG-15331 Reviewed-by: Martin Jones --- src/declarative/qml/qdeclarativeproperty.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index 60edd64..8eaa98b 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -315,6 +315,8 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name if (property && !(property->flags & QDeclarativePropertyCache::Data::IsFunction)) { object = currentObject; core = *property; + nameCache = terminal; + isNameCached = true; } } -- cgit v0.12 From a764a0b5d66e13fb69a5b69330c5edfecf89ee8b Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 21 Dec 2010 08:53:00 +1000 Subject: Optimize QByteArray to QString conversion in PropertyChanges. Perform the conversion once at compile time, rather than many times later. Task-number: QTBUG-15331 Reviewed-by: Martin Jones --- .../util/qdeclarativepropertychanges.cpp | 72 +++++++++++----------- .../util/qdeclarativepropertychanges_p.h | 18 +++--- src/declarative/util/qdeclarativestate.cpp | 24 ++++---- src/declarative/util/qdeclarativestate_p.h | 12 ++-- 4 files changed, 62 insertions(+), 64 deletions(-) diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index 400803e..6737382 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -220,12 +220,12 @@ public: void decode(); - QList > properties; - QList > expressions; + QList > properties; + QList > expressions; QList ids; QList signalReplacements; - QDeclarativeProperty property(const QByteArray &); + QDeclarativeProperty property(const QString &); }; void @@ -293,7 +293,7 @@ QDeclarativePropertyChangesParser::compile(const QList> count; for (int ii = 0; ii < count; ++ii) { - QByteArray name; + QString name; bool isScript; QVariant data; QDeclarativeBinding::Identifier id; @@ -405,15 +405,15 @@ void QDeclarativePropertyChanges::setRestoreEntryValues(bool v) } QDeclarativeProperty -QDeclarativePropertyChangesPrivate::property(const QByteArray &property) +QDeclarativePropertyChangesPrivate::property(const QString &property) { Q_Q(QDeclarativePropertyChanges); - QDeclarativeProperty prop(object, QString::fromUtf8(property), qmlContext(q)); + QDeclarativeProperty prop(object, property, qmlContext(q)); if (!prop.isValid()) { - qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(property)); + qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(property); return QDeclarativeProperty(); } else if (!(prop.type() & QDeclarativeProperty::SignalProperty) && !prop.isWritable()) { - qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(QString::fromUtf8(property)); + qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(property); return QDeclarativeProperty(); } return prop; @@ -429,9 +429,7 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() for (int ii = 0; ii < d->properties.count(); ++ii) { - QByteArray property = d->properties.at(ii).first; - - QDeclarativeAction a(d->object, QString::fromUtf8(property), + QDeclarativeAction a(d->object, d->properties.at(ii).first, qmlContext(this), d->properties.at(ii).second); if (a.property.isValid()) { @@ -453,7 +451,7 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() for (int ii = 0; ii < d->expressions.count(); ++ii) { - QByteArray property = d->expressions.at(ii).first; + const QString &property = d->expressions.at(ii).first; QDeclarativeProperty prop = d->property(property); if (prop.isValid()) { @@ -462,7 +460,7 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() a.property = prop; a.fromValue = a.property.read(); a.specifiedObject = d->object; - a.specifiedProperty = QString::fromUtf8(property); + a.specifiedProperty = property; if (d->isExplicit) { a.toValue = d->expressions.at(ii).second->evaluate(); @@ -518,10 +516,10 @@ void QDeclarativePropertyChanges::setIsExplicit(bool e) d->isExplicit = e; } -bool QDeclarativePropertyChanges::containsValue(const QByteArray &name) const +bool QDeclarativePropertyChanges::containsValue(const QString &name) const { Q_D(const QDeclarativePropertyChanges); - typedef QPair PropertyEntry; + typedef QPair PropertyEntry; QListIterator propertyIterator(d->properties); while (propertyIterator.hasNext()) { @@ -534,10 +532,10 @@ bool QDeclarativePropertyChanges::containsValue(const QByteArray &name) const return false; } -bool QDeclarativePropertyChanges::containsExpression(const QByteArray &name) const +bool QDeclarativePropertyChanges::containsExpression(const QString &name) const { Q_D(const QDeclarativePropertyChanges); - typedef QPair ExpressionEntry; + typedef QPair ExpressionEntry; QListIterator expressionIterator(d->expressions); while (expressionIterator.hasNext()) { @@ -550,16 +548,16 @@ bool QDeclarativePropertyChanges::containsExpression(const QByteArray &name) con return false; } -bool QDeclarativePropertyChanges::containsProperty(const QByteArray &name) const +bool QDeclarativePropertyChanges::containsProperty(const QString &name) const { return containsValue(name) || containsExpression(name); } -void QDeclarativePropertyChanges::changeValue(const QByteArray &name, const QVariant &value) +void QDeclarativePropertyChanges::changeValue(const QString &name, const QVariant &value) { Q_D(QDeclarativePropertyChanges); - typedef QPair PropertyEntry; - typedef QPair ExpressionEntry; + typedef QPair PropertyEntry; + typedef QPair ExpressionEntry; QMutableListIterator expressionIterator(d->expressions); while (expressionIterator.hasNext()) { @@ -596,7 +594,7 @@ void QDeclarativePropertyChanges::changeValue(const QByteArray &name, const QVar action.property = d->property(name); action.fromValue = action.property.read(); action.specifiedObject = object(); - action.specifiedProperty = QString::fromUtf8(name); + action.specifiedProperty = name; action.toValue = value; propertyIterator.insert(PropertyEntry(name, value)); @@ -609,11 +607,11 @@ void QDeclarativePropertyChanges::changeValue(const QByteArray &name, const QVar } } -void QDeclarativePropertyChanges::changeExpression(const QByteArray &name, const QString &expression) +void QDeclarativePropertyChanges::changeExpression(const QString &name, const QString &expression) { Q_D(QDeclarativePropertyChanges); - typedef QPair PropertyEntry; - typedef QPair ExpressionEntry; + typedef QPair PropertyEntry; + typedef QPair ExpressionEntry; bool hadValue = false; @@ -667,7 +665,7 @@ void QDeclarativePropertyChanges::changeExpression(const QByteArray &name, const action.property = d->property(name); action.fromValue = action.property.read(); action.specifiedObject = object(); - action.specifiedProperty = QString::fromUtf8(name); + action.specifiedProperty = name; if (d->isExplicit) { @@ -690,11 +688,11 @@ void QDeclarativePropertyChanges::changeExpression(const QByteArray &name, const // what about the signal handler? } -QVariant QDeclarativePropertyChanges::property(const QByteArray &name) const +QVariant QDeclarativePropertyChanges::property(const QString &name) const { Q_D(const QDeclarativePropertyChanges); - typedef QPair PropertyEntry; - typedef QPair ExpressionEntry; + typedef QPair PropertyEntry; + typedef QPair ExpressionEntry; QListIterator propertyIterator(d->properties); while (propertyIterator.hasNext()) { @@ -715,11 +713,11 @@ QVariant QDeclarativePropertyChanges::property(const QByteArray &name) const return QVariant(); } -void QDeclarativePropertyChanges::removeProperty(const QByteArray &name) +void QDeclarativePropertyChanges::removeProperty(const QString &name) { Q_D(QDeclarativePropertyChanges); - typedef QPair PropertyEntry; - typedef QPair ExpressionEntry; + typedef QPair PropertyEntry; + typedef QPair ExpressionEntry; QMutableListIterator expressionIterator(d->expressions); while (expressionIterator.hasNext()) { @@ -742,10 +740,10 @@ void QDeclarativePropertyChanges::removeProperty(const QByteArray &name) } } -QVariant QDeclarativePropertyChanges::value(const QByteArray &name) const +QVariant QDeclarativePropertyChanges::value(const QString &name) const { Q_D(const QDeclarativePropertyChanges); - typedef QPair PropertyEntry; + typedef QPair PropertyEntry; QListIterator propertyIterator(d->properties); while (propertyIterator.hasNext()) { @@ -758,10 +756,10 @@ QVariant QDeclarativePropertyChanges::value(const QByteArray &name) const return QVariant(); } -QString QDeclarativePropertyChanges::expression(const QByteArray &name) const +QString QDeclarativePropertyChanges::expression(const QString &name) const { Q_D(const QDeclarativePropertyChanges); - typedef QPair ExpressionEntry; + typedef QPair ExpressionEntry; QListIterator expressionIterator(d->expressions); while (expressionIterator.hasNext()) { diff --git a/src/declarative/util/qdeclarativepropertychanges_p.h b/src/declarative/util/qdeclarativepropertychanges_p.h index 449574c..1a98cec 100644 --- a/src/declarative/util/qdeclarativepropertychanges_p.h +++ b/src/declarative/util/qdeclarativepropertychanges_p.h @@ -75,19 +75,19 @@ public: virtual ActionList actions(); - bool containsProperty(const QByteArray &name) const; - bool containsValue(const QByteArray &name) const; - bool containsExpression(const QByteArray &name) const; - void changeValue(const QByteArray &name, const QVariant &value); - void changeExpression(const QByteArray &name, const QString &expression); - void removeProperty(const QByteArray &name); - QVariant value(const QByteArray &name) const; - QString expression(const QByteArray &name) const; + bool containsProperty(const QString &name) const; + bool containsValue(const QString &name) const; + bool containsExpression(const QString &name) const; + void changeValue(const QString &name, const QVariant &value); + void changeExpression(const QString &name, const QString &expression); + void removeProperty(const QString &name); + QVariant value(const QString &name) const; + QString expression(const QString &name) const; void detachFromState(); void attachToState(); - QVariant property(const QByteArray &name) const; + QVariant property(const QString &name) const; }; class QDeclarativePropertyChangesParser : public QDeclarativeCustomParser diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp index 6925e03..cde6f00 100644 --- a/src/declarative/util/qdeclarativestate.cpp +++ b/src/declarative/util/qdeclarativestate.cpp @@ -370,7 +370,7 @@ void QDeclarativeAction::deleteFromBinding() } } -bool QDeclarativeState::containsPropertyInRevertList(QObject *target, const QByteArray &name) const +bool QDeclarativeState::containsPropertyInRevertList(QObject *target, const QString &name) const { Q_D(const QDeclarativeState); @@ -379,7 +379,7 @@ bool QDeclarativeState::containsPropertyInRevertList(QObject *target, const QByt while (revertListIterator.hasNext()) { const QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); - if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty().toUtf8() == name) + if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) return true; } } @@ -387,7 +387,7 @@ bool QDeclarativeState::containsPropertyInRevertList(QObject *target, const QByt return false; } -bool QDeclarativeState::changeValueInRevertList(QObject *target, const QByteArray &name, const QVariant &revertValue) +bool QDeclarativeState::changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue) { Q_D(QDeclarativeState); @@ -396,7 +396,7 @@ bool QDeclarativeState::changeValueInRevertList(QObject *target, const QByteArra while (revertListIterator.hasNext()) { QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); - if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty().toUtf8() == name) { + if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) { simpleAction.setValue(revertValue); return true; } @@ -406,7 +406,7 @@ bool QDeclarativeState::changeValueInRevertList(QObject *target, const QByteArra return false; } -bool QDeclarativeState::changeBindingInRevertList(QObject *target, const QByteArray &name, QDeclarativeAbstractBinding *binding) +bool QDeclarativeState::changeBindingInRevertList(QObject *target, const QString &name, QDeclarativeAbstractBinding *binding) { Q_D(QDeclarativeState); @@ -415,7 +415,7 @@ bool QDeclarativeState::changeBindingInRevertList(QObject *target, const QByteAr while (revertListIterator.hasNext()) { QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); - if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty().toUtf8() == name) { + if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) { if (simpleAction.binding()) simpleAction.binding()->destroy(); @@ -428,7 +428,7 @@ bool QDeclarativeState::changeBindingInRevertList(QObject *target, const QByteAr return false; } -bool QDeclarativeState::removeEntryFromRevertList(QObject *target, const QByteArray &name) +bool QDeclarativeState::removeEntryFromRevertList(QObject *target, const QString &name) { Q_D(QDeclarativeState); @@ -437,7 +437,7 @@ bool QDeclarativeState::removeEntryFromRevertList(QObject *target, const QByteAr while (revertListIterator.hasNext()) { QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); - if (simpleAction.property().object() == target && simpleAction.property().name().toUtf8() == name) { + if (simpleAction.property().object() == target && simpleAction.property().name() == name) { QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(simpleAction.property()); if (oldBinding) { QDeclarativePropertyPrivate::setBinding(simpleAction.property(), 0); @@ -517,7 +517,7 @@ void QDeclarativeState::addEntriesToRevertList(const QList & } } -QVariant QDeclarativeState::valueInRevertList(QObject *target, const QByteArray &name) const +QVariant QDeclarativeState::valueInRevertList(QObject *target, const QString &name) const { Q_D(const QDeclarativeState); @@ -526,7 +526,7 @@ QVariant QDeclarativeState::valueInRevertList(QObject *target, const QByteArray while (revertListIterator.hasNext()) { const QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); - if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty().toUtf8() == name) + if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) return simpleAction.value(); } } @@ -534,7 +534,7 @@ QVariant QDeclarativeState::valueInRevertList(QObject *target, const QByteArray return QVariant(); } -QDeclarativeAbstractBinding *QDeclarativeState::bindingInRevertList(QObject *target, const QByteArray &name) const +QDeclarativeAbstractBinding *QDeclarativeState::bindingInRevertList(QObject *target, const QString &name) const { Q_D(const QDeclarativeState); @@ -543,7 +543,7 @@ QDeclarativeAbstractBinding *QDeclarativeState::bindingInRevertList(QObject *tar while (revertListIterator.hasNext()) { const QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); - if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty().toUtf8() == name) + if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) return simpleAction.binding(); } } diff --git a/src/declarative/util/qdeclarativestate_p.h b/src/declarative/util/qdeclarativestate_p.h index 7b9c18a..dd43a50 100644 --- a/src/declarative/util/qdeclarativestate_p.h +++ b/src/declarative/util/qdeclarativestate_p.h @@ -180,15 +180,15 @@ public: QDeclarativeStateGroup *stateGroup() const; void setStateGroup(QDeclarativeStateGroup *); - bool containsPropertyInRevertList(QObject *target, const QByteArray &name) const; - bool changeValueInRevertList(QObject *target, const QByteArray &name, const QVariant &revertValue); - bool changeBindingInRevertList(QObject *target, const QByteArray &name, QDeclarativeAbstractBinding *binding); - bool removeEntryFromRevertList(QObject *target, const QByteArray &name); + bool containsPropertyInRevertList(QObject *target, const QString &name) const; + bool changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue); + bool changeBindingInRevertList(QObject *target, const QString &name, QDeclarativeAbstractBinding *binding); + bool removeEntryFromRevertList(QObject *target, const QString &name); void addEntryToRevertList(const QDeclarativeAction &action); void removeAllEntriesFromRevertList(QObject *target); void addEntriesToRevertList(const QList &actions); - QVariant valueInRevertList(QObject *target, const QByteArray &name) const; - QDeclarativeAbstractBinding *bindingInRevertList(QObject *target, const QByteArray &name) const; + QVariant valueInRevertList(QObject *target, const QString &name) const; + QDeclarativeAbstractBinding *bindingInRevertList(QObject *target, const QString &name) const; bool isStateActive() const; -- cgit v0.12 From 3468ee1a47bc646fe2af5de38425ee917ea92f59 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 21 Dec 2010 13:52:44 +1000 Subject: Fix potential crash in PropertyChanges binding rewrite handling. This fixes the autotest regression for tst_qdeclarativestates::editProperties introduced by 488e616b50707e5b37162e6d0cfc71a1ffdf9bef. Reviewed-by: Joona Petrell --- src/declarative/qml/qdeclarativebinding.cpp | 5 ++ src/declarative/qml/qdeclarativebinding_p.h | 1 + .../util/qdeclarativepropertychanges.cpp | 63 ++++++++++++---------- 3 files changed, 42 insertions(+), 27 deletions(-) diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index 1ead6ce..223d057 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -209,6 +209,8 @@ void QDeclarativeAbstractBinding::setEnabled(bool enabled, QDeclarativePropertyP if (enabled) update(flags); } +QDeclarativeBinding::Identifier QDeclarativeBinding::Invalid = -1; + void QDeclarativeBindingPrivate::refresh() { Q_Q(QDeclarativeBinding); @@ -238,6 +240,9 @@ QDeclarativeBinding * QDeclarativeBinding::createBinding(Identifier id, QObject *obj, QDeclarativeContext *ctxt, const QString &url, int lineNumber, QObject *parent) { + if (id < 0) + return 0; + QDeclarativeContextData *ctxtdata = QDeclarativeContextData::get(ctxt); QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(qmlEngine(obj)); diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h index 787a3b9..69931d9 100644 --- a/src/declarative/qml/qdeclarativebinding_p.h +++ b/src/declarative/qml/qdeclarativebinding_p.h @@ -163,6 +163,7 @@ public: virtual QString expression() const; typedef int Identifier; + static Identifier Invalid; static QDeclarativeBinding *createBinding(Identifier, QObject *, QDeclarativeContext *, const QString &, int, QObject *parent=0); public Q_SLOTS: diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index 6737382..47f03a1 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -220,9 +220,19 @@ public: void decode(); + class ExpressionChange { + public: + ExpressionChange(const QString &_name, + QDeclarativeBinding::Identifier _id, + QDeclarativeExpression *_expr) + : name(_name), id(_id), expression(_expr) {} + QString name; + QDeclarativeBinding::Identifier id; + QDeclarativeExpression *expression; + }; + QList > properties; - QList > expressions; - QList ids; + QList expressions; QList signalReplacements; QDeclarativeProperty property(const QString &); @@ -315,7 +325,7 @@ void QDeclarativePropertyChangesPrivate::decode() QString name; bool isScript; QVariant data; - QDeclarativeBinding::Identifier id; + QDeclarativeBinding::Identifier id = QDeclarativeBinding::Invalid; ds >> name; ds >> isScript; ds >> data; @@ -337,8 +347,7 @@ void QDeclarativePropertyChangesPrivate::decode() QDeclarativeData *ddata = QDeclarativeData::get(q); if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) expression->setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); - expressions << qMakePair(name, expression); - ids << id; + expressions << ExpressionChange(name, id, expression); } else { properties << qMakePair(name, data); } @@ -366,7 +375,7 @@ QDeclarativePropertyChanges::~QDeclarativePropertyChanges() { Q_D(QDeclarativePropertyChanges); for(int ii = 0; ii < d->expressions.count(); ++ii) - delete d->expressions.at(ii).second; + delete d->expressions.at(ii).expression; for(int ii = 0; ii < d->signalReplacements.count(); ++ii) delete d->signalReplacements.at(ii); } @@ -451,7 +460,7 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() for (int ii = 0; ii < d->expressions.count(); ++ii) { - const QString &property = d->expressions.at(ii).first; + const QString &property = d->expressions.at(ii).name; QDeclarativeProperty prop = d->property(property); if (prop.isValid()) { @@ -463,12 +472,12 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() a.specifiedProperty = property; if (d->isExplicit) { - a.toValue = d->expressions.at(ii).second->evaluate(); + a.toValue = d->expressions.at(ii).expression->evaluate(); } else { - QDeclarativeExpression *e = d->expressions.at(ii).second; + QDeclarativeExpression *e = d->expressions.at(ii).expression; - QDeclarativeBinding::Identifier id = d->ids.at(ii); - QDeclarativeBinding *newBinding = QDeclarativeBinding::createBinding(id, object(), qmlContext(this), e->sourceFile(), e->lineNumber()); + QDeclarativeBinding::Identifier id = d->expressions.at(ii).id; + QDeclarativeBinding *newBinding = id != QDeclarativeBinding::Invalid ? QDeclarativeBinding::createBinding(id, object(), qmlContext(this), e->sourceFile(), e->lineNumber()) : 0; if (!newBinding) { newBinding = new QDeclarativeBinding(e->expression(), object(), qmlContext(this)); newBinding->setSourceLocation(e->sourceFile(), e->lineNumber()); @@ -535,12 +544,12 @@ bool QDeclarativePropertyChanges::containsValue(const QString &name) const bool QDeclarativePropertyChanges::containsExpression(const QString &name) const { Q_D(const QDeclarativePropertyChanges); - typedef QPair ExpressionEntry; + typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; QListIterator expressionIterator(d->expressions); while (expressionIterator.hasNext()) { const ExpressionEntry &entry = expressionIterator.next(); - if (entry.first == name) { + if (entry.name == name) { return true; } } @@ -557,12 +566,12 @@ void QDeclarativePropertyChanges::changeValue(const QString &name, const QVarian { Q_D(QDeclarativePropertyChanges); typedef QPair PropertyEntry; - typedef QPair ExpressionEntry; + typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; QMutableListIterator expressionIterator(d->expressions); while (expressionIterator.hasNext()) { const ExpressionEntry &entry = expressionIterator.next(); - if (entry.first == name) { + if (entry.name == name) { expressionIterator.remove(); if (state() && state()->isStateActive()) { QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(d->property(name)); @@ -611,7 +620,7 @@ void QDeclarativePropertyChanges::changeExpression(const QString &name, const QS { Q_D(QDeclarativePropertyChanges); typedef QPair PropertyEntry; - typedef QPair ExpressionEntry; + typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; bool hadValue = false; @@ -628,8 +637,8 @@ void QDeclarativePropertyChanges::changeExpression(const QString &name, const QS QMutableListIterator expressionIterator(d->expressions); while (expressionIterator.hasNext()) { const ExpressionEntry &entry = expressionIterator.next(); - if (entry.first == name) { - entry.second->setExpression(expression); + if (entry.name == name) { + entry.expression->setExpression(expression); if (state() && state()->isStateActive()) { QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(d->property(name)); if (oldBinding) { @@ -646,7 +655,7 @@ void QDeclarativePropertyChanges::changeExpression(const QString &name, const QS } QDeclarativeExpression *newExpression = new QDeclarativeExpression(qmlContext(this), d->object, expression); - expressionIterator.insert(ExpressionEntry(name, newExpression)); + expressionIterator.insert(ExpressionEntry(name, QDeclarativeBinding::Invalid, newExpression)); if (state() && state()->isStateActive()) { if (hadValue) { @@ -692,7 +701,7 @@ QVariant QDeclarativePropertyChanges::property(const QString &name) const { Q_D(const QDeclarativePropertyChanges); typedef QPair PropertyEntry; - typedef QPair ExpressionEntry; + typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; QListIterator propertyIterator(d->properties); while (propertyIterator.hasNext()) { @@ -705,8 +714,8 @@ QVariant QDeclarativePropertyChanges::property(const QString &name) const QListIterator expressionIterator(d->expressions); while (expressionIterator.hasNext()) { const ExpressionEntry &entry = expressionIterator.next(); - if (entry.first == name) { - return QVariant(entry.second->expression()); + if (entry.name == name) { + return QVariant(entry.expression->expression()); } } @@ -717,12 +726,12 @@ void QDeclarativePropertyChanges::removeProperty(const QString &name) { Q_D(QDeclarativePropertyChanges); typedef QPair PropertyEntry; - typedef QPair ExpressionEntry; + typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; QMutableListIterator expressionIterator(d->expressions); while (expressionIterator.hasNext()) { const ExpressionEntry &entry = expressionIterator.next(); - if (entry.first == name) { + if (entry.name == name) { expressionIterator.remove(); state()->removeEntryFromRevertList(object(), name); return; @@ -759,13 +768,13 @@ QVariant QDeclarativePropertyChanges::value(const QString &name) const QString QDeclarativePropertyChanges::expression(const QString &name) const { Q_D(const QDeclarativePropertyChanges); - typedef QPair ExpressionEntry; + typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; QListIterator expressionIterator(d->expressions); while (expressionIterator.hasNext()) { const ExpressionEntry &entry = expressionIterator.next(); - if (entry.first == name) { - return entry.second->expression(); + if (entry.name == name) { + return entry.expression->expression(); } } -- cgit v0.12 From 956c026be3f0a701024aaa466e158a3744284a83 Mon Sep 17 00:00:00 2001 From: Christopher Ham Date: Tue, 21 Dec 2010 17:05:04 +1000 Subject: ContentX and ContentY reset on flow change The gridView should be visible when the flow is changed, regardless of the content position before the flow change. Task-number: QTBUG-16230 Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 4a6a9dc..5aa88b5 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1606,6 +1606,8 @@ void QDeclarativeGridView::setFlow(Flow flow) setContentHeight(-1); setFlickableDirection(QDeclarativeFlickable::HorizontalFlick); } + setContentX(0); + setContentY(0); d->clear(); d->updateGrid(); refill(); -- cgit v0.12 From 5af714b2f1ec9dd85707809397751128c95a93bf Mon Sep 17 00:00:00 2001 From: Christopher Ham Date: Tue, 21 Dec 2010 17:23:46 +1000 Subject: Adding autotest coverage to QDecalarativeGridView Tests added for snapping, and adding coverage for TopToBottom flow Reviewed-by: Martin Jones --- .../tst_qdeclarativegridview.cpp | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index fd5d140..bd9885d 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -78,6 +78,7 @@ private slots: void componentChanges(); void modelChanges(); void positionViewAtIndex(); + void snapping(); void resetModel(); void enforceRange(); void QTBUG_8456(); @@ -993,6 +994,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex() // Position on a currently visible item gridview->positionViewAtIndex(4, QDeclarativeGridView::Beginning); + QTRY_COMPARE(gridview->indexAt(120, 90), 4); QTRY_COMPARE(gridview->contentY(), 60.); // Confirm items positioned correctly @@ -1007,6 +1009,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex() // Position on an item beyond the visible items gridview->positionViewAtIndex(21, QDeclarativeGridView::Beginning); + QTRY_COMPARE(gridview->indexAt(40, 450), 21); QTRY_COMPARE(gridview->contentY(), 420.); // Confirm items positioned correctly @@ -1021,6 +1024,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex() // Position on an item that would leave empty space if positioned at the top gridview->positionViewAtIndex(31, QDeclarativeGridView::Beginning); + QTRY_COMPARE(gridview->indexAt(120, 630), 31); QTRY_COMPARE(gridview->contentY(), 520.); // Confirm items positioned correctly @@ -1035,6 +1039,9 @@ void tst_QDeclarativeGridView::positionViewAtIndex() // Position at the beginning again gridview->positionViewAtIndex(0, QDeclarativeGridView::Beginning); + QTRY_COMPARE(gridview->indexAt(0, 0), 0); + QTRY_COMPARE(gridview->indexAt(40, 30), 0); + QTRY_COMPARE(gridview->indexAt(80, 60), 4); QTRY_COMPARE(gridview->contentY(), 0.); // Confirm items positioned correctly @@ -1088,6 +1095,82 @@ void tst_QDeclarativeGridView::positionViewAtIndex() gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain); QTRY_COMPARE(gridview->contentY(), 100.); + // Test for Top To Bottom layout + ctxt->setContextProperty("testTopToBottom", QVariant(true)); + + // Confirm items positioned correctly + itemCount = findItems(contentItem, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount-1; ++i) { + QDeclarativeItem *item = findItem(contentItem, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QTRY_VERIFY(item); + QTRY_COMPARE(item->x(), (i/5)*80.); + QTRY_COMPARE(item->y(), (i%5)*60.); + } + + // Position at End + gridview->positionViewAtIndex(30, QDeclarativeGridView::End); + QTRY_COMPARE(gridview->contentX(), 320.); + QTRY_COMPARE(gridview->contentY(), 0.); + + // Position in Center + gridview->positionViewAtIndex(15, QDeclarativeGridView::Center); + QTRY_COMPARE(gridview->contentX(), 160.); + + // Ensure at least partially visible + gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible); + QTRY_COMPARE(gridview->contentX(), 160.); + + gridview->setContentX(170); + gridview->positionViewAtIndex(25, QDeclarativeGridView::Visible); + QTRY_COMPARE(gridview->contentX(), 170.); + + gridview->positionViewAtIndex(30, QDeclarativeGridView::Visible); + QTRY_COMPARE(gridview->contentX(), 320.); + + gridview->setContentX(170); + gridview->positionViewAtIndex(25, QDeclarativeGridView::Contain); + QTRY_COMPARE(gridview->contentX(), 240.); + + delete canvas; +} + +void tst_QDeclarativeGridView::snapping() +{ + QDeclarativeView *canvas = createView(); + + TestModel model; + for (int i = 0; i < 40; i++) + model.addItem("Item" + QString::number(i), ""); + + QDeclarativeContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + ctxt->setContextProperty("testTopToBottom", QVariant(false)); + + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml")); + qApp->processEvents(); + + QDeclarativeGridView *gridview = findItem(canvas->rootObject(), "grid"); + QTRY_VERIFY(gridview != 0); + + gridview->setHeight(220); + QCOMPARE(gridview->height(), 220.); + + gridview->positionViewAtIndex(12, QDeclarativeGridView::Visible); + QCOMPARE(gridview->contentY(), 80.); + + gridview->setContentY(0); + QCOMPARE(gridview->contentY(), 0.); + + gridview->setSnapMode(QDeclarativeGridView::SnapToRow); + QCOMPARE(gridview->snapMode(), QDeclarativeGridView::SnapToRow); + + gridview->positionViewAtIndex(12, QDeclarativeGridView::Visible); + QCOMPARE(gridview->contentY(), 60.); + + gridview->positionViewAtIndex(15, QDeclarativeGridView::End); + QCOMPARE(gridview->contentY(), 120.); + delete canvas; } @@ -1231,6 +1314,15 @@ void tst_QDeclarativeGridView::manualHighlight() QTRY_COMPARE(gridview->currentItem(), findItem(contentItem, "wrapper", 2)); QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y()); QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x()); + + gridview->setFlow(QDeclarativeGridView::TopToBottom); + QTRY_COMPARE(gridview->flow(), QDeclarativeGridView::TopToBottom); + + gridview->setCurrentIndex(0); + QTRY_COMPARE(gridview->currentIndex(), 0); + QTRY_COMPARE(gridview->currentItem(), findItem(contentItem, "wrapper", 0)); + QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y()); + QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x()); } void tst_QDeclarativeGridView::footer() -- cgit v0.12 From 111e306c9991a0d89b0001b476e466891974945f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 21 Dec 2010 09:12:58 +0100 Subject: QDeclarativeDebug: Remove unused file Got added in 5336e1838a95d97. --- src/declarative/debugger/debugger.pri | 1 - src/declarative/debugger/qdeclarativedebugserverplugin_p.h | 0 2 files changed, 1 deletion(-) delete mode 100644 src/declarative/debugger/qdeclarativedebugserverplugin_p.h diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 9152677..75287b4 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -19,6 +19,5 @@ HEADERS += \ $$PWD/qdeclarativedebug_p.h \ $$PWD/qdeclarativedebugtrace_p.h \ $$PWD/qdeclarativedebughelper_p.h \ - $$PWD/qdeclarativedebugserverplugin_p.h \ $$PWD/qdeclarativedebugserver_p.h \ debugger/qdeclarativedebugserverconnection_p.h diff --git a/src/declarative/debugger/qdeclarativedebugserverplugin_p.h b/src/declarative/debugger/qdeclarativedebugserverplugin_p.h deleted file mode 100644 index e69de29..0000000 -- cgit v0.12 From b22ff71d8f8fa03260d5ad0eef67184a047685e7 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 21 Dec 2010 15:04:04 +0100 Subject: Doc: Fixed whitespace. --- doc/src/template/style/narrow.css | 14 ++++++------ doc/src/template/style/superfish.css | 44 ++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css index fbb0752..39b4740 100644 --- a/doc/src/template/style/narrow.css +++ b/doc/src/template/style/narrow.css @@ -135,7 +135,7 @@ .creator .wrap { margin: 0px; - background:#FFFFFF; + background:#FFFFFF; } .narrow .wrap .toolbar { @@ -170,7 +170,7 @@ .narrow .wrap .breadcrumb ul li.last a { color: #363534; } - + #narrowsearch { display: none; } @@ -213,7 +213,7 @@ width: 64%; padding-left: 0; } - + .narrow .indexboxcont .sectionlist { width: 32.5%; } @@ -253,7 +253,7 @@ #narrowmenu li, #narrowmenu li ul { background-color: #fff; - margin-top:-1px; + margin-top:-1px; } #narrowmenu li ul { @@ -266,6 +266,6 @@ } /* end narrow mode */ - .creator #narrowsearch, .creator #narrowmenu{ - display:none; - } + .creator #narrowsearch, .creator #narrowmenu{ + display:none; + } diff --git a/doc/src/template/style/superfish.css b/doc/src/template/style/superfish.css index 0cf0f7d..2bdaef4 100644 --- a/doc/src/template/style/superfish.css +++ b/doc/src/template/style/superfish.css @@ -1,51 +1,51 @@ .sf-menu, .sf-menu * { - margin: 0; - padding: 0; - list-style: none; + margin: 0; + padding: 0; + list-style: none; } .sf-menu { - line-height: 1.0; + line-height: 1.0; } .sf-menu ul { - position: absolute; - top: -999em; - width: 10em; /* left offset of submenus need to match (see below) */ + position: absolute; + top: -999em; + width: 10em; /* left offset of submenus need to match (see below) */ } .sf-menu ul li { - width: 100%; + width: 100%; } .sf-menu li:hover { - visibility: inherit; /* fixes IE7 'sticky bug' */ + visibility: inherit; /* fixes IE7 'sticky bug' */ } .sf-menu li { - float: left; - position: relative; + float: left; + position: relative; } .sf-menu a { - display: block; - position: relative; + display: block; + position: relative; } .sf-menu li:hover ul, .sf-menu li.sfHover ul { - left: 0; - top: 2.5em; /* match top ul list item height */ - z-index: 99; + left: 0; + top: 2.5em; /* match top ul list item height */ + z-index: 99; } ul.sf-menu li:hover li ul, ul.sf-menu li.sfHover li ul { - top: -999em; + top: -999em; } ul.sf-menu li li:hover ul, ul.sf-menu li li.sfHover ul { - left: 10em; /* match ul width */ - top: 0; + left: 10em; /* match ul width */ + top: 0; } ul.sf-menu li li:hover li ul, ul.sf-menu li li.sfHover li ul { - top: -999em; + top: -999em; } ul.sf-menu li li li:hover ul, ul.sf-menu li li li.sfHover ul { - left: 10em; /* match ul width */ - top: 0; + left: 10em; /* match ul width */ + top: 0; } -- cgit v0.12 From ae0f24513158ea48b21ba3e6676c5fb8a786a73e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 21 Dec 2010 15:07:16 +0100 Subject: Doc: Fixed whitespace. --- tools/qdoc3/test/compat.qdocconf | 8 ++++---- tools/qdoc3/test/qt-cpp-ignore.qdocconf | 10 +++++----- tools/qdoc3/test/qt-defines.qdocconf | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/qdoc3/test/compat.qdocconf b/tools/qdoc3/test/compat.qdocconf index 5745ed9..0b59629 100644 --- a/tools/qdoc3/test/compat.qdocconf +++ b/tools/qdoc3/test/compat.qdocconf @@ -1,5 +1,5 @@ -alias.i = e -alias.include = input +alias.i = e +alias.include = input macro.0 = "\\\\0" macro.b = "\\\\b" @@ -27,5 +27,5 @@ macro.img = "\\image" macro.endquote = "\\endquotation" macro.relatesto = "\\relates" -spurious = "Missing comma in .*" \ - "Missing pattern .*" +spurious = "Missing comma in .*" \ + "Missing pattern .*" diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf index 5d52a47..044eef4 100644 --- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf +++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf @@ -71,8 +71,8 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \ QT_END_INCLUDE_NAMESPACE \ PHONON_EXPORT \ Q_DECLARATIVE_EXPORT \ - Q_GADGET \ - QWEBKIT_EXPORT \ + Q_GADGET \ + QWEBKIT_EXPORT \ Q_INVOKABLE Cpp.ignoredirectives = Q_DECLARE_HANDLE \ Q_DECLARE_INTERFACE \ @@ -93,6 +93,6 @@ Cpp.ignoredirectives = Q_DECLARE_HANDLE \ K_DECLARE_PRIVATE \ PHONON_OBJECT \ PHONON_HEIR \ - Q_PRIVATE_PROPERTY \ - Q_DECLARE_PRIVATE_D \ - Q_CLASSINFO + Q_PRIVATE_PROPERTY \ + Q_DECLARE_PRIVATE_D \ + Q_CLASSINFO diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf index bf7fd08..50a355f 100644 --- a/tools/qdoc3/test/qt-defines.qdocconf +++ b/tools/qdoc3/test/qt-defines.qdocconf @@ -3,12 +3,12 @@ defines = Q_QDOC \ QT_.*_LIB \ QT_COMPAT \ QT_KEYPAD_NAVIGATION \ - QT_NO_EGL \ + QT_NO_EGL \ QT3_SUPPORT \ Q_WS_.* \ Q_OS_.* \ Q_BYTE_ORDER \ - QT_DEPRECATED \ + QT_DEPRECATED \ Q_NO_USING_KEYWORD \ __cplusplus -- cgit v0.12 From 9862f29b3c8d3f23113388b48b1c4b86523137dc Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 21 Dec 2010 15:07:46 +0100 Subject: Doc: Updated the Qt version number. --- tools/qdoc3/test/qt-project.qdocconf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/test/qt-project.qdocconf b/tools/qdoc3/test/qt-project.qdocconf index 135fbbb..ca7caa9 100644 --- a/tools/qdoc3/test/qt-project.qdocconf +++ b/tools/qdoc3/test/qt-project.qdocconf @@ -6,7 +6,7 @@ include(qt-defines.qdocconf) project = Qt description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.7 -version = 4.7.1 +version = 4.7.2 sourceencoding = UTF-8 outputencoding = UTF-8 @@ -20,9 +20,9 @@ qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = -qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.7.1 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 +qhp.Qt.filterAttributes = qt 4.7.2 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.7.2 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes -- cgit v0.12 From fa4526a79112baccf9b00adca7f360ac8588a22d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 21 Dec 2010 17:35:43 +0100 Subject: Doc: Updated the HarfBuzz license information. As-requested-by: Legal --- doc/src/legal/3rdparty.qdoc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/src/legal/3rdparty.qdoc b/doc/src/legal/3rdparty.qdoc index 9cc83a6..e2c088a 100644 --- a/doc/src/legal/3rdparty.qdoc +++ b/doc/src/legal/3rdparty.qdoc @@ -92,13 +92,8 @@ \section1 HarfBuzz (\c harfbuzz) - \e{This is HarfBuzz, an OpenType Layout engine.} - - \e{It was derived originally from the OpenType code in FreeType-1.x, ported to - FreeType2. (This code has been abandoned for FreeType2, but until something - better comes along, should serve our purposes.) In addition to porting to - FreeType-2, it has been modified in various other ways.} -- quoted from - \c src/3rdparty/harfbuzz/README. + \e{This is HarfBuzz, an OpenType Layout engine library.} + -- quoted from \c src/3rdparty/harfbuzz/README. \hr @@ -129,8 +124,7 @@ \hr - See \c src/3rdparty/harfbuzz/COPYING.FTL and src/3rdparty/harfbuzz/COPYING.GPL - for license details. + See \c src/3rdparty/harfbuzz/COPYING for license details. \section1 The Independent JPEG Group's JPEG Software (\c libjpeg) version 8 -- cgit v0.12 From 84232c88aa9b05d91016b66963d68b8096099f9c Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 21 Dec 2010 17:36:25 +0100 Subject: Doc: Changed a page title. --- doc/src/declarative/anchor-layout.qdoc | 2 +- doc/src/declarative/declarativeui.qdoc | 2 +- doc/src/declarative/qdeclarativereference.qdoc | 2 +- doc/src/declarative/tutorial.qdoc | 4 ++-- doc/src/getting-started/gettingstartedqml.qdoc | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/declarative/anchor-layout.qdoc b/doc/src/declarative/anchor-layout.qdoc index f5d5697..e9f79d1 100644 --- a/doc/src/declarative/anchor-layout.qdoc +++ b/doc/src/declarative/anchor-layout.qdoc @@ -28,7 +28,7 @@ /*! \page qml-anchor-layout.html \target anchor-layout -\title Anchor-based Layout in QML +\title Anchor-Based Layout in QML \section1 Overview diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index 41b9952..e10c5c8 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -91,7 +91,7 @@ Module. \list \o \l{QML Documents} \o \l{Property Binding} -\o \l{Anchor-based Layout in QML} +\o \l{Anchor-Based Layout in QML} \o \l{Writing QML Components: Properties, Methods and Signals} \o \l{QML Scope} \o \l{QML Modules} diff --git a/doc/src/declarative/qdeclarativereference.qdoc b/doc/src/declarative/qdeclarativereference.qdoc index c2c5e91..76fcc40 100644 --- a/doc/src/declarative/qdeclarativereference.qdoc +++ b/doc/src/declarative/qdeclarativereference.qdoc @@ -64,7 +64,7 @@ \o \l {QML Scope} \o \l {Network Transparency} \o \l {qmlmodels}{Data Models} - \o \l {anchor-layout}{Anchor-based Layout} + \o \l {anchor-layout}{Anchor-Based Layout} \o \l {qmlstates}{States} \o \l {qdeclarativeanimation.html}{Animation} \o \l {qdeclarativemodules.html}{Modules} diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc index d8139b4..a24fa85 100644 --- a/doc/src/declarative/tutorial.qdoc +++ b/doc/src/declarative/tutorial.qdoc @@ -94,7 +94,7 @@ We add a \l Text element as a child of the root Rectangle element that displays The \c y property is used to position the text vertically at 30 pixels from the top of its parent. The \c anchors.horizontalCenter property refers to the horizontal center of an element. -In this case, we specify that our text element should be horizontally centered in the \e page element (see \l{anchor-layout}{Anchor-based Layout}). +In this case, we specify that our text element should be horizontally centered in the \e page element (see \l{anchor-layout}{Anchor-Based Layout}). The \c font.pointSize and \c font.bold properties are related to fonts and use the \l{dot properties}{dot notation}. @@ -156,7 +156,7 @@ We will use this signal to change the color of the text in the main QML file lat Our cell component is basically a colored rectangle with the \c id \e rectangle. The \c anchors.fill property is a convenient way to set the size of an element. -In this case the rectangle will have the same size as its parent (see \l{anchor-layout}{Anchor-based Layout}). +In this case the rectangle will have the same size as its parent (see \l{anchor-layout}{Anchor-Based Layout}). \snippet examples/declarative/tutorials/helloworld/Cell.qml 3 diff --git a/doc/src/getting-started/gettingstartedqml.qdoc b/doc/src/getting-started/gettingstartedqml.qdoc index e3977bb..11fad03 100644 --- a/doc/src/getting-started/gettingstartedqml.qdoc +++ b/doc/src/getting-started/gettingstartedqml.qdoc @@ -133,7 +133,7 @@ the interactive area where mouse movements are detected. For our button, we anchor the whole MouseArea to its parent, which is \c simplebutton. The \c anchors.fill syntax is one way of accessing a specific property called \c fill inside a group of properties - called \c anchors. QML uses \l {Anchor-based Layout in QML}{anchor based layouts} where + called \c anchors. QML uses \l {Anchor-Based Layout in QML}{anchor-based layouts} where items can anchor to another item, creating robust layouts. The \c MouseArea has many signal handlers that are called during mouse movements within -- cgit v0.12 From ea41ba11fc848dbefecb0cde324478ab1986e555 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 21 Dec 2010 18:38:04 +0100 Subject: Enabled error reporting and a plain text fallback for invalid QML. The location of places where code is included in documentation is now passed into each code marker when highlighted code is needed. --- tools/qdoc3/codemarker.h | 2 +- tools/qdoc3/cppcodemarker.cpp | 9 +++++---- tools/qdoc3/cppcodemarker.h | 4 ++-- tools/qdoc3/doc.cpp | 6 +++--- tools/qdoc3/jscodemarker.cpp | 12 +++++++++--- tools/qdoc3/jscodemarker.h | 6 +++--- tools/qdoc3/plaincodemarker.cpp | 2 +- tools/qdoc3/plaincodemarker.h | 2 +- tools/qdoc3/qmlcodemarker.cpp | 15 +++++++++++---- tools/qdoc3/qmlcodemarker.h | 6 +++--- 10 files changed, 39 insertions(+), 25 deletions(-) diff --git a/tools/qdoc3/codemarker.h b/tools/qdoc3/codemarker.h index 029ddb9..3cf3984 100644 --- a/tools/qdoc3/codemarker.h +++ b/tools/qdoc3/codemarker.h @@ -126,7 +126,7 @@ class CodeMarker const Node *relative = 0) = 0; virtual QString markedUpCode(const QString& code, const Node *relative, - const QString& dirPath) = 0; + const Location &location) = 0; virtual QString markedUpSynopsis(const Node *node, const Node *relative, SynopsisStyle style) = 0; diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 55a455f..8ea1c7f 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -157,9 +157,9 @@ QString CppCodeMarker::plainFullName(const Node *node, const Node *relative) QString CppCodeMarker::markedUpCode(const QString &code, const Node *relative, - const QString &dirPath) + const Location &location) { - return addMarkUp(protect(code), relative, dirPath); + return addMarkUp(protect(code), relative, location); } QString CppCodeMarker::markedUpSynopsis(const Node *node, @@ -440,7 +440,8 @@ QString CppCodeMarker::markedUpIncludes(const QStringList& includes) code += "#include <<@headerfile>" + *inc + ">\n"; ++inc; } - return addMarkUp(code, 0, ""); + Location location; + return addMarkUp(code, 0, location); } QString CppCodeMarker::functionBeginRegExp(const QString& funcName) @@ -868,7 +869,7 @@ const Node *CppCodeMarker::resolveTarget(const QString& target, QString CppCodeMarker::addMarkUp(const QString& protectedCode, const Node * /* relative */, - const QString& /* dirPath */) + const Location & /* location */) { static QRegExp globalInclude("#include +<([^<>&]+)>"); static QRegExp yHasTypeX("(?:^|\n *)([a-zA-Z_][a-zA-Z_0-9]*)" diff --git a/tools/qdoc3/cppcodemarker.h b/tools/qdoc3/cppcodemarker.h index 40695c5..bb307f9 100644 --- a/tools/qdoc3/cppcodemarker.h +++ b/tools/qdoc3/cppcodemarker.h @@ -63,7 +63,7 @@ class CppCodeMarker : public CodeMarker virtual QString plainFullName(const Node *node, const Node *relative); virtual QString markedUpCode(const QString& code, const Node *relative, - const QString& dirPath); + const Location &location); virtual QString markedUpSynopsis(const Node *node, const Node *relative, SynopsisStyle style); @@ -90,7 +90,7 @@ class CppCodeMarker : public CodeMarker private: QString addMarkUp(const QString& protectedCode, const Node *relative, - const QString& dirPath); + const Location &location); }; QT_END_NAMESPACE diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index ce9e30d..774f8ba 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -536,7 +536,7 @@ void DocParser::parse(const QString& source, enterPara(); x = untabifyEtc(getArgument(true)); marker = CodeMarker::markerForCode(x); - append(Atom::C, marker->markedUpCode(x, 0, "")); + append(Atom::C, marker->markedUpCode(x, 0, location())); break; case CMD_CAPTION: leavePara(); @@ -2305,7 +2305,7 @@ QString DocParser::getCode(int cmd, CodeMarker *marker) code = unindent(minIndent, code); if (!marker) marker = CodeMarker::markerForCode(code); - return marker->markedUpCode(code, 0, ""); + return marker->markedUpCode(code, 0, location()); } /*! @@ -3043,7 +3043,7 @@ CodeMarker *Doc::quoteFromFile(const Location &location, CodeMarker *marker = CodeMarker::markerForFileName(fileName); quoter.quoteFromFile(userFriendlyFilePath, code, - marker->markedUpCode(code, 0, dirPath)); + marker->markedUpCode(code, 0, location)); return marker; } diff --git a/tools/qdoc3/jscodemarker.cpp b/tools/qdoc3/jscodemarker.cpp index 84a28c6..80df0aa 100644 --- a/tools/qdoc3/jscodemarker.cpp +++ b/tools/qdoc3/jscodemarker.cpp @@ -103,14 +103,14 @@ bool JsCodeMarker::recognizeLanguage(const QString &language) QString JsCodeMarker::markedUpCode(const QString &code, const Node *relative, - const QString &dirPath) + const Location &location) { - return addMarkUp(code, relative, dirPath); + return addMarkUp(code, relative, location); } QString JsCodeMarker::addMarkUp(const QString &code, const Node * /* relative */, - const QString & /* dirPath */) + const Location &location) { QDeclarativeJS::Engine engine; QDeclarativeJS::Lexer lexer(&engine); @@ -130,7 +130,13 @@ QString JsCodeMarker::addMarkUp(const QString &code, QmlMarkupVisitor visitor(code, pragmas, &engine); QDeclarativeJS::AST::Node::accept(ast, &visitor); output = visitor.markedUpCode(); + } else { + location.warning(tr("Unable to parse JavaScript: \"%1\" at line %2, column %3").arg( + parser.errorMessage()).arg(parser.errorLineNumber()).arg( + parser.errorColumnNumber())); + output = protect(code); } + return output; } diff --git a/tools/qdoc3/jscodemarker.h b/tools/qdoc3/jscodemarker.h index f7cb025..6d85063 100644 --- a/tools/qdoc3/jscodemarker.h +++ b/tools/qdoc3/jscodemarker.h @@ -62,11 +62,11 @@ public: virtual QString markedUpCode(const QString &code, const Node *relative, - const QString &dirPath); + const Location &location); private: - QString addMarkUp(const QString &code, const Node * /* relative */, - const QString & /* dirPath */); + QString addMarkUp(const QString &code, const Node *relative, + const Location &location); }; QT_END_NAMESPACE diff --git a/tools/qdoc3/plaincodemarker.cpp b/tools/qdoc3/plaincodemarker.cpp index d825c13..9819593 100644 --- a/tools/qdoc3/plaincodemarker.cpp +++ b/tools/qdoc3/plaincodemarker.cpp @@ -78,7 +78,7 @@ QString PlainCodeMarker::plainFullName(const Node * /* node */, const Node * /* QString PlainCodeMarker::markedUpCode( const QString& code, const Node * /* relative */, - const QString& /* dirPath */ ) + const Location & /* location */ ) { return protect( code ); } diff --git a/tools/qdoc3/plaincodemarker.h b/tools/qdoc3/plaincodemarker.h index 7afb88e..1c469a0 100644 --- a/tools/qdoc3/plaincodemarker.h +++ b/tools/qdoc3/plaincodemarker.h @@ -61,7 +61,7 @@ public: bool recognizeLanguage( const QString& lang ); QString plainName( const Node *node ); QString plainFullName( const Node *node, const Node *relative ); - QString markedUpCode( const QString& code, const Node *relative, const QString& dirPath ); + QString markedUpCode( const QString& code, const Node *relative, const Location &location ); QString markedUpSynopsis( const Node *node, const Node *relative, SynopsisStyle style ); QString markedUpName( const Node *node ); diff --git a/tools/qdoc3/qmlcodemarker.cpp b/tools/qdoc3/qmlcodemarker.cpp index 1e4ad1e..fc91cbb 100644 --- a/tools/qdoc3/qmlcodemarker.cpp +++ b/tools/qdoc3/qmlcodemarker.cpp @@ -134,9 +134,9 @@ QString QmlCodeMarker::plainFullName(const Node *node, const Node *relative) QString QmlCodeMarker::markedUpCode(const QString &code, const Node *relative, - const QString &dirPath) + const Location &location) { - return addMarkUp(code, relative, dirPath); + return addMarkUp(code, relative, location); } QString QmlCodeMarker::markedUpName(const Node *node) @@ -174,7 +174,8 @@ QString QmlCodeMarker::markedUpIncludes(const QStringList& includes) code += "import " + *inc + "\n"; ++inc; } - return protect(addMarkUp(code, 0, "")); + Location location; + return protect(addMarkUp(code, 0, location)); } QString QmlCodeMarker::functionBeginRegExp(const QString& funcName) @@ -190,7 +191,7 @@ QString QmlCodeMarker::functionEndRegExp(const QString& /* funcName */) QString QmlCodeMarker::addMarkUp(const QString &code, const Node * /* relative */, - const QString & /* dirPath */) + const Location &location) { QDeclarativeJS::Engine engine; QDeclarativeJS::Lexer lexer(&engine); @@ -210,7 +211,13 @@ QString QmlCodeMarker::addMarkUp(const QString &code, QmlMarkupVisitor visitor(code, pragmas, &engine); QDeclarativeJS::AST::Node::accept(ast, &visitor); output = visitor.markedUpCode(); + } else { + location.warning(tr("Unable to parse QML: \"%1\" at line %2, column %3").arg( + parser.errorMessage()).arg(parser.errorLineNumber()).arg( + parser.errorColumnNumber())); + output = protect(code); } + return output; } diff --git a/tools/qdoc3/qmlcodemarker.h b/tools/qdoc3/qmlcodemarker.h index 68e6753..b1d365c 100644 --- a/tools/qdoc3/qmlcodemarker.h +++ b/tools/qdoc3/qmlcodemarker.h @@ -64,7 +64,7 @@ public: virtual QString plainFullName(const Node *node, const Node *relative); virtual QString markedUpCode(const QString &code, const Node *relative, - const QString &dirPath); + const Location &location); virtual QString markedUpName(const Node *node); virtual QString markedUpFullName(const Node *node, const Node *relative); @@ -76,8 +76,8 @@ public: QList extractPragmas(QString &script); private: - QString addMarkUp(const QString &code, const Node * /* relative */, - const QString & /* dirPath */); + QString addMarkUp(const QString &code, const Node *relative, + const Location &location); }; QT_END_NAMESPACE -- cgit v0.12 From 2143a50d274d36e4fe779de2c732c66f47496ace Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 21 Dec 2010 20:21:47 +0100 Subject: Doc: Fixed QML syntax in quoted code snippets. --- doc/src/declarative/extending.qdoc | 2 +- .../declarative/states/statechangescript.qml | 61 ++++++++++++++++++++++ src/declarative/util/qdeclarativeconnections.cpp | 8 +-- .../util/qdeclarativestateoperations.cpp | 20 +------ 4 files changed, 67 insertions(+), 24 deletions(-) create mode 100644 doc/src/snippets/declarative/states/statechangescript.qml diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 748ec6c..c34dc13 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -823,7 +823,7 @@ If the \l{Item::children}{children} property was not the default property for \qml Item { children: [ - Rectangle {} + Rectangle {}, Rectangle {} ] } diff --git a/doc/src/snippets/declarative/states/statechangescript.qml b/doc/src/snippets/declarative/states/statechangescript.qml new file mode 100644 index 0000000..b885137 --- /dev/null +++ b/doc/src/snippets/declarative/states/statechangescript.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +Item { +//! [state and transition] +State { + name: "state1" + StateChangeScript { + name: "myScript" + script: doStateStuff(); + } + // ... +} +// ... +Transition { + to: "state1" + SequentialAnimation { + NumberAnimation { /* ... */ } + ScriptAction { scriptName: "myScript" } + NumberAnimation { /* ... */ } + } +} +//! [state and transition] +} diff --git a/src/declarative/util/qdeclarativeconnections.cpp b/src/declarative/util/qdeclarativeconnections.cpp index 15e5ac5..8b3a9da 100644 --- a/src/declarative/util/qdeclarativeconnections.cpp +++ b/src/declarative/util/qdeclarativeconnections.cpp @@ -82,7 +82,7 @@ public: \qml MouseArea { - onClicked: { foo(...) } + onClicked: { foo(parameters) } } \endqml @@ -103,7 +103,7 @@ public: \qml MouseArea { Connections { - onClicked: foo(...) + onClicked: foo(parameters) } } \endqml @@ -115,10 +115,10 @@ public: MouseArea { id: area } - ... + // ... Connections { target: area - onClicked: foo(...) + onClicked: foo(parameters) } \endqml diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index d1d7822..1df9013 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -599,25 +599,7 @@ public: ScriptAction to specify the point in the transition at which the StateChangeScript should to be run. - \qml - State { - name "state1" - StateChangeScript { - name: "myScript" - script: doStateStuff(); - } - ... - } - ... - Transition { - to: "state1" - SequentialAnimation { - NumberAnimation { ... } - ScriptAction { scriptName: "myScript" } - NumberAnimation { ... } - } - } - \endqml + \snippet snippets/declarative/states/statechangescript.qml state and transition \sa ScriptAction */ -- cgit v0.12 From 042e797a21a88ccafbaf54bbcfbf1e8d75b33740 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 22 Dec 2010 10:29:43 +1000 Subject: Optimization: make QDeclarativePropertyPrivate shared. Task-number: QTBUG-15331 Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarativeproperty.cpp | 98 +++++++++++++++++----------- src/declarative/qml/qdeclarativeproperty_p.h | 13 +--- 2 files changed, 64 insertions(+), 47 deletions(-) diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index 8eaa98b..d7cf6cc 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -106,15 +106,16 @@ qWarning() << "Pixel size should now be 24:" << property.read().toInt(); Create an invalid QDeclarativeProperty. */ QDeclarativeProperty::QDeclarativeProperty() -: d(new QDeclarativePropertyPrivate) +: d(0) { - d->q = this; } /*! \internal */ QDeclarativeProperty::~QDeclarativeProperty() { - delete d; d = 0; + if (d) + d->release(); + d = 0; } /*! @@ -124,7 +125,6 @@ QDeclarativeProperty::~QDeclarativeProperty() QDeclarativeProperty::QDeclarativeProperty(QObject *obj) : d(new QDeclarativePropertyPrivate) { - d->q = this; d->initDefault(obj); } @@ -137,7 +137,6 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj) QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeContext *ctxt) : d(new QDeclarativePropertyPrivate) { - d->q = this; d->context = ctxt?QDeclarativeContextData::get(ctxt):0; d->engine = ctxt?ctxt->engine():0; d->initDefault(obj); @@ -152,7 +151,6 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeContext *ct QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeEngine *engine) : d(new QDeclarativePropertyPrivate) { - d->q = this; d->context = 0; d->engine = engine; d->initDefault(obj); @@ -178,7 +176,6 @@ void QDeclarativePropertyPrivate::initDefault(QObject *obj) QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name) : d(new QDeclarativePropertyPrivate) { - d->q = this; d->initProperty(obj, name); if (!isValid()) d->object = 0; } @@ -190,7 +187,6 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name) QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeContext *ctxt) : d(new QDeclarativePropertyPrivate) { - d->q = this; d->context = ctxt?QDeclarativeContextData::get(ctxt):0; d->engine = ctxt?ctxt->engine():0; d->initProperty(obj, name); @@ -205,7 +201,6 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QD QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeEngine *engine) : d(new QDeclarativePropertyPrivate) { - d->q = this; d->context = 0; d->engine = engine; d->initProperty(obj, name); @@ -324,9 +319,10 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name Create a copy of \a other. */ QDeclarativeProperty::QDeclarativeProperty(const QDeclarativeProperty &other) -: d(new QDeclarativePropertyPrivate(*other.d)) { - d->q = this; + d = other.d; + if (d) + d->addref(); } /*! @@ -355,13 +351,13 @@ QDeclarativeProperty::QDeclarativeProperty(const QDeclarativeProperty &other) */ QDeclarativeProperty::PropertyTypeCategory QDeclarativeProperty::propertyTypeCategory() const { - return d->propertyTypeCategory(); + return d ? d->propertyTypeCategory() : InvalidCategory; } QDeclarativeProperty::PropertyTypeCategory QDeclarativePropertyPrivate::propertyTypeCategory() const { - uint type = q->type(); + uint type = this->type(); if (isValueType()) { return QDeclarativeProperty::Normal; @@ -388,6 +384,8 @@ QDeclarativePropertyPrivate::propertyTypeCategory() const */ const char *QDeclarativeProperty::propertyTypeName() const { + if (!d) + return 0; if (d->isValueType()) { QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(d->context); @@ -414,6 +412,8 @@ const char *QDeclarativeProperty::propertyTypeName() const */ bool QDeclarativeProperty::operator==(const QDeclarativeProperty &other) const { + if (!d || !other.d) + return false; // category is intentially omitted here as it is generated // from the other members return d->object == other.d->object && @@ -427,7 +427,7 @@ bool QDeclarativeProperty::operator==(const QDeclarativeProperty &other) const */ int QDeclarativeProperty::propertyType() const { - return d->propertyType(); + return d ? d->propertyType() : QVariant::Invalid; } bool QDeclarativePropertyPrivate::isValueType() const @@ -437,7 +437,7 @@ bool QDeclarativePropertyPrivate::isValueType() const int QDeclarativePropertyPrivate::propertyType() const { - uint type = q->type(); + uint type = this->type(); if (isValueType()) { return valueType.valueTypePropType; } else if (type & QDeclarativeProperty::Property) { @@ -450,17 +450,22 @@ int QDeclarativePropertyPrivate::propertyType() const } } +QDeclarativeProperty::Type QDeclarativePropertyPrivate::type() const +{ + if (core.flags & QDeclarativePropertyCache::Data::IsFunction) + return QDeclarativeProperty::SignalProperty; + else if (core.isValid()) + return QDeclarativeProperty::Property; + else + return QDeclarativeProperty::Invalid; +} + /*! Returns the type of the property. */ QDeclarativeProperty::Type QDeclarativeProperty::type() const { - if (d->core.flags & QDeclarativePropertyCache::Data::IsFunction) - return SignalProperty; - else if (d->core.isValid()) - return Property; - else - return Invalid; + return d ? d->type() : Invalid; } /*! @@ -484,7 +489,7 @@ bool QDeclarativeProperty::isSignalProperty() const */ QObject *QDeclarativeProperty::object() const { - return d->object; + return d ? d->object : 0; } /*! @@ -492,15 +497,11 @@ QObject *QDeclarativeProperty::object() const */ QDeclarativeProperty &QDeclarativeProperty::operator=(const QDeclarativeProperty &other) { - d->context = other.d->context; - d->engine = other.d->engine; - d->object = other.d->object; - - d->isNameCached = other.d->isNameCached; - d->core = other.d->core; - d->nameCache = other.d->nameCache; - - d->valueType = other.d->valueType; + if (d) + d->release(); + d = other.d; + if (d) + d->addref(); return *this; } @@ -510,6 +511,8 @@ QDeclarativeProperty &QDeclarativeProperty::operator=(const QDeclarativeProperty */ bool QDeclarativeProperty::isWritable() const { + if (!d) + return false; if (!d->object) return false; if (d->core.flags & QDeclarativePropertyCache::Data::IsQList) //list @@ -527,6 +530,8 @@ bool QDeclarativeProperty::isWritable() const */ bool QDeclarativeProperty::isDesignable() const { + if (!d) + return false; if (type() & Property && d->core.isValid() && d->object) return d->object->metaObject()->property(d->core.coreIndex).isDesignable(); else @@ -538,6 +543,8 @@ bool QDeclarativeProperty::isDesignable() const */ bool QDeclarativeProperty::isResettable() const { + if (!d) + return false; if (type() & Property && d->core.isValid() && d->object) return d->core.flags & QDeclarativePropertyCache::Data::IsResettable; else @@ -550,6 +557,8 @@ bool QDeclarativeProperty::isResettable() const */ bool QDeclarativeProperty::isValid() const { + if (!d) + return false; return type() != Invalid; } @@ -558,6 +567,8 @@ bool QDeclarativeProperty::isValid() const */ QString QDeclarativeProperty::name() const { + if (!d) + return QString(); if (!d->isNameCached) { // ### if (!d->object) { @@ -594,6 +605,8 @@ QString QDeclarativeProperty::name() const */ QMetaProperty QDeclarativeProperty::property() const { + if (!d) + return QMetaProperty(); if (type() & Property && d->core.isValid() && d->object) return d->object->metaObject()->property(d->core.coreIndex); else @@ -606,6 +619,8 @@ QMetaProperty QDeclarativeProperty::property() const */ QMetaMethod QDeclarativeProperty::method() const { + if (!d) + return QMetaMethod(); if (type() & SignalProperty && d->object) return d->object->metaObject()->method(d->core.coreIndex); else @@ -619,7 +634,7 @@ QMetaMethod QDeclarativeProperty::method() const QDeclarativeAbstractBinding * QDeclarativePropertyPrivate::binding(const QDeclarativeProperty &that) { - if (!that.isProperty() || !that.d->object) + if (!that.d || !that.isProperty() || !that.d->object) return 0; return binding(that.d->object, that.d->core.coreIndex, that.d->valueType.valueTypeCoreIdx); @@ -643,7 +658,7 @@ QDeclarativePropertyPrivate::setBinding(const QDeclarativeProperty &that, QDeclarativeAbstractBinding *newBinding, WriteFlags flags) { - if (!that.isProperty() || !that.d->object) { + if (!that.d || !that.isProperty() || !that.d->object) { if (newBinding) newBinding->destroy(); return 0; @@ -893,6 +908,8 @@ QDeclarativePropertyPrivate::setSignalExpression(const QDeclarativeProperty &tha */ QVariant QDeclarativeProperty::read() const { + if (!d) + return QVariant(); if (!d->object) return QVariant(); @@ -1034,8 +1051,10 @@ bool QDeclarativePropertyPrivate::writeEnumProperty(const QMetaProperty &prop, i bool QDeclarativePropertyPrivate::writeValueProperty(const QVariant &value, WriteFlags flags) { // Remove any existing bindings on this property - if (!(flags & DontRemoveBinding)) { - QDeclarativeAbstractBinding *binding = setBinding(*q, 0); + if (!(flags & DontRemoveBinding) && + (type() & QDeclarativeProperty::Property) && object) { + QDeclarativeAbstractBinding *binding = setBinding(object, core.coreIndex, + valueType.valueTypeCoreIdx, 0, flags); if (binding) binding->destroy(); } @@ -1314,6 +1333,8 @@ bool QDeclarativeProperty::reset() const bool QDeclarativePropertyPrivate::write(const QDeclarativeProperty &that, const QVariant &value, WriteFlags flags) { + if (!that.d) + return false; if (that.d->object && that.type() & QDeclarativeProperty::Property && that.d->core.isValid() && that.isWritable()) return that.d->writeValueProperty(value, flags); @@ -1392,12 +1413,12 @@ bool QDeclarativeProperty::connectNotifySignal(QObject *dest, const char *slot) */ int QDeclarativeProperty::index() const { - return d->core.coreIndex; + return d ? d->core.coreIndex : -1; } int QDeclarativePropertyPrivate::valueTypeCoreIndex(const QDeclarativeProperty &that) { - return that.d->valueType.valueTypeCoreIdx; + return that.d ? that.d->valueType.valueTypeCoreIdx : -1; } /*! @@ -1406,6 +1427,8 @@ int QDeclarativePropertyPrivate::valueTypeCoreIndex(const QDeclarativeProperty & */ int QDeclarativePropertyPrivate::bindingIndex(const QDeclarativeProperty &that) { + if (!that.d) + return -1; int rv = that.d->core.coreIndex; if (rv != -1 && that.d->valueType.valueTypeCoreIdx != -1) rv = rv | (that.d->valueType.valueTypeCoreIdx << 24); @@ -1457,6 +1480,7 @@ QDeclarativePropertyPrivate::restore(const QByteArray &data, QObject *object, QD if (data.isEmpty()) return prop; + prop.d = new QDeclarativePropertyPrivate; prop.d->object = object; prop.d->context = ctxt; prop.d->engine = ctxt->engine; diff --git a/src/declarative/qml/qdeclarativeproperty_p.h b/src/declarative/qml/qdeclarativeproperty_p.h index 6392f88..f7d24f1 100644 --- a/src/declarative/qml/qdeclarativeproperty_p.h +++ b/src/declarative/qml/qdeclarativeproperty_p.h @@ -65,23 +65,15 @@ QT_BEGIN_NAMESPACE class QDeclarativeContext; class QDeclarativeEnginePrivate; class QDeclarativeExpression; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativePropertyPrivate +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativePropertyPrivate : public QDeclarativeRefCount { public: enum WriteFlag { BypassInterceptor = 0x01, DontRemoveBinding = 0x02, RemoveBindingOnAliasWrite = 0x04 }; Q_DECLARE_FLAGS(WriteFlags, WriteFlag) QDeclarativePropertyPrivate() - : q(0), context(0), engine(0), object(0), isNameCached(false) {} - + : context(0), engine(0), object(0), isNameCached(false) {} - QDeclarativePropertyPrivate(const QDeclarativePropertyPrivate &other) - : q(0), context(other.context), engine(other.engine), object(other.object), - isNameCached(other.isNameCached), - core(other.core), nameCache(other.nameCache), - valueType(other.valueType) {} - - QDeclarativeProperty *q; QDeclarativeContextData *context; QDeclarativeEngine *engine; QDeclarativeGuard object; @@ -98,6 +90,7 @@ public: bool isValueType() const; int propertyType() const; + QDeclarativeProperty::Type type() const; QDeclarativeProperty::PropertyTypeCategory propertyTypeCategory() const; QVariant readValueProperty(); -- cgit v0.12 From 14f89148d8c6b12c8c6bfb4554428b30bb24b4bc Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 22 Dec 2010 10:47:10 +0100 Subject: Fixed a double selection in QFileDialog when saving Task-number: QTBUG-15504 Reviewed-by: Trust-Me --- src/gui/dialogs/qfiledialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 9509330..9060fae 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -2996,6 +2996,7 @@ void QFileDialogPrivate::_q_useNameFilter(int index) const int fileNameExtensionLength = fileNameExtension.count(); fileName.replace(fileName.count() - fileNameExtensionLength, fileNameExtensionLength, newNameFilterExtension); + qFileDialogUi->listView->clearSelection(); lineEdit()->setText(fileName); } } -- cgit v0.12 From f44f7084a3020ed8e249644d5b5e07f74cb7b070 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 22 Dec 2010 15:56:01 +0100 Subject: Doc: Sync with upstream. --- doc/src/snippets/declarative/focus/focusColumn.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/snippets/declarative/focus/focusColumn.qml b/doc/src/snippets/declarative/focus/focusColumn.qml index 9b761dd..42ee3da 100644 --- a/doc/src/snippets/declarative/focus/focusColumn.qml +++ b/doc/src/snippets/declarative/focus/focusColumn.qml @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the FOO module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: -- cgit v0.12 From 7a3cac878f4f4a7c2cf3ea08557ee63d8c6a9330 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 19 Oct 2010 08:47:29 +0200 Subject: Fixed some tools definitions and properties in symbian profiles. This is needed for Symbian development on Windows using makefiles. RevBy: Trust me --- mkspecs/common/armcc.conf | 1 + mkspecs/common/symbian/symbian.conf | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mkspecs/common/armcc.conf b/mkspecs/common/armcc.conf index 2c765bc..4f178d7 100644 --- a/mkspecs/common/armcc.conf +++ b/mkspecs/common/armcc.conf @@ -37,5 +37,6 @@ QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB QMAKE_LFLAGS_THREAD += QMAKE_AR = armar --create +QMAKE_LIB = armar --create QMAKE_RANLIB = diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 8c79d8b..ed14b32 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -114,11 +114,11 @@ contains(QMAKE_HOST.os,Windows) { } QMAKE_IDL = midl -QMAKE_LIB = ar -ru -QMAKE_RC = windres QMAKE_ZIP = zip -r -9 QMAKE_UNZIP = unzip -o +QMAKE_WRITE_DEFAULT_RC = 1 + QMAKE_TAR = tar -cf QMAKE_GZIP = gzip -9f -- cgit v0.12 From 2de60ba30f86a9dd338359f7269b62ca5d0a2c46 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 30 Dec 2010 17:16:16 +1000 Subject: Forward qmlviewer traces to system's default message handler on Symbian Task-number: QTBUG-16353 Reviewed-by: Christopher Ham --- tools/qml/main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index b9513b9..2df96c0 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -88,6 +88,9 @@ void myMessageOutput(QtMsgType type, const char *msg) ::write(fd, "\n", 1); ::fsync(fd); + if (systemMsgOutput) + systemMsgOutput(type, msg); + switch (type) { case QtFatalMsg: abort(); @@ -529,11 +532,7 @@ QDeclarativeViewer *openFile(const QString &fileName) int main(int argc, char ** argv) { -#if defined (Q_OS_SYMBIAN) - qInstallMsgHandler(myMessageOutput); -#else systemMsgOutput = qInstallMsgHandler(myMessageOutput); -#endif #if defined (Q_WS_X11) || defined (Q_WS_MAC) //### default to using raster graphics backend for now -- cgit v0.12 From 22daf9fbdfaa859db6414d39d9354e7d46f63005 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 30 Dec 2010 17:52:30 +1000 Subject: Add convenience deselect() functions to TextInput and TextEdit Task-number: QTBUG-16059 Reviewed-by: Christopher Ham --- src/declarative/graphicsitems/qdeclarativetextedit.cpp | 13 +++++++++++++ src/declarative/graphicsitems/qdeclarativetextedit_p.h | 1 + src/declarative/graphicsitems/qdeclarativetextinput.cpp | 11 +++++++++++ src/declarative/graphicsitems/qdeclarativetextinput_p.h | 1 + .../qdeclarativetextedit/tst_qdeclarativetextedit.cpp | 7 +++++++ .../qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 7 +++++++ 6 files changed, 40 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index f37fa62..c1314ff 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -996,6 +996,19 @@ void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus) } /*! + \qmlmethod void TextEdit::deselect() + + Removes active text selection. +*/ +void QDeclarativeTextEdit::deselect() +{ + Q_D(QDeclarativeTextEdit); + QTextCursor c = d->control->textCursor(); + c.clearSelection(); + d->control->setTextCursor(c); +} + +/*! \qmlmethod void TextEdit::selectAll() Causes all text to be selected. diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h index 7f12c85..691d995 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h @@ -223,6 +223,7 @@ Q_SIGNALS: void selectByMouseChanged(bool selectByMouse); public Q_SLOTS: + void deselect(); void selectAll(); void selectWord(); void select(int start, int end); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 4649be8..4e1c297 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -1166,6 +1166,17 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property) } /*! + \qmlmethod void TextInput::deselect() + + Removes active text selection. +*/ +void QDeclarativeTextInput::deselect() +{ + Q_D(QDeclarativeTextInput); + d->control->deselect(); +} + +/*! \qmlmethod void TextInput::selectAll() Causes all text to be selected. diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h index 06f77e5..878f040 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h @@ -231,6 +231,7 @@ protected: void focusInEvent(QFocusEvent *event); public Q_SLOTS: + void deselect(); void selectAll(); void selectWord(); void select(int start, int end); diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index a7971cc..c0bb46e 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -689,6 +689,13 @@ void tst_qdeclarativetextedit::selection() QVERIFY(textEditObject->selectedText().size() == 10); textEditObject->select(0,100); QVERIFY(textEditObject->selectedText().size() == 10); + + textEditObject->deselect(); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->select(0,10); + QVERIFY(textEditObject->selectedText().size() == 10); + textEditObject->deselect(); + QVERIFY(textEditObject->selectedText().isNull()); } void tst_qdeclarativetextedit::mouseSelection_data() diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 76e0102..589ffa6 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -392,6 +392,13 @@ void tst_qdeclarativetextinput::selection() textinputObject->select(0,100); QVERIFY(textinputObject->selectedText().size() == 10); + textinputObject->deselect(); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->select(0,10); + QVERIFY(textinputObject->selectedText().size() == 10); + textinputObject->deselect(); + QVERIFY(textinputObject->selectedText().isNull()); + delete textinputObject; } -- cgit v0.12 From e8b736c44426fd4ae832e82a9e624c9737a40213 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 31 Dec 2010 11:28:08 +1000 Subject: Use deselect() function in text selection example Task-number: QTBUG-16059 Reviewed-by: Christopher Ham --- examples/declarative/text/textselection/textselection.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/declarative/text/textselection/textselection.qml b/examples/declarative/text/textselection/textselection.qml index f343be5..c6f44a0 100644 --- a/examples/declarative/text/textselection/textselection.qml +++ b/examples/declarative/text/textselection/textselection.qml @@ -265,7 +265,7 @@ Rectangle { anchors.fill: parent onClicked: { edit.cursorPosition = edit.selectionEnd; - edit.select(edit.cursorPosition, edit.cursorPosition); + edit.deselect(); editor.state = "" } } -- cgit v0.12 From 59ec08d255b7d7bd8975bdbfd0b0a42c1b6ed2a0 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 31 Dec 2010 15:49:48 +1000 Subject: Provide qmlviewer warning window also on Symbian Task-number: QTBUG-10800 Reviewed-by: Christopher Ham --- tools/qml/loggerwidget.cpp | 9 +++++++++ tools/qml/main.cpp | 49 ++++++++++++++++++---------------------------- tools/qml/qmlruntime.cpp | 8 +++++++- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp index 8aa029f..f601d95 100644 --- a/tools/qml/loggerwidget.cpp +++ b/tools/qml/loggerwidget.cpp @@ -64,6 +64,14 @@ LoggerWidget::LoggerWidget(QWidget *parent) : m_plainTextEdit = new QPlainTextEdit(); +#if defined(Q_OS_SYMBIAN) + m_plainTextEdit->setReadOnly(true); + QAction* backAction = new QAction( tr("Back"), this ); + backAction->setSoftKeyRole( QAction::NegativeSoftKey ); + connect(backAction, SIGNAL(triggered()), this, SLOT(hide())); + addAction( backAction ); +#endif + #ifdef Q_WS_MAEMO_5 new TextEditAutoResizer(m_plainTextEdit); setAttribute(Qt::WA_Maemo5StackedWindow); @@ -74,6 +82,7 @@ LoggerWidget::LoggerWidget(QWidget *parent) : #else setCentralWidget(m_plainTextEdit); #endif + readSettings(); setupPreferencesMenu(); } diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 2df96c0..b5a4fd0 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -72,36 +72,15 @@ void exitApp(int i) exit(i); } +QWeakPointer logger; +static QAtomicInt recursiveLock(0); + #if defined (Q_OS_SYMBIAN) #include #include #include #include - -void myMessageOutput(QtMsgType type, const char *msg) -{ - static int fd = -1; - if (fd == -1) - fd = ::open("E:\\qml.log", O_WRONLY | O_CREAT); - - ::write(fd, msg, strlen(msg)); - ::write(fd, "\n", 1); - ::fsync(fd); - - if (systemMsgOutput) - systemMsgOutput(type, msg); - - switch (type) { - case QtFatalMsg: - abort(); - } -} - -#else // !defined (Q_OS_SYMBIAN) - -QWeakPointer logger; - -static QAtomicInt recursiveLock(0); +#endif void myMessageOutput(QtMsgType type, const char *msg) { @@ -118,7 +97,21 @@ void myMessageOutput(QtMsgType type, const char *msg) warnings += QLatin1Char('\n'); } } - if (systemMsgOutput) { // Windows +#if defined (Q_OS_SYMBIAN) + static int fd = -1; + if (fd == -1) + fd = ::open("E:\\qml.log", O_WRONLY | O_CREAT); + + ::write(fd, msg, strlen(msg)); + ::write(fd, "\n", 1); + ::fsync(fd); + switch (type) { + case QtFatalMsg: + abort(); + } +#endif + + if (systemMsgOutput) { systemMsgOutput(type, msg); } else { // Unix fprintf(stderr, "%s\n", msg); @@ -126,8 +119,6 @@ void myMessageOutput(QtMsgType type, const char *msg) } } -#endif - static QDeclarativeViewer* globalViewer = 0; // The qml file that is shown if the user didn't specify a QML file @@ -472,7 +463,6 @@ static QDeclarativeViewer *createViewer() viewer->setScript(opts.script); } -#if !defined(Q_OS_SYMBIAN) logger = viewer->warningsWidget(); if (opts.warningsConfig == ShowWarnings) { logger.data()->setDefaultVisibility(LoggerWidget::ShowWarnings); @@ -480,7 +470,6 @@ static QDeclarativeViewer *createViewer() } else if (opts.warningsConfig == HideWarnings){ logger.data()->setDefaultVisibility(LoggerWidget::HideWarnings); } -#endif if (opts.experimentalGestures) viewer->enableExperimentalGestures(); diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 142e4c5..b829528 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -742,8 +742,10 @@ void QDeclarativeViewer::createMenu() connect(slowAction, SIGNAL(triggered(bool)), this, SLOT(setSlowMode(bool))); showWarningsWindow = new QAction(tr("Show Warnings"), this); +#if !defined(Q_OS_SYMBIAN) showWarningsWindow->setCheckable((true)); showWarningsWindow->setChecked(loggerWindow->isVisible()); +#endif connect(showWarningsWindow, SIGNAL(triggered(bool)), this, SLOT(showWarnings(bool))); QAction *proxyAction = new QAction(tr("HTTP &Proxy..."), this); @@ -826,11 +828,11 @@ void QDeclarativeViewer::createMenu() QMenu *recordMenu = menu->addMenu(tr("&Recording")); recordMenu->addAction(snapshotAction); recordMenu->addAction(recordAction); +#endif // ! Q_OS_SYMBIAN QMenu *debugMenu = menu->addMenu(tr("&Debugging")); debugMenu->addAction(slowAction); debugMenu->addAction(showWarningsWindow); -#endif // ! Q_OS_SYMBIAN QMenu *settingsMenu = menu->addMenu(tr("&Settings")); settingsMenu->addAction(proxyAction); @@ -914,7 +916,11 @@ void QDeclarativeViewer::toggleFullScreen() void QDeclarativeViewer::showWarnings(bool show) { +#if defined(Q_OS_SYMBIAN) + loggerWindow->showMaximized(); +#else loggerWindow->setVisible(show); +#endif } void QDeclarativeViewer::warningsWidgetOpened() -- cgit v0.12 From 086f33dd4c70be03adcbc1703997afa27add920b Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 4 Jan 2011 15:03:53 +1000 Subject: Fix results of number() queries for zero and non-number values Use xs:string() to test whether a value is empty, instead of using a simple boolean check which fails for zero-type values. This fix also means 'NaN' is returned for non-number (including empty) values. Task-number: QTBUG-16423, QTBUG-16265 Reviewed-by: Michael Brasser --- src/declarative/util/qdeclarativexmllistmodel.cpp | 2 +- .../qdeclarativexmllistmodel/data/model2.qml | 11 ---- .../tst_qdeclarativexmllistmodel.cpp | 76 ++++++++++++++++++---- 3 files changed, 64 insertions(+), 25 deletions(-) delete mode 100644 tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index 49a12b1..f5c3ad4 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -382,7 +382,7 @@ void QDeclarativeXmlQuery::doSubQueryJob() for (int i = 0; i < queries.size(); ++i) { QList resultList; if (!queries[i].isEmpty()) { - subquery.setQuery(m_prefix + QLatin1String("(let $v := ") + queries[i] + QLatin1String(" return if ($v) then ") + queries[i] + QLatin1String(" else \"\")")); + subquery.setQuery(m_prefix + QLatin1String("(let $v := string(") + queries[i] + QLatin1String(") return if ($v) then ") + queries[i] + QLatin1String(" else \"\")")); if (subquery.isValid()) { QXmlResultItems resultItems; subquery.evaluateTo(&resultItems); diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml deleted file mode 100644 index e56aafa..0000000 --- a/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml +++ /dev/null @@ -1,11 +0,0 @@ -import QtQuick 1.0 - -XmlListModel { - source: "model.xml" - query: "/Pets/Pet" - XmlRole { name: "name"; query: "name/string()" } - XmlRole { name: "type"; query: "type/string()" } - XmlRole { name: "age"; query: "age/number()" } - XmlRole { name: "size"; query: "size/string()" } - XmlRole { name: "tricks"; query: "tricks/string()" } -} diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp index a14f942..3e81c53 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp +++ b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp @@ -38,6 +38,12 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include + +#include +#include +#include + #include #include #include @@ -75,7 +81,8 @@ private slots: } void buildModel(); - void missingFields(); + void testTypes(); + void testTypes_data(); void cdata(); void attributes(); void roles(); @@ -158,27 +165,70 @@ void tst_qdeclarativexmllistmodel::buildModel() delete model; } -void tst_qdeclarativexmllistmodel::missingFields() +void tst_qdeclarativexmllistmodel::testTypes() { - QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model2.qml")); + QFETCH(QString, xml); + QFETCH(QString, roleName); + QFETCH(QVariant, expectedValue); + + QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/testtypes.qml")); QDeclarativeXmlListModel *model = qobject_cast(component.create()); QVERIFY(model != 0); - QTRY_COMPARE(model->count(), 9); + model->setXml(xml.toUtf8()); + model->reload(); + QTRY_COMPARE(model->count(), 1); - QList roles; - roles << Qt::UserRole << Qt::UserRole + 1 << Qt::UserRole + 2 << Qt::UserRole + 3 << Qt::UserRole + 4; - QHash data = model->data(5, roles); - QVERIFY(data.count() == 5); - QCOMPARE(data.value(Qt::UserRole+3).toString(), QLatin1String("")); - QCOMPARE(data.value(Qt::UserRole+4).toString(), QLatin1String("")); + int role = -1; + foreach (int i, model->roles()) { + if (model->toString(i) == roleName) { + role = i; + break; + } + } + QVERIFY(role >= 0); - data = model->data(7, roles); - QVERIFY(data.count() == 5); - QCOMPARE(data.value(Qt::UserRole+2).toString(), QLatin1String("")); + if (expectedValue.toString() == "nan") + QVERIFY(qIsNaN(model->data(0, role).toDouble())); + else + QCOMPARE(model->data(0, role), expectedValue); delete model; } +void tst_qdeclarativexmllistmodel::testTypes_data() +{ + QTest::addColumn("xml"); + QTest::addColumn("roleName"); + QTest::addColumn("expectedValue"); + + QTest::newRow("missing string field") << "" + << "stringValue" << QVariant(""); + QTest::newRow("empty string") << "" + << "stringValue" << QVariant(""); + QTest::newRow("1-char string") << "5" + << "stringValue" << QVariant("5"); + QTest::newRow("string ok") << "abc def g" + << "stringValue" << QVariant("abc def g"); + + QTest::newRow("missing number field") << "" + << "numberValue" << QVariant(""); + double nan = qQNaN(); + QTest::newRow("empty number field") << "" + << "numberValue" << QVariant(nan); + QTest::newRow("number field with string") << "a string" + << "numberValue" << QVariant(nan); + QTest::newRow("-1") << "-1" + << "numberValue" << QVariant("-1"); + QTest::newRow("-1.5") << "-1.5" + << "numberValue" << QVariant("-1.5"); + QTest::newRow("0") << "0" + << "numberValue" << QVariant("0"); + QTest::newRow("+1") << "1" + << "numberValue" << QVariant("1"); + QTest::newRow("+1.5") << "1.5" + << "numberValue" << QVariant("1.5"); +} + void tst_qdeclarativexmllistmodel::cdata() { QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/recipes.qml")); -- cgit v0.12 From 31460847fed4bc0867c3fd78466fed32e407fafb Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 4 Jan 2011 14:21:26 +1000 Subject: Fix translation in Connections element. Provide the component's file name to the expression as the translation context. Task-number: QTBUG-10300 Reviewed-by: Martin Jones --- src/declarative/util/qdeclarativeconnections.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/declarative/util/qdeclarativeconnections.cpp b/src/declarative/util/qdeclarativeconnections.cpp index 15e5ac5..e102f2c 100644 --- a/src/declarative/util/qdeclarativeconnections.cpp +++ b/src/declarative/util/qdeclarativeconnections.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -257,7 +258,11 @@ void QDeclarativeConnections::connectSignals() if (prop.isValid() && (prop.type() & QDeclarativeProperty::SignalProperty)) { QDeclarativeBoundSignal *signal = new QDeclarativeBoundSignal(target(), prop.method(), this); - signal->setExpression(new QDeclarativeExpression(qmlContext(this), 0, script)); + QDeclarativeExpression *expression = new QDeclarativeExpression(qmlContext(this), 0, script); + QDeclarativeData *ddata = QDeclarativeData::get(this); + if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) + expression->setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); + signal->setExpression(expression); d->boundsignals += signal; } else { if (!d->ignoreUnknownSignals) -- cgit v0.12 From 3753b15e88f2c8220b887f27be79491c4135a291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 6 Dec 2010 16:13:34 +0100 Subject: Added window focus handling to lighthouse The idea is that QPlatformWindows can request focus handling. And when actual focus shifting is done by windowsystem callbacks/events which are sent to QWindowSystemInterface --- src/gui/kernel/qapplication_p.h | 2 ++ src/gui/kernel/qapplication_qpa.cpp | 7 +++++++ src/gui/kernel/qplatformwindow_qpa.cpp | 19 +++++++++++++++++++ src/gui/kernel/qplatformwindow_qpa.h | 1 + src/gui/kernel/qwidget_qpa.cpp | 8 ++------ src/gui/kernel/qwindowsysteminterface_qpa.cpp | 6 ++++++ src/gui/kernel/qwindowsysteminterface_qpa.h | 1 + src/gui/kernel/qwindowsysteminterface_qpa_p.h | 9 +++++++++ src/plugins/platforms/testlite/qtestlitewindow.cpp | 22 ++++++++++++++++++++++ src/plugins/platforms/testlite/qtestlitewindow.h | 3 +++ 10 files changed, 72 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 7b49999..73c4462 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -508,6 +508,8 @@ public: static void processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e); static void processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e); + static void processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e); + static void processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e); // static void reportScreenCount(int count); diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp index ece035c..a587e8e 100644 --- a/src/gui/kernel/qapplication_qpa.cpp +++ b/src/gui/kernel/qapplication_qpa.cpp @@ -111,6 +111,9 @@ void QApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate case QWindowSystemInterfacePrivate::Leave: QApplicationPrivate::processLeaveEvent(static_cast(e)); break; + case QWindowSystemInterfacePrivate::ActivatedWindow: + QApplicationPrivate::processActivatedEvent(static_cast(e)); + break; case QWindowSystemInterfacePrivate::Close: QApplicationPrivate::processCloseEvent( static_cast(e)); @@ -823,6 +826,10 @@ void QApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Leave } +void QApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e) +{ + QApplication::setActiveWindow(e->activated.data()); +} void QApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e) { diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index 29eaa82..b6b6693 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -41,6 +41,7 @@ #include "qplatformwindow_qpa.h" +#include #include class QPlatformWindowPrivate @@ -171,6 +172,24 @@ void QPlatformWindow::setOpacity(qreal level) } /*! + Reimplement to let Qt be able to request activation/focus for a window + + Some window systems will probably not have callbacks for this functionality, + and then calling QWindowSystemInterface::handleWindowActivated(QWidget *w) + would be sufficient. + + If the window system has some event handling/callbacks then call + QWindowSystemInterface::handleWindowActivated(QWidget *w) when the window system + gives the notification. + + Default implementation calls QWindowSystem::handleWindowActivated(QWidget *w) +*/ +void QPlatformWindow::requestActivateWindow() +{ + QWindowSystemInterface::handleWindowActivated(widget()); +} + +/*! Reimplement to return the glContext associated with the window. */ QPlatformGLContext *QPlatformWindow::glContext() const diff --git a/src/gui/kernel/qplatformwindow_qpa.h b/src/gui/kernel/qplatformwindow_qpa.h index 4f6fedc..abc35d1 100644 --- a/src/gui/kernel/qplatformwindow_qpa.h +++ b/src/gui/kernel/qplatformwindow_qpa.h @@ -80,6 +80,7 @@ public: virtual void lower(); virtual void setOpacity(qreal level); + virtual void requestActivateWindow(); virtual QPlatformGLContext *glContext() const; protected: diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index 617d984..1279e0a 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -379,9 +379,8 @@ QWidget *QWidget::keyboardGrabber() void QWidget::activateWindow() { - // XXX -// qDebug() << "QWidget::activateWindow" << this; - QApplication::setActiveWindow(this); //##### + if (platformWindow()) + platformWindow()->requestActivateWindow(); } void QWidgetPrivate::show_sys() @@ -409,9 +408,6 @@ void QWidgetPrivate::show_sys() } if (window) window->setVisible(true); - - if (q->isWindow() && q->windowType() != Qt::Popup && q->windowType() != Qt::ToolTip && !(q->windowFlags() & Qt::X11BypassWindowManagerHint)) - q->activateWindow(); //### QWindowSystemInterface should have callback function for when WS actually activates window. } } diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index bb29cbf..b6177b0 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -82,6 +82,12 @@ void QWindowSystemInterface::handleLeaveEvent(QWidget *tlw) QWindowSystemInterfacePrivate::queueWindowSystemEvent(e); } +void QWindowSystemInterface::handleWindowActivated(QWidget *tlw) +{ + QWindowSystemInterfacePrivate::ActivatedWindowEvent *e = new QWindowSystemInterfacePrivate::ActivatedWindowEvent(tlw); + QWindowSystemInterfacePrivate::queueWindowSystemEvent(e); +} + void QWindowSystemInterface::handleGeometryChange(QWidget *tlw, const QRect &newRect) { if (tlw) { diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.h b/src/gui/kernel/qwindowsysteminterface_qpa.h index 1c79f2a..39c2f79 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.h +++ b/src/gui/kernel/qwindowsysteminterface_qpa.h @@ -83,6 +83,7 @@ public: static void handleCloseEvent(QWidget *w); static void handleEnterEvent(QWidget *w); static void handleLeaveEvent(QWidget *w); + static void handleWindowActivated(QWidget *w); // Changes to the screen static void handleScreenGeometryChange(int screenIndex); diff --git a/src/gui/kernel/qwindowsysteminterface_qpa_p.h b/src/gui/kernel/qwindowsysteminterface_qpa_p.h index 78e1f33..3491a1a 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa_p.h +++ b/src/gui/kernel/qwindowsysteminterface_qpa_p.h @@ -54,6 +54,7 @@ public: GeometryChange, Enter, Leave, + ActivatedWindow, Mouse, Wheel, Key, @@ -102,6 +103,14 @@ public: QWeakPointer leave; }; + class ActivatedWindowEvent : public WindowSystemEvent { + public: + ActivatedWindowEvent(QWidget *activatedWindow) + : WindowSystemEvent(ActivatedWindow), activated(activatedWindow) + { } + QWeakPointer activated; + }; + class UserEvent : public WindowSystemEvent { public: UserEvent(QWidget * w, ulong time, EventType t) diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index b52aae9..5f9d387 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -318,6 +318,16 @@ void QTestLiteWindow::handleLeaveEvent() QWindowSystemInterface::handleLeaveEvent(widget()); } +void QTestLiteWindow::handleFocusInEvent() +{ + QWindowSystemInterface::handleWindowActivated(widget()); +} + +void QTestLiteWindow::handleFocusOutEvent() +{ + QWindowSystemInterface::handleWindowActivated(0); +} + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Key event stuff -- not pretty either @@ -694,6 +704,10 @@ void QTestLiteWindow::paintEvent() surface->flush(widget(), QRect(xpos,ypos,width, height), QPoint()); } +void QTestLiteWindow::requestActivateWindow() +{ + XSetInputFocus(xd->display, x_window, XRevertToParent, CurrentTime); +} void QTestLiteWindow::resizeEvent(XConfigureEvent *e) { @@ -1456,6 +1470,14 @@ bool MyDisplay::handleEvent(XEvent *xe) xw->handleLeaveEvent(); break; + case XFocusIn: + xw->handleFocusInEvent(); + break; + + case XFocusOut: + xw->handleFocusOutEvent(); + break; + default: #ifdef MYX11_DEBUG qDebug() << hex << xe->xany.window << "Other X event" << xe->type; diff --git a/src/plugins/platforms/testlite/qtestlitewindow.h b/src/plugins/platforms/testlite/qtestlitewindow.h index dc628f1..69442f1 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.h +++ b/src/plugins/platforms/testlite/qtestlitewindow.h @@ -109,10 +109,13 @@ public: void handleCloseEvent(); void handleEnterEvent(); void handleLeaveEvent(); + void handleFocusInEvent(); + void handleFocusOutEvent(); void resizeEvent(XConfigureEvent *configure_event); void paintEvent(); + void requestActivateWindow(); void setGeometry(const QRect &rect); -- cgit v0.12 From f6c5b16768d45f196bab0a2766d4be6027991e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 8 Dec 2010 13:09:36 +0100 Subject: Add function QPlatformScreen::platformScreenForWidget This so there is some logical connection between what screen a widget belongs to --- src/gui/kernel/qdesktopwidget_qpa_p.h | 8 ++++++- src/gui/kernel/qplatformscreen_qpa.cpp | 15 ++++++++++++++ src/gui/kernel/qplatformscreen_qpa.h | 4 ++++ src/gui/kernel/qwidget.cpp | 5 ++--- src/gui/kernel/qwidget_p.h | 5 ++--- src/gui/kernel/qwidget_qpa.cpp | 38 ++++++---------------------------- 6 files changed, 36 insertions(+), 39 deletions(-) diff --git a/src/gui/kernel/qdesktopwidget_qpa_p.h b/src/gui/kernel/qdesktopwidget_qpa_p.h index 8bed09d..47ccca2 100644 --- a/src/gui/kernel/qdesktopwidget_qpa_p.h +++ b/src/gui/kernel/qdesktopwidget_qpa_p.h @@ -59,7 +59,13 @@ class QDesktopScreenWidget : public QWidget { Q_OBJECT public: - QDesktopScreenWidget(int screenNumber = -1) { setWindowFlags(Qt::Desktop); setVisible(false); d_func()->screenNumber = screenNumber; } + QDesktopScreenWidget(int screenNumber = -1) + { + setWindowFlags(Qt::Desktop); + setVisible(false); + QTLWExtra *topData = d_func()->topData(); + topData->screenIndex = screenNumber; + } }; class QDesktopWidgetPrivate : public QWidgetPrivate { diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp index 5e80ba8..118835f 100644 --- a/src/gui/kernel/qplatformscreen_qpa.cpp +++ b/src/gui/kernel/qplatformscreen_qpa.cpp @@ -41,7 +41,11 @@ #include "qplatformscreen_qpa.h" #include +#include #include +#include +#include +#include /*! Return the given top level widget for a given position. @@ -77,6 +81,17 @@ QSize QPlatformScreen::physicalSize() const return QSize(width,height); } +Q_GUI_EXPORT extern QWidgetPrivate *qt_widget_private(QWidget *widget); +QPlatformScreen * QPlatformScreen::platformScreenForWidget(const QWidget *widget) +{ + QWidget *window = widget->window(); + QWidgetPrivate *windowPrivate = qt_widget_private(window); + QTLWExtra * topData = windowPrivate->topData(); + QPlatformIntegration *integration = + QApplicationPrivate::platformIntegration(); + return integration->screens()[topData->screenIndex]; +} + /*! \class QPlatformScreen \since 4.8 diff --git a/src/gui/kernel/qplatformscreen_qpa.h b/src/gui/kernel/qplatformscreen_qpa.h index 9080489..1f52764 100644 --- a/src/gui/kernel/qplatformscreen_qpa.h +++ b/src/gui/kernel/qplatformscreen_qpa.h @@ -73,6 +73,10 @@ public: //jl: should setDirty be removed. virtual void setDirty(const QRect &) {} virtual QWidget *topLevelAt(const QPoint &point) const; + + //jl: should this function be in QPlatformIntegration + //jl: maybe screenForWidget is a better name? + static QPlatformScreen *platformScreenForWidget(const QWidget *widget); }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 16f64ff..6a6a218 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -303,8 +303,6 @@ QWidgetPrivate::QWidgetPrivate(int version) , hasAlienChildren(0) , window_event(0) , qd_hd(0) -#elif defined (Q_WS_QPA) - , screenNumber(0) #endif { if (!qApp) { @@ -1277,7 +1275,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) } #elif defined(Q_WS_QPA) if (desktopWidget) { - int screen = desktopWidget->d_func()->screenNumber; + int screen = desktopWidget->d_func()->topData()->screenIndex; QPlatformIntegration *platform = QApplicationPrivate::platformIntegration(); platform->moveToScreen(q, screen); } @@ -1729,6 +1727,7 @@ void QWidgetPrivate::createTLExtra() #if defined(Q_WS_QPA) x->platformWindow = 0; x->platformWindowFormat = QPlatformWindowFormat::defaultFormat(); + x->screenIndex = 0; #endif } } diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 6b85391..a0f0ec8 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -233,6 +233,7 @@ struct QTLWExtra { #elif defined(Q_WS_QPA) QPlatformWindow *platformWindow; QPlatformWindowFormat platformWindowFormat; + quint32 screenIndex; // index in qplatformscreenlist #endif }; @@ -885,11 +886,9 @@ public: void updateCursor() const; #endif QScreen* getScreen() const; -#elif defined(Q_WS_QPA) +#elif defined(Q_WS_QPA) // <--------------------------------------------------------- QPA void setMaxWindowState_helper(); void setFullScreenSize_helper(); - - int screenNumber; // screen the widget should be displayed on #ifndef QT_NO_CURSOR void updateCursor() const; #endif diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index 1279e0a..24ab8f7 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -53,7 +53,6 @@ #include QT_BEGIN_NAMESPACE -static QPlatformScreen *qt_screenForWidget(const QWidget *w); void q_createNativeChildrenAndSetParent(QPlatformWindow *parentWindow, const QWidget *parentWidget) { @@ -122,7 +121,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO } } - QApplicationPrivate::platformIntegration()->moveToScreen(q, screenNumber); + QApplicationPrivate::platformIntegration()->moveToScreen(q, topData()->screenIndex); // qDebug() << "create_sys" << q << q->internalWinId(); } @@ -173,7 +172,7 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) // programmer specified desktop widget // get the desktop's screen number - targetScreen = newparent->d_func()->screenNumber; + targetScreen = newparent->window()->d_func()->topData()->screenIndex; newparent = 0; } @@ -192,7 +191,7 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) f |= Qt::Window; if (targetScreen == -1) { if (parent) - targetScreen = qobject_cast(parent)->d_func()->screenNumber; + targetScreen = q->parentWidget()->window()->d_func()->topData()->screenIndex; } } @@ -228,7 +227,8 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) // move the window to the selected screen if (!newparent && targetScreen != -1) { - screenNumber = targetScreen; + if (maybeTopData()) + maybeTopData()->screenIndex = targetScreen; // only if it is already created if (q->testAttribute(Qt::WA_WState_Created)) { QPlatformIntegration *platform = QApplicationPrivate::platformIntegration(); @@ -643,37 +643,11 @@ void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r) scrollRect(r, dx, dy); } -static QPlatformScreen *qt_screenForWidget(const QWidget *w) -{ - if (!w) - return 0; - QRect frame = w->frameGeometry(); - if (!w->isWindow()) - frame.moveTopLeft(w->mapToGlobal(QPoint(0, 0))); - const QPoint p = (frame.topLeft() + frame.bottomRight()) / 2; - - QPlatformIntegration *pi = QApplicationPrivate::platformIntegration(); - QList screens = pi->screens(); - - for (int i = 0; i < screens.size(); ++i) { - if (screens[i]->geometry().contains(p)) - return screens[i]; - } - - // Assume screen zero if we have it. - if (!screens.isEmpty()) - return screens[0]; - else - qWarning("qt_screenForWidget: no screens"); - - return 0; -} - int QWidget::metric(PaintDeviceMetric m) const { Q_D(const QWidget); - QPlatformScreen *screen = qt_screenForWidget(this); + QPlatformScreen *screen = QPlatformScreen::platformScreenForWidget(this); if (!screen) { if (m == PdmDpiX || m == PdmDpiY) return 72; -- cgit v0.12 From 337f75854883fb93e1b4f41e10c79dc7c352f4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 8 Dec 2010 13:11:30 +0100 Subject: Refactoring of testlite to conform with Lighthouse structure --- src/plugins/platforms/testlite/qglxintegration.cpp | 75 +- src/plugins/platforms/testlite/qglxintegration.h | 18 +- src/plugins/platforms/testlite/qtestlitecursor.cpp | 200 +++++ src/plugins/platforms/testlite/qtestlitecursor.h | 69 ++ .../platforms/testlite/qtestliteintegration.cpp | 65 +- .../platforms/testlite/qtestliteintegration.h | 29 +- src/plugins/platforms/testlite/qtestlitescreen.cpp | 430 ++++++++++ src/plugins/platforms/testlite/qtestlitescreen.h | 103 +++ src/plugins/platforms/testlite/qtestlitewindow.cpp | 871 ++------------------- src/plugins/platforms/testlite/qtestlitewindow.h | 96 +-- .../platforms/testlite/qtestlitewindowsurface.cpp | 34 +- .../platforms/testlite/qtestlitewindowsurface.h | 2 +- src/plugins/platforms/testlite/testlite.pro | 9 +- 13 files changed, 1005 insertions(+), 996 deletions(-) create mode 100644 src/plugins/platforms/testlite/qtestlitecursor.cpp create mode 100644 src/plugins/platforms/testlite/qtestlitecursor.h create mode 100644 src/plugins/platforms/testlite/qtestlitescreen.cpp create mode 100644 src/plugins/platforms/testlite/qtestlitescreen.h diff --git a/src/plugins/platforms/testlite/qglxintegration.cpp b/src/plugins/platforms/testlite/qglxintegration.cpp index a4b7b69..1dffb3e 100644 --- a/src/plugins/platforms/testlite/qglxintegration.cpp +++ b/src/plugins/platforms/testlite/qglxintegration.cpp @@ -44,6 +44,7 @@ #include #include "qtestlitewindow.h" +#include "qtestlitescreen.h" #include #include @@ -57,9 +58,9 @@ QT_BEGIN_NAMESPACE -QMutex QGLXGLContext::m_defaultSharedContextMutex(QMutex::Recursive); +QMutex QGLXContext::m_defaultSharedContextMutex(QMutex::Recursive); -QVector QGLXGLContext::buildSpec(const QPlatformWindowFormat &format) +QVector QGLXContext::buildSpec(const QPlatformWindowFormat &format) { QVector spec(48); int i = 0; @@ -111,7 +112,7 @@ QVector QGLXGLContext::buildSpec(const QPlatformWindowFormat &format) return spec; } -GLXFBConfig QGLXGLContext::findConfig(const MyDisplay *xd, const QPlatformWindowFormat &format) +GLXFBConfig QGLXContext::findConfig(const QTestLiteScreen *screen, const QPlatformWindowFormat &format) { bool reduced = true; GLXFBConfig chosenConfig = 0; @@ -120,7 +121,7 @@ GLXFBConfig QGLXGLContext::findConfig(const MyDisplay *xd, const QPlatformWindow QVector spec = buildSpec(reducedFormat); int confcount = 0; GLXFBConfig *configs; - configs = glXChooseFBConfig(xd->display,xd->screen,spec.constData(),&confcount); + configs = glXChooseFBConfig(screen->display(),screen->xScreenNumber(),spec.constData(),&confcount); if (confcount) { for (int i = 0; i < confcount; i++) { @@ -128,7 +129,7 @@ GLXFBConfig QGLXGLContext::findConfig(const MyDisplay *xd, const QPlatformWindow // Make sure we try to get an ARGB visual if the format asked for an alpha: if (reducedFormat.alpha()) { int alphaSize; - glXGetFBConfigAttrib(xd->display,configs[i],GLX_ALPHA_SIZE,&alphaSize); + glXGetFBConfigAttrib(screen->display(),configs[i],GLX_ALPHA_SIZE,&alphaSize); if (alphaSize > 0) break; } else { @@ -147,14 +148,14 @@ GLXFBConfig QGLXGLContext::findConfig(const MyDisplay *xd, const QPlatformWindow return chosenConfig; } -XVisualInfo *QGLXGLContext::findVisualInfo(const MyDisplay *xd, const QPlatformWindowFormat &format) +XVisualInfo *QGLXContext::findVisualInfo(const QTestLiteScreen *screen, const QPlatformWindowFormat &format) { - GLXFBConfig config = QGLXGLContext::findConfig(xd,format); - XVisualInfo *visualInfo = glXGetVisualFromFBConfig(xd->display,config); + GLXFBConfig config = QGLXContext::findConfig(screen,format); + XVisualInfo *visualInfo = glXGetVisualFromFBConfig(screen->display(),config); return visualInfo; } -QPlatformWindowFormat QGLXGLContext::platformWindowFromGLXFBConfig(Display *display, GLXFBConfig config, GLXContext ctx) +QPlatformWindowFormat QGLXContext::platformWindowFromGLXFBConfig(Display *display, GLXFBConfig config, GLXContext ctx) { QPlatformWindowFormat format; int redSize = 0; @@ -210,7 +211,7 @@ QPlatformWindowFormat QGLXGLContext::platformWindowFromGLXFBConfig(Display *disp return format; } -QPlatformWindowFormat QGLXGLContext::reducePlatformWindowFormat(const QPlatformWindowFormat &format, bool *reduced) +QPlatformWindowFormat QGLXContext::reducePlatformWindowFormat(const QPlatformWindowFormat &format, bool *reduced) { QPlatformWindowFormat retFormat = format; *reduced = true; @@ -235,9 +236,9 @@ QPlatformWindowFormat QGLXGLContext::reducePlatformWindowFormat(const QPlatformW return retFormat; } -QGLXGLContext::QGLXGLContext(Window window, MyDisplay *xd, const QPlatformWindowFormat &format) +QGLXContext::QGLXContext(Window window, QTestLiteScreen *screen, const QPlatformWindowFormat &format) : QPlatformGLContext() - , m_xd(xd) + , m_screen(screen) , m_drawable((Drawable)window) , m_context(0) { @@ -246,7 +247,7 @@ QGLXGLContext::QGLXGLContext(Window window, MyDisplay *xd, const QPlatformWindow if (format.useDefaultSharedContext()) { if (!QPlatformGLContext::defaultSharedContext()) { if (m_defaultSharedContextMutex.tryLock()){ - createDefaultSharedContex(xd); + createDefaultSharedContex(screen); m_defaultSharedContextMutex.unlock(); } else { m_defaultSharedContextMutex.lock(); //wait to the the shared context is created @@ -259,32 +260,32 @@ QGLXGLContext::QGLXGLContext(Window window, MyDisplay *xd, const QPlatformWindow } GLXContext shareGlxContext = 0; if (sharePlatformContext) - shareGlxContext = static_cast(sharePlatformContext)->glxContext(); + shareGlxContext = static_cast(sharePlatformContext)->glxContext(); - GLXFBConfig config = findConfig(xd,format); - m_context = glXCreateNewContext(xd->display,config,GLX_RGBA_TYPE,shareGlxContext,TRUE); - m_windowFormat = QGLXGLContext::platformWindowFromGLXFBConfig(xd->display,config,m_context); + GLXFBConfig config = findConfig(screen,format); + m_context = glXCreateNewContext(screen->display(),config,GLX_RGBA_TYPE,shareGlxContext,TRUE); + m_windowFormat = QGLXContext::platformWindowFromGLXFBConfig(screen->display(),config,m_context); #ifdef MYX11_DEBUG qDebug() << "QGLXGLContext::create context" << m_context; #endif } -QGLXGLContext::QGLXGLContext(MyDisplay *display, Drawable drawable, GLXContext context) - : QPlatformGLContext(), m_xd(display), m_drawable(drawable), m_context(context) +QGLXContext::QGLXContext(QTestLiteScreen *screen, Drawable drawable, GLXContext context) + : QPlatformGLContext(), m_screen(screen), m_drawable(drawable), m_context(context) { } -QGLXGLContext::~QGLXGLContext() +QGLXContext::~QGLXContext() { if (m_context) { qDebug("Destroying GLX context 0x%p", m_context); - glXDestroyContext(m_xd->display, m_context); + glXDestroyContext(m_screen->display(), m_context); } } -void QGLXGLContext::createDefaultSharedContex(MyDisplay *xd) +void QGLXContext::createDefaultSharedContex(QTestLiteScreen *screen) { int x = 0; int y = 0; @@ -293,45 +294,45 @@ void QGLXGLContext::createDefaultSharedContex(MyDisplay *xd) QPlatformWindowFormat format = QPlatformWindowFormat::defaultFormat(); GLXContext context; - GLXFBConfig config = findConfig(xd,format); + GLXFBConfig config = findConfig(screen,format); if (config) { - XVisualInfo *visualInfo = glXGetVisualFromFBConfig(xd->display,config); - Colormap cmap = XCreateColormap(xd->display,xd->rootWindow(),visualInfo->visual,AllocNone); + XVisualInfo *visualInfo = glXGetVisualFromFBConfig(screen->display(),config); + Colormap cmap = XCreateColormap(screen->display(),screen->rootWindow(),visualInfo->visual,AllocNone); XSetWindowAttributes a; a.colormap = cmap; - Window sharedWindow = XCreateWindow(xd->display, xd->rootWindow(),x, y, w, h, + Window sharedWindow = XCreateWindow(screen->display(), screen->rootWindow(),x, y, w, h, 0, visualInfo->depth, InputOutput, visualInfo->visual, CWColormap, &a); - context = glXCreateNewContext(xd->display,config,GLX_RGBA_TYPE,0,TRUE); - QPlatformGLContext *sharedContext = new QGLXGLContext(xd,sharedWindow,context); + context = glXCreateNewContext(screen->display(),config,GLX_RGBA_TYPE,0,TRUE); + QPlatformGLContext *sharedContext = new QGLXContext(screen,sharedWindow,context); QPlatformGLContext::setDefaultSharedContext(sharedContext); } else { qWarning("Warning no shared context created"); } } -void QGLXGLContext::makeCurrent() +void QGLXContext::makeCurrent() { QPlatformGLContext::makeCurrent(); #ifdef MYX11_DEBUG qDebug("QGLXGLContext::makeCurrent(window=0x%x, ctx=0x%x)", m_drawable, m_context); #endif - glXMakeCurrent(m_xd->display, m_drawable, m_context); + glXMakeCurrent(m_screen->display(), m_drawable, m_context); } -void QGLXGLContext::doneCurrent() +void QGLXContext::doneCurrent() { QPlatformGLContext::doneCurrent(); - glXMakeCurrent(m_xd->display, 0, 0); + glXMakeCurrent(m_screen->display(), 0, 0); } -void QGLXGLContext::swapBuffers() +void QGLXContext::swapBuffers() { - glXSwapBuffers(m_xd->display, m_drawable); + glXSwapBuffers(m_screen->display(), m_drawable); } -void* QGLXGLContext::getProcAddress(const QString& procName) +void* QGLXContext::getProcAddress(const QString& procName) { typedef void *(*qt_glXGetProcAddressARB)(const GLubyte *); static qt_glXGetProcAddressARB glXGetProcAddressARB = 0; @@ -340,7 +341,7 @@ void* QGLXGLContext::getProcAddress(const QString& procName) if (resolved && !glXGetProcAddressARB) return 0; if (!glXGetProcAddressARB) { - QList glxExt = QByteArray(glXGetClientString(m_xd->display, GLX_EXTENSIONS)).split(' '); + QList glxExt = QByteArray(glXGetClientString(m_screen->display(), GLX_EXTENSIONS)).split(' '); if (glxExt.contains("GLX_ARB_get_proc_address")) { #if defined(Q_OS_LINUX) || defined(Q_OS_BSD4) void *handle = dlopen(NULL, RTLD_LAZY); @@ -364,7 +365,7 @@ void* QGLXGLContext::getProcAddress(const QString& procName) return glXGetProcAddressARB(reinterpret_cast(procName.toLatin1().data())); } -QPlatformWindowFormat QGLXGLContext::platformWindowFormat() const +QPlatformWindowFormat QGLXContext::platformWindowFormat() const { return m_windowFormat; } diff --git a/src/plugins/platforms/testlite/qglxintegration.h b/src/plugins/platforms/testlite/qglxintegration.h index e17790e..5ae0b2a 100644 --- a/src/plugins/platforms/testlite/qglxintegration.h +++ b/src/plugins/platforms/testlite/qglxintegration.h @@ -53,13 +53,11 @@ QT_BEGIN_NAMESPACE -class MyDisplay; - -class QGLXGLContext : public QPlatformGLContext +class QGLXContext : public QPlatformGLContext { public: - QGLXGLContext(Window window, MyDisplay *xd, const QPlatformWindowFormat &format); - ~QGLXGLContext(); + QGLXContext(Window window, QTestLiteScreen *xd, const QPlatformWindowFormat &format); + ~QGLXContext(); virtual void makeCurrent(); virtual void doneCurrent(); @@ -70,22 +68,22 @@ public: QPlatformWindowFormat platformWindowFormat() const; - static XVisualInfo *findVisualInfo(const MyDisplay *xd, const QPlatformWindowFormat &format); + static XVisualInfo *findVisualInfo(const QTestLiteScreen *xd, const QPlatformWindowFormat &format); private: - static GLXFBConfig findConfig(const MyDisplay *xd,const QPlatformWindowFormat &format); + static GLXFBConfig findConfig(const QTestLiteScreen *xd,const QPlatformWindowFormat &format); static QVector buildSpec(const QPlatformWindowFormat &format); static QPlatformWindowFormat platformWindowFromGLXFBConfig(Display *display, GLXFBConfig config, GLXContext context); static QPlatformWindowFormat reducePlatformWindowFormat(const QPlatformWindowFormat &format, bool *reduced); - MyDisplay *m_xd; + QTestLiteScreen *m_screen; Drawable m_drawable; GLXContext m_context; QPlatformWindowFormat m_windowFormat; - QGLXGLContext (MyDisplay *display, Drawable drawable, GLXContext context); + QGLXContext (QTestLiteScreen *screen, Drawable drawable, GLXContext context); static QMutex m_defaultSharedContextMutex; - static void createDefaultSharedContex(MyDisplay *xd); + static void createDefaultSharedContex(QTestLiteScreen *xd); }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestlitecursor.cpp b/src/plugins/platforms/testlite/qtestlitecursor.cpp new file mode 100644 index 0000000..4f3f0cb --- /dev/null +++ b/src/plugins/platforms/testlite/qtestlitecursor.cpp @@ -0,0 +1,200 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenVG module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qtestlitecursor.h" + +#include "qtestliteintegration.h" +#include "qtestlitescreen.h" +#include "qtestlitewindow.h" + +#include + +#include + +QT_BEGIN_NAMESPACE + +QTestLiteCursor::QTestLiteCursor(QTestLiteScreen *screen) + : QPlatformCursor(screen) +{ +} + +void QTestLiteCursor::changeCursor(QCursor *cursor, QWidget *widget) +{ + QTestLiteWindow *w = 0; + if (widget) { + QWidget *window = widget->window(); + w = static_cast(window->platformWindow()); + } else { + // No X11 cursor control when there is no widget under the cursor + return; + } + + if (!w) + return; + + int id = cursor->handle(); + if (id == currentCursor) + return; + Cursor c; + if (!cursorMap.contains(id)) { + if (cursor->shape() == Qt::BitmapCursor) + c = createCursorBitmap(cursor); + else + c = createCursorShape(cursor->shape()); + if (!c) { + return; + } + cursorMap.insert(id, c); + } else { + c = cursorMap.value(id); + } + + w->setCursor(c); +} + +Cursor QTestLiteCursor::createCursorBitmap(QCursor * cursor) +{ + XColor bg, fg; + bg.red = 255 << 8; + bg.green = 255 << 8; + bg.blue = 255 << 8; + fg.red = 0; + fg.green = 0; + fg.blue = 0; + QPoint spot = cursor->hotSpot(); + Window rootwin = testLiteScreen()->rootWindow(); + + QImage mapImage = cursor->bitmap()->toImage().convertToFormat(QImage::Format_MonoLSB); + QImage maskImage = cursor->mask()->toImage().convertToFormat(QImage::Format_MonoLSB); + + int width = cursor->bitmap()->width(); + int height = cursor->bitmap()->height(); + int bytesPerLine = mapImage.bytesPerLine(); + int destLineSize = width / 8; + if (width % 8) + destLineSize++; + + const uchar * map = mapImage.bits(); + const uchar * mask = maskImage.bits(); + + char * mapBits = new char[height * destLineSize]; + char * maskBits = new char[height * destLineSize]; + for (int i = 0; i < height; i++) { + memcpy(mapBits + (destLineSize * i),map + (bytesPerLine * i), destLineSize); + memcpy(maskBits + (destLineSize * i),mask + (bytesPerLine * i), destLineSize); + } + + Pixmap cp = XCreateBitmapFromData(testLiteScreen()->display(), rootwin, mapBits, width, height); + Pixmap mp = XCreateBitmapFromData(testLiteScreen()->display(), rootwin, maskBits, width, height); + Cursor c = XCreatePixmapCursor(testLiteScreen()->display(), cp, mp, &fg, &bg, spot.x(), spot.y()); + XFreePixmap(testLiteScreen()->display(), cp); + XFreePixmap(testLiteScreen()->display(), mp); + delete[] mapBits; + delete[] maskBits; + + return c; +} + +Cursor QTestLiteCursor::createCursorShape(int cshape) +{ + Cursor cursor = 0; + + if (cshape < 0 || cshape > Qt::LastCursor) + return 0; + + switch (cshape) { + case Qt::ArrowCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_left_ptr); + break; + case Qt::UpArrowCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_center_ptr); + break; + case Qt::CrossCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_crosshair); + break; + case Qt::WaitCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_watch); + break; + case Qt::IBeamCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_xterm); + break; + case Qt::SizeAllCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_fleur); + break; + case Qt::PointingHandCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_hand2); + break; + case Qt::SizeBDiagCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_top_right_corner); + break; + case Qt::SizeFDiagCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_bottom_right_corner); + break; + case Qt::SizeVerCursor: + case Qt::SplitVCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_sb_v_double_arrow); + break; + case Qt::SizeHorCursor: + case Qt::SplitHCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_sb_h_double_arrow); + break; + case Qt::WhatsThisCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_question_arrow); + break; + case Qt::ForbiddenCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_circle); + break; + case Qt::BusyCursor: + cursor = XCreateFontCursor(testLiteScreen()->display(), XC_watch); + break; + + default: //default cursor for all the rest + break; + } + return cursor; +} + +QTestLiteScreen * QTestLiteCursor::testLiteScreen() const +{ + return static_cast(screen); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestlitecursor.h b/src/plugins/platforms/testlite/qtestlitecursor.h new file mode 100644 index 0000000..15a5b2a --- /dev/null +++ b/src/plugins/platforms/testlite/qtestlitecursor.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenVG module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTESTLITECURSOR_H +#define QTESTLITECURSOR_H + +#include + +#include "qtestliteintegration.h" + +QT_BEGIN_NAMESPACE + +class QTestLiteCursor : QPlatformCursor +{ +public: + QTestLiteCursor(QTestLiteScreen *screen); + + void changeCursor(QCursor * cursor, QWidget * widget); +private: + + Cursor createCursorBitmap(QCursor * cursor); + Cursor createCursorShape(int cshape); + + QTestLiteScreen *testLiteScreen() const; + int currentCursor; + QMap cursorMap; +}; + +QT_END_NAMESPACE + +#endif // QTESTLITECURSOR_H diff --git a/src/plugins/platforms/testlite/qtestliteintegration.cpp b/src/plugins/platforms/testlite/qtestliteintegration.cpp index 68e9051..fc2a89c 100644 --- a/src/plugins/platforms/testlite/qtestliteintegration.cpp +++ b/src/plugins/platforms/testlite/qtestliteintegration.cpp @@ -39,17 +39,14 @@ ** ****************************************************************************/ - - #include "qtestliteintegration.h" #include "qtestlitewindowsurface.h" #include #include -#include - #include "qtestlitewindow.h" #include "qgenericunixfontdatabase.h" +#include "qtestlitescreen.h" #ifndef QT_NO_OPENGL #include @@ -59,50 +56,13 @@ QT_BEGIN_NAMESPACE -class MyCursor : QPlatformCursor -{ -public: - MyCursor(QPlatformScreen *screen) : QPlatformCursor(screen) {} - - void changeCursor(QCursor * cursor, QWidget * widget) { - QTestLiteWindow *w = 0; - if (widget) { - QWidget *window = widget->window(); - w = static_cast(window->platformWindow()); - } else { - // No X11 cursor control when there is no widget under the cursor - return; - } - - //qDebug() << "changeCursor" << widget << ws; - if (!w) - return; - - w->setCursor(cursor); - } -}; - QTestLiteIntegration::QTestLiteIntegration(bool useOpenGL) : mUseOpenGL(useOpenGL) , mFontDb(new QGenericUnixFontDatabase()) { - xd = new MyDisplay; - mPrimaryScreen = new QTestLiteScreen(); - - mPrimaryScreen->mGeometry = QRect - (0, 0, xd->width, xd->height); - mPrimaryScreen->mDepth = 32; - mPrimaryScreen->mFormat = QImage::Format_RGB32; - mPrimaryScreen->mPhysicalSize = - QSize(xd->physicalWidth, xd->physicalHeight); - mScreens.append(mPrimaryScreen); - - - (void)new MyCursor(mPrimaryScreen); - } QPixmapData *QTestLiteIntegration::createPixmapData(QPixmapData::PixelType type) const @@ -120,21 +80,33 @@ QWindowSurface *QTestLiteIntegration::createWindowSurface(QWidget *widget, WId) if (mUseOpenGL) return new QGLWindowSurface(widget); #endif - return new QTestLiteWindowSurface(mPrimaryScreen, widget); + return new QTestLiteWindowSurface(widget); } QPlatformWindow *QTestLiteIntegration::createPlatformWindow(QWidget *widget, WId /*winId*/) const { - return new QTestLiteWindow(this, mPrimaryScreen, widget); + return new QTestLiteWindow(widget); } QPixmap QTestLiteIntegration::grabWindow(WId window, int x, int y, int width, int height) const { - QImage img = xd->grabWindow(window, x, y, width, height); - return QPixmap::fromImage(img); + QImage image; + QWidget *widget = QWidget::find(window); + if (widget) { + QTestLiteScreen *screen = QTestLiteScreen::testLiteScreenForWidget(widget); + image = screen->grabWindow(window,x,y,width,height); + } else { + for (int i = 0; i < mScreens.size(); i++) { + QTestLiteScreen *screen = static_cast(mScreens[i]); + if (screen->rootWindow() == window) { + image = screen->grabWindow(window,x,y,width,height); + } + } + } + return QPixmap::fromImage(image); } QPlatformFontDatabase *QTestLiteIntegration::fontDatabase() const @@ -145,7 +117,8 @@ QPlatformFontDatabase *QTestLiteIntegration::fontDatabase() const bool QTestLiteIntegration::hasOpenGL() const { #ifndef QT_NO_OPENGL - return glXQueryExtension(xd->display, 0, 0) != 0; + QTestLiteScreen *screen = static_cast(mScreens.at(0)); + return glXQueryExtension(screen->display(), 0, 0) != 0; #endif return false; } diff --git a/src/plugins/platforms/testlite/qtestliteintegration.h b/src/plugins/platforms/testlite/qtestliteintegration.h index 8286ef0..37d09f5 100644 --- a/src/plugins/platforms/testlite/qtestliteintegration.h +++ b/src/plugins/platforms/testlite/qtestliteintegration.h @@ -42,34 +42,17 @@ #ifndef QGRAPHICSSYSTEM_TESTLITE_H #define QGRAPHICSSYSTEM_TESTLITE_H -#include -#include - //make sure textstream is included before any X11 headers #include -QT_BEGIN_NAMESPACE +#include +#include -class MyDisplay; +#include -class QTestLiteScreen : public QPlatformScreen -{ -public: - QTestLiteScreen() - : mDepth(16), mFormat(QImage::Format_RGB16) {} - ~QTestLiteScreen() {} - - QRect geometry() const { return mGeometry; } - int depth() const { return mDepth; } - QImage::Format format() const { return mFormat; } - QSize physicalSize() const { return mPhysicalSize; } +QT_BEGIN_NAMESPACE -public: - QRect mGeometry; - int mDepth; - QImage::Format mFormat; - QSize mPhysicalSize; -}; +class QTestLiteScreen; class QTestLiteIntegration : public QPlatformIntegration { @@ -88,8 +71,6 @@ public: bool hasOpenGL() const; - MyDisplay *xd; - private: bool mUseOpenGL; QTestLiteScreen *mPrimaryScreen; diff --git a/src/plugins/platforms/testlite/qtestlitescreen.cpp b/src/plugins/platforms/testlite/qtestlitescreen.cpp new file mode 100644 index 0000000..919506e --- /dev/null +++ b/src/plugins/platforms/testlite/qtestlitescreen.cpp @@ -0,0 +1,430 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qtestlitescreen.h" + +#include "qtestlitecursor.h" +#include "qtestlitewindow.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +static int (*original_x_errhandler)(Display *dpy, XErrorEvent *); +static bool seen_badwindow; + +static int qt_x_errhandler(Display *dpy, XErrorEvent *err) +{ + +qDebug() << "qt_x_errhandler" << err->error_code; + + switch (err->error_code) { + case BadAtom: +#if 0 + if (err->request_code == 20 /* X_GetProperty */ + && (err->resourceid == XA_RESOURCE_MANAGER + || err->resourceid == XA_RGB_DEFAULT_MAP + || err->resourceid == ATOM(_NET_SUPPORTED) + || err->resourceid == ATOM(_NET_SUPPORTING_WM_CHECK) + || err->resourceid == ATOM(KDE_FULL_SESSION) + || err->resourceid == ATOM(KWIN_RUNNING) + || err->resourceid == ATOM(XdndProxy) + || err->resourceid == ATOM(XdndAware)) + + + ) { + // Perhaps we're running under SECURITY reduction? :/ + return 0; + } +#endif + qDebug() << "BadAtom"; + break; + + case BadWindow: + if (err->request_code == 2 /* X_ChangeWindowAttributes */ + || err->request_code == 38 /* X_QueryPointer */) { + for (int i = 0; i < ScreenCount(dpy); ++i) { + if (err->resourceid == RootWindow(dpy, i)) { + // Perhaps we're running under SECURITY reduction? :/ + return 0; + } + } + } + seen_badwindow = true; + if (err->request_code == 25 /* X_SendEvent */) { + for (int i = 0; i < ScreenCount(dpy); ++i) { + if (err->resourceid == RootWindow(dpy, i)) { + // Perhaps we're running under SECURITY reduction? :/ + return 0; + } + } +#if 0 + if (X11->xdndHandleBadwindow()) { + qDebug("xdndHandleBadwindow returned true"); + return 0; + } +#endif + } +#if 0 + if (X11->ignore_badwindow) + return 0; +#endif + break; + + case BadMatch: + if (err->request_code == 42 /* X_SetInputFocus */) + return 0; + break; + + default: +#if 0 //!defined(QT_NO_XINPUT) + if (err->request_code == X11->xinput_major + && err->error_code == (X11->xinput_errorbase + XI_BadDevice) + && err->minor_code == 3 /* X_OpenDevice */) { + return 0; + } +#endif + break; + } + + char errstr[256]; + XGetErrorText( dpy, err->error_code, errstr, 256 ); + char buffer[256]; + char request_str[256]; + qsnprintf(buffer, 256, "%d", err->request_code); + XGetErrorDatabaseText(dpy, "XRequest", buffer, "", request_str, 256); + if (err->request_code < 128) { + // X error for a normal protocol request + qWarning( "X Error: %s %d\n" + " Major opcode: %d (%s)\n" + " Resource id: 0x%lx", + errstr, err->error_code, + err->request_code, + request_str, + err->resourceid ); + } else { + // X error for an extension request + const char *extensionName = 0; +#if 0 + if (err->request_code == X11->xrender_major) + extensionName = "RENDER"; + else if (err->request_code == X11->xrandr_major) + extensionName = "RANDR"; + else if (err->request_code == X11->xinput_major) + extensionName = "XInputExtension"; + else if (err->request_code == X11->mitshm_major) + extensionName = "MIT-SHM"; +#endif + char minor_str[256]; + if (extensionName) { + qsnprintf(buffer, 256, "%s.%d", extensionName, err->minor_code); + XGetErrorDatabaseText(dpy, "XRequest", buffer, "", minor_str, 256); + } else { + extensionName = "Uknown extension"; + qsnprintf(minor_str, 256, "Unknown request"); + } + qWarning( "X Error: %s %d\n" + " Extension: %d (%s)\n" + " Minor opcode: %d (%s)\n" + " Resource id: 0x%lx", + errstr, err->error_code, + err->request_code, + extensionName, + err->minor_code, + minor_str, + err->resourceid ); + } + + // ### we really should distinguish between severe, non-severe and + // ### application specific errors + + return 0; +} + +QTestLiteScreen::QTestLiteScreen() + : mFormat(QImage::Format_RGB32) + , mWmProtocolsAtom(0) + , mWmDeleteWindowAtom(0) +{ + char *display_name = getenv("DISPLAY"); + mDisplay = XOpenDisplay(display_name); + if (!mDisplay) { + fprintf(stderr, "Cannot connect to X server: %s\n", + display_name); + exit(1); + } + +#ifndef DONT_USE_MIT_SHM + Status MIT_SHM_extension_supported = XShmQueryExtension (mDisplay); + Q_ASSERT(MIT_SHM_extension_supported == True); +#endif + original_x_errhandler = XSetErrorHandler(qt_x_errhandler); + + if (qgetenv("DO_X_SYNCHRONIZE").toInt()) + XSynchronize(mDisplay, true); + + mScreen = DefaultScreen(mDisplay); + int width = DisplayWidth(mDisplay, mScreen); + int height = DisplayHeight(mDisplay, mScreen); + mGeometry = QRect(0,0,width,height); + + int physicalWidth = DisplayWidthMM(mDisplay, mScreen); + int physicalHeight = DisplayHeightMM(mDisplay, mScreen); + mPhysicalSize = QSize(physicalWidth,physicalHeight); + + int xSocketNumber = XConnectionNumber(mDisplay); + + mDepth = DefaultDepth(mDisplay,mScreen); +#ifdef MYX11_DEBUG + qDebug() << "X socket:"<< xSocketNumber; +#endif + QSocketNotifier *sock = new QSocketNotifier(xSocketNumber, QSocketNotifier::Read, this); + connect(sock, SIGNAL(activated(int)), this, SLOT(eventDispatcher())); + + mWmProtocolsAtom = XInternAtom (mDisplay, "WM_PROTOCOLS", False); + mWmDeleteWindowAtom = XInternAtom (mDisplay, "WM_DELETE_WINDOW", False); + + mWmMotifHintAtom = XInternAtom(mDisplay, "_MOTIF_WM_HINTS\0", False); + + mCursor = new QTestLiteCursor(this); +} + +QTestLiteScreen::~QTestLiteScreen() +{ + delete mCursor; + XCloseDisplay(mDisplay); +} + +#ifdef KeyPress +#undef KeyPress +#endif +#ifdef KeyRelease +#undef KeyRelease +#endif + +//Q_GUI_EXPORT extern Atom wmProtocolsAtom; +//Q_GUI_EXPORT extern Atom wmDeleteWindowAtom; + +bool QTestLiteScreen::handleEvent(XEvent *xe) +{ + int quit = false; + QTestLiteWindow *xw = 0; + QWidget *widget = QWidget::find(xe->xany.window); + if (widget) { + xw = static_cast(widget->platformWindow()); + } + if (!xw) { +#ifdef MYX11_DEBUG + qWarning() << "Unknown window" << hex << xe->xany.window << "received event" << xe->type; +#endif + return quit; + } + + switch (xe->type) { + + case ClientMessage: + if (xe->xclient.format == 32 && xe->xclient.message_type == wmProtocolsAtom()) { + Atom a = xe->xclient.data.l[0]; + if (a == wmDeleteWindowAtom()) + xw->handleCloseEvent(); +#ifdef MYX11_DEBUG + qDebug() << "ClientMessage WM_PROTOCOLS" << a; +#endif + } +#ifdef MYX11_DEBUG + else + qDebug() << "ClientMessage" << xe->xclient.format << xe->xclient.message_type; +#endif + break; + + case Expose: + if (xw) + if (xe->xexpose.count == 0) + xw->paintEvent(); + break; + case ConfigureNotify: + if (xw) + xw->resizeEvent(&xe->xconfigure); + break; + + case ButtonPress: + xw->mousePressEvent(&xe->xbutton); + break; + + case ButtonRelease: + xw->handleMouseEvent(QEvent::MouseButtonRelease, &xe->xbutton); + break; + + case MotionNotify: + xw->handleMouseEvent(QEvent::MouseMove, &xe->xbutton); + break; + + case XKeyPress: + xw->handleKeyEvent(QEvent::KeyPress, &xe->xkey); + break; + + case XKeyRelease: + xw->handleKeyEvent(QEvent::KeyRelease, &xe->xkey); + break; + + case EnterNotify: + xw->handleEnterEvent(); + break; + + case LeaveNotify: + xw->handleLeaveEvent(); + break; + + case XFocusIn: + xw->handleFocusInEvent(); + break; + + case XFocusOut: + xw->handleFocusOutEvent(); + break; + + default: +#ifdef MYX11_DEBUG + qDebug() << hex << xe->xany.window << "Other X event" << xe->type; +#endif + break; + } + return quit; +} + +void QTestLiteScreen::eventDispatcher() +{ + ulong marker = XNextRequest(mDisplay); + // int i = 0; + while (XPending(mDisplay)) { + XEvent event; + XNextEvent(mDisplay, &event); + /* done = */ + handleEvent(&event); + + if (event.xany.serial >= marker) { + #ifdef MYX11_DEBUG + qDebug() << "potential livelock averted"; + #endif + #if 0 + if (XEventsQueued(mDisplay, QueuedAfterFlush)) { + qDebug() << " with events queued"; + QTimer::singleShot(0, this, SLOT(eventDispatcher())); + } + #endif + break; + } + } +} + +QImage QTestLiteScreen::grabWindow(Window window, int x, int y, int w, int h) +{ + if (w == 0 || h ==0) + return QImage(); + + //WinId 0 means the desktop widget + if (!window) + window = rootWindow(); + + XWindowAttributes window_attr; + if (!XGetWindowAttributes(mDisplay, window, &window_attr)) + return QImage(); + + if (w < 0) + w = window_attr.width - x; + if (h < 0) + h = window_attr.height - y; + + // Ideally, we should also limit ourselves to the screen area, but the Qt docs say + // that it's "unsafe" to go outside the screen, so we can ignore that problem. + + //We're definitely not optimizing for speed... + XImage *xi = XGetImage(mDisplay, window, x, y, w, h, AllPlanes, ZPixmap); + + if (!xi) + return QImage(); + + //taking a copy to make sure we have ownership -- not fast + QImage result = QImage( (uchar*) xi->data, xi->width, xi->height, xi->bytes_per_line, QImage::Format_RGB32 ).copy(); + + XDestroyImage(xi); + + return result; +} + +QTestLiteScreen * QTestLiteScreen::testLiteScreenForWidget(QWidget *widget) +{ + QPlatformScreen *platformScreen = platformScreenForWidget(widget); + return static_cast(platformScreen); +} + +Display * QTestLiteScreen::display() const +{ + return mDisplay; +} + +int QTestLiteScreen::xScreenNumber() const +{ + return mScreen; +} + +Atom QTestLiteScreen::wmProtocolsAtom() const +{ + return mWmProtocolsAtom; +} + +Atom QTestLiteScreen::wmDeleteWindowAtom() const +{ + return mWmDeleteWindowAtom; +} + +void QTestLiteScreen::setWmDeleteWindowAtom(Atom newDeleteWindowAtom) +{ + mWmDeleteWindowAtom = newDeleteWindowAtom; +} + +Atom QTestLiteScreen::atomForMotifWmHints() const +{ + return mWmMotifHintAtom; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestlitescreen.h b/src/plugins/platforms/testlite/qtestlitescreen.h new file mode 100644 index 0000000..f8d9468 --- /dev/null +++ b/src/plugins/platforms/testlite/qtestlitescreen.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTESTLITESCREEN_H +#define QTESTLITESCREEN_H + +#include +#include "qtestliteintegration.h" + +QT_BEGIN_NAMESPACE + +class QTestLiteCursor; + +class QTestLiteScreen : public QPlatformScreen +{ + Q_OBJECT +public: + QTestLiteScreen(); + + ~QTestLiteScreen(); + + QRect geometry() const { return mGeometry; } + int depth() const { return mDepth; } + QImage::Format format() const { return mFormat; } + QSize physicalSize() const { return mPhysicalSize; } + + Window rootWindow() { return RootWindow(mDisplay, mScreen); } + unsigned long blackPixel() { return BlackPixel(mDisplay, mScreen); } + unsigned long whitePixel() { return WhitePixel(mDisplay, mScreen); } + + bool handleEvent(XEvent *xe); + QImage grabWindow(Window window, int x, int y, int w, int h); + + static QTestLiteScreen *testLiteScreenForWidget(QWidget *widget); + + Display *display() const; + int xScreenNumber() const; + + Atom wmProtocolsAtom() const; + Atom wmDeleteWindowAtom() const; + void setWmDeleteWindowAtom(Atom newDeleteWindowAtom); + + Atom atomForMotifWmHints() const; + + +public slots: + void eventDispatcher(); + +private: + QRect mGeometry; + QSize mPhysicalSize; + int mDepth; + QImage::Format mFormat; + QTestLiteCursor *mCursor; + + Display * mDisplay; + int mScreen; + Atom mWmProtocolsAtom; + Atom mWmDeleteWindowAtom; + Atom mWmMotifHintAtom; +}; + +QT_END_NAMESPACE + +#endif // QTESTLITESCREEN_H diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index 5f9d387..f8f4a5f 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -39,169 +39,81 @@ ** ****************************************************************************/ -#include "qtestliteintegration.h" -#include -#include -#include - #include "qtestlitewindow.h" -#include -#include -#include -#include -#include -#include +#include "qtestliteintegration.h" +#include "qtestlitescreen.h" -#include -#include +#include +#include #include +#include + +#include +#include #ifndef QT_NO_OPENGL #include "qglxintegration.h" #endif -#include -#include - - -#include - -#include - - - -//### remove stuff we don't want from qt_x11_p.h -#undef ATOM -#undef X11 - //#define MYX11_DEBUG QT_BEGIN_NAMESPACE -static int (*original_x_errhandler)(Display *dpy, XErrorEvent *); -static bool seen_badwindow; - - -static Atom wmProtocolsAtom; -static Atom wmDeleteWindowAtom; - -class MyX11CursorNode +QTestLiteWindow::QTestLiteWindow(QWidget *window) + : QPlatformWindow(window) + , mGLContext(0) + , mScreen(QTestLiteScreen::testLiteScreenForWidget(window)) { -public: - MyX11CursorNode(int id, Cursor c) { idValue = id; cursorValue = c; refCount = 1; } - QDateTime expiration() { return t; } - void setExpiration(QDateTime val) { t = val; } - MyX11CursorNode * ante() { return before; } - void setAnte(MyX11CursorNode *node) { before = node; } - MyX11CursorNode * post() { return after; } - void setPost(MyX11CursorNode *node) { after = node; } - Cursor cursor() { return cursorValue; } - int id() { return idValue; } - unsigned int refCount; - -private: - MyX11CursorNode *before; - MyX11CursorNode *after; - QDateTime t; - Cursor cursorValue; - int idValue; - - Display * display; -}; - - - - - -class MyX11Cursors : public QObject -{ - Q_OBJECT -public: - MyX11Cursors(Display * d); - ~MyX11Cursors() { timer.stop(); } - void incrementUseCount(int id); - void decrementUseCount(int id); - void createNode(int id, Cursor c); - bool exists(int id) { return lookupMap.contains(id); } - Cursor cursor(int id); -public slots: - void timeout(); - -private: - void removeNode(MyX11CursorNode *node); - void insertNode(MyX11CursorNode *node); - - // linked list of cursors currently not assigned to any window - MyX11CursorNode *firstExpired; - MyX11CursorNode *lastExpired; - - QHash lookupMap; - QTimer timer; - - Display *display; - - int removalDelay; -}; - - - - - -QTestLiteWindow::QTestLiteWindow(const QTestLiteIntegration *platformIntegration, - QTestLiteScreen */*screen*/, QWidget *window) - :QPlatformWindow(window), mGLContext(0) -{ - xd = platformIntegration->xd; - xd->windowList.append(this); - { - int x = window->x(); - int y = window->y(); - int w = window->width(); - int h = window->height(); + int x = window->x(); + int y = window->y(); + int w = window->width(); + int h = window->height(); if(window->platformWindowFormat().windowApi() == QPlatformWindowFormat::OpenGL - && QApplicationPrivate::platformIntegration()->hasOpenGL() ) { + && QApplicationPrivate + ::platformIntegration()->hasOpenGL() ) { #ifndef QT_NO_OPENGL - XVisualInfo *visualInfo = QGLXGLContext::findVisualInfo(xd,window->platformWindowFormat()); - Colormap cmap = XCreateColormap(xd->display,xd->rootWindow(),visualInfo->visual,AllocNone); + XVisualInfo *visualInfo = QGLXContext::findVisualInfo(mScreen,window->platformWindowFormat()); + Colormap cmap = XCreateColormap(mScreen->display(),mScreen->rootWindow(),visualInfo->visual,AllocNone); XSetWindowAttributes a; a.colormap = cmap; - x_window = XCreateWindow(xd->display, xd->rootWindow(),x, y, w, h, + x_window = XCreateWindow(mScreen->display(), mScreen->rootWindow(),x, y, w, h, 0, visualInfo->depth, InputOutput, visualInfo->visual, CWColormap, &a); #endif //QT_NO_OPENGL } else { - x_window = XCreateSimpleWindow(xd->display, xd->rootWindow(), + x_window = XCreateSimpleWindow(mScreen->display(), mScreen->rootWindow(), x, y, w, h, 0 /*border_width*/, - xd->blackPixel(), xd->whitePixel()); + mScreen->blackPixel(), mScreen->whitePixel()); } #ifdef MYX11_DEBUG qDebug() << "QTestLiteWindow::QTestLiteWindow creating" << hex << x_window << window; #endif - } +// } - width = -1; - height = -1; - xpos = -1; - ypos = -1; +// width = -1; +// height = -1; +// xpos = -1; +// ypos = -1; - XSetWindowBackgroundPixmap(xd->display, x_window, XNone); + XSetWindowBackgroundPixmap(mScreen->display(), x_window, XNone); - XSelectInput(xd->display, x_window, ExposureMask | KeyPressMask | KeyReleaseMask | + XSelectInput(mScreen->display(), x_window, ExposureMask | KeyPressMask | KeyReleaseMask | EnterWindowMask | LeaveWindowMask | FocusChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | StructureNotifyMask); gc = createGC(); - XChangeProperty (xd->display, x_window, - wmProtocolsAtom, - XA_ATOM, 32, PropModeAppend, - (unsigned char *) &wmDeleteWindowAtom, 1); - currentCursor = -1; + Atom wmDeleteWindowAtom = mScreen->wmDeleteWindowAtom(); + XChangeProperty (mScreen->display(), x_window, + mScreen->wmProtocolsAtom(), + XA_ATOM, 32, PropModeAppend, + (unsigned char *) &wmDeleteWindowAtom, 1); + mScreen->setWmDeleteWindowAtom(wmDeleteWindowAtom); } @@ -211,19 +123,12 @@ QTestLiteWindow::~QTestLiteWindow() qDebug() << "~QTestLiteWindow" << hex << x_window; #endif delete mGLContext; - XFreeGC(xd->display, gc); - XDestroyWindow(xd->display, x_window); - - xd->windowList.removeAll(this); + XFreeGC(mScreen->display(), gc); + XDestroyWindow(mScreen->display(), x_window); } - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Mouse event stuff - - - - static Qt::MouseButtons translateMouseButtons(int s) { Qt::MouseButtons ret = 0; @@ -236,13 +141,11 @@ static Qt::MouseButtons translateMouseButtons(int s) return ret; } - static Qt::KeyboardModifiers translateModifiers(int s) { const uchar qt_alt_mask = Mod1Mask; const uchar qt_meta_mask = Mod4Mask; - Qt::KeyboardModifiers ret = 0; if (s & ShiftMask) ret |= Qt::ShiftModifier; @@ -328,7 +231,6 @@ void QTestLiteWindow::handleFocusOutEvent() QWindowSystemInterface::handleWindowActivated(0); } - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Key event stuff -- not pretty either // @@ -570,7 +472,6 @@ static const unsigned int keyTbl[] = { 0, 0 }; - static int lookupCode(unsigned int xkeycode) { if (xkeycode >= XK_F1 && xkeycode <= XK_F35) @@ -586,7 +487,6 @@ static int lookupCode(unsigned int xkeycode) return 0; } - static Qt::KeyboardModifiers modifierFromKeyCode(int qtcode) { switch (qtcode) { @@ -640,7 +540,7 @@ void QTestLiteWindow::handleKeyEvent(QEvent::Type type, void *ev) void QTestLiteWindow::setGeometry(const QRect &rect) { - XMoveResizeWindow(xd->display, x_window, rect.x(), rect.y(), rect.width(), rect.height()); + XMoveResizeWindow(mScreen->display(), x_window, rect.x(), rect.y(), rect.width(), rect.height()); QPlatformWindow::setGeometry(rect); } @@ -658,17 +558,17 @@ WId QTestLiteWindow::winId() const void QTestLiteWindow::setParent(const QPlatformWindow *window) { QPoint point = widget()->mapTo(widget()->nativeParentWidget(),QPoint()); - XReparentWindow(xd->display,x_window,window->winId(),point.x(),point.y()); + XReparentWindow(mScreen->display(),x_window,window->winId(),point.x(),point.y()); } void QTestLiteWindow::raise() { - XRaiseWindow(xd->display, x_window); + XRaiseWindow(mScreen->display(), x_window); } void QTestLiteWindow::lower() { - XLowerWindow(xd->display, x_window); + XLowerWindow(mScreen->display(), x_window); } void QTestLiteWindow::setWindowTitle(const QString &title) @@ -680,14 +580,14 @@ void QTestLiteWindow::setWindowTitle(const QString &title) windowName.format = 8; windowName.nitems = ba.length(); - XSetWMName(xd->display, x_window, &windowName); + XSetWMName(mScreen->display(), x_window, &windowName); } GC QTestLiteWindow::createGC() { GC gc; - gc = XCreateGC(xd->display, x_window, 0, 0); + gc = XCreateGC(mScreen->display(), x_window, 0, 0); if (gc < 0) { qWarning("QTestLiteWindow::createGC() could not create GC"); } @@ -701,34 +601,32 @@ void QTestLiteWindow::paintEvent() #endif if (QWindowSurface *surface = widget()->windowSurface()) - surface->flush(widget(), QRect(xpos,ypos,width, height), QPoint()); + surface->flush(widget(), widget()->geometry(), QPoint()); } void QTestLiteWindow::requestActivateWindow() { - XSetInputFocus(xd->display, x_window, XRevertToParent, CurrentTime); + XSetInputFocus(mScreen->display(), x_window, XRevertToParent, CurrentTime); } void QTestLiteWindow::resizeEvent(XConfigureEvent *e) { - if ((e->width != width || e->height != height) && e->x == 0 && e->y == 0) { + int xpos = geometry().x(); + int ypos = geometry().y(); + if ((e->width != geometry().width() || e->height != geometry().height()) && e->x == 0 && e->y == 0) { //qDebug() << "resize with bogus pos" << e->x << e->y << e->width << e->height << "window"<< hex << window; } else { //qDebug() << "geometry change" << e->x << e->y << e->width << e->height << "window"<< hex << window; xpos = e->x; ypos = e->y; } - width = e->width; - height = e->height; - #ifdef MYX11_DEBUG qDebug() << hex << x_window << dec << "ConfigureNotify" << e->x << e->y << e->width << e->height << "geometry" << xpos << ypos << width << height; #endif - QWindowSystemInterface::handleGeometryChange(widget(), QRect(xpos, ypos, width, height)); + QWindowSystemInterface::handleGeometryChange(widget(), QRect(xpos, ypos, e->width, e->height)); } - void QTestLiteWindow::mousePressEvent(XButtonEvent *e) { static long prevTime = 0; @@ -752,51 +650,7 @@ void QTestLiteWindow::mousePressEvent(XButtonEvent *e) handleMouseEvent(type, e); } - - -// WindowFlag stuff, lots of copied code from qwidget_x11.cpp... - -//We're hacking here... - - -// MWM support -struct QtMWMHints { - ulong flags, functions, decorations; - long input_mode; - ulong status; -}; - -enum { - MWM_HINTS_FUNCTIONS = (1L << 0), - - MWM_FUNC_ALL = (1L << 0), - MWM_FUNC_RESIZE = (1L << 1), - MWM_FUNC_MOVE = (1L << 2), - MWM_FUNC_MINIMIZE = (1L << 3), - MWM_FUNC_MAXIMIZE = (1L << 4), - MWM_FUNC_CLOSE = (1L << 5), - - MWM_HINTS_DECORATIONS = (1L << 1), - - MWM_DECOR_ALL = (1L << 0), - MWM_DECOR_BORDER = (1L << 1), - MWM_DECOR_RESIZEH = (1L << 2), - MWM_DECOR_TITLE = (1L << 3), - MWM_DECOR_MENU = (1L << 4), - MWM_DECOR_MINIMIZE = (1L << 5), - MWM_DECOR_MAXIMIZE = (1L << 6), - - MWM_HINTS_INPUT_MODE = (1L << 2), - - MWM_INPUT_MODELESS = 0L, - MWM_INPUT_PRIMARY_APPLICATION_MODAL = 1L, - MWM_INPUT_FULL_APPLICATION_MODAL = 3L -}; - -static Atom mwm_hint_atom = XNone; - -#if 0 -static QtMWMHints GetMWMHints(Display *display, Window window) +QtMWMHints QTestLiteWindow::getMWMHints() const { QtMWMHints mwmhints; @@ -804,10 +658,10 @@ static QtMWMHints GetMWMHints(Display *display, Window window) int format; ulong nitems, bytesLeft; uchar *data = 0; - if ((XGetWindowProperty(display, window, mwm_hint_atom, 0, 5, false, - mwm_hint_atom, &type, &format, &nitems, &bytesLeft, + if ((XGetWindowProperty(mScreen->display(), x_window, mScreen->atomForMotifWmHints(), 0, 5, false, + mScreen->atomForMotifWmHints(), &type, &format, &nitems, &bytesLeft, &data) == Success) - && (type == mwm_hint_atom + && (type == mScreen->atomForMotifWmHints() && format == 32 && nitems >= 5)) { mwmhints = *(reinterpret_cast(data)); @@ -824,15 +678,15 @@ static QtMWMHints GetMWMHints(Display *display, Window window) return mwmhints; } -#endif -static void SetMWMHints(Display *display, Window window, const QtMWMHints &mwmhints) +void QTestLiteWindow::setMWMHints(const QtMWMHints &mwmhints) { if (mwmhints.flags != 0l) { - XChangeProperty(display, window, mwm_hint_atom, mwm_hint_atom, 32, + XChangeProperty(mScreen->display(), x_window, + mScreen->atomForMotifWmHints(), mScreen->atomForMotifWmHints(), 32, PropModeReplace, (unsigned char *) &mwmhints, 5); } else { - XDeleteProperty(display, window, mwm_hint_atom); + XDeleteProperty(mScreen->display(), x_window, mScreen->atomForMotifWmHints()); } } @@ -849,17 +703,11 @@ static inline bool isTransient(const QWidget *w) && !w->testAttribute(Qt::WA_X11BypassTransientForHint)); } - - Qt::WindowFlags QTestLiteWindow::setWindowFlags(Qt::WindowFlags flags) { // Q_ASSERT(flags & Qt::Window); window_flags = flags; - if (mwm_hint_atom == XNone) { - mwm_hint_atom = XInternAtom(xd->display, "_MOTIF_WM_HINTS\0", False); - } - #ifdef MYX11_DEBUG qDebug() << "QTestLiteWindow::setWindowFlags" << hex << x_window << "flags" << flags; #endif @@ -878,12 +726,10 @@ Qt::WindowFlags QTestLiteWindow::setWindowFlags(Qt::WindowFlags flags) bool tool = (type == Qt::Tool || type == Qt::SplashScreen || type == Qt::ToolTip || type == Qt::Drawer); - Q_UNUSED(topLevel); Q_UNUSED(dialog); Q_UNUSED(desktop); - bool tooltip = (type == Qt::ToolTip); XSetWindowAttributes wsa; @@ -964,7 +810,7 @@ Qt::WindowFlags QTestLiteWindow::setWindowFlags(Qt::WindowFlags flags) mwmhints.decorations = 0; } - SetMWMHints(xd->display, x_window, mwmhints); + setMWMHints(mwmhints); //##### only if initializeWindow??? @@ -977,7 +823,7 @@ Qt::WindowFlags QTestLiteWindow::setWindowFlags(Qt::WindowFlags flags) wsa.override_redirect = True; wsa.save_under = True; - XChangeWindowAttributes(xd->display, x_window, CWOverrideRedirect | CWSaveUnder, + XChangeWindowAttributes(mScreen->display(), x_window, CWOverrideRedirect | CWSaveUnder, &wsa); } else { #ifdef MYX11_DEBUG @@ -994,38 +840,15 @@ void QTestLiteWindow::setVisible(bool visible) qDebug() << "QTestLiteWindow::setVisible" << visible << hex << x_window; #endif if (visible) - XMapWindow(xd->display, x_window); + XMapWindow(mScreen->display(), x_window); else - XUnmapWindow(xd->display, x_window); + XUnmapWindow(mScreen->display(), x_window); } - -void QTestLiteWindow::setCursor(QCursor * cursor) +void QTestLiteWindow::setCursor(const Cursor &cursor) { - int id = cursor->handle(); - if (id == currentCursor) - return; - Cursor c; - if (!xd->cursors->exists(id)) { - if (cursor->shape() == Qt::BitmapCursor) - c = createCursorBitmap(cursor); - else - c = createCursorShape(cursor->shape()); - if (!c) { - return; - } - xd->cursors->createNode(id, c); - } else { - xd->cursors->incrementUseCount(id); - c = xd->cursors->cursor(id); - } - - if (currentCursor != -1) - xd->cursors->decrementUseCount(currentCursor); - currentCursor = id; - - XDefineCursor(xd->display, x_window, c); - XFlush(xd->display); + XDefineCursor(mScreen->display(), x_window, cursor); + XFlush(mScreen->display()); } QPlatformGLContext *QTestLiteWindow::glContext() const @@ -1035,574 +858,20 @@ QPlatformGLContext *QTestLiteWindow::glContext() const if (!mGLContext) { QTestLiteWindow *that = const_cast(this); #ifndef QT_NO_OPENGL - that->mGLContext = new QGLXGLContext(x_window, xd,widget()->platformWindowFormat()); + that->mGLContext = new QGLXContext(x_window, mScreen,widget()->platformWindowFormat()); #endif } return mGLContext; } -Cursor QTestLiteWindow::createCursorBitmap(QCursor * cursor) -{ - XColor bg, fg; - bg.red = 255 << 8; - bg.green = 255 << 8; - bg.blue = 255 << 8; - fg.red = 0; - fg.green = 0; - fg.blue = 0; - QPoint spot = cursor->hotSpot(); - Window rootwin = x_window; - - QImage mapImage = cursor->bitmap()->toImage().convertToFormat(QImage::Format_MonoLSB); - QImage maskImage = cursor->mask()->toImage().convertToFormat(QImage::Format_MonoLSB); - - int width = cursor->bitmap()->width(); - int height = cursor->bitmap()->height(); - int bytesPerLine = mapImage.bytesPerLine(); - int destLineSize = width / 8; - if (width % 8) - destLineSize++; - - const uchar * map = mapImage.bits(); - const uchar * mask = maskImage.bits(); - - char * mapBits = new char[height * destLineSize]; - char * maskBits = new char[height * destLineSize]; - for (int i = 0; i < height; i++) { - memcpy(mapBits + (destLineSize * i),map + (bytesPerLine * i), destLineSize); - memcpy(maskBits + (destLineSize * i),mask + (bytesPerLine * i), destLineSize); - } - - Pixmap cp = XCreateBitmapFromData(xd->display, rootwin, mapBits, width, height); - Pixmap mp = XCreateBitmapFromData(xd->display, rootwin, maskBits, width, height); - Cursor c = XCreatePixmapCursor(xd->display, cp, mp, &fg, &bg, spot.x(), spot.y()); - XFreePixmap(xd->display, cp); - XFreePixmap(xd->display, mp); - delete[] mapBits; - delete[] maskBits; - - return c; -} - -Cursor QTestLiteWindow::createCursorShape(int cshape) -{ - Cursor cursor = 0; - - if (cshape < 0 || cshape > Qt::LastCursor) - return 0; - - switch (cshape) { - case Qt::ArrowCursor: - cursor = XCreateFontCursor(xd->display, XC_left_ptr); - break; - case Qt::UpArrowCursor: - cursor = XCreateFontCursor(xd->display, XC_center_ptr); - break; - case Qt::CrossCursor: - cursor = XCreateFontCursor(xd->display, XC_crosshair); - break; - case Qt::WaitCursor: - cursor = XCreateFontCursor(xd->display, XC_watch); - break; - case Qt::IBeamCursor: - cursor = XCreateFontCursor(xd->display, XC_xterm); - break; - case Qt::SizeAllCursor: - cursor = XCreateFontCursor(xd->display, XC_fleur); - break; - case Qt::PointingHandCursor: - cursor = XCreateFontCursor(xd->display, XC_hand2); - break; - case Qt::SizeBDiagCursor: - cursor = XCreateFontCursor(xd->display, XC_top_right_corner); - break; - case Qt::SizeFDiagCursor: - cursor = XCreateFontCursor(xd->display, XC_bottom_right_corner); - break; - case Qt::SizeVerCursor: - case Qt::SplitVCursor: - cursor = XCreateFontCursor(xd->display, XC_sb_v_double_arrow); - break; - case Qt::SizeHorCursor: - case Qt::SplitHCursor: - cursor = XCreateFontCursor(xd->display, XC_sb_h_double_arrow); - break; - case Qt::WhatsThisCursor: - cursor = XCreateFontCursor(xd->display, XC_question_arrow); - break; - case Qt::ForbiddenCursor: - cursor = XCreateFontCursor(xd->display, XC_circle); - break; - case Qt::BusyCursor: - cursor = XCreateFontCursor(xd->display, XC_watch); - break; - - default: //default cursor for all the rest - break; - } - return cursor; -} - - -MyX11Cursors::MyX11Cursors(Display * d) : firstExpired(0), lastExpired(0), display(d), removalDelay(3) -{ - connect(&timer, SIGNAL(timeout()), this, SLOT(timeout())); -} - -void MyX11Cursors::insertNode(MyX11CursorNode * node) +Window QTestLiteWindow::xWindow() const { - QDateTime now = QDateTime::currentDateTime(); - QDateTime timeout = now.addSecs(removalDelay); - node->setExpiration(timeout); - node->setPost(0); - if (lastExpired) { - lastExpired->setPost(node); - node->setAnte(lastExpired); - } - lastExpired = node; - if (!firstExpired) { - firstExpired = node; - node->setAnte(0); - int interval = removalDelay * 1000; - timer.setInterval(interval); - timer.start(); - } -} - -void MyX11Cursors::removeNode(MyX11CursorNode * node) -{ - MyX11CursorNode *pre = node->ante(); - MyX11CursorNode *post = node->post(); - if (pre) - pre->setPost(post); - if (post) - post->setAnte(pre); - if (node == lastExpired) - lastExpired = pre; - if (node == firstExpired) { - firstExpired = post; - if (!firstExpired) { - timer.stop(); - return; - } - int interval = QDateTime::currentDateTime().secsTo(firstExpired->expiration()) * 1000; - timer.stop(); - timer.setInterval(interval); - timer.start(); - } -} - -void MyX11Cursors::incrementUseCount(int id) -{ - MyX11CursorNode * node = lookupMap.value(id); - Q_ASSERT(node); - if (!node->refCount) - removeNode(node); - node->refCount++; -} - -void MyX11Cursors::decrementUseCount(int id) -{ - MyX11CursorNode * node = lookupMap.value(id); - Q_ASSERT(node); - node->refCount--; - if (!node->refCount) - insertNode(node); -} - -void MyX11Cursors::createNode(int id, Cursor c) -{ - MyX11CursorNode * node = new MyX11CursorNode(id, c); - lookupMap.insert(id, node); -} - -void MyX11Cursors::timeout() -{ - MyX11CursorNode * node; - node = firstExpired; - QDateTime now = QDateTime::currentDateTime(); - while (node && now.secsTo(node->expiration()) < 1) { - Cursor c = node->cursor(); - int id = node->id(); - lookupMap.take(id); - MyX11CursorNode * tmp = node; - node = node->post(); - if (node) - node->setAnte(0); - delete tmp; - XFreeCursor(display, c); - } - firstExpired = node; - if (node == 0) { - timer.stop(); - lastExpired = 0; - } - else { - int interval = QDateTime::currentDateTime().secsTo(firstExpired->expiration()) * 1000; - timer.setInterval(interval); - timer.start(); - } -} - -Cursor MyX11Cursors::cursor(int id) -{ - MyX11CursorNode * node = lookupMap.value(id); - Q_ASSERT(node); - return node->cursor(); -} - - - -/******************************************************************** - -MyDisplay class - perhaps better placed in qplatformintegration_testlite? - -*********************************************************************/ - -//### copied from qapplication_x11.cpp - -static int qt_x_errhandler(Display *dpy, XErrorEvent *err) -{ - -qDebug() << "qt_x_errhandler" << err->error_code; - - switch (err->error_code) { - case BadAtom: -#if 0 - if (err->request_code == 20 /* X_GetProperty */ - && (err->resourceid == XA_RESOURCE_MANAGER - || err->resourceid == XA_RGB_DEFAULT_MAP - || err->resourceid == ATOM(_NET_SUPPORTED) - || err->resourceid == ATOM(_NET_SUPPORTING_WM_CHECK) - || err->resourceid == ATOM(KDE_FULL_SESSION) - || err->resourceid == ATOM(KWIN_RUNNING) - || err->resourceid == ATOM(XdndProxy) - || err->resourceid == ATOM(XdndAware)) - - - ) { - // Perhaps we're running under SECURITY reduction? :/ - return 0; - } -#endif - qDebug() << "BadAtom"; - break; - - case BadWindow: - if (err->request_code == 2 /* X_ChangeWindowAttributes */ - || err->request_code == 38 /* X_QueryPointer */) { - for (int i = 0; i < ScreenCount(dpy); ++i) { - if (err->resourceid == RootWindow(dpy, i)) { - // Perhaps we're running under SECURITY reduction? :/ - return 0; - } - } - } - seen_badwindow = true; - if (err->request_code == 25 /* X_SendEvent */) { - for (int i = 0; i < ScreenCount(dpy); ++i) { - if (err->resourceid == RootWindow(dpy, i)) { - // Perhaps we're running under SECURITY reduction? :/ - return 0; - } - } -#if 0 - if (X11->xdndHandleBadwindow()) { - qDebug("xdndHandleBadwindow returned true"); - return 0; - } -#endif - } -#if 0 - if (X11->ignore_badwindow) - return 0; -#endif - break; - - case BadMatch: - if (err->request_code == 42 /* X_SetInputFocus */) - return 0; - break; - - default: -#if 0 //!defined(QT_NO_XINPUT) - if (err->request_code == X11->xinput_major - && err->error_code == (X11->xinput_errorbase + XI_BadDevice) - && err->minor_code == 3 /* X_OpenDevice */) { - return 0; - } -#endif - break; - } - - char errstr[256]; - XGetErrorText( dpy, err->error_code, errstr, 256 ); - char buffer[256]; - char request_str[256]; - qsnprintf(buffer, 256, "%d", err->request_code); - XGetErrorDatabaseText(dpy, "XRequest", buffer, "", request_str, 256); - if (err->request_code < 128) { - // X error for a normal protocol request - qWarning( "X Error: %s %d\n" - " Major opcode: %d (%s)\n" - " Resource id: 0x%lx", - errstr, err->error_code, - err->request_code, - request_str, - err->resourceid ); - } else { - // X error for an extension request - const char *extensionName = 0; -#if 0 - if (err->request_code == X11->xrender_major) - extensionName = "RENDER"; - else if (err->request_code == X11->xrandr_major) - extensionName = "RANDR"; - else if (err->request_code == X11->xinput_major) - extensionName = "XInputExtension"; - else if (err->request_code == X11->mitshm_major) - extensionName = "MIT-SHM"; -#endif - char minor_str[256]; - if (extensionName) { - qsnprintf(buffer, 256, "%s.%d", extensionName, err->minor_code); - XGetErrorDatabaseText(dpy, "XRequest", buffer, "", minor_str, 256); - } else { - extensionName = "Uknown extension"; - qsnprintf(minor_str, 256, "Unknown request"); - } - qWarning( "X Error: %s %d\n" - " Extension: %d (%s)\n" - " Minor opcode: %d (%s)\n" - " Resource id: 0x%lx", - errstr, err->error_code, - err->request_code, - extensionName, - err->minor_code, - minor_str, - err->resourceid ); - } - - // ### we really should distinguish between severe, non-severe and - // ### application specific errors - - return 0; -} - - -#ifdef KeyPress -#undef KeyPress -#endif -#ifdef KeyRelease -#undef KeyRelease -#endif - -bool MyDisplay::handleEvent(XEvent *xe) -{ - //qDebug() << "handleEvent" << xe->xany.type << xe->xany.window; - int quit = false; - QTestLiteWindow *xw = 0; - foreach (QTestLiteWindow *w, windowList) { - if (w->winId() == xe->xany.window) { - xw = w; - break; - } - } - if (!xw) { -#ifdef MYX11_DEBUG - qWarning() << "Unknown window" << hex << xe->xany.window << "received event" << xe->type; -#endif - return quit; - } - - switch (xe->type) { - - case ClientMessage: - if (xe->xclient.format == 32 && xe->xclient.message_type == wmProtocolsAtom) { - Atom a = xe->xclient.data.l[0]; - if (a == wmDeleteWindowAtom) - xw->handleCloseEvent(); -#ifdef MYX11_DEBUG - qDebug() << "ClientMessage WM_PROTOCOLS" << a; -#endif - } -#ifdef MYX11_DEBUG - else - qDebug() << "ClientMessage" << xe->xclient.format << xe->xclient.message_type; -#endif - break; - - case Expose: - if (xw) - if (xe->xexpose.count == 0) - xw->paintEvent(); - break; - case ConfigureNotify: - if (xw) - xw->resizeEvent(&xe->xconfigure); - break; - - case ButtonPress: - xw->mousePressEvent(&xe->xbutton); - break; - - case ButtonRelease: - xw->handleMouseEvent(QEvent::MouseButtonRelease, &xe->xbutton); - break; - - case MotionNotify: - xw->handleMouseEvent(QEvent::MouseMove, &xe->xbutton); - break; - - case XKeyPress: - xw->handleKeyEvent(QEvent::KeyPress, &xe->xkey); - break; - - case XKeyRelease: - xw->handleKeyEvent(QEvent::KeyRelease, &xe->xkey); - break; - - case EnterNotify: - xw->handleEnterEvent(); - break; - - case LeaveNotify: - xw->handleLeaveEvent(); - break; - - case XFocusIn: - xw->handleFocusInEvent(); - break; - - case XFocusOut: - xw->handleFocusOutEvent(); - break; - - default: -#ifdef MYX11_DEBUG - qDebug() << hex << xe->xany.window << "Other X event" << xe->type; -#endif - break; - } - return quit; -}; - - - -MyDisplay::MyDisplay() -{ - char *display_name = getenv("DISPLAY"); - display = XOpenDisplay(display_name); - if (!display) { - fprintf(stderr, "Cannot connect to X server: %s\n", - display_name); - exit(1); - } - -#ifndef DONT_USE_MIT_SHM - Status MIT_SHM_extension_supported = XShmQueryExtension (display); - Q_ASSERT(MIT_SHM_extension_supported == True); -#endif - original_x_errhandler = XSetErrorHandler(qt_x_errhandler); - - if (qgetenv("DO_X_SYNCHRONIZE").toInt()) - XSynchronize(display, true); - - screen = DefaultScreen(display); - width = DisplayWidth(display, screen); - height = DisplayHeight(display, screen); - physicalWidth = DisplayWidthMM(display, screen); - physicalHeight = DisplayHeightMM(display, screen); - - int xSocketNumber = XConnectionNumber(display); -#ifdef MYX11_DEBUG - qDebug() << "X socket:"<< xSocketNumber; -#endif - QSocketNotifier *sock = new QSocketNotifier(xSocketNumber, QSocketNotifier::Read, this); - connect(sock, SIGNAL(activated(int)), this, SLOT(eventDispatcher())); - - wmProtocolsAtom = XInternAtom (display, "WM_PROTOCOLS", False); - wmDeleteWindowAtom = XInternAtom (display, "WM_DELETE_WINDOW", False); - - cursors = new MyX11Cursors(display); -} - - -MyDisplay::~MyDisplay() -{ - XCloseDisplay(display); -} - - -void MyDisplay::eventDispatcher() -{ -// qDebug() << "eventDispatcher"; - - - ulong marker = XNextRequest(display); -// int i = 0; - while (XPending(display)) { - XEvent event; - XNextEvent(display, &event); - /* done = */ - handleEvent(&event); - - if (event.xany.serial >= marker) { -#ifdef MYX11_DEBUG - qDebug() << "potential livelock averted"; -#endif -#if 0 - if (XEventsQueued(display, QueuedAfterFlush)) { - qDebug() << " with events queued"; - QTimer::singleShot(0, this, SLOT(eventDispatcher())); - } -#endif - break; - } - } + return x_window; } - -QImage MyDisplay::grabWindow(Window window, int x, int y, int w, int h) +GC QTestLiteWindow::graphicsContext() const { - if (w == 0 || h ==0) - return QImage(); - - //WinId 0 means the desktop widget - if (!window) - window = rootWindow(); - - XWindowAttributes window_attr; - if (!XGetWindowAttributes(display, window, &window_attr)) - return QImage(); - - if (w < 0) - w = window_attr.width - x; - if (h < 0) - h = window_attr.height - y; - - // Ideally, we should also limit ourselves to the screen area, but the Qt docs say - // that it's "unsafe" to go outside the screen, so we can ignore that problem. - - //We're definitely not optimizing for speed... - XImage *xi = XGetImage(display, window, x, y, w, h, AllPlanes, ZPixmap); - - if (!xi) - return QImage(); - - //taking a copy to make sure we have ownership -- not fast - QImage result = QImage( (uchar*) xi->data, xi->width, xi->height, xi->bytes_per_line, QImage::Format_RGB32 ).copy(); - - XDestroyImage(xi); - - return result; + return gc; } - - - - - - QT_END_NAMESPACE -#include "qtestlitewindow.moc" diff --git a/src/plugins/platforms/testlite/qtestlitewindow.h b/src/plugins/platforms/testlite/qtestlitewindow.h index 69442f1..8e9f6fd 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.h +++ b/src/plugins/platforms/testlite/qtestlitewindow.h @@ -42,63 +42,51 @@ #ifndef QTESTLITEWINDOW_H #define QTESTLITEWINDOW_H +#include "qtestliteintegration.h" + #include -#include +#include #include #include -#include -#include - -#include - -#include -#include - - - -class QTestLiteIntegration; -class QTestLiteScreen; -class QTestLiteWindowSurface; -class MyX11Cursors; -class QTestLiteWindow; -class MyDisplay : public QObject -{ - Q_OBJECT; -public: - MyDisplay(); - ~MyDisplay(); +struct QtMWMHints { + ulong flags, functions, decorations; + long input_mode; + ulong status; +}; - Window rootWindow() { return RootWindow(display, screen); } - unsigned long blackPixel() { return BlackPixel(display, screen); } - unsigned long whitePixel() { return WhitePixel(display, screen); } +enum { + MWM_HINTS_FUNCTIONS = (1L << 0), - bool handleEvent(XEvent *xe); - QImage grabWindow(Window window, int x, int y, int w, int h); + MWM_FUNC_ALL = (1L << 0), + MWM_FUNC_RESIZE = (1L << 1), + MWM_FUNC_MOVE = (1L << 2), + MWM_FUNC_MINIMIZE = (1L << 3), + MWM_FUNC_MAXIMIZE = (1L << 4), + MWM_FUNC_CLOSE = (1L << 5), -public slots: - void eventDispatcher(); + MWM_HINTS_DECORATIONS = (1L << 1), -public: //### - Display * display; - int screen; - int width, height; - int physicalWidth; - int physicalHeight; + MWM_DECOR_ALL = (1L << 0), + MWM_DECOR_BORDER = (1L << 1), + MWM_DECOR_RESIZEH = (1L << 2), + MWM_DECOR_TITLE = (1L << 3), + MWM_DECOR_MENU = (1L << 4), + MWM_DECOR_MINIMIZE = (1L << 5), + MWM_DECOR_MAXIMIZE = (1L << 6), - QList windowList; + MWM_HINTS_INPUT_MODE = (1L << 2), - MyX11Cursors * cursors; + MWM_INPUT_MODELESS = 0L, + MWM_INPUT_PRIMARY_APPLICATION_MODAL = 1L, + MWM_INPUT_FULL_APPLICATION_MODAL = 3L }; -struct MyShmImageInfo; - class QTestLiteWindow : public QPlatformWindow { public: - QTestLiteWindow(const QTestLiteIntegration *platformIntegration, - QTestLiteScreen *screen, QWidget *window); + QTestLiteWindow(QWidget *window); ~QTestLiteWindow(); @@ -128,33 +116,29 @@ public: void lower(); void setWindowTitle(const QString &title); - void setCursor(QCursor * cursor); + void setCursor(const Cursor &cursor); QPlatformGLContext *glContext() const; + Window xWindow() const; + GC graphicsContext() const; + +protected: + void setMWMHints(const QtMWMHints &mwmhints); + QtMWMHints getMWMHints() const; + private: - int xpos, ypos; - int width, height; Window x_window; GC gc; GC createGC(); - Cursor createCursorShape(int cshape); - Cursor createCursorBitmap(QCursor * cursor); - - int currentCursor; - - MyDisplay *xd; + QPlatformGLContext *mGLContext; QTestLiteScreen *mScreen; Qt::WindowFlags window_flags; - QPlatformGLContext *mGLContext; - - friend class QTestLiteWindowSurface; // x_window, gc and windowSurface -}; - - + Atom m_mwm_hint_atom; +}; #endif diff --git a/src/plugins/platforms/testlite/qtestlitewindowsurface.cpp b/src/plugins/platforms/testlite/qtestlitewindowsurface.cpp index b3232c8..ced964a 100644 --- a/src/plugins/platforms/testlite/qtestlitewindowsurface.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindowsurface.cpp @@ -46,6 +46,7 @@ #include #include "qtestlitewindow.h" +#include "qtestlitescreen.h" # include # include @@ -65,8 +66,6 @@ struct MyShmImageInfo { Display *display; }; -//void QTestLiteWindowSurface::flush() - #ifndef DONT_USE_MIT_SHM void MyShmImageInfo::destroy() @@ -80,20 +79,21 @@ void MyShmImageInfo::destroy() void QTestLiteWindowSurface::resizeShmImage(int width, int height) { - MyDisplay *xd = xw->xd; #ifdef DONT_USE_MIT_SHM shm_img = QImage(width, height, QImage::Format_RGB32); #else + + QTestLiteScreen *screen = QTestLiteScreen::testLiteScreenForWidget(window()); if (image_info) image_info->destroy(); else - image_info = new MyShmImageInfo(xd->display); + image_info = new MyShmImageInfo(screen->display()); - Visual *visual = DefaultVisual(xd->display, xd->screen); + Visual *visual = DefaultVisual(screen->display(), screen->xScreenNumber()); - XImage *image = XShmCreateImage (xd->display, visual, 24, ZPixmap, 0, + XImage *image = XShmCreateImage (screen->display(), visual, 24, ZPixmap, 0, &image_info->shminfo, width, height); @@ -105,7 +105,7 @@ void QTestLiteWindowSurface::resizeShmImage(int width, int height) image_info->image = image; - Status shm_attach_status = XShmAttach(xd->display, &image_info->shminfo); + Status shm_attach_status = XShmAttach(screen->display(), &image_info->shminfo); Q_ASSERT(shm_attach_status == True); @@ -126,7 +126,7 @@ QSize QTestLiteWindowSurface::bufferSize() const return shm_img.size(); } -QTestLiteWindowSurface::QTestLiteWindowSurface (QTestLiteScreen */*screen*/, QWidget *window) +QTestLiteWindowSurface::QTestLiteWindowSurface (QWidget *window) : QWindowSurface(window), painted(false), image_info(0) { @@ -151,29 +151,27 @@ void QTestLiteWindowSurface::flush(QWidget *widget, const QRegion ®ion, const Q_UNUSED(region); Q_UNUSED(offset); - // qDebug() << "QTestLiteWindowSurface::flush:" << (long)this; - if (!painted) return; - MyDisplay *xd = xw->xd; - GC gc = xw->gc; - Window window = xw->x_window; + QTestLiteScreen *screen = QTestLiteScreen::testLiteScreenForWidget(widget); + GC gc = xw->graphicsContext(); + Window window = xw->xWindow(); #ifdef DONT_USE_MIT_SHM // just convert the image every time... if (!shm_img.isNull()) { - Visual *visual = DefaultVisual(xd->display, xd->screen); + Visual *visual = DefaultVisual(screen->display(), screen->xScreenNumber()); QImage image = shm_img; //img.convertToFormat( - XImage *xi = XCreateImage(xd->display, visual, 24, ZPixmap, + XImage *xi = XCreateImage(screen->display(), visual, 24, ZPixmap, 0, (char *) image.scanLine(0), image.width(), image.height(), 32, image.bytesPerLine()); int x = 0; int y = 0; - /*int r =*/ XPutImage(xd->display, window, gc, xi, 0, 0, x, y, image.width(), image.height()); + /*int r =*/ XPutImage(screen->display(), window, gc, xi, 0, 0, x, y, image.width(), image.height()); xi->data = 0; // QImage owns these bits XDestroyImage(xi); @@ -187,11 +185,11 @@ void QTestLiteWindowSurface::flush(QWidget *widget, const QRegion ®ion, const // We could set send_event to true, and then use the ShmCompletion to synchronize, // but let's do like Qt/11 and just use XSync - XShmPutImage (xd->display, window, gc, image_info->image, 0, 0, + XShmPutImage (screen->display(), window, gc, image_info->image, 0, 0, x, y, image_info->image->width, image_info->image->height, /*send_event*/ False); - XSync(xd->display, False); + XSync(screen->display(), False); } #endif } diff --git a/src/plugins/platforms/testlite/qtestlitewindowsurface.h b/src/plugins/platforms/testlite/qtestlitewindowsurface.h index 915e7fe..ca900e5 100644 --- a/src/plugins/platforms/testlite/qtestlitewindowsurface.h +++ b/src/plugins/platforms/testlite/qtestlitewindowsurface.h @@ -55,7 +55,7 @@ class MyShmImageInfo; class QTestLiteWindowSurface : public QWindowSurface { public: - QTestLiteWindowSurface (QTestLiteScreen *screen, QWidget *window); + QTestLiteWindowSurface (QWidget *window); ~QTestLiteWindowSurface(); QPaintDevice *paintDevice(); diff --git a/src/plugins/platforms/testlite/testlite.pro b/src/plugins/platforms/testlite/testlite.pro index 05bd384..ef977bf 100644 --- a/src/plugins/platforms/testlite/testlite.pro +++ b/src/plugins/platforms/testlite/testlite.pro @@ -7,13 +7,16 @@ SOURCES = \ main.cpp \ qtestliteintegration.cpp \ qtestlitewindowsurface.cpp \ - qtestlitewindow.cpp + qtestlitewindow.cpp \ + qtestlitecursor.cpp \ + qtestlitescreen.cpp HEADERS = \ qtestliteintegration.h \ qtestlitewindowsurface.h \ - qtestlitewindow.h - + qtestlitewindow.h \ + qtestlitecursor.h \ + qtestlitescreen.h LIBS += -lX11 -lXext -- cgit v0.12 From dd72b151b500838475f2ec40695449a37acd3922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 9 Dec 2010 09:00:02 +0100 Subject: Remove Lighthouse specific code in QGLWidget constructor truth to be told, I can't remember why I decided that it was a good idea to have the code there. But clearly now I don't think so anymore. Such initialisation should happen in qgl_qpa.cpp chooseContext. If we tear down the window and the context then that has to be solved elsewhere. --- src/opengl/opengl.pro.user.2.1pre1 | 83 ++++++++++++++++++++++++++++++++++++++ src/opengl/qgl.cpp | 34 ---------------- src/opengl/qgl_qpa.cpp | 5 --- 3 files changed, 83 insertions(+), 39 deletions(-) create mode 100644 src/opengl/opengl.pro.user.2.1pre1 diff --git a/src/opengl/opengl.pro.user.2.1pre1 b/src/opengl/opengl.pro.user.2.1pre1 new file mode 100644 index 0000000..0c38724 --- /dev/null +++ b/src/opengl/opengl.pro.user.2.1pre1 @@ -0,0 +1,83 @@ + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + UTF-8 + + + + ProjectExplorer.Project.Target.0 + + Desktop + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + + + qmake + QtProjectManager.QMakeBuildStep + + QMAKE_ABSOLUTE_SOURCE_PATH=/home/jlind/dev/qt/lighthouse-master/src/opengl + + + + Make + Qt4ProjectManager.MakeStep + false + + -j9 + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/jlind/builds/master-lighthouse/src/opengl + 23 + 0 + true + + 1 + + headers + Qt4ProjectManager.Qt4RunConfiguration + 2 + + ../../../../../builds/master-lighthouse/include/QtOpenGL/headers.pri + false + false + + false + false + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 4 + + diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index e9e8880..dac00dc 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -3772,24 +3772,7 @@ QGLWidget::QGLWidget(QWidget *parent, const QGLWidget* shareWidget, Qt::WindowFl setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_NoSystemBackground); setAutoFillBackground(true); // for compatibility -#ifdef Q_WS_QPA - QPlatformWindowFormat platformFormat = QGLFormat::toPlatformWindowFormat(QGLFormat::defaultFormat()); - platformFormat.setUseDefaultSharedContext(false); - if (shareWidget && shareWidget->d_func()->glcx) { - QPlatformGLContext *sharedPlatformContext = shareWidget->d_func()->glcx->d_func()->platformContext; - platformFormat.setSharedContext(sharedPlatformContext); - } - setPlatformWindowFormat(platformFormat); - winId(); // create window; - QGLContext *glContext = 0; - if (platformWindow()) - glContext = QGLContext::fromPlatformGLContext(platformWindow()->glContext()); - if (glContext){ - d->init(glContext,shareWidget); - } -#else d->init(new QGLContext(QGLFormat::defaultFormat(), this), shareWidget); -#endif } @@ -3829,24 +3812,7 @@ QGLWidget::QGLWidget(const QGLFormat &format, QWidget *parent, const QGLWidget* setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_NoSystemBackground); setAutoFillBackground(true); // for compatibility -#ifdef Q_WS_QPA - QPlatformWindowFormat platformFormat = QGLFormat::toPlatformWindowFormat(format); - platformFormat.setUseDefaultSharedContext(false); - if (shareWidget && shareWidget->d_func()->glcx) { - QPlatformGLContext *sharedPlatformContext = shareWidget->d_func()->glcx->d_func()->platformContext; - platformFormat.setSharedContext(sharedPlatformContext); - } - setPlatformWindowFormat(platformFormat); - winId(); // create window; - QGLContext *glContext = 0; - if (platformWindow()) - glContext = QGLContext::fromPlatformGLContext(platformWindow()->glContext()); - if (glContext){ - d->init(glContext,shareWidget); - } -#else d->init(new QGLContext(format, this), shareWidget); -#endif } /*! diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 415e915..52eb57f 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -325,11 +325,6 @@ void QGLWidget::setMouseTracking(bool enable) bool QGLWidget::event(QEvent *e) { Q_D(QGLWidget); - if (e->type() == QEvent::WinIdChange) { - if (platformWindow()) { - d->glcx = QGLContext::fromPlatformGLContext(platformWindow()->glContext()); - } - } return QWidget::event(e); } -- cgit v0.12 From 90de48493be283b9afb249f6a0fd8dbd8958517d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 10 Dec 2010 16:43:16 +0100 Subject: Handle the QWidgetPrivate::mapper structure Dont have widgets without a valid winId there --- src/gui/kernel/qwidget_qpa.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index 24ab8f7..560c9cd 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -768,6 +768,7 @@ void QWidgetPrivate::deleteTLSysExtra() context->deleteQGLContext(); } } + setWinId(0); delete extra->topextra->platformWindow; extra->topextra->platformWindow = 0; extra->topextra->backingStore.destroy(); -- cgit v0.12 From d0414bd582190e205aa698f5cb24f1c6909d8222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 10 Dec 2010 16:44:44 +0100 Subject: Dont do backingStore.destroy in deleteTLSysExtra It is done by QWidgetPrivate::deleteExtra() --- src/gui/kernel/qwidget_qpa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index 560c9cd..dce23a3 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -771,7 +771,6 @@ void QWidgetPrivate::deleteTLSysExtra() setWinId(0); delete extra->topextra->platformWindow; extra->topextra->platformWindow = 0; - extra->topextra->backingStore.destroy(); } } -- cgit v0.12 From e90cb6992e35ed4b9c2aae85edb8d787c24a8a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 14 Dec 2010 17:08:55 +0100 Subject: Fix gstreamer phonon build on X11 I added an x11{ } clause in the pro file for the plugin. But as it turnes out the x11 clause is defined in gui.pro so it is not available for use in any other pro or pri files. Also fixed a missing !qpa in qttest_p4.prf --- mkspecs/features/qttest_p4.prf | 2 +- src/plugins/phonon/gstreamer/gstreamer.pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qttest_p4.prf b/mkspecs/features/qttest_p4.prf index 2ee148b..26f4b35 100644 --- a/mkspecs/features/qttest_p4.prf +++ b/mkspecs/features/qttest_p4.prf @@ -2,7 +2,7 @@ isEmpty(TEMPLATE):TEMPLATE=app CONFIG += qt warn_on console depend_includepath testcase # x11 is not defined by configure (the following line is copied from gui.pro) -!win32:!embedded:!mac:!symbian:CONFIG += x11 +!win32:!embedded:!qpa:!mac:!symbian:CONFIG += x11 qtAddLibrary(QtTest) diff --git a/src/plugins/phonon/gstreamer/gstreamer.pro b/src/plugins/phonon/gstreamer/gstreamer.pro index 02e0848..c0d2604 100644 --- a/src/plugins/phonon/gstreamer/gstreamer.pro +++ b/src/plugins/phonon/gstreamer/gstreamer.pro @@ -58,7 +58,7 @@ SOURCES += $$PHONON_GSTREAMER_DIR/abstractrenderer.cpp \ $$PHONON_GSTREAMER_DIR/volumefadereffect.cpp \ $$PHONON_GSTREAMER_DIR/widgetrenderer.cpp -x11 { +!qpa:!embedded{ HEADERS += $$PHONON_GSTREAMER_DIR/x11renderer.h SOURCES += $$PHONON_GSTREAMER_DIR/x11renderer.cpp } -- cgit v0.12 From a7fc0e8bad3bd020ece5fa70f0462bcaf59b3d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 14 Dec 2010 17:15:44 +0100 Subject: Fix nativechild widget position in Lighthouse --- src/gui/kernel/qwidget_qpa.cpp | 16 ++++++---------- src/plugins/platforms/testlite/qtestlitewindow.cpp | 11 ++++++----- src/plugins/platforms/testlite/qtestlitewindow.h | 3 --- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index dce23a3..001810e 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -162,7 +162,6 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) { Q_Q(QWidget); - // QWidget *oldParent = q->parentWidget(); Qt::WindowFlags oldFlags = data.window_flags; int targetScreen = -1; @@ -214,13 +213,6 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) data.window_flags = window->setWindowFlags(data.window_flags); } - // Reparenting child to toplevel - if ((f&Qt::Window) && !(oldFlags&Qt::Window)) { - //qDebug() << "setParent_sys() change to toplevel"; - q->create(); //### too early: this ought to happen at show() time - } - - if (q->isWindow() || (!newparent || newparent->isVisible()) || explicitlyHidden) q->setAttribute(Qt::WA_WState_Hidden); q->setAttribute(Qt::WA_WState_ExplicitShowHide, explicitlyHidden); @@ -396,7 +388,11 @@ void QWidgetPrivate::show_sys() QPlatformWindow *window = q->platformWindow(); if (window) { - const QRect geomRect = q->geometry(); + QRect geomRect = q->geometry(); + if (!q->isWindow()) { + QPoint topLeftOfWindow = q->mapTo(q->nativeParentWidget(),QPoint()); + geomRect.moveTopLeft(topLeftOfWindow); + } const QRect windowRect = window->geometry(); if (windowRect != geomRect) { window->setGeometry(geomRect); @@ -591,7 +587,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) if (q->isVisible()) { if (q->platformWindow()) { if (q->isWindow()) { - q->platformWindow()->setGeometry(q->frameGeometry()); + q->platformWindow()->setGeometry(q->geometry()); } else { QPoint posInNativeParent = q->mapTo(q->nativeParentWidget(),QPoint()); q->platformWindow()->setGeometry(QRect(posInNativeParent,r.size())); diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index f8f4a5f..5446615 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -71,8 +71,7 @@ QTestLiteWindow::QTestLiteWindow(QWidget *window) int h = window->height(); if(window->platformWindowFormat().windowApi() == QPlatformWindowFormat::OpenGL - && QApplicationPrivate - ::platformIntegration()->hasOpenGL() ) { + && QApplicationPrivate::platformIntegration()->hasOpenGL() ) { #ifndef QT_NO_OPENGL XVisualInfo *visualInfo = QGLXContext::findVisualInfo(mScreen,window->platformWindowFormat()); Colormap cmap = XCreateColormap(mScreen->display(),mScreen->rootWindow(),visualInfo->visual,AllocNone); @@ -117,6 +116,7 @@ QTestLiteWindow::QTestLiteWindow(QWidget *window) } + QTestLiteWindow::~QTestLiteWindow() { #ifdef MYX11_DEBUG @@ -557,8 +557,8 @@ WId QTestLiteWindow::winId() const void QTestLiteWindow::setParent(const QPlatformWindow *window) { - QPoint point = widget()->mapTo(widget()->nativeParentWidget(),QPoint()); - XReparentWindow(mScreen->display(),x_window,window->winId(),point.x(),point.y()); + QPoint topLeft = geometry().topLeft(); + XReparentWindow(mScreen->display(),x_window,window->winId(),topLeft.x(),topLeft.y()); } void QTestLiteWindow::raise() @@ -624,7 +624,8 @@ void QTestLiteWindow::resizeEvent(XConfigureEvent *e) qDebug() << hex << x_window << dec << "ConfigureNotify" << e->x << e->y << e->width << e->height << "geometry" << xpos << ypos << width << height; #endif - QWindowSystemInterface::handleGeometryChange(widget(), QRect(xpos, ypos, e->width, e->height)); + QRect newRect(xpos, ypos, e->width, e->height); + QWindowSystemInterface::handleGeometryChange(widget(), newRect); } void QTestLiteWindow::mousePressEvent(XButtonEvent *e) diff --git a/src/plugins/platforms/testlite/qtestlitewindow.h b/src/plugins/platforms/testlite/qtestlitewindow.h index 8e9f6fd..7e990ee 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.h +++ b/src/plugins/platforms/testlite/qtestlitewindow.h @@ -136,9 +136,6 @@ private: QPlatformGLContext *mGLContext; QTestLiteScreen *mScreen; Qt::WindowFlags window_flags; - - Atom m_mwm_hint_atom; - }; #endif -- cgit v0.12 From fc79d664af9fe3396badac8d1829623118e827fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 17 Dec 2010 07:58:43 +0100 Subject: Remove current cursor optimization It was broken since it didn't take care of the initial cursor. --- src/plugins/platforms/testlite/qtestlitecursor.cpp | 3 +-- src/plugins/platforms/testlite/qtestlitecursor.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/platforms/testlite/qtestlitecursor.cpp b/src/plugins/platforms/testlite/qtestlitecursor.cpp index 4f3f0cb..e9e6eb7 100644 --- a/src/plugins/platforms/testlite/qtestlitecursor.cpp +++ b/src/plugins/platforms/testlite/qtestlitecursor.cpp @@ -71,8 +71,7 @@ void QTestLiteCursor::changeCursor(QCursor *cursor, QWidget *widget) return; int id = cursor->handle(); - if (id == currentCursor) - return; + Cursor c; if (!cursorMap.contains(id)) { if (cursor->shape() == Qt::BitmapCursor) diff --git a/src/plugins/platforms/testlite/qtestlitecursor.h b/src/plugins/platforms/testlite/qtestlitecursor.h index 15a5b2a..bb3549e 100644 --- a/src/plugins/platforms/testlite/qtestlitecursor.h +++ b/src/plugins/platforms/testlite/qtestlitecursor.h @@ -60,7 +60,6 @@ private: Cursor createCursorShape(int cshape); QTestLiteScreen *testLiteScreen() const; - int currentCursor; QMap cursorMap; }; -- cgit v0.12 From 683263e4010e3e1797221edb73d91471aea7b93a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 17 Dec 2010 08:02:04 +0100 Subject: Refactored the keyboard event handling in testlite --- .../platforms/testlite/qtestlitekeyboard.cpp | 943 +++++++++++++++++++++ src/plugins/platforms/testlite/qtestlitekeyboard.h | 35 + src/plugins/platforms/testlite/qtestlitescreen.cpp | 11 +- src/plugins/platforms/testlite/qtestlitescreen.h | 3 + src/plugins/platforms/testlite/qtestlitewindow.cpp | 329 +------ src/plugins/platforms/testlite/qtestlitewindow.h | 1 - src/plugins/platforms/testlite/testlite.pro | 6 +- 7 files changed, 997 insertions(+), 331 deletions(-) create mode 100644 src/plugins/platforms/testlite/qtestlitekeyboard.cpp create mode 100644 src/plugins/platforms/testlite/qtestlitekeyboard.h diff --git a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp new file mode 100644 index 0000000..c18de59 --- /dev/null +++ b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp @@ -0,0 +1,943 @@ +#include "qtestlitekeyboard.h" + +#include "qtestlitescreen.h" + +#include + +#include + +#ifndef XK_ISO_Left_Tab +#define XK_ISO_Left_Tab 0xFE20 +#endif + +#ifndef XK_dead_hook +#define XK_dead_hook 0xFE61 +#endif + +#ifndef XK_dead_horn +#define XK_dead_horn 0xFE62 +#endif + +#ifndef XK_Codeinput +#define XK_Codeinput 0xFF37 +#endif + +#ifndef XK_Kanji_Bangou +#define XK_Kanji_Bangou 0xFF37 /* same as codeinput */ +#endif + +// Fix old X libraries +#ifndef XK_KP_Home +#define XK_KP_Home 0xFF95 +#endif +#ifndef XK_KP_Left +#define XK_KP_Left 0xFF96 +#endif +#ifndef XK_KP_Up +#define XK_KP_Up 0xFF97 +#endif +#ifndef XK_KP_Right +#define XK_KP_Right 0xFF98 +#endif +#ifndef XK_KP_Down +#define XK_KP_Down 0xFF99 +#endif +#ifndef XK_KP_Prior +#define XK_KP_Prior 0xFF9A +#endif +#ifndef XK_KP_Next +#define XK_KP_Next 0xFF9B +#endif +#ifndef XK_KP_End +#define XK_KP_End 0xFF9C +#endif +#ifndef XK_KP_Insert +#define XK_KP_Insert 0xFF9E +#endif +#ifndef XK_KP_Delete +#define XK_KP_Delete 0xFF9F +#endif + +// the next lines are taken on 10/2009 from X.org (X11/XF86keysym.h), defining some special +// multimedia keys. They are included here as not every system has them. +#define XF86XK_MonBrightnessUp 0x1008FF02 +#define XF86XK_MonBrightnessDown 0x1008FF03 +#define XF86XK_KbdLightOnOff 0x1008FF04 +#define XF86XK_KbdBrightnessUp 0x1008FF05 +#define XF86XK_KbdBrightnessDown 0x1008FF06 +#define XF86XK_Standby 0x1008FF10 +#define XF86XK_AudioLowerVolume 0x1008FF11 +#define XF86XK_AudioMute 0x1008FF12 +#define XF86XK_AudioRaiseVolume 0x1008FF13 +#define XF86XK_AudioPlay 0x1008FF14 +#define XF86XK_AudioStop 0x1008FF15 +#define XF86XK_AudioPrev 0x1008FF16 +#define XF86XK_AudioNext 0x1008FF17 +#define XF86XK_HomePage 0x1008FF18 +#define XF86XK_Mail 0x1008FF19 +#define XF86XK_Start 0x1008FF1A +#define XF86XK_Search 0x1008FF1B +#define XF86XK_AudioRecord 0x1008FF1C +#define XF86XK_Calculator 0x1008FF1D +#define XF86XK_Memo 0x1008FF1E +#define XF86XK_ToDoList 0x1008FF1F +#define XF86XK_Calendar 0x1008FF20 +#define XF86XK_PowerDown 0x1008FF21 +#define XF86XK_ContrastAdjust 0x1008FF22 +#define XF86XK_Back 0x1008FF26 +#define XF86XK_Forward 0x1008FF27 +#define XF86XK_Stop 0x1008FF28 +#define XF86XK_Refresh 0x1008FF29 +#define XF86XK_PowerOff 0x1008FF2A +#define XF86XK_WakeUp 0x1008FF2B +#define XF86XK_Eject 0x1008FF2C +#define XF86XK_ScreenSaver 0x1008FF2D +#define XF86XK_WWW 0x1008FF2E +#define XF86XK_Sleep 0x1008FF2F +#define XF86XK_Favorites 0x1008FF30 +#define XF86XK_AudioPause 0x1008FF31 +#define XF86XK_AudioMedia 0x1008FF32 +#define XF86XK_MyComputer 0x1008FF33 +#define XF86XK_LightBulb 0x1008FF35 +#define XF86XK_Shop 0x1008FF36 +#define XF86XK_History 0x1008FF37 +#define XF86XK_OpenURL 0x1008FF38 +#define XF86XK_AddFavorite 0x1008FF39 +#define XF86XK_HotLinks 0x1008FF3A +#define XF86XK_BrightnessAdjust 0x1008FF3B +#define XF86XK_Finance 0x1008FF3C +#define XF86XK_Community 0x1008FF3D +#define XF86XK_AudioRewind 0x1008FF3E +#define XF86XK_BackForward 0x1008FF3F +#define XF86XK_Launch0 0x1008FF40 +#define XF86XK_Launch1 0x1008FF41 +#define XF86XK_Launch2 0x1008FF42 +#define XF86XK_Launch3 0x1008FF43 +#define XF86XK_Launch4 0x1008FF44 +#define XF86XK_Launch5 0x1008FF45 +#define XF86XK_Launch6 0x1008FF46 +#define XF86XK_Launch7 0x1008FF47 +#define XF86XK_Launch8 0x1008FF48 +#define XF86XK_Launch9 0x1008FF49 +#define XF86XK_LaunchA 0x1008FF4A +#define XF86XK_LaunchB 0x1008FF4B +#define XF86XK_LaunchC 0x1008FF4C +#define XF86XK_LaunchD 0x1008FF4D +#define XF86XK_LaunchE 0x1008FF4E +#define XF86XK_LaunchF 0x1008FF4F +#define XF86XK_ApplicationLeft 0x1008FF50 +#define XF86XK_ApplicationRight 0x1008FF51 +#define XF86XK_Book 0x1008FF52 +#define XF86XK_CD 0x1008FF53 +#define XF86XK_Calculater 0x1008FF54 +#define XF86XK_Clear 0x1008FF55 +#define XF86XK_ClearGrab 0x1008FE21 +#define XF86XK_Close 0x1008FF56 +#define XF86XK_Copy 0x1008FF57 +#define XF86XK_Cut 0x1008FF58 +#define XF86XK_Display 0x1008FF59 +#define XF86XK_DOS 0x1008FF5A +#define XF86XK_Documents 0x1008FF5B +#define XF86XK_Excel 0x1008FF5C +#define XF86XK_Explorer 0x1008FF5D +#define XF86XK_Game 0x1008FF5E +#define XF86XK_Go 0x1008FF5F +#define XF86XK_iTouch 0x1008FF60 +#define XF86XK_LogOff 0x1008FF61 +#define XF86XK_Market 0x1008FF62 +#define XF86XK_Meeting 0x1008FF63 +#define XF86XK_MenuKB 0x1008FF65 +#define XF86XK_MenuPB 0x1008FF66 +#define XF86XK_MySites 0x1008FF67 +#define XF86XK_News 0x1008FF69 +#define XF86XK_OfficeHome 0x1008FF6A +#define XF86XK_Option 0x1008FF6C +#define XF86XK_Paste 0x1008FF6D +#define XF86XK_Phone 0x1008FF6E +#define XF86XK_Reply 0x1008FF72 +#define XF86XK_Reload 0x1008FF73 +#define XF86XK_RotateWindows 0x1008FF74 +#define XF86XK_RotationPB 0x1008FF75 +#define XF86XK_RotationKB 0x1008FF76 +#define XF86XK_Save 0x1008FF77 +#define XF86XK_Send 0x1008FF7B +#define XF86XK_Spell 0x1008FF7C +#define XF86XK_SplitScreen 0x1008FF7D +#define XF86XK_Support 0x1008FF7E +#define XF86XK_TaskPane 0x1008FF7F +#define XF86XK_Terminal 0x1008FF80 +#define XF86XK_Tools 0x1008FF81 +#define XF86XK_Travel 0x1008FF82 +#define XF86XK_Video 0x1008FF87 +#define XF86XK_Word 0x1008FF89 +#define XF86XK_Xfer 0x1008FF8A +#define XF86XK_ZoomIn 0x1008FF8B +#define XF86XK_ZoomOut 0x1008FF8C +#define XF86XK_Away 0x1008FF8D +#define XF86XK_Messenger 0x1008FF8E +#define XF86XK_WebCam 0x1008FF8F +#define XF86XK_MailForward 0x1008FF90 +#define XF86XK_Pictures 0x1008FF91 +#define XF86XK_Music 0x1008FF92 +#define XF86XK_Battery 0x1008FF93 +#define XF86XK_Bluetooth 0x1008FF94 +#define XF86XK_WLAN 0x1008FF95 +#define XF86XK_UWB 0x1008FF96 +#define XF86XK_AudioForward 0x1008FF97 +#define XF86XK_AudioRepeat 0x1008FF98 +#define XF86XK_AudioRandomPlay 0x1008FF99 +#define XF86XK_Subtitle 0x1008FF9A +#define XF86XK_AudioCycleTrack 0x1008FF9B +#define XF86XK_Time 0x1008FF9F +#define XF86XK_Select 0x1008FFA0 +#define XF86XK_View 0x1008FFA1 +#define XF86XK_TopMenu 0x1008FFA2 +#define XF86XK_Suspend 0x1008FFA7 +#define XF86XK_Hibernate 0x1008FFA8 + + +// end of XF86keysyms.h + +// Special keys used by Qtopia, mapped into the X11 private keypad range. +#define QTOPIAXK_Select 0x11000601 +#define QTOPIAXK_Yes 0x11000602 +#define QTOPIAXK_No 0x11000603 +#define QTOPIAXK_Cancel 0x11000604 +#define QTOPIAXK_Printer 0x11000605 +#define QTOPIAXK_Execute 0x11000606 +#define QTOPIAXK_Sleep 0x11000607 +#define QTOPIAXK_Play 0x11000608 +#define QTOPIAXK_Zoom 0x11000609 +#define QTOPIAXK_Context1 0x1100060A +#define QTOPIAXK_Context2 0x1100060B +#define QTOPIAXK_Context3 0x1100060C +#define QTOPIAXK_Context4 0x1100060D +#define QTOPIAXK_Call 0x1100060E +#define QTOPIAXK_Hangup 0x1100060F +#define QTOPIAXK_Flip 0x11000610 + +// keyboard mapping table +static const unsigned int KeyTbl[] = { + + // misc keys + + XK_Escape, Qt::Key_Escape, + XK_Tab, Qt::Key_Tab, + XK_ISO_Left_Tab, Qt::Key_Backtab, + XK_BackSpace, Qt::Key_Backspace, + XK_Return, Qt::Key_Return, + XK_Insert, Qt::Key_Insert, + XK_Delete, Qt::Key_Delete, + XK_Clear, Qt::Key_Delete, + XK_Pause, Qt::Key_Pause, + XK_Print, Qt::Key_Print, + 0x1005FF60, Qt::Key_SysReq, // hardcoded Sun SysReq + 0x1007ff00, Qt::Key_SysReq, // hardcoded X386 SysReq + + // cursor movement + + XK_Home, Qt::Key_Home, + XK_End, Qt::Key_End, + XK_Left, Qt::Key_Left, + XK_Up, Qt::Key_Up, + XK_Right, Qt::Key_Right, + XK_Down, Qt::Key_Down, + XK_Prior, Qt::Key_PageUp, + XK_Next, Qt::Key_PageDown, + + // modifiers + + XK_Shift_L, Qt::Key_Shift, + XK_Shift_R, Qt::Key_Shift, + XK_Shift_Lock, Qt::Key_Shift, + XK_Control_L, Qt::Key_Control, + XK_Control_R, Qt::Key_Control, + XK_Meta_L, Qt::Key_Meta, + XK_Meta_R, Qt::Key_Meta, + XK_Alt_L, Qt::Key_Alt, + XK_Alt_R, Qt::Key_Alt, + XK_Caps_Lock, Qt::Key_CapsLock, + XK_Num_Lock, Qt::Key_NumLock, + XK_Scroll_Lock, Qt::Key_ScrollLock, + XK_Super_L, Qt::Key_Super_L, + XK_Super_R, Qt::Key_Super_R, + XK_Menu, Qt::Key_Menu, + XK_Hyper_L, Qt::Key_Hyper_L, + XK_Hyper_R, Qt::Key_Hyper_R, + XK_Help, Qt::Key_Help, + 0x1000FF74, Qt::Key_Backtab, // hardcoded HP backtab + 0x1005FF10, Qt::Key_F11, // hardcoded Sun F36 (labeled F11) + 0x1005FF11, Qt::Key_F12, // hardcoded Sun F37 (labeled F12) + + // numeric and function keypad keys + + XK_KP_Space, Qt::Key_Space, + XK_KP_Tab, Qt::Key_Tab, + XK_KP_Enter, Qt::Key_Enter, + //XK_KP_F1, Qt::Key_F1, + //XK_KP_F2, Qt::Key_F2, + //XK_KP_F3, Qt::Key_F3, + //XK_KP_F4, Qt::Key_F4, + XK_KP_Home, Qt::Key_Home, + XK_KP_Left, Qt::Key_Left, + XK_KP_Up, Qt::Key_Up, + XK_KP_Right, Qt::Key_Right, + XK_KP_Down, Qt::Key_Down, + XK_KP_Prior, Qt::Key_PageUp, + XK_KP_Next, Qt::Key_PageDown, + XK_KP_End, Qt::Key_End, + XK_KP_Begin, Qt::Key_Clear, + XK_KP_Insert, Qt::Key_Insert, + XK_KP_Delete, Qt::Key_Delete, + XK_KP_Equal, Qt::Key_Equal, + XK_KP_Multiply, Qt::Key_Asterisk, + XK_KP_Add, Qt::Key_Plus, + XK_KP_Separator, Qt::Key_Comma, + XK_KP_Subtract, Qt::Key_Minus, + XK_KP_Decimal, Qt::Key_Period, + XK_KP_Divide, Qt::Key_Slash, + + // International input method support keys + + // International & multi-key character composition + XK_ISO_Level3_Shift, Qt::Key_AltGr, + XK_Multi_key, Qt::Key_Multi_key, + XK_Codeinput, Qt::Key_Codeinput, + XK_SingleCandidate, Qt::Key_SingleCandidate, + XK_MultipleCandidate, Qt::Key_MultipleCandidate, + XK_PreviousCandidate, Qt::Key_PreviousCandidate, + + // Misc Functions + XK_Mode_switch, Qt::Key_Mode_switch, + XK_script_switch, Qt::Key_Mode_switch, + + // Japanese keyboard support + XK_Kanji, Qt::Key_Kanji, + XK_Muhenkan, Qt::Key_Muhenkan, + //XK_Henkan_Mode, Qt::Key_Henkan_Mode, + XK_Henkan_Mode, Qt::Key_Henkan, + XK_Henkan, Qt::Key_Henkan, + XK_Romaji, Qt::Key_Romaji, + XK_Hiragana, Qt::Key_Hiragana, + XK_Katakana, Qt::Key_Katakana, + XK_Hiragana_Katakana, Qt::Key_Hiragana_Katakana, + XK_Zenkaku, Qt::Key_Zenkaku, + XK_Hankaku, Qt::Key_Hankaku, + XK_Zenkaku_Hankaku, Qt::Key_Zenkaku_Hankaku, + XK_Touroku, Qt::Key_Touroku, + XK_Massyo, Qt::Key_Massyo, + XK_Kana_Lock, Qt::Key_Kana_Lock, + XK_Kana_Shift, Qt::Key_Kana_Shift, + XK_Eisu_Shift, Qt::Key_Eisu_Shift, + XK_Eisu_toggle, Qt::Key_Eisu_toggle, + //XK_Kanji_Bangou, Qt::Key_Kanji_Bangou, + //XK_Zen_Koho, Qt::Key_Zen_Koho, + //XK_Mae_Koho, Qt::Key_Mae_Koho, + XK_Kanji_Bangou, Qt::Key_Codeinput, + XK_Zen_Koho, Qt::Key_MultipleCandidate, + XK_Mae_Koho, Qt::Key_PreviousCandidate, + +#ifdef XK_KOREAN + // Korean keyboard support + XK_Hangul, Qt::Key_Hangul, + XK_Hangul_Start, Qt::Key_Hangul_Start, + XK_Hangul_End, Qt::Key_Hangul_End, + XK_Hangul_Hanja, Qt::Key_Hangul_Hanja, + XK_Hangul_Jamo, Qt::Key_Hangul_Jamo, + XK_Hangul_Romaja, Qt::Key_Hangul_Romaja, + //XK_Hangul_Codeinput, Qt::Key_Hangul_Codeinput, + XK_Hangul_Codeinput, Qt::Key_Codeinput, + XK_Hangul_Jeonja, Qt::Key_Hangul_Jeonja, + XK_Hangul_Banja, Qt::Key_Hangul_Banja, + XK_Hangul_PreHanja, Qt::Key_Hangul_PreHanja, + XK_Hangul_PostHanja, Qt::Key_Hangul_PostHanja, + //XK_Hangul_SingleCandidate,Qt::Key_Hangul_SingleCandidate, + //XK_Hangul_MultipleCandidate,Qt::Key_Hangul_MultipleCandidate, + //XK_Hangul_PreviousCandidate,Qt::Key_Hangul_PreviousCandidate, + XK_Hangul_SingleCandidate, Qt::Key_SingleCandidate, + XK_Hangul_MultipleCandidate,Qt::Key_MultipleCandidate, + XK_Hangul_PreviousCandidate,Qt::Key_PreviousCandidate, + XK_Hangul_Special, Qt::Key_Hangul_Special, + //XK_Hangul_switch, Qt::Key_Hangul_switch, + XK_Hangul_switch, Qt::Key_Mode_switch, +#endif // XK_KOREAN + + // dead keys + XK_dead_grave, Qt::Key_Dead_Grave, + XK_dead_acute, Qt::Key_Dead_Acute, + XK_dead_circumflex, Qt::Key_Dead_Circumflex, + XK_dead_tilde, Qt::Key_Dead_Tilde, + XK_dead_macron, Qt::Key_Dead_Macron, + XK_dead_breve, Qt::Key_Dead_Breve, + XK_dead_abovedot, Qt::Key_Dead_Abovedot, + XK_dead_diaeresis, Qt::Key_Dead_Diaeresis, + XK_dead_abovering, Qt::Key_Dead_Abovering, + XK_dead_doubleacute, Qt::Key_Dead_Doubleacute, + XK_dead_caron, Qt::Key_Dead_Caron, + XK_dead_cedilla, Qt::Key_Dead_Cedilla, + XK_dead_ogonek, Qt::Key_Dead_Ogonek, + XK_dead_iota, Qt::Key_Dead_Iota, + XK_dead_voiced_sound, Qt::Key_Dead_Voiced_Sound, + XK_dead_semivoiced_sound, Qt::Key_Dead_Semivoiced_Sound, + XK_dead_belowdot, Qt::Key_Dead_Belowdot, + XK_dead_hook, Qt::Key_Dead_Hook, + XK_dead_horn, Qt::Key_Dead_Horn, + + // Special keys from X.org - This include multimedia keys, + // wireless/bluetooth/uwb keys, special launcher keys, etc. + XF86XK_Back, Qt::Key_Back, + XF86XK_Forward, Qt::Key_Forward, + XF86XK_Stop, Qt::Key_Stop, + XF86XK_Refresh, Qt::Key_Refresh, + XF86XK_Favorites, Qt::Key_Favorites, + XF86XK_AudioMedia, Qt::Key_LaunchMedia, + XF86XK_OpenURL, Qt::Key_OpenUrl, + XF86XK_HomePage, Qt::Key_HomePage, + XF86XK_Search, Qt::Key_Search, + XF86XK_AudioLowerVolume, Qt::Key_VolumeDown, + XF86XK_AudioMute, Qt::Key_VolumeMute, + XF86XK_AudioRaiseVolume, Qt::Key_VolumeUp, + XF86XK_AudioPlay, Qt::Key_MediaPlay, + XF86XK_AudioStop, Qt::Key_MediaStop, + XF86XK_AudioPrev, Qt::Key_MediaPrevious, + XF86XK_AudioNext, Qt::Key_MediaNext, + XF86XK_AudioRecord, Qt::Key_MediaRecord, + XF86XK_Mail, Qt::Key_LaunchMail, + XF86XK_MyComputer, Qt::Key_Launch0, // ### Qt 5: remap properly + XF86XK_Calculator, Qt::Key_Launch1, + XF86XK_Memo, Qt::Key_Memo, + XF86XK_ToDoList, Qt::Key_ToDoList, + XF86XK_Calendar, Qt::Key_Calendar, + XF86XK_PowerDown, Qt::Key_PowerDown, + XF86XK_ContrastAdjust, Qt::Key_ContrastAdjust, + XF86XK_Standby, Qt::Key_Standby, + XF86XK_MonBrightnessUp, Qt::Key_MonBrightnessUp, + XF86XK_MonBrightnessDown, Qt::Key_MonBrightnessDown, + XF86XK_KbdLightOnOff, Qt::Key_KeyboardLightOnOff, + XF86XK_KbdBrightnessUp, Qt::Key_KeyboardBrightnessUp, + XF86XK_KbdBrightnessDown, Qt::Key_KeyboardBrightnessDown, + XF86XK_PowerOff, Qt::Key_PowerOff, + XF86XK_WakeUp, Qt::Key_WakeUp, + XF86XK_Eject, Qt::Key_Eject, + XF86XK_ScreenSaver, Qt::Key_ScreenSaver, + XF86XK_WWW, Qt::Key_WWW, + XF86XK_Sleep, Qt::Key_Sleep, + XF86XK_LightBulb, Qt::Key_LightBulb, + XF86XK_Shop, Qt::Key_Shop, + XF86XK_History, Qt::Key_History, + XF86XK_AddFavorite, Qt::Key_AddFavorite, + XF86XK_HotLinks, Qt::Key_HotLinks, + XF86XK_BrightnessAdjust, Qt::Key_BrightnessAdjust, + XF86XK_Finance, Qt::Key_Finance, + XF86XK_Community, Qt::Key_Community, + XF86XK_AudioRewind, Qt::Key_AudioRewind, + XF86XK_BackForward, Qt::Key_BackForward, + XF86XK_ApplicationLeft, Qt::Key_ApplicationLeft, + XF86XK_ApplicationRight, Qt::Key_ApplicationRight, + XF86XK_Book, Qt::Key_Book, + XF86XK_CD, Qt::Key_CD, + XF86XK_Calculater, Qt::Key_Calculator, + XF86XK_Clear, Qt::Key_Clear, + XF86XK_ClearGrab, Qt::Key_ClearGrab, + XF86XK_Close, Qt::Key_Close, + XF86XK_Copy, Qt::Key_Copy, + XF86XK_Cut, Qt::Key_Cut, + XF86XK_Display, Qt::Key_Display, + XF86XK_DOS, Qt::Key_DOS, + XF86XK_Documents, Qt::Key_Documents, + XF86XK_Excel, Qt::Key_Excel, + XF86XK_Explorer, Qt::Key_Explorer, + XF86XK_Game, Qt::Key_Game, + XF86XK_Go, Qt::Key_Go, + XF86XK_iTouch, Qt::Key_iTouch, + XF86XK_LogOff, Qt::Key_LogOff, + XF86XK_Market, Qt::Key_Market, + XF86XK_Meeting, Qt::Key_Meeting, + XF86XK_MenuKB, Qt::Key_MenuKB, + XF86XK_MenuPB, Qt::Key_MenuPB, + XF86XK_MySites, Qt::Key_MySites, + XF86XK_News, Qt::Key_News, + XF86XK_OfficeHome, Qt::Key_OfficeHome, + XF86XK_Option, Qt::Key_Option, + XF86XK_Paste, Qt::Key_Paste, + XF86XK_Phone, Qt::Key_Phone, + XF86XK_Reply, Qt::Key_Reply, + XF86XK_Reload, Qt::Key_Reload, + XF86XK_RotateWindows, Qt::Key_RotateWindows, + XF86XK_RotationPB, Qt::Key_RotationPB, + XF86XK_RotationKB, Qt::Key_RotationKB, + XF86XK_Save, Qt::Key_Save, + XF86XK_Send, Qt::Key_Send, + XF86XK_Spell, Qt::Key_Spell, + XF86XK_SplitScreen, Qt::Key_SplitScreen, + XF86XK_Support, Qt::Key_Support, + XF86XK_TaskPane, Qt::Key_TaskPane, + XF86XK_Terminal, Qt::Key_Terminal, + XF86XK_Tools, Qt::Key_Tools, + XF86XK_Travel, Qt::Key_Travel, + XF86XK_Video, Qt::Key_Video, + XF86XK_Word, Qt::Key_Word, + XF86XK_Xfer, Qt::Key_Xfer, + XF86XK_ZoomIn, Qt::Key_ZoomIn, + XF86XK_ZoomOut, Qt::Key_ZoomOut, + XF86XK_Away, Qt::Key_Away, + XF86XK_Messenger, Qt::Key_Messenger, + XF86XK_WebCam, Qt::Key_WebCam, + XF86XK_MailForward, Qt::Key_MailForward, + XF86XK_Pictures, Qt::Key_Pictures, + XF86XK_Music, Qt::Key_Music, + XF86XK_Battery, Qt::Key_Battery, + XF86XK_Bluetooth, Qt::Key_Bluetooth, + XF86XK_WLAN, Qt::Key_WLAN, + XF86XK_UWB, Qt::Key_UWB, + XF86XK_AudioForward, Qt::Key_AudioForward, + XF86XK_AudioRepeat, Qt::Key_AudioRepeat, + XF86XK_AudioRandomPlay, Qt::Key_AudioRandomPlay, + XF86XK_Subtitle, Qt::Key_Subtitle, + XF86XK_AudioCycleTrack, Qt::Key_AudioCycleTrack, + XF86XK_Time, Qt::Key_Time, + XF86XK_Select, Qt::Key_Select, + XF86XK_View, Qt::Key_View, + XF86XK_TopMenu, Qt::Key_TopMenu, + XF86XK_Bluetooth, Qt::Key_Bluetooth, + XF86XK_Suspend, Qt::Key_Suspend, + XF86XK_Hibernate, Qt::Key_Hibernate, + XF86XK_Launch0, Qt::Key_Launch2, // ### Qt 5: remap properly + XF86XK_Launch1, Qt::Key_Launch3, + XF86XK_Launch2, Qt::Key_Launch4, + XF86XK_Launch3, Qt::Key_Launch5, + XF86XK_Launch4, Qt::Key_Launch6, + XF86XK_Launch5, Qt::Key_Launch7, + XF86XK_Launch6, Qt::Key_Launch8, + XF86XK_Launch7, Qt::Key_Launch9, + XF86XK_Launch8, Qt::Key_LaunchA, + XF86XK_Launch9, Qt::Key_LaunchB, + XF86XK_LaunchA, Qt::Key_LaunchC, + XF86XK_LaunchB, Qt::Key_LaunchD, + XF86XK_LaunchC, Qt::Key_LaunchE, + XF86XK_LaunchD, Qt::Key_LaunchF, + XF86XK_LaunchE, Qt::Key_LaunchG, + XF86XK_LaunchF, Qt::Key_LaunchH, + + // Qtopia keys + QTOPIAXK_Select, Qt::Key_Select, + QTOPIAXK_Yes, Qt::Key_Yes, + QTOPIAXK_No, Qt::Key_No, + QTOPIAXK_Cancel, Qt::Key_Cancel, + QTOPIAXK_Printer, Qt::Key_Printer, + QTOPIAXK_Execute, Qt::Key_Execute, + QTOPIAXK_Sleep, Qt::Key_Sleep, + QTOPIAXK_Play, Qt::Key_Play, + QTOPIAXK_Zoom, Qt::Key_Zoom, + QTOPIAXK_Context1, Qt::Key_Context1, + QTOPIAXK_Context2, Qt::Key_Context2, + QTOPIAXK_Context3, Qt::Key_Context3, + QTOPIAXK_Context4, Qt::Key_Context4, + QTOPIAXK_Call, Qt::Key_Call, + QTOPIAXK_Hangup, Qt::Key_Hangup, + QTOPIAXK_Flip, Qt::Key_Flip, + + 0, 0 +}; + +static const unsigned short katakanaKeysymsToUnicode[] = { + 0x0000, 0x3002, 0x300C, 0x300D, 0x3001, 0x30FB, 0x30F2, 0x30A1, + 0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30E3, 0x30E5, 0x30E7, 0x30C3, + 0x30FC, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, + 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, + 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, + 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, + 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, + 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F3, 0x309B, 0x309C +}; + +static const unsigned short cyrillicKeysymsToUnicode[] = { + 0x0000, 0x0452, 0x0453, 0x0451, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x0000, 0x045e, 0x045f, + 0x2116, 0x0402, 0x0403, 0x0401, 0x0404, 0x0405, 0x0406, 0x0407, + 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x0000, 0x040e, 0x040f, + 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, + 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, + 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, + 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, + 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, + 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, + 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, + 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a +}; + +static const unsigned short greekKeysymsToUnicode[] = { + 0x0000, 0x0386, 0x0388, 0x0389, 0x038a, 0x03aa, 0x0000, 0x038c, + 0x038e, 0x03ab, 0x0000, 0x038f, 0x0000, 0x0000, 0x0385, 0x2015, + 0x0000, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03ca, 0x0390, 0x03cc, + 0x03cd, 0x03cb, 0x03b0, 0x03ce, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, + 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, + 0x03a0, 0x03a1, 0x03a3, 0x0000, 0x03a4, 0x03a5, 0x03a6, 0x03a7, + 0x03a8, 0x03a9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, + 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, + 0x03c0, 0x03c1, 0x03c3, 0x03c2, 0x03c4, 0x03c5, 0x03c6, 0x03c7, + 0x03c8, 0x03c9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +}; + +static const unsigned short technicalKeysymsToUnicode[] = { + 0x0000, 0x23B7, 0x250C, 0x2500, 0x2320, 0x2321, 0x2502, 0x23A1, + 0x23A3, 0x23A4, 0x23A6, 0x239B, 0x239D, 0x239E, 0x23A0, 0x23A8, + 0x23AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x2264, 0x2260, 0x2265, 0x222B, + 0x2234, 0x221D, 0x221E, 0x0000, 0x0000, 0x2207, 0x0000, 0x0000, + 0x223C, 0x2243, 0x0000, 0x0000, 0x0000, 0x21D4, 0x21D2, 0x2261, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x221A, 0x0000, + 0x0000, 0x0000, 0x2282, 0x2283, 0x2229, 0x222A, 0x2227, 0x2228, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2202, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0192, 0x0000, + 0x0000, 0x0000, 0x0000, 0x2190, 0x2191, 0x2192, 0x2193, 0x0000 +}; + +static const unsigned short specialKeysymsToUnicode[] = { + 0x25C6, 0x2592, 0x2409, 0x240C, 0x240D, 0x240A, 0x0000, 0x0000, + 0x2424, 0x240B, 0x2518, 0x2510, 0x250C, 0x2514, 0x253C, 0x23BA, + 0x23BB, 0x2500, 0x23BC, 0x23BD, 0x251C, 0x2524, 0x2534, 0x252C, + 0x2502, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +}; + +static const unsigned short publishingKeysymsToUnicode[] = { + 0x0000, 0x2003, 0x2002, 0x2004, 0x2005, 0x2007, 0x2008, 0x2009, + 0x200a, 0x2014, 0x2013, 0x0000, 0x0000, 0x0000, 0x2026, 0x2025, + 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215a, + 0x2105, 0x0000, 0x0000, 0x2012, 0x2329, 0x0000, 0x232a, 0x0000, + 0x0000, 0x0000, 0x0000, 0x215b, 0x215c, 0x215d, 0x215e, 0x0000, + 0x0000, 0x2122, 0x2613, 0x0000, 0x25c1, 0x25b7, 0x25cb, 0x25af, + 0x2018, 0x2019, 0x201c, 0x201d, 0x211e, 0x0000, 0x2032, 0x2033, + 0x0000, 0x271d, 0x0000, 0x25ac, 0x25c0, 0x25b6, 0x25cf, 0x25ae, + 0x25e6, 0x25ab, 0x25ad, 0x25b3, 0x25bd, 0x2606, 0x2022, 0x25aa, + 0x25b2, 0x25bc, 0x261c, 0x261e, 0x2663, 0x2666, 0x2665, 0x0000, + 0x2720, 0x2020, 0x2021, 0x2713, 0x2717, 0x266f, 0x266d, 0x2642, + 0x2640, 0x260e, 0x2315, 0x2117, 0x2038, 0x201a, 0x201e, 0x0000 +}; + +static const unsigned short aplKeysymsToUnicode[] = { + 0x0000, 0x0000, 0x0000, 0x003c, 0x0000, 0x0000, 0x003e, 0x0000, + 0x2228, 0x2227, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x00af, 0x0000, 0x22a5, 0x2229, 0x230a, 0x0000, 0x005f, 0x0000, + 0x0000, 0x0000, 0x2218, 0x0000, 0x2395, 0x0000, 0x22a4, 0x25cb, + 0x0000, 0x0000, 0x0000, 0x2308, 0x0000, 0x0000, 0x222a, 0x0000, + 0x2283, 0x0000, 0x2282, 0x0000, 0x22a2, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x22a3, 0x0000, 0x0000, 0x0000 +}; + +static const unsigned short koreanKeysymsToUnicode[] = { + 0x0000, 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, + 0x3138, 0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f, + 0x3140, 0x3141, 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147, + 0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e, 0x314f, + 0x3150, 0x3151, 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157, + 0x3158, 0x3159, 0x315a, 0x315b, 0x315c, 0x315d, 0x315e, 0x315f, + 0x3160, 0x3161, 0x3162, 0x3163, 0x11a8, 0x11a9, 0x11aa, 0x11ab, + 0x11ac, 0x11ad, 0x11ae, 0x11af, 0x11b0, 0x11b1, 0x11b2, 0x11b3, + 0x11b4, 0x11b5, 0x11b6, 0x11b7, 0x11b8, 0x11b9, 0x11ba, 0x11bb, + 0x11bc, 0x11bd, 0x11be, 0x11bf, 0x11c0, 0x11c1, 0x11c2, 0x316d, + 0x3171, 0x3178, 0x317f, 0x3181, 0x3184, 0x3186, 0x318d, 0x318e, + 0x11eb, 0x11f0, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x20a9 +}; + +static QChar keysymToUnicode(unsigned char byte3, unsigned char byte4) +{ + switch (byte3) { + case 0x04: + // katakana + if (byte4 > 0xa0 && byte4 < 0xe0) + return QChar(katakanaKeysymsToUnicode[byte4 - 0xa0]); + else if (byte4 == 0x7e) + return QChar(0x203e); // Overline + break; + case 0x06: + // russian, use lookup table + if (byte4 > 0xa0) + return QChar(cyrillicKeysymsToUnicode[byte4 - 0xa0]); + break; + case 0x07: + // greek + if (byte4 > 0xa0) + return QChar(greekKeysymsToUnicode[byte4 - 0xa0]); + break; + case 0x08: + // technical + if (byte4 > 0xa0) + return QChar(technicalKeysymsToUnicode[byte4 - 0xa0]); + break; + case 0x09: + // special + if (byte4 >= 0xe0) + return QChar(specialKeysymsToUnicode[byte4 - 0xe0]); + break; + case 0x0a: + // publishing + if (byte4 > 0xa0) + return QChar(publishingKeysymsToUnicode[byte4 - 0xa0]); + break; + case 0x0b: + // APL + if (byte4 > 0xa0) + return QChar(aplKeysymsToUnicode[byte4 - 0xa0]); + break; + case 0x0e: + // Korean + if (byte4 > 0xa0) + return QChar(koreanKeysymsToUnicode[byte4 - 0xa0]); + break; + default: + break; + } + return QChar(0x0); +} + +Qt::KeyboardModifiers QTestLiteKeyboard::translateModifiers(int s) +{ + Qt::KeyboardModifiers ret = 0; + if (s & ShiftMask) + ret |= Qt::ShiftModifier; + if (s & ControlMask) + ret |= Qt::ControlModifier; + if (s & m_alt_mask) + ret |= Qt::AltModifier; + if (s & m_meta_mask) + ret |= Qt::MetaModifier; + if (s & m_mode_switch_mask) + ret |= Qt::GroupSwitchModifier; + return ret; +} + +void QTestLiteKeyboard::setMask(KeySym sym, uint mask) +{ + if (m_alt_mask == 0 + && m_meta_mask != mask + && m_super_mask != mask + && m_hyper_mask != mask + && (sym == XK_Alt_L || sym == XK_Alt_R)) { + m_alt_mask = mask; + } + if (m_meta_mask == 0 + && m_alt_mask != mask + && m_super_mask != mask + && m_hyper_mask != mask + && (sym == XK_Meta_L || sym == XK_Meta_R)) { + m_meta_mask = mask; + } + if (m_super_mask == 0 + && m_alt_mask != mask + && m_meta_mask != mask + && m_hyper_mask != mask + && (sym == XK_Super_L || sym == XK_Super_R)) { + m_super_mask = mask; + } + if (m_hyper_mask == 0 + && m_alt_mask != mask + && m_meta_mask != mask + && m_super_mask != mask + && (sym == XK_Hyper_L || sym == XK_Hyper_R)) { + m_hyper_mask = mask; + } + if (m_mode_switch_mask == 0 + && m_alt_mask != mask + && m_meta_mask != mask + && m_super_mask != mask + && m_hyper_mask != mask + && sym == XK_Mode_switch) { + m_mode_switch_mask = mask; + } + if (m_num_lock_mask == 0 + && sym == XK_Num_Lock) { + m_num_lock_mask = mask; + } +} + +int QTestLiteKeyboard::translateKeySym(uint key) const +{ + int code = -1; + int i = 0; // any other keys + while (KeyTbl[i]) { + if (key == KeyTbl[i]) { + code = (int)KeyTbl[i+1]; + break; + } + i += 2; + } + if (m_meta_mask) { + // translate Super/Hyper keys to Meta if we're using them as the MetaModifier + if (m_meta_mask == m_super_mask && (code == Qt::Key_Super_L || code == Qt::Key_Super_R)) { + code = Qt::Key_Meta; + } else if (m_meta_mask == m_hyper_mask && (code == Qt::Key_Hyper_L || code == Qt::Key_Hyper_R)) { + code = Qt::Key_Meta; + } + } + return code; +} + +QString QTestLiteKeyboard::translateKeySym(KeySym keysym, uint xmodifiers, + int &code, Qt::KeyboardModifiers &modifiers, + QByteArray &chars, int &count) +{ + // all keysyms smaller than 0xff00 are actally keys that can be mapped to unicode chars + + QTextCodec *mapper = QTextCodec::codecForLocale(); + QChar converted; + + if (/*count == 0 &&*/ keysym < 0xff00) { + unsigned char byte3 = (unsigned char)(keysym >> 8); + int mib = -1; + switch(byte3) { + case 0: // Latin 1 + case 1: // Latin 2 + case 2: //latin 3 + case 3: // latin4 + mib = byte3 + 4; break; + case 5: // arabic + mib = 82; break; + case 12: // Hebrew + mib = 85; break; + case 13: // Thai + mib = 2259; break; + case 4: // kana + case 6: // cyrillic + case 7: // greek + case 8: // technical, no mapping here at the moment + case 9: // Special + case 10: // Publishing + case 11: // APL + case 14: // Korean, no mapping + mib = -1; // manual conversion + mapper= 0; +#if !defined(QT_NO_XIM) + converted = keysymToUnicode(byte3, keysym & 0xff); +#endif + case 0x20: + // currency symbols + if (keysym >= 0x20a0 && keysym <= 0x20ac) { + mib = -1; // manual conversion + mapper = 0; + converted = (uint)keysym; + } + break; + default: + break; + } + if (mib != -1) { + mapper = QTextCodec::codecForMib(mib); + if (chars.isEmpty()) + chars.resize(1); + chars[0] = (unsigned char) (keysym & 0xff); // get only the fourth bit for conversion later + count++; + } + } else if (keysym >= 0x1000000 && keysym <= 0x100ffff) { + converted = (ushort) (keysym - 0x1000000); + mapper = 0; + } + if (count < (int)chars.size()-1) + chars[count] = '\0'; + + QString text; + if (!mapper && converted.unicode() != 0x0) { + text = converted; + } else if (!chars.isEmpty()) { + // convert chars (8bit) to text (unicode). + if (mapper) + text = mapper->toUnicode(chars.data(), count, 0); + if (text.isEmpty()) { + // no mapper, or codec couldn't convert to unicode (this + // can happen when running in the C locale or with no LANG + // set). try converting from latin-1 + text = QString::fromLatin1(chars); + } + } + + modifiers = translateModifiers(xmodifiers); + + // Commentary in X11/keysymdef says that X codes match ASCII, so it + // is safe to use the locale functions to process X codes in ISO8859-1. + // + // This is mainly for compatibility - applications should not use the + // Qt keycodes between 128 and 255, but should rather use the + // QKeyEvent::text(). + // + if (keysym < 128 || (keysym < 256 && (!mapper || mapper->mibEnum()==4))) { + // upper-case key, if known + code = isprint((int)keysym) ? toupper((int)keysym) : 0; + } else if (keysym >= XK_F1 && keysym <= XK_F35) { + // function keys + code = Qt::Key_F1 + ((int)keysym - XK_F1); + } else if (keysym >= XK_KP_Space && keysym <= XK_KP_9) { + if (keysym >= XK_KP_0) { + // numeric keypad keys + code = Qt::Key_0 + ((int)keysym - XK_KP_0); + } else { + code = translateKeySym(keysym); + } + modifiers |= Qt::KeypadModifier; + } else if (text.length() == 1 && text.unicode()->unicode() > 0x1f && text.unicode()->unicode() != 0x7f && !(keysym >= XK_dead_grave && keysym <= XK_dead_horn)) { + code = text.unicode()->toUpper().unicode(); + } else { + // any other keys + code = translateKeySym(keysym); + + if (code == Qt::Key_Tab && (modifiers & Qt::ShiftModifier)) { + // map shift+tab to shift+backtab, QShortcutMap knows about it + // and will handle it. + code = Qt::Key_Backtab; + text = QString(); + } + } + + return text; +} + +QTestLiteKeyboard::QTestLiteKeyboard(QTestLiteScreen *screen) + : m_screen(screen) + , m_alt_mask(0) + , m_super_mask(0) + , m_hyper_mask(0) + , m_meta_mask(0) +{ + changeLayout(); +} + +void QTestLiteKeyboard::changeLayout() +{ + XkbDescPtr xkbDesc = XkbGetMap(m_screen->display(), XkbAllClientInfoMask, XkbUseCoreKbd); + for (int i = xkbDesc->min_key_code; i < xkbDesc->max_key_code; ++i) { + const uint mask = xkbDesc->map->modmap ? xkbDesc->map->modmap[i] : 0; + if (mask == 0) { + // key is not bound to a modifier + continue; + } + + for (int j = 0; j < XkbKeyGroupsWidth(xkbDesc, i); ++j) { + KeySym keySym = XkbKeySym(xkbDesc, i, j); + if (keySym == NoSymbol) + continue; + setMask(keySym, mask); + } + } + XkbFreeKeyboard(xkbDesc, XkbAllComponentsMask, true); + +} + +void QTestLiteKeyboard::handleKeyEvent(QWidget *widget, QEvent::Type type, XKeyEvent *ev) +{ + int qtcode = 0; + Qt::KeyboardModifiers modifiers; + QByteArray chars; + chars.resize(513); + int count = 1; + KeySym keySym; + count = XLookupString(ev,chars.data(),chars.size(),&keySym,0); + QString text = translateKeySym(keySym,ev->state,qtcode,modifiers,chars,count); + QWindowSystemInterface::handleKeyEvent(widget,ev->time,type,qtcode,modifiers,text); +} diff --git a/src/plugins/platforms/testlite/qtestlitekeyboard.h b/src/plugins/platforms/testlite/qtestlitekeyboard.h new file mode 100644 index 0000000..65ead16 --- /dev/null +++ b/src/plugins/platforms/testlite/qtestlitekeyboard.h @@ -0,0 +1,35 @@ +#ifndef QTESTLITEKEYBOARD_H +#define QTESTLITEKEYBOARD_H + +#include "qtestliteintegration.h" + +class QTestLiteKeyboard +{ +public: + QTestLiteKeyboard(QTestLiteScreen *screen); + + void changeLayout(); + + void handleKeyEvent(QWidget *widget, QEvent::Type type, XKeyEvent *ev); + + Qt::KeyboardModifiers translateModifiers(int s); + +private: + + void setMask(KeySym sym, uint mask); + int translateKeySym(uint key) const; + QString translateKeySym(KeySym keysym, uint xmodifiers, + int &code, Qt::KeyboardModifiers &modifiers, + QByteArray &chars, int &count); + + QTestLiteScreen *m_screen; + + uint m_alt_mask; + uint m_super_mask; + uint m_hyper_mask; + uint m_meta_mask; + uint m_mode_switch_mask; + uint m_num_lock_mask; +}; + +#endif // QTESTLITEKEYBOARD_H diff --git a/src/plugins/platforms/testlite/qtestlitescreen.cpp b/src/plugins/platforms/testlite/qtestlitescreen.cpp index 919506e..c0f696d 100644 --- a/src/plugins/platforms/testlite/qtestlitescreen.cpp +++ b/src/plugins/platforms/testlite/qtestlitescreen.cpp @@ -43,6 +43,7 @@ #include "qtestlitecursor.h" #include "qtestlitewindow.h" +#include "qtestlitekeyboard.h" #include #include @@ -226,6 +227,7 @@ QTestLiteScreen::QTestLiteScreen() mWmMotifHintAtom = XInternAtom(mDisplay, "_MOTIF_WM_HINTS\0", False); mCursor = new QTestLiteCursor(this); + mKeyboard = new QTestLiteKeyboard(this); } QTestLiteScreen::~QTestLiteScreen() @@ -299,11 +301,11 @@ bool QTestLiteScreen::handleEvent(XEvent *xe) break; case XKeyPress: - xw->handleKeyEvent(QEvent::KeyPress, &xe->xkey); + mKeyboard->handleKeyEvent(widget,QEvent::KeyPress, &xe->xkey); break; case XKeyRelease: - xw->handleKeyEvent(QEvent::KeyRelease, &xe->xkey); + mKeyboard->handleKeyEvent(widget,QEvent::KeyRelease, &xe->xkey); break; case EnterNotify: @@ -427,4 +429,9 @@ Atom QTestLiteScreen::atomForMotifWmHints() const return mWmMotifHintAtom; } +QTestLiteKeyboard * QTestLiteScreen::keyboard() const +{ + return mKeyboard; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestlitescreen.h b/src/plugins/platforms/testlite/qtestlitescreen.h index f8d9468..9a1a510 100644 --- a/src/plugins/platforms/testlite/qtestlitescreen.h +++ b/src/plugins/platforms/testlite/qtestlitescreen.h @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE class QTestLiteCursor; +class QTestLiteKeyboard; class QTestLiteScreen : public QPlatformScreen { @@ -80,6 +81,7 @@ public: Atom atomForMotifWmHints() const; + QTestLiteKeyboard *keyboard() const; public slots: void eventDispatcher(); @@ -90,6 +92,7 @@ private: int mDepth; QImage::Format mFormat; QTestLiteCursor *mCursor; + QTestLiteKeyboard *mKeyboard; Display * mDisplay; int mScreen; diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index 5446615..42f2302 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -43,6 +43,7 @@ #include "qtestliteintegration.h" #include "qtestlitescreen.h" +#include "qtestlitekeyboard.h" #include #include @@ -141,26 +142,7 @@ static Qt::MouseButtons translateMouseButtons(int s) return ret; } -static Qt::KeyboardModifiers translateModifiers(int s) -{ - const uchar qt_alt_mask = Mod1Mask; - const uchar qt_meta_mask = Mod4Mask; - - Qt::KeyboardModifiers ret = 0; - if (s & ShiftMask) - ret |= Qt::ShiftModifier; - if (s & ControlMask) - ret |= Qt::ControlModifier; - if (s & qt_alt_mask) - ret |= Qt::AltModifier; - if (s & qt_meta_mask) - ret |= Qt::MetaModifier; -#if 0 - if (s & qt_mode_switch_mask) - ret |= Qt::GroupSwitchModifier; -#endif - return ret; -} + void QTestLiteWindow::handleMouseEvent(QEvent::Type type, XButtonEvent *e) { @@ -168,7 +150,7 @@ void QTestLiteWindow::handleMouseEvent(QEvent::Type type, XButtonEvent *e) Qt::MouseButton button = Qt::NoButton; Qt::MouseButtons buttons = translateMouseButtons(e->state); - Qt::KeyboardModifiers modifiers = translateModifiers(e->state); + Qt::KeyboardModifiers modifiers = mScreen->keyboard()->translateModifiers(e->state); if (type != QEvent::MouseMove) { switch (e->button) { case Button1: button = Qt::LeftButton; break; @@ -231,312 +213,7 @@ void QTestLiteWindow::handleFocusOutEvent() QWindowSystemInterface::handleWindowActivated(0); } -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Key event stuff -- not pretty either -// -// What we want to do is to port Robert's keytable code properly - -// keyboard mapping table -static const unsigned int keyTbl[] = { - - // misc keys - - XK_Escape, Qt::Key_Escape, - XK_Tab, Qt::Key_Tab, - XK_ISO_Left_Tab, Qt::Key_Backtab, - XK_BackSpace, Qt::Key_Backspace, - XK_Return, Qt::Key_Return, - XK_Insert, Qt::Key_Insert, - XK_Delete, Qt::Key_Delete, - XK_Clear, Qt::Key_Delete, - XK_Pause, Qt::Key_Pause, - XK_Print, Qt::Key_Print, - 0x1005FF60, Qt::Key_SysReq, // hardcoded Sun SysReq - 0x1007ff00, Qt::Key_SysReq, // hardcoded X386 SysReq - - // cursor movement - - XK_Home, Qt::Key_Home, - XK_End, Qt::Key_End, - XK_Left, Qt::Key_Left, - XK_Up, Qt::Key_Up, - XK_Right, Qt::Key_Right, - XK_Down, Qt::Key_Down, - XK_Prior, Qt::Key_PageUp, - XK_Next, Qt::Key_PageDown, - - // modifiers - - XK_Shift_L, Qt::Key_Shift, - XK_Shift_R, Qt::Key_Shift, - XK_Shift_Lock, Qt::Key_Shift, - XK_Control_L, Qt::Key_Control, - XK_Control_R, Qt::Key_Control, - XK_Meta_L, Qt::Key_Meta, - XK_Meta_R, Qt::Key_Meta, - XK_Alt_L, Qt::Key_Alt, - XK_Alt_R, Qt::Key_Alt, - XK_Caps_Lock, Qt::Key_CapsLock, - XK_Num_Lock, Qt::Key_NumLock, - XK_Scroll_Lock, Qt::Key_ScrollLock, - XK_Super_L, Qt::Key_Super_L, - XK_Super_R, Qt::Key_Super_R, - XK_Menu, Qt::Key_Menu, - XK_Hyper_L, Qt::Key_Hyper_L, - XK_Hyper_R, Qt::Key_Hyper_R, - XK_Help, Qt::Key_Help, - 0x1000FF74, Qt::Key_Backtab, // hardcoded HP backtab - 0x1005FF10, Qt::Key_F11, // hardcoded Sun F36 (labeled F11) - 0x1005FF11, Qt::Key_F12, // hardcoded Sun F37 (labeled F12) - - // numeric and function keypad keys - - XK_KP_Space, Qt::Key_Space, - XK_KP_Tab, Qt::Key_Tab, - XK_KP_Enter, Qt::Key_Enter, - //XK_KP_F1, Qt::Key_F1, - //XK_KP_F2, Qt::Key_F2, - //XK_KP_F3, Qt::Key_F3, - //XK_KP_F4, Qt::Key_F4, - XK_KP_Home, Qt::Key_Home, - XK_KP_Left, Qt::Key_Left, - XK_KP_Up, Qt::Key_Up, - XK_KP_Right, Qt::Key_Right, - XK_KP_Down, Qt::Key_Down, - XK_KP_Prior, Qt::Key_PageUp, - XK_KP_Next, Qt::Key_PageDown, - XK_KP_End, Qt::Key_End, - XK_KP_Begin, Qt::Key_Clear, - XK_KP_Insert, Qt::Key_Insert, - XK_KP_Delete, Qt::Key_Delete, - XK_KP_Equal, Qt::Key_Equal, - XK_KP_Multiply, Qt::Key_Asterisk, - XK_KP_Add, Qt::Key_Plus, - XK_KP_Separator, Qt::Key_Comma, - XK_KP_Subtract, Qt::Key_Minus, - XK_KP_Decimal, Qt::Key_Period, - XK_KP_Divide, Qt::Key_Slash, - - // International input method support keys - - // International & multi-key character composition - XK_ISO_Level3_Shift, Qt::Key_AltGr, - XK_Multi_key, Qt::Key_Multi_key, - XK_Codeinput, Qt::Key_Codeinput, - XK_SingleCandidate, Qt::Key_SingleCandidate, - XK_MultipleCandidate, Qt::Key_MultipleCandidate, - XK_PreviousCandidate, Qt::Key_PreviousCandidate, - - // Misc Functions - XK_Mode_switch, Qt::Key_Mode_switch, - XK_script_switch, Qt::Key_Mode_switch, - - // Japanese keyboard support - XK_Kanji, Qt::Key_Kanji, - XK_Muhenkan, Qt::Key_Muhenkan, - //XK_Henkan_Mode, Qt::Key_Henkan_Mode, - XK_Henkan_Mode, Qt::Key_Henkan, - XK_Henkan, Qt::Key_Henkan, - XK_Romaji, Qt::Key_Romaji, - XK_Hiragana, Qt::Key_Hiragana, - XK_Katakana, Qt::Key_Katakana, - XK_Hiragana_Katakana, Qt::Key_Hiragana_Katakana, - XK_Zenkaku, Qt::Key_Zenkaku, - XK_Hankaku, Qt::Key_Hankaku, - XK_Zenkaku_Hankaku, Qt::Key_Zenkaku_Hankaku, - XK_Touroku, Qt::Key_Touroku, - XK_Massyo, Qt::Key_Massyo, - XK_Kana_Lock, Qt::Key_Kana_Lock, - XK_Kana_Shift, Qt::Key_Kana_Shift, - XK_Eisu_Shift, Qt::Key_Eisu_Shift, - XK_Eisu_toggle, Qt::Key_Eisu_toggle, - //XK_Kanji_Bangou, Qt::Key_Kanji_Bangou, - //XK_Zen_Koho, Qt::Key_Zen_Koho, - //XK_Mae_Koho, Qt::Key_Mae_Koho, - XK_Kanji_Bangou, Qt::Key_Codeinput, - XK_Zen_Koho, Qt::Key_MultipleCandidate, - XK_Mae_Koho, Qt::Key_PreviousCandidate, - -#ifdef XK_KOREAN - // Korean keyboard support - XK_Hangul, Qt::Key_Hangul, - XK_Hangul_Start, Qt::Key_Hangul_Start, - XK_Hangul_End, Qt::Key_Hangul_End, - XK_Hangul_Hanja, Qt::Key_Hangul_Hanja, - XK_Hangul_Jamo, Qt::Key_Hangul_Jamo, - XK_Hangul_Romaja, Qt::Key_Hangul_Romaja, - //XK_Hangul_Codeinput, Qt::Key_Hangul_Codeinput, - XK_Hangul_Codeinput, Qt::Key_Codeinput, - XK_Hangul_Jeonja, Qt::Key_Hangul_Jeonja, - XK_Hangul_Banja, Qt::Key_Hangul_Banja, - XK_Hangul_PreHanja, Qt::Key_Hangul_PreHanja, - XK_Hangul_PostHanja, Qt::Key_Hangul_PostHanja, - //XK_Hangul_SingleCandidate,Qt::Key_Hangul_SingleCandidate, - //XK_Hangul_MultipleCandidate,Qt::Key_Hangul_MultipleCandidate, - //XK_Hangul_PreviousCandidate,Qt::Key_Hangul_PreviousCandidate, - XK_Hangul_SingleCandidate, Qt::Key_SingleCandidate, - XK_Hangul_MultipleCandidate,Qt::Key_MultipleCandidate, - XK_Hangul_PreviousCandidate,Qt::Key_PreviousCandidate, - XK_Hangul_Special, Qt::Key_Hangul_Special, - //XK_Hangul_switch, Qt::Key_Hangul_switch, - XK_Hangul_switch, Qt::Key_Mode_switch, -#endif // XK_KOREAN - - // dead keys - XK_dead_grave, Qt::Key_Dead_Grave, - XK_dead_acute, Qt::Key_Dead_Acute, - XK_dead_circumflex, Qt::Key_Dead_Circumflex, - XK_dead_tilde, Qt::Key_Dead_Tilde, - XK_dead_macron, Qt::Key_Dead_Macron, - XK_dead_breve, Qt::Key_Dead_Breve, - XK_dead_abovedot, Qt::Key_Dead_Abovedot, - XK_dead_diaeresis, Qt::Key_Dead_Diaeresis, - XK_dead_abovering, Qt::Key_Dead_Abovering, - XK_dead_doubleacute, Qt::Key_Dead_Doubleacute, - XK_dead_caron, Qt::Key_Dead_Caron, - XK_dead_cedilla, Qt::Key_Dead_Cedilla, - XK_dead_ogonek, Qt::Key_Dead_Ogonek, - XK_dead_iota, Qt::Key_Dead_Iota, - XK_dead_voiced_sound, Qt::Key_Dead_Voiced_Sound, - XK_dead_semivoiced_sound, Qt::Key_Dead_Semivoiced_Sound, - XK_dead_belowdot, Qt::Key_Dead_Belowdot, - XK_dead_hook, Qt::Key_Dead_Hook, - XK_dead_horn, Qt::Key_Dead_Horn, - -#if 0 - // Special multimedia keys - // currently only tested with MS internet keyboard - - // browsing keys - XF86XK_Back, Qt::Key_Back, - XF86XK_Forward, Qt::Key_Forward, - XF86XK_Stop, Qt::Key_Stop, - XF86XK_Refresh, Qt::Key_Refresh, - XF86XK_Favorites, Qt::Key_Favorites, - XF86XK_AudioMedia, Qt::Key_LaunchMedia, - XF86XK_OpenURL, Qt::Key_OpenUrl, - XF86XK_HomePage, Qt::Key_HomePage, - XF86XK_Search, Qt::Key_Search, - - // media keys - XF86XK_AudioLowerVolume, Qt::Key_VolumeDown, - XF86XK_AudioMute, Qt::Key_VolumeMute, - XF86XK_AudioRaiseVolume, Qt::Key_VolumeUp, - XF86XK_AudioPlay, Qt::Key_MediaPlay, - XF86XK_AudioStop, Qt::Key_MediaStop, - XF86XK_AudioPrev, Qt::Key_MediaPrevious, - XF86XK_AudioNext, Qt::Key_MediaNext, - XF86XK_AudioRecord, Qt::Key_MediaRecord, - - // launch keys - XF86XK_Mail, Qt::Key_LaunchMail, - XF86XK_MyComputer, Qt::Key_Launch0, - XF86XK_Calculator, Qt::Key_Launch1, - XF86XK_Standby, Qt::Key_Standby, - - XF86XK_Launch0, Qt::Key_Launch2, - XF86XK_Launch1, Qt::Key_Launch3, - XF86XK_Launch2, Qt::Key_Launch4, - XF86XK_Launch3, Qt::Key_Launch5, - XF86XK_Launch4, Qt::Key_Launch6, - XF86XK_Launch5, Qt::Key_Launch7, - XF86XK_Launch6, Qt::Key_Launch8, - XF86XK_Launch7, Qt::Key_Launch9, - XF86XK_Launch8, Qt::Key_LaunchA, - XF86XK_Launch9, Qt::Key_LaunchB, - XF86XK_LaunchA, Qt::Key_LaunchC, - XF86XK_LaunchB, Qt::Key_LaunchD, - XF86XK_LaunchC, Qt::Key_LaunchE, - XF86XK_LaunchD, Qt::Key_LaunchF, -#endif - -#if 0 - // Qtopia keys - QTOPIAXK_Select, Qt::Key_Select, - QTOPIAXK_Yes, Qt::Key_Yes, - QTOPIAXK_No, Qt::Key_No, - QTOPIAXK_Cancel, Qt::Key_Cancel, - QTOPIAXK_Printer, Qt::Key_Printer, - QTOPIAXK_Execute, Qt::Key_Execute, - QTOPIAXK_Sleep, Qt::Key_Sleep, - QTOPIAXK_Play, Qt::Key_Play, - QTOPIAXK_Zoom, Qt::Key_Zoom, - QTOPIAXK_Context1, Qt::Key_Context1, - QTOPIAXK_Context2, Qt::Key_Context2, - QTOPIAXK_Context3, Qt::Key_Context3, - QTOPIAXK_Context4, Qt::Key_Context4, - QTOPIAXK_Call, Qt::Key_Call, - QTOPIAXK_Hangup, Qt::Key_Hangup, - QTOPIAXK_Flip, Qt::Key_Flip, -#endif - 0, 0 -}; - -static int lookupCode(unsigned int xkeycode) -{ - if (xkeycode >= XK_F1 && xkeycode <= XK_F35) - return Qt::Key_F1 + (int(xkeycode) - XK_F1); - - const unsigned int *p = keyTbl; - while (*p) { - if (*p == xkeycode) - return *++p; - p += 2; - } - - return 0; -} - -static Qt::KeyboardModifiers modifierFromKeyCode(int qtcode) -{ - switch (qtcode) { - case Qt::Key_Control: - return Qt::ControlModifier; - case Qt::Key_Alt: - return Qt::AltModifier; - case Qt::Key_Shift: - return Qt::ShiftModifier; - case Qt::Key_Meta: - return Qt::MetaModifier; - default: - return Qt::NoModifier; - } -} - -void QTestLiteWindow::handleKeyEvent(QEvent::Type type, void *ev) -{ - XKeyEvent *e = static_cast(ev); - - KeySym keySym; - QByteArray chars; - chars.resize(513); - int count = XLookupString(e, chars.data(), chars.size(), &keySym, 0); - Q_UNUSED(count); -// qDebug() << "QTLWS::handleKeyEvent" << count << hex << "XKeysym:" << keySym; -// if (count) -// qDebug() << hex << int(chars[0]) << "String:" << chars; - - Qt::KeyboardModifiers modifiers = translateModifiers(e->state); - - int qtcode = lookupCode(keySym); -// qDebug() << "lookup: " << hex << keySym << qtcode << "mod" << modifiers; - - //X11 specifies state *before*, Qt expects state *after* the event - - modifiers ^= modifierFromKeyCode(qtcode); - - if (qtcode) { - QWindowSystemInterface::handleKeyEvent(widget(), e->time, type, qtcode, modifiers); - } else if (chars[0]) { - int qtcode = chars.toUpper()[0]; //Not exactly right... - if (modifiers & Qt::ControlModifier && qtcode < ' ') - qtcode = chars[0] + '@'; - QWindowSystemInterface::handleKeyEvent(0, e->time, type, qtcode, modifiers, QString::fromLatin1(chars)); - } else { - qWarning() << "unknown X keycode" << hex << e->keycode << keySym; - } -} void QTestLiteWindow::setGeometry(const QRect &rect) { diff --git a/src/plugins/platforms/testlite/qtestlitewindow.h b/src/plugins/platforms/testlite/qtestlitewindow.h index 7e990ee..35ba677 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.h +++ b/src/plugins/platforms/testlite/qtestlitewindow.h @@ -93,7 +93,6 @@ public: void mousePressEvent(XButtonEvent*); void handleMouseEvent(QEvent::Type, XButtonEvent *ev); - void handleKeyEvent(QEvent::Type, void *); void handleCloseEvent(); void handleEnterEvent(); void handleLeaveEvent(); diff --git a/src/plugins/platforms/testlite/testlite.pro b/src/plugins/platforms/testlite/testlite.pro index ef977bf..d2f2562 100644 --- a/src/plugins/platforms/testlite/testlite.pro +++ b/src/plugins/platforms/testlite/testlite.pro @@ -9,14 +9,16 @@ SOURCES = \ qtestlitewindowsurface.cpp \ qtestlitewindow.cpp \ qtestlitecursor.cpp \ - qtestlitescreen.cpp + qtestlitescreen.cpp \ + qtestlitekeyboard.cpp HEADERS = \ qtestliteintegration.h \ qtestlitewindowsurface.h \ qtestlitewindow.h \ qtestlitecursor.h \ - qtestlitescreen.h + qtestlitescreen.h \ + qtestlitekeyboard.h LIBS += -lX11 -lXext -- cgit v0.12 From 91a438cad2139ae33f8a18c8ca8f81a41795ebe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 17 Dec 2010 08:51:53 +0100 Subject: Add basic mouse context menues to lighthouse --- src/gui/kernel/qapplication_qpa.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp index a587e8e..a164c2d 100644 --- a/src/gui/kernel/qapplication_qpa.cpp +++ b/src/gui/kernel/qapplication_qpa.cpp @@ -735,7 +735,15 @@ void QApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mouse cursor.data()->pointerEvent(ev); } + int oldOpenPopupCount = openPopupCount; QApplication::sendSpontaneousEvent(mouseWidget, &ev); + +#ifndef QT_NO_CONTEXTMENU + if (type == QEvent::MouseButtonPress && button == Qt::RightButton && (openPopupCount == oldOpenPopupCount)) { + QContextMenuEvent e(QContextMenuEvent::Mouse, localPoint, globalPoint, modifiers); + QApplication::sendSpontaneousEvent(mouseWidget, &e); + } +#endif // QT_NO_CONTEXTMENU } -- cgit v0.12 From d79b18d59cc39396f4993a294f24cfb804be728f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 20 Dec 2010 10:24:48 +0100 Subject: Make TestLite show windows in correct position --- src/plugins/platforms/testlite/qtestlitewindow.cpp | 28 +++++++++++++++++++--- src/plugins/platforms/testlite/qtestlitewindow.h | 2 ++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index 42f2302..6f9ad58 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -517,10 +517,13 @@ void QTestLiteWindow::setVisible(bool visible) #ifdef MYX11_DEBUG qDebug() << "QTestLiteWindow::setVisible" << visible << hex << x_window; #endif - if (visible) - XMapWindow(mScreen->display(), x_window); - else + if (visible) { + //ensure that the window is viewed in correct position. + doSizeHints(); + XMapWindow(mScreen->display(), x_window); + } else { XUnmapWindow(mScreen->display(), x_window); + } } void QTestLiteWindow::setCursor(const Cursor &cursor) @@ -552,4 +555,23 @@ GC QTestLiteWindow::graphicsContext() const return gc; } +void QTestLiteWindow::doSizeHints() +{ + Q_ASSERT(widget()->testAttribute(Qt::WA_WState_Created)); + XSizeHints s; + s.flags = 0; + QRect g = geometry(); + s.x = g.x(); + s.y = g.y(); + s.width = g.width(); + s.height = g.height(); + s.flags |= USPosition; + s.flags |= PPosition; + s.flags |= USSize; + s.flags |= PSize; + s.flags |= PWinGravity; + s.win_gravity = QApplication::isRightToLeft() ? NorthEastGravity : NorthWestGravity; + XSetWMNormalHints(mScreen->display(), x_window, &s); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestlitewindow.h b/src/plugins/platforms/testlite/qtestlitewindow.h index 35ba677..4b952dc 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.h +++ b/src/plugins/platforms/testlite/qtestlitewindow.h @@ -126,6 +126,8 @@ protected: void setMWMHints(const QtMWMHints &mwmhints); QtMWMHints getMWMHints() const; + void doSizeHints(); + private: Window x_window; GC gc; -- cgit v0.12 From a7fbc64969168fef3285901e383a044692bebfd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 20 Dec 2010 10:36:00 +0100 Subject: Lighthouse: fix keyboard problem in testlite --- src/plugins/platforms/testlite/qtestlitekeyboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp index c18de59..be7a686 100644 --- a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp +++ b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp @@ -834,7 +834,7 @@ QString QTestLiteKeyboard::translateKeySym(KeySym keysym, uint xmodifiers, if (chars.isEmpty()) chars.resize(1); chars[0] = (unsigned char) (keysym & 0xff); // get only the fourth bit for conversion later - count++; + count = 1; } } else if (keysym >= 0x1000000 && keysym <= 0x100ffff) { converted = (ushort) (keysym - 0x1000000); @@ -935,9 +935,9 @@ void QTestLiteKeyboard::handleKeyEvent(QWidget *widget, QEvent::Type type, XKeyE Qt::KeyboardModifiers modifiers; QByteArray chars; chars.resize(513); - int count = 1; + int count = 0; KeySym keySym; count = XLookupString(ev,chars.data(),chars.size(),&keySym,0); QString text = translateKeySym(keySym,ev->state,qtcode,modifiers,chars,count); - QWindowSystemInterface::handleKeyEvent(widget,ev->time,type,qtcode,modifiers,text); + QWindowSystemInterface::handleKeyEvent(widget,ev->time,type,qtcode,modifiers,text.left(count)); } -- cgit v0.12 From f03d9c91d7576974d1a156749c1e159468f2451a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 28 Dec 2010 15:26:19 +0100 Subject: Initial support for WS specific clipboard support in Lighthouse default implementation in QPlatformIntegration still supports in process copy/paste --- src/gui/kernel/kernel.pri | 6 +- src/gui/kernel/qclipboard_qpa.cpp | 82 ++++------------------ src/gui/kernel/qdnd_p.h | 2 +- src/gui/kernel/qplatformclipboard_qpa.cpp | 101 ++++++++++++++++++++++++++++ src/gui/kernel/qplatformclipboard_qpa.h | 70 +++++++++++++++++++ src/gui/kernel/qplatformintegration_qpa.cpp | 18 +++++ src/gui/kernel/qplatformintegration_qpa.h | 4 +- 7 files changed, 209 insertions(+), 74 deletions(-) create mode 100644 src/gui/kernel/qplatformclipboard_qpa.cpp create mode 100644 src/gui/kernel/qplatformclipboard_qpa.h diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index 4261e93..0ff3d88 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -222,7 +222,8 @@ qpa { kernel/qplatformglcontext_qpa.h \ kernel/qdesktopwidget_qpa_p.h \ kernel/qplatformeventloopintegration_qpa.h \ - kernel/qplatformcursor_qpa.h + kernel/qplatformcursor_qpa.h \ + kernel/qplatformclipboard_qpa.h SOURCES += \ kernel/qapplication_qpa.cpp \ @@ -244,7 +245,8 @@ qpa { kernel/qplatformwindowformat_qpa.cpp \ kernel/qplatformeventloopintegration_qpa.cpp \ kernel/qplatformglcontext_qpa.cpp \ - kernel/qplatformcursor_qpa.cpp + kernel/qplatformcursor_qpa.cpp \ + kernel/qplatformclipboard_qpa.cpp contains(QT_CONFIG, glib) { SOURCES += \ diff --git a/src/gui/kernel/qclipboard_qpa.cpp b/src/gui/kernel/qclipboard_qpa.cpp index 92b9e83..b8ce60e 100644 --- a/src/gui/kernel/qclipboard_qpa.cpp +++ b/src/gui/kernel/qclipboard_qpa.cpp @@ -44,73 +44,16 @@ #ifndef QT_NO_CLIPBOARD #include "qmimedata.h" -#include "qapplication.h" +#include "private/qapplication_p.h" +#include "qplatformclipboard_qpa.h" QT_BEGIN_NAMESPACE QT_USE_NAMESPACE - -class QClipboardData -{ -public: - QClipboardData(); - ~QClipboardData(); - - void setSource(QMimeData* s) - { - if (s == src) - return; - delete src; - src = s; - } - QMimeData* source() - { return src; } - - void clear(); - -private: - QMimeData* src; -}; - -QClipboardData::QClipboardData() -{ - src = 0; -} - -QClipboardData::~QClipboardData() -{ - delete src; -} - -void QClipboardData::clear() -{ - delete src; - src = 0; -} - - -static QClipboardData *internalCbData = 0; - -static void cleanupClipboardData() -{ - delete internalCbData; - internalCbData = 0; -} - -static QClipboardData *clipboardData() -{ - if (internalCbData == 0) { - internalCbData = new QClipboardData; - qAddPostRoutine(cleanupClipboardData); - } - return internalCbData; -} - - void QClipboard::clear(Mode mode) { - setText(QString(), mode); + setMimeData(0,mode); } @@ -121,26 +64,25 @@ bool QClipboard::event(QEvent *e) const QMimeData* QClipboard::mimeData(Mode mode) const { - if (mode != Clipboard) return 0; - - QClipboardData *d = clipboardData(); - return d->source(); + QPlatformClipboard *clipboard = QApplicationPrivate::platformIntegration()->clipboard(); + if (!clipboard->supportsMode(mode)) return 0; + return clipboard->mimeData(mode); } void QClipboard::setMimeData(QMimeData* src, Mode mode) { - if (mode != Clipboard) return; - - QClipboardData *d = clipboardData(); + QPlatformClipboard *clipboard = QApplicationPrivate::platformIntegration()->clipboard(); + if (!clipboard->supportsMode(mode)) return; - d->setSource(src); + clipboard->setMimeData(src,mode); - emitChanged(QClipboard::Clipboard); + emitChanged(mode); } bool QClipboard::supportsMode(Mode mode) const { - return (mode == Clipboard); + QPlatformClipboard *clipboard = QApplicationPrivate::platformIntegration()->clipboard(); + return clipboard->supportsMode(mode); } bool QClipboard::ownsMode(Mode mode) const diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h index 598a9de..7b23630 100644 --- a/src/gui/kernel/qdnd_p.h +++ b/src/gui/kernel/qdnd_p.h @@ -76,7 +76,7 @@ class QEventLoop; #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) -class QInternalMimeData : public QMimeData +class Q_GUI_EXPORT QInternalMimeData : public QMimeData { Q_OBJECT public: diff --git a/src/gui/kernel/qplatformclipboard_qpa.cpp b/src/gui/kernel/qplatformclipboard_qpa.cpp new file mode 100644 index 0000000..fff4e19 --- /dev/null +++ b/src/gui/kernel/qplatformclipboard_qpa.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "qplatformclipboard_qpa.h" + +QT_BEGIN_NAMESPACE + +class QClipboardData +{ +public: + QClipboardData(); + ~QClipboardData(); + + void setSource(QMimeData* s) + { + if (s == src) + return; + delete src; + src = s; + } + QMimeData* source() + { return src; } + +private: + QMimeData* src; +}; + +QClipboardData::QClipboardData() +{ + src = 0; +} + +QClipboardData::~QClipboardData() +{ + delete src; +} + +Q_GLOBAL_STATIC(QClipboardData,q_clipboardData); + +QPlatformClipboard::~QPlatformClipboard() +{ + +} + +const QMimeData *QPlatformClipboard::mimeData(QClipboard::Mode mode) const +{ + //we know its clipboard + Q_UNUSED(mode); + return q_clipboardData()->source(); +} + +void QPlatformClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) +{ + //we know its clipboard + Q_UNUSED(mode); + q_clipboardData()->setSource(data); +} + +bool QPlatformClipboard::supportsMode(QClipboard::Mode mode) const +{ + return mode == QClipboard::Clipboard; +} + +QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformclipboard_qpa.h b/src/gui/kernel/qplatformclipboard_qpa.h new file mode 100644 index 0000000..3f7bfbb --- /dev/null +++ b/src/gui/kernel/qplatformclipboard_qpa.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMCLIPBOARD_QPA_H +#define QPLATFORMCLIPBOARD_QPA_H + +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class Q_GUI_EXPORT QPlatformClipboard +{ +public: + virtual ~QPlatformClipboard(); + + virtual const QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard ) const; + virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard); + virtual bool supportsMode(QClipboard::Mode mode) const; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + + +#endif //QPLATFORMCLIPBOARD_QPA_H diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp index 9b6e590..0cac57d 100644 --- a/src/gui/kernel/qplatformintegration_qpa.cpp +++ b/src/gui/kernel/qplatformintegration_qpa.cpp @@ -42,6 +42,7 @@ #include "qplatformintegration_qpa.h" #include +#include QT_BEGIN_NAMESPACE @@ -94,6 +95,23 @@ QPlatformFontDatabase *QPlatformIntegration::fontDatabase() const } /*! + Accessor for the platform integrations clipboard. + + Default implementation returns a default QPlatformClipboard. + + \sa QPlatformClipboard + +*/ +QPlatformClipboard *QPlatformIntegration::clipboard() const +{ + static QPlatformClipboard *clipboard = 0; + if (!clipboard) { + clipboard = new QPlatformClipboard; + } + return clipboard; +} + +/*! \class QPlatformIntegration \since 4.8 \internal diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h index f01b4f4..7050245 100644 --- a/src/gui/kernel/qplatformintegration_qpa.h +++ b/src/gui/kernel/qplatformintegration_qpa.h @@ -59,6 +59,7 @@ class QBlittable; class QWidget; class QPlatformEventLoopIntegration; class QPlatformFontDatabase; +class QPlatformClipboard; class Q_GUI_EXPORT QPlatformIntegration { @@ -76,8 +77,9 @@ public: virtual bool isVirtualDesktop() { return false; } virtual QPixmap grabWindow(WId window, int x, int y, int width, int height) const; -//Fontdatabase integration. +//Deeper window system integrations virtual QPlatformFontDatabase *fontDatabase() const; + virtual QPlatformClipboard *clipboard() const; // Experimental in mainthread eventloop integration // This should only be used if it is only possible to do window system event processing in -- cgit v0.12 From 1097310a4ff0bda0f3c5a0204c42ed40035e6dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 28 Dec 2010 15:27:52 +0100 Subject: Fix keyboard when using modifiers for testlite --- src/plugins/platforms/testlite/qtestlitekeyboard.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp index be7a686..93d21b3 100644 --- a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp +++ b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp @@ -929,15 +929,32 @@ void QTestLiteKeyboard::changeLayout() } +static Qt::KeyboardModifiers modifierFromKeyCode(int qtcode) +{ + switch (qtcode) { + case Qt::Key_Control: + return Qt::ControlModifier; + case Qt::Key_Alt: + return Qt::AltModifier; + case Qt::Key_Shift: + return Qt::ShiftModifier; + case Qt::Key_Meta: + return Qt::MetaModifier; + default: + return Qt::NoModifier; + } +} + void QTestLiteKeyboard::handleKeyEvent(QWidget *widget, QEvent::Type type, XKeyEvent *ev) { int qtcode = 0; - Qt::KeyboardModifiers modifiers; + Qt::KeyboardModifiers modifiers = translateModifiers(ev->state); QByteArray chars; chars.resize(513); int count = 0; KeySym keySym; count = XLookupString(ev,chars.data(),chars.size(),&keySym,0); QString text = translateKeySym(keySym,ev->state,qtcode,modifiers,chars,count); + modifiers ^= modifierFromKeyCode(qtcode); QWindowSystemInterface::handleKeyEvent(widget,ev->time,type,qtcode,modifiers,text.left(count)); } -- cgit v0.12 From c33402ff531c1667305907963c221b88dd168691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 28 Dec 2010 15:44:47 +0100 Subject: Copy/Paste in testlite and also added QTestLiteStaticInfo which is a class to resolve atoms etc. --- .../platforms/testlite/qtestliteclipboard.cpp | 519 +++++++++++++++++++++ .../platforms/testlite/qtestliteclipboard.h | 52 +++ .../platforms/testlite/qtestliteintegration.cpp | 13 + .../platforms/testlite/qtestliteintegration.h | 4 +- src/plugins/platforms/testlite/qtestlitemime.cpp | 362 ++++++++++++++ src/plugins/platforms/testlite/qtestlitemime.h | 42 ++ src/plugins/platforms/testlite/qtestlitescreen.cpp | 133 ++++-- src/plugins/platforms/testlite/qtestlitescreen.h | 16 +- .../platforms/testlite/qtestlitestaticinfo.cpp | 417 +++++++++++++++++ .../platforms/testlite/qtestlitestaticinfo.h | 371 +++++++++++++++ src/plugins/platforms/testlite/qtestlitewindow.cpp | 36 +- src/plugins/platforms/testlite/testlite.pro | 10 +- 12 files changed, 1899 insertions(+), 76 deletions(-) create mode 100644 src/plugins/platforms/testlite/qtestliteclipboard.cpp create mode 100644 src/plugins/platforms/testlite/qtestliteclipboard.h create mode 100644 src/plugins/platforms/testlite/qtestlitemime.cpp create mode 100644 src/plugins/platforms/testlite/qtestlitemime.h create mode 100644 src/plugins/platforms/testlite/qtestlitestaticinfo.cpp create mode 100644 src/plugins/platforms/testlite/qtestlitestaticinfo.h diff --git a/src/plugins/platforms/testlite/qtestliteclipboard.cpp b/src/plugins/platforms/testlite/qtestliteclipboard.cpp new file mode 100644 index 0000000..fdd6d30 --- /dev/null +++ b/src/plugins/platforms/testlite/qtestliteclipboard.cpp @@ -0,0 +1,519 @@ +#include "qtestliteclipboard.h" + +#include "qtestlitescreen.h" +#include "qtestlitemime.h" + +#include + +#include + +const int QTestLiteClipboard::clipboard_timeout = 5000; + +QTestLiteClipboard::QTestLiteClipboard(QTestLiteScreen *screen) + : QPlatformClipboard() + , m_screen(screen) + , m_xClipboard(0) + , m_clientClipboard(0) + , m_xSelection(0) + , m_clientSelection(0) + , m_requestor(XNone) + , m_owner(XNone) +{ +} + +const QMimeData * QTestLiteClipboard::mimeData(QClipboard::Mode mode) const +{ + if (mode == QClipboard::Clipboard) { + if (!m_xClipboard) { + QTestLiteClipboard *that = const_cast(this); + that->m_xClipboard = new QTestLiteMime(mode,that); + } + Window clipboardOwner = XGetSelectionOwner(screen()->display(),QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD)); + if (clipboardOwner == owner()) { + return m_clientClipboard; + } else { + return m_xClipboard; + } + } + return 0; +} + +void QTestLiteClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) +{ + Atom modeAtom; + QMimeData **d; + switch (mode) { + case QClipboard::Selection: + modeAtom = XA_PRIMARY; + d = &m_clientSelection; + break; + + case QClipboard::Clipboard: + modeAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD); + d = &m_clientClipboard; + break; + + default: + qWarning("QClipboard::setMimeData: unsupported mode '%d'", mode); + return; + } + + Window newOwner; + + if (! data) { // no data, clear clipboard contents + newOwner = XNone; + } else { + newOwner = owner(); + + *d = data; + } + + XSetSelectionOwner(m_screen->display(), modeAtom, newOwner, CurrentTime); + + if (XGetSelectionOwner(m_screen->display(), modeAtom) != newOwner) { +// qWarning("QClipboard::setData: Cannot set X11 selection owner for %s", +// xdndAtomToString(atom).data()); + *d = 0; + return; + } + +} + +QTestLiteScreen * QTestLiteClipboard::screen() const +{ + return m_screen; +} + +Window QTestLiteClipboard::requestor() const +{ + if (!m_requestor) { + int x = 0, y = 0, w = 3, h = 3; + QTestLiteClipboard *that = const_cast(this); + Window window = XCreateSimpleWindow(m_screen->display(), m_screen->rootWindow(), + x, y, w, h, 0 /*border_width*/, + m_screen->blackPixel(), m_screen->whitePixel()); + that->setRequestor(window); + } + return m_requestor; +} + +void QTestLiteClipboard::setRequestor(Window window) +{ + if (m_requestor != XNone) { + XDestroyWindow(m_screen->display(),m_requestor); + } + m_requestor = window; +} + +Window QTestLiteClipboard::owner() const +{ + if (!m_owner) { + int x = 0, y = 0, w = 3, h = 3; + QTestLiteClipboard *that = const_cast(this); + Window window = XCreateSimpleWindow(m_screen->display(), m_screen->rootWindow(), + x, y, w, h, 0 /*border_width*/, + m_screen->blackPixel(), m_screen->whitePixel()); + that->setOwner(window); + } + return m_owner; +} + +void QTestLiteClipboard::setOwner(Window window) +{ + if (m_owner != XNone){ + XDestroyWindow(m_screen->display(),m_owner); + } + m_owner = window; +} + +Atom QTestLiteClipboard::sendTargetsSelection(QMimeData *d, Window window, Atom property) +{ + QVector types; + QStringList formats = QInternalMimeData::formatsHelper(d); + for (int i = 0; i < formats.size(); ++i) { + QList atoms = QTestLiteMime::xdndMimeAtomsForFormat(screen()->display(),formats.at(i)); + for (int j = 0; j < atoms.size(); ++j) { + if (!types.contains(atoms.at(j))) + types.append(atoms.at(j)); + } + } + types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TARGETS)); + types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::MULTIPLE)); + types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TIMESTAMP)); + types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::SAVE_TARGETS)); + + XChangeProperty(screen()->display(), window, property, XA_ATOM, 32, + PropModeReplace, (uchar *) types.data(), types.size()); + return property; +} + +Atom QTestLiteClipboard::sendSelection(QMimeData *d, Atom target, Window window, Atom property) +{ + Atom atomFormat = target; + int dataFormat = 0; + QByteArray data; + + QString fmt = QTestLiteMime::xdndMimeAtomToString(screen()->display(), target); + if (fmt.isEmpty()) { // Not a MIME type we have + qDebug() << "QClipboard: send_selection(): converting to type '%s' is not supported" << fmt.data(); + return XNone; + } + qDebug() << "QClipboard: send_selection(): converting to type '%s'" << fmt.data(); + + if (QTestLiteMime::xdndMimeDataForAtom(screen()->display(),target, d, &data, &atomFormat, &dataFormat)) { + + // don't allow INCR transfers when using MULTIPLE or to + // Motif clients (since Motif doesn't support INCR) + static Atom motif_clip_temporary = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIP_TEMPORARY); + bool allow_incr = property != motif_clip_temporary; + + // X_ChangeProperty protocol request is 24 bytes + const int increment = (XMaxRequestSize(screen()->display()) * 4) - 24; + if (data.size() > increment && allow_incr) { + long bytes = data.size(); + XChangeProperty(screen()->display(), window, property, + QTestLiteStaticInfo::atom(QTestLiteStaticInfo::INCR), 32, PropModeReplace, (uchar *) &bytes, 1); + +// (void)new QClipboardINCRTransaction(window, property, atomFormat, dataFormat, data, increment); + qDebug() << "not implemented INCRT just YET!"; + return property; + } + + // make sure we can perform the XChangeProperty in a single request + if (data.size() > increment) + return XNone; // ### perhaps use several XChangeProperty calls w/ PropModeAppend? + int dataSize = data.size() / (dataFormat / 8); + // use a single request to transfer data + XChangeProperty(screen()->display(), window, property, atomFormat, + dataFormat, PropModeReplace, (uchar *) data.data(), + dataSize); + } + return property; +} + +void QTestLiteClipboard::handleSelectionRequest(XEvent *xevent) +{ + XSelectionRequestEvent *req = &xevent->xselectionrequest; + + if (requestor() && req->requestor == requestor()) { + qDebug() << "This should be caught before"; + return; + } + + XEvent event; + event.xselection.type = SelectionNotify; + event.xselection.display = req->display; + event.xselection.requestor = req->requestor; + event.xselection.selection = req->selection; + event.xselection.target = req->target; + event.xselection.property = XNone; + event.xselection.time = req->time; + + QMimeData *d; + if (req->selection == XA_PRIMARY) { + d = m_clientSelection; + } else if (req->selection == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD)) { + d = m_clientClipboard; + } else { + qWarning("QClipboard: Unknown selection '%lx'", req->selection); + XSendEvent(screen()->display(), req->requestor, False, NoEventMask, &event); + return; + } + + if (!d) { + qWarning("QClipboard: Cannot transfer data, no data available"); + XSendEvent(screen()->display(), req->requestor, False, NoEventMask, &event); + return; + } + + Atom xa_targets = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TARGETS); + Atom xa_multiple = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::MULTIPLE); + Atom xa_timestamp = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TIMESTAMP); + + struct AtomPair { Atom target; Atom property; } *multi = 0; + Atom multi_type = XNone; + int multi_format = 0; + int nmulti = 0; + int imulti = -1; + bool multi_writeback = false; + + if (req->target == xa_multiple) { + QByteArray multi_data; + if (req->property == XNone + || !clipboardReadProperty(req->requestor, req->property, false, &multi_data, + 0, &multi_type, &multi_format) + || multi_format != 32) { + // MULTIPLE property not formatted correctly + XSendEvent(screen()->display(), req->requestor, False, NoEventMask, &event); + return; + } + nmulti = multi_data.size()/sizeof(*multi); + multi = new AtomPair[nmulti]; + memcpy(multi,multi_data.data(),multi_data.size()); + imulti = 0; + } + + for (; imulti < nmulti; ++imulti) { + Atom target; + Atom property; + + if (multi) { + target = multi[imulti].target; + property = multi[imulti].property; + } else { + target = req->target; + property = req->property; + if (property == XNone) // obsolete client + property = target; + } + + Atom ret = XNone; + if (target == XNone || property == XNone) { + ; + } else if (target == xa_timestamp) { +// if (d->timestamp != CurrentTime) { + XChangeProperty(screen()->display(), req->requestor, property, XA_INTEGER, 32, + PropModeReplace, CurrentTime, 1); + ret = property; +// } else { +// qWarning("QClipboard: Invalid data timestamp"); +// } + } else if (target == xa_targets) { + ret = sendTargetsSelection(d, req->requestor, property); + } else { + ret = sendSelection(d, target, req->requestor, property); + } + + if (nmulti > 0) { + if (ret == XNone) { + multi[imulti].property = XNone; + multi_writeback = true; + } + } else { + event.xselection.property = ret; + break; + } + } + + if (nmulti > 0) { + if (multi_writeback) { + // according to ICCCM 2.6.2 says to put None back + // into the original property on the requestor window + XChangeProperty(screen()->display(), req->requestor, req->property, multi_type, 32, + PropModeReplace, (uchar *) multi, nmulti * 2); + } + + delete [] multi; + event.xselection.property = req->property; + } + + // send selection notify to requestor + XSendEvent(screen()->display(), req->requestor, False, NoEventMask, &event); +} + +static inline int maxSelectionIncr(Display *dpy) +{ return XMaxRequestSize(dpy) > 65536 ? 65536*4 : XMaxRequestSize(dpy)*4 - 100; } + +bool QTestLiteClipboard::clipboardReadProperty(Window win, Atom property, bool deleteProperty, QByteArray *buffer, int *size, Atom *type, int *format) const +{ + int maxsize = maxSelectionIncr(screen()->display()); + ulong bytes_left; // bytes_after + ulong length; // nitems + uchar *data; + Atom dummy_type; + int dummy_format; + int r; + + if (!type) // allow null args + type = &dummy_type; + if (!format) + format = &dummy_format; + + // Don't read anything, just get the size of the property data + r = XGetWindowProperty(screen()->display(), win, property, 0, 0, False, + AnyPropertyType, type, format, + &length, &bytes_left, &data); + if (r != Success || (type && *type == XNone)) { + buffer->resize(0); + return false; + } + XFree((char*)data); + + int offset = 0, buffer_offset = 0, format_inc = 1, proplen = bytes_left; + + switch (*format) { + case 8: + default: + format_inc = sizeof(char) / 1; + break; + + case 16: + format_inc = sizeof(short) / 2; + proplen *= sizeof(short) / 2; + break; + + case 32: + format_inc = sizeof(long) / 4; + proplen *= sizeof(long) / 4; + break; + } + + int newSize = proplen; + buffer->resize(newSize); + + bool ok = (buffer->size() == newSize); + + if (ok && newSize) { + // could allocate buffer + + while (bytes_left) { + // more to read... + + r = XGetWindowProperty(screen()->display(), win, property, offset, maxsize/4, + False, AnyPropertyType, type, format, + &length, &bytes_left, &data); + if (r != Success || (type && *type == XNone)) + break; + + offset += length / (32 / *format); + length *= format_inc * (*format) / 8; + + // Here we check if we get a buffer overflow and tries to + // recover -- this shouldn't normally happen, but it doesn't + // hurt to be defensive + if ((int)(buffer_offset + length) > buffer->size()) { + length = buffer->size() - buffer_offset; + + // escape loop + bytes_left = 0; + } + + memcpy(buffer->data() + buffer_offset, data, length); + buffer_offset += length; + + XFree((char*)data); + } + + if (*format == 8 && *type == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) { + // convert COMPOUND_TEXT to a multibyte string + XTextProperty textprop; + textprop.encoding = *type; + textprop.format = *format; + textprop.nitems = buffer_offset; + textprop.value = (unsigned char *) buffer->data(); + + char **list_ret = 0; + int count; + if (XmbTextPropertyToTextList(screen()->display(), &textprop, &list_ret, + &count) == Success && count && list_ret) { + offset = buffer_offset = strlen(list_ret[0]); + buffer->resize(offset); + memcpy(buffer->data(), list_ret[0], offset); + } + if (list_ret) XFreeStringList(list_ret); + } + } + + // correct size, not 0-term. + if (size) + *size = buffer_offset; + + if (deleteProperty) + XDeleteProperty(screen()->display(), win, property); + + XFlush(screen()->display()); + + return ok; +} + +QByteArray QTestLiteClipboard::clipboardReadIncrementalProperty(Window win, Atom property, int nbytes, bool nullterm) +{ + XEvent event; + + QByteArray buf; + QByteArray tmp_buf; + bool alloc_error = false; + int length; + int offset = 0; + + if (nbytes > 0) { + // Reserve buffer + zero-terminator (for text data) + // We want to complete the INCR transfer even if we cannot + // allocate more memory + buf.resize(nbytes+1); + alloc_error = buf.size() != nbytes+1; + } + + for (;;) { + XFlush(screen()->display()); + if (!screen()->waitForClipboardEvent(win,PropertyNotify,&event,clipboard_timeout)) + break; + if (event.xproperty.atom != property || + event.xproperty.state != PropertyNewValue) + continue; + if (clipboardReadProperty(win, property, true, &tmp_buf, &length, 0, 0)) { + if (length == 0) { // no more data, we're done + if (nullterm) { + buf.resize(offset+1); + buf[offset] = '\0'; + } else { + buf.resize(offset); + } + return buf; + } else if (!alloc_error) { + if (offset+length > (int)buf.size()) { + buf.resize(offset+length+65535); + if (buf.size() != offset+length+65535) { + alloc_error = true; + length = buf.size() - offset; + } + } + memcpy(buf.data()+offset, tmp_buf.constData(), length); + tmp_buf.resize(0); + offset += length; + } + } else { + break; + } + } + + // timed out ... create a new requestor window, otherwise the requestor + // could consider next request to be still part of this timed out request + setRequestor(0); + + return QByteArray(); +} + +QByteArray QTestLiteClipboard::getDataInFormat(Atom modeAtom, Atom fmtatom) +{ + QByteArray buf; + + Window win = requestor(); + + XSelectInput(screen()->display(), win, NoEventMask); // don't listen for any events + + XDeleteProperty(screen()->display(), win, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION)); + XConvertSelection(screen()->display(), modeAtom, fmtatom, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION), win, CurrentTime); + XSync(screen()->display(), false); + + XEvent xevent; + if (!screen()->waitForClipboardEvent(win,SelectionNotify,&xevent,clipboard_timeout) || + xevent.xselection.property == XNone) { + return buf; + } + + Atom type; + XSelectInput(screen()->display(), win, PropertyChangeMask); + + if (clipboardReadProperty(win, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION), true, &buf, 0, &type, 0)) { + if (type == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::INCR)) { + int nbytes = buf.size() >= 4 ? *((int*)buf.data()) : 0; + buf = clipboardReadIncrementalProperty(win, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION), nbytes, false); + } + } + + XSelectInput(screen()->display(), win, NoEventMask); + + + return buf; +} diff --git a/src/plugins/platforms/testlite/qtestliteclipboard.h b/src/plugins/platforms/testlite/qtestliteclipboard.h new file mode 100644 index 0000000..31e42b7 --- /dev/null +++ b/src/plugins/platforms/testlite/qtestliteclipboard.h @@ -0,0 +1,52 @@ +#ifndef QTESTLITECLIPBOARD_H +#define QTESTLITECLIPBOARD_H + +#include +#include "qtestlitestaticinfo.h" + +class QTestLiteScreen; +class QTestLiteMime; +class QTestLiteClipboard : public QPlatformClipboard +{ +public: + QTestLiteClipboard(QTestLiteScreen *screen); + + const QMimeData *mimeData(QClipboard::Mode mode) const; + void setMimeData(QMimeData *data, QClipboard::Mode mode); + + QTestLiteScreen *screen() const; + + Window requestor() const; + void setRequestor(Window window); + + Window owner() const; + + void handleSelectionRequest(XEvent *event); + + bool clipboardReadProperty(Window win, Atom property, bool deleteProperty, QByteArray *buffer, int *size, Atom *type, int *format) const; + QByteArray clipboardReadIncrementalProperty(Window win, Atom property, int nbytes, bool nullterm); + + QByteArray getDataInFormat(Atom modeAtom, Atom fmtatom); + +private: + void setOwner(Window window); + + Atom sendTargetsSelection(QMimeData *d, Window window, Atom property); + Atom sendSelection(QMimeData *d, Atom target, Window window, Atom property); + + QTestLiteScreen *m_screen; + + QTestLiteMime *m_xClipboard; + QMimeData *m_clientClipboard; + + QTestLiteMime *m_xSelection; + QMimeData *m_clientSelection; + + Window m_requestor; + Window m_owner; + + static const int clipboard_timeout; + +}; + +#endif // QTESTLITECLIPBOARD_H diff --git a/src/plugins/platforms/testlite/qtestliteintegration.cpp b/src/plugins/platforms/testlite/qtestliteintegration.cpp index fc2a89c..537e22a 100644 --- a/src/plugins/platforms/testlite/qtestliteintegration.cpp +++ b/src/plugins/platforms/testlite/qtestliteintegration.cpp @@ -47,6 +47,7 @@ #include "qtestlitewindow.h" #include "qgenericunixfontdatabase.h" #include "qtestlitescreen.h" +#include "qtestliteclipboard.h" #ifndef QT_NO_OPENGL #include @@ -60,6 +61,7 @@ QT_BEGIN_NAMESPACE QTestLiteIntegration::QTestLiteIntegration(bool useOpenGL) : mUseOpenGL(useOpenGL) , mFontDb(new QGenericUnixFontDatabase()) + , mClipboard(0) { mPrimaryScreen = new QTestLiteScreen(); mScreens.append(mPrimaryScreen); @@ -114,6 +116,16 @@ QPlatformFontDatabase *QTestLiteIntegration::fontDatabase() const return mFontDb; } +QPlatformClipboard * QTestLiteIntegration::clipboard() const +{ + //Use lazy init since clipboard needs QTestliteScreen + if (!mClipboard) { + QTestLiteIntegration *that = const_cast(this); + that->mClipboard = new QTestLiteClipboard(mPrimaryScreen); + } + return mClipboard; +} + bool QTestLiteIntegration::hasOpenGL() const { #ifndef QT_NO_OPENGL @@ -123,4 +135,5 @@ bool QTestLiteIntegration::hasOpenGL() const return false; } + QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestliteintegration.h b/src/plugins/platforms/testlite/qtestliteintegration.h index 37d09f5..320cf00 100644 --- a/src/plugins/platforms/testlite/qtestliteintegration.h +++ b/src/plugins/platforms/testlite/qtestliteintegration.h @@ -48,7 +48,7 @@ #include #include -#include +#include "qtestlitestaticinfo.h" QT_BEGIN_NAMESPACE @@ -68,6 +68,7 @@ public: QList screens() const { return mScreens; } QPlatformFontDatabase *fontDatabase() const; + QPlatformClipboard *clipboard() const; bool hasOpenGL() const; @@ -76,6 +77,7 @@ private: QTestLiteScreen *mPrimaryScreen; QList mScreens; QPlatformFontDatabase *mFontDb; + QPlatformClipboard *mClipboard; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestlitemime.cpp b/src/plugins/platforms/testlite/qtestlitemime.cpp new file mode 100644 index 0000000..6261383 --- /dev/null +++ b/src/plugins/platforms/testlite/qtestlitemime.cpp @@ -0,0 +1,362 @@ +#include "qtestlitemime.h" + +#include "qtestlitestaticinfo.h" +#include "qtestlitescreen.h" + +#include + +QTestLiteMime::QTestLiteMime(QClipboard::Mode mode, QTestLiteClipboard *clipboard) + : QInternalMimeData(), m_clipboard(clipboard) +{ + switch (mode) { + case QClipboard::Selection: + modeAtom = XA_PRIMARY; + break; + + case QClipboard::Clipboard: + modeAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD); + break; + + default: + qWarning("QTestLiteMime: Internal error: Unsupported clipboard mode"); + break; + } +} + +QTestLiteMime::~QTestLiteMime() +{ +} + +bool QTestLiteMime::empty() const +{ + Window win = XGetSelectionOwner(m_clipboard->screen()->display(), modeAtom); + + return win == XNone; +} + +QStringList QTestLiteMime::formats_sys() const +{ + if (empty()) + return QStringList(); + + if (!formatList.count()) { + // get the list of targets from the current clipboard owner - we do this + // once so that multiple calls to this function don't require multiple + // server round trips... + + format_atoms = m_clipboard->getDataInFormat(modeAtom,QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TARGETS)); + + if (format_atoms.size() > 0) { + Atom *targets = (Atom *) format_atoms.data(); + int size = format_atoms.size() / sizeof(Atom); + + for (int i = 0; i < size; ++i) { + if (targets[i] == 0) + continue; + + QStringList formatsForAtom = xdndMimeFormatsForAtom(m_clipboard->screen()->display(),targets[i]); + for (int j = 0; j < formatsForAtom.size(); ++j) { + if (!formatList.contains(formatsForAtom.at(j))) + formatList.append(formatsForAtom.at(j)); + } + } + } + } + + return formatList; +} + +bool QTestLiteMime::hasFormat_sys(const QString &format) const +{ + QStringList list = formats(); + return list.contains(format); +} + +QVariant QTestLiteMime::retrieveData_sys(const QString &fmt, QVariant::Type requestedType) const +{ + if (fmt.isEmpty() || empty()) + return QByteArray(); + + (void)formats(); // trigger update of format list + + QList atoms; + Atom *targets = (Atom *) format_atoms.data(); + int size = format_atoms.size() / sizeof(Atom); + for (int i = 0; i < size; ++i) + atoms.append(targets[i]); + + QByteArray encoding; + Atom fmtatom = xdndMimeAtomForFormat(m_clipboard->screen()->display(),fmt, requestedType, atoms, &encoding); + + if (fmtatom == 0) + return QVariant(); + + return xdndMimeConvertToFormat(m_clipboard->screen()->display(),fmtatom, m_clipboard->getDataInFormat(modeAtom,fmtatom), fmt, requestedType, encoding); +} + + +QString QTestLiteMime::xdndMimeAtomToString(Display *display, Atom a) +{ + if (!a) return 0; + + if (a == XA_STRING || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)) { + return "text/plain"; // some Xdnd clients are dumb + } + char *atom = XGetAtomName(display, a); + QString result = QString::fromLatin1(atom); + XFree(atom); + return result; +} + +Atom QTestLiteMime::xdndMimeStringToAtom(Display *display, const QString &mimeType) +{ + if (mimeType.isEmpty()) + return 0; + return XInternAtom(display, mimeType.toLatin1().constData(), False); +} + +QStringList QTestLiteMime::xdndMimeFormatsForAtom(Display *display, Atom a) +{ + QStringList formats; + if (a) { + QString atomName = xdndMimeAtomToString(display, a); + formats.append(atomName); + + // special cases for string type + if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING) + || a == XA_STRING + || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) + || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + formats.append(QLatin1String("text/plain")); + + // special cases for uris + if (atomName == QLatin1String("text/x-moz-url")) + formats.append(QLatin1String("text/uri-list")); + + // special case for images + if (a == XA_PIXMAP) + formats.append(QLatin1String("image/ppm")); + } + return formats; +} + +bool QTestLiteMime::xdndMimeDataForAtom(Display *display, Atom a, QMimeData *mimeData, QByteArray *data, Atom *atomFormat, int *dataFormat) +{ + bool ret = false; + *atomFormat = a; + *dataFormat = 8; + QString atomName = xdndMimeAtomToString(display, a); + if (QInternalMimeData::hasFormatHelper(atomName, mimeData)) { + *data = QInternalMimeData::renderDataHelper(atomName, mimeData); + if (atomName == QLatin1String("application/x-color")) + *dataFormat = 16; + ret = true; + } else { + if ((a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING) + || a == XA_STRING + || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) + || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + && QInternalMimeData::hasFormatHelper(QLatin1String("text/plain"), mimeData)) { + if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)){ + *data = QInternalMimeData::renderDataHelper(QLatin1String("text/plain"), mimeData); + ret = true; + } else if (a == XA_STRING) { + *data = QString::fromUtf8(QInternalMimeData::renderDataHelper( + QLatin1String("text/plain"), mimeData)).toLocal8Bit(); + ret = true; + } else if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) + || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) { + // the ICCCM states that TEXT and COMPOUND_TEXT are in the + // encoding of choice, so we choose the encoding of the locale + QByteArray strData = QString::fromUtf8(QInternalMimeData::renderDataHelper( + QLatin1String("text/plain"), mimeData)).toLocal8Bit(); + char *list[] = { strData.data(), NULL }; + + XICCEncodingStyle style = (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + ? XCompoundTextStyle : XStdICCTextStyle; + XTextProperty textprop; + if (list[0] != NULL + && XmbTextListToTextProperty(display, list, 1, style, + &textprop) == Success) { + *atomFormat = textprop.encoding; + *dataFormat = textprop.format; + *data = QByteArray((const char *) textprop.value, textprop.nitems * textprop.format / 8); + ret = true; + + XFree(textprop.value); + } + } + } else if (atomName == QLatin1String("text/x-moz-url") && + QInternalMimeData::hasFormatHelper(QLatin1String("text/uri-list"), mimeData)) { + QByteArray uri = QInternalMimeData::renderDataHelper( + QLatin1String("text/uri-list"), mimeData).split('\n').first(); + QString mozUri = QString::fromLatin1(uri, uri.size()); + mozUri += QLatin1Char('\n'); + *data = QByteArray(reinterpret_cast(mozUri.utf16()), mozUri.length() * 2); + ret = true; + } else if ((a == XA_PIXMAP || a == XA_BITMAP) && mimeData->hasImage()) { + QPixmap pm = qvariant_cast(mimeData->imageData()); + if (a == XA_BITMAP && pm.depth() != 1) { + QImage img = pm.toImage(); + img = img.convertToFormat(QImage::Format_MonoLSB); + pm = QPixmap::fromImage(img); + } +// QDragManager *dm = QDragManager::self(); +// if (dm) { +// Pixmap handle = pm.handle(); +// *data = QByteArray((const char *) &handle, sizeof(Pixmap)); +// dm->xdndMimeTransferedPixmap[dm->xdndMimeTransferedPixmapIndex] = pm; +// dm->xdndMimeTransferedPixmapIndex = +// (dm->xdndMimeTransferedPixmapIndex + 1) % 2; +// ret = true; +// } + } + } + return ret && data != 0; +} + +QList QTestLiteMime::xdndMimeAtomsForFormat(Display *display, const QString &format) +{ + QList atoms; + atoms.append(xdndMimeStringToAtom(display, format)); + + // special cases for strings + if (format == QLatin1String("text/plain")) { + atoms.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)); + atoms.append(XA_STRING); + atoms.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT)); + atoms.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)); + } + + // special cases for uris + if (format == QLatin1String("text/uri-list")) { + atoms.append(xdndMimeStringToAtom(display,QLatin1String("text/x-moz-url"))); + } + + //special cases for images + if (format == QLatin1String("image/ppm")) + atoms.append(XA_PIXMAP); + if (format == QLatin1String("image/pbm")) + atoms.append(XA_BITMAP); + + return atoms; +} + +QVariant QTestLiteMime::xdndMimeConvertToFormat(Display *display, Atom a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding) +{ + QString atomName = xdndMimeAtomToString(display,a); + if (atomName == format) + return data; + + if (!encoding.isEmpty() + && atomName == format + QLatin1String(";charset=") + QString::fromLatin1(encoding)) { + + if (requestedType == QVariant::String) { + QTextCodec *codec = QTextCodec::codecForName(encoding); + if (codec) + return codec->toUnicode(data); + } + + return data; + } + + // special cases for string types + if (format == QLatin1String("text/plain")) { + if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)) + return QString::fromUtf8(data); + if (a == XA_STRING) + return QString::fromLatin1(data); + if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) + || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + // #### might be wrong for COMPUND_TEXT + return QString::fromLocal8Bit(data, data.size()); + } + + // special case for uri types + if (format == QLatin1String("text/uri-list")) { + if (atomName == QLatin1String("text/x-moz-url")) { + // we expect this as utf16 + // the first part is a url that should only contain ascci char + // so it should be safe to check that the second char is 0 + // to verify that it is utf16 + if (data.size() > 1 && data.at(1) == 0) + return QString::fromRawData((const QChar *)data.constData(), + data.size() / 2).split(QLatin1Char('\n')).first().toLatin1(); + } + } + + // special cas for images + if (format == QLatin1String("image/ppm")) { + if (a == XA_PIXMAP && data.size() == sizeof(Pixmap)) { +// Pixmap xpm = *((Pixmap*)data.data()); +// if (!xpm) +// return QByteArray(); +// QPixmap qpm = QPixmap::fromX11Pixmap(xpm); +// QImageWriter imageWriter; +// imageWriter.setFormat("PPMRAW"); +// QImage imageToWrite = qpm.toImage(); +// QBuffer buf; +// buf.open(QIODevice::WriteOnly); +// imageWriter.setDevice(&buf); +// imageWriter.write(imageToWrite); +// return buf.buffer(); + return QVariant(); + } + } + return QVariant(); +} + +Atom QTestLiteMime::xdndMimeAtomForFormat(Display *display, const QString &format, QVariant::Type requestedType, const QList<Atom> &atoms, QByteArray *requestedEncoding) +{ + requestedEncoding->clear(); + + // find matches for string types + if (format == QLatin1String("text/plain")) { + if (atoms.contains(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING))) + return QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING); + if (atoms.contains(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT))) + return QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT); + if (atoms.contains(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT))) + return QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT); + if (atoms.contains(XA_STRING)) + return XA_STRING; + } + + // find matches for uri types + if (format == QLatin1String("text/uri-list")) { + Atom a = xdndMimeStringToAtom(display,format); + if (a && atoms.contains(a)) + return a; + a = xdndMimeStringToAtom(display,QLatin1String("text/x-moz-url")); + if (a && atoms.contains(a)) + return a; + } + + // find match for image + if (format == QLatin1String("image/ppm")) { + if (atoms.contains(XA_PIXMAP)) + return XA_PIXMAP; + } + + // for string/text requests try to use a format with a well-defined charset + // first to avoid encoding problems + if (requestedType == QVariant::String + && format.startsWith(QLatin1String("text/")) + && !format.contains(QLatin1String("charset="))) { + + QString formatWithCharset = format; + formatWithCharset.append(QLatin1String(";charset=utf-8")); + + Atom a = xdndMimeStringToAtom(display,formatWithCharset); + if (a && atoms.contains(a)) { + *requestedEncoding = "utf-8"; + return a; + } + } + + Atom a = xdndMimeStringToAtom(display,format); + if (a && atoms.contains(a)) + return a; + + return 0; +} diff --git a/src/plugins/platforms/testlite/qtestlitemime.h b/src/plugins/platforms/testlite/qtestlitemime.h new file mode 100644 index 0000000..e5ed7b0 --- /dev/null +++ b/src/plugins/platforms/testlite/qtestlitemime.h @@ -0,0 +1,42 @@ +#ifndef QTESTLITEMIME_H +#define QTESTLITEMIME_H + +#include <private/qdnd_p.h> + +#include <QtGui/QClipboard> + +#include "qtestliteintegration.h" +#include "qtestliteclipboard.h" + +class QTestLiteMime : public QInternalMimeData { + Q_OBJECT +public: + QTestLiteMime(QClipboard::Mode mode, QTestLiteClipboard *clipboard); + ~QTestLiteMime(); + bool empty() const; + + static QList<Atom> xdndMimeAtomsForFormat(Display *display, const QString &format); + static QString xdndMimeAtomToString(Display *display, Atom a); + static bool xdndMimeDataForAtom(Display *display, Atom a, QMimeData *mimeData, QByteArray *data, Atom *atomFormat, int *dataFormat); + static QStringList xdndMimeFormatsForAtom(Display *display, Atom a); + static Atom xdndMimeStringToAtom(Display *display, const QString &mimeType); + + static QVariant xdndMimeConvertToFormat(Display *display, Atom a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); + static Atom xdndMimeAtomForFormat(Display *display, const QString &format, QVariant::Type requestedType, const QList<Atom> &atoms, QByteArray *requestedEncoding); + + +protected: + virtual bool hasFormat_sys(const QString &mimetype) const; + virtual QStringList formats_sys() const; + + QVariant retrieveData_sys(const QString &mimetype, QVariant::Type type) const; + + +private: + QTestLiteClipboard *m_clipboard; + Atom modeAtom; + mutable QStringList formatList; + mutable QByteArray format_atoms; +}; + +#endif // QTESTLITEMIME_H diff --git a/src/plugins/platforms/testlite/qtestlitescreen.cpp b/src/plugins/platforms/testlite/qtestlitescreen.cpp index c0f696d..2ae7028 100644 --- a/src/plugins/platforms/testlite/qtestlitescreen.cpp +++ b/src/plugins/platforms/testlite/qtestlitescreen.cpp @@ -44,9 +44,16 @@ #include "qtestlitecursor.h" #include "qtestlitewindow.h" #include "qtestlitekeyboard.h" +#include "qtestlitestaticinfo.h" +#include "qtestliteclipboard.h" #include <QtCore/QDebug> #include <QtCore/QSocketNotifier> +#include <QtCore/QElapsedTimer> + +#include <private/qapplication_p.h> + +#include <X11/extensions/Xfixes.h> QT_BEGIN_NAMESPACE @@ -183,11 +190,10 @@ qDebug() << "qt_x_errhandler" << err->error_code; QTestLiteScreen::QTestLiteScreen() : mFormat(QImage::Format_RGB32) - , mWmProtocolsAtom(0) - , mWmDeleteWindowAtom(0) { char *display_name = getenv("DISPLAY"); mDisplay = XOpenDisplay(display_name); + mDisplayName = QString::fromLocal8Bit(display_name); if (!mDisplay) { fprintf(stderr, "Cannot connect to X server: %s\n", display_name); @@ -204,6 +210,7 @@ QTestLiteScreen::QTestLiteScreen() XSynchronize(mDisplay, true); mScreen = DefaultScreen(mDisplay); + XSelectInput(mDisplay,rootWindow(), KeymapStateMask | EnterWindowMask | LeaveWindowMask | PropertyChangeMask); int width = DisplayWidth(mDisplay, mScreen); int height = DisplayHeight(mDisplay, mScreen); mGeometry = QRect(0,0,width,height); @@ -221,11 +228,6 @@ QTestLiteScreen::QTestLiteScreen() QSocketNotifier *sock = new QSocketNotifier(xSocketNumber, QSocketNotifier::Read, this); connect(sock, SIGNAL(activated(int)), this, SLOT(eventDispatcher())); - mWmProtocolsAtom = XInternAtom (mDisplay, "WM_PROTOCOLS", False); - mWmDeleteWindowAtom = XInternAtom (mDisplay, "WM_DELETE_WINDOW", False); - - mWmMotifHintAtom = XInternAtom(mDisplay, "_MOTIF_WM_HINTS\0", False); - mCursor = new QTestLiteCursor(this); mKeyboard = new QTestLiteKeyboard(this); } @@ -243,9 +245,6 @@ QTestLiteScreen::~QTestLiteScreen() #undef KeyRelease #endif -//Q_GUI_EXPORT extern Atom wmProtocolsAtom; -//Q_GUI_EXPORT extern Atom wmDeleteWindowAtom; - bool QTestLiteScreen::handleEvent(XEvent *xe) { int quit = false; @@ -254,28 +253,17 @@ bool QTestLiteScreen::handleEvent(XEvent *xe) if (widget) { xw = static_cast<QTestLiteWindow *>(widget->platformWindow()); } - if (!xw) { -#ifdef MYX11_DEBUG - qWarning() << "Unknown window" << hex << xe->xany.window << "received event" << xe->type; -#endif - return quit; - } + Atom wmProtocolsAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_PROTOCOLS); + Atom wmDeleteWindowAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_DELETE_WINDOW); switch (xe->type) { case ClientMessage: - if (xe->xclient.format == 32 && xe->xclient.message_type == wmProtocolsAtom()) { + if (xe->xclient.format == 32 && xe->xclient.message_type == wmProtocolsAtom) { Atom a = xe->xclient.data.l[0]; - if (a == wmDeleteWindowAtom()) + if (a == wmDeleteWindowAtom) xw->handleCloseEvent(); -#ifdef MYX11_DEBUG - qDebug() << "ClientMessage WM_PROTOCOLS" << a; -#endif } -#ifdef MYX11_DEBUG - else - qDebug() << "ClientMessage" << xe->xclient.format << xe->xclient.message_type; -#endif break; case Expose: @@ -289,15 +277,18 @@ bool QTestLiteScreen::handleEvent(XEvent *xe) break; case ButtonPress: - xw->mousePressEvent(&xe->xbutton); + if (xw) + xw->mousePressEvent(&xe->xbutton); break; case ButtonRelease: - xw->handleMouseEvent(QEvent::MouseButtonRelease, &xe->xbutton); + if (xw) + xw->handleMouseEvent(QEvent::MouseButtonRelease, &xe->xbutton); break; case MotionNotify: - xw->handleMouseEvent(QEvent::MouseMove, &xe->xbutton); + if (xw) + xw->handleMouseEvent(QEvent::MouseMove, &xe->xbutton); break; case XKeyPress: @@ -309,20 +300,39 @@ bool QTestLiteScreen::handleEvent(XEvent *xe) break; case EnterNotify: - xw->handleEnterEvent(); + if (xw) + xw->handleEnterEvent(); break; case LeaveNotify: - xw->handleLeaveEvent(); + if (xw) + xw->handleLeaveEvent(); break; case XFocusIn: - xw->handleFocusInEvent(); + if (xw) + xw->handleFocusInEvent(); break; case XFocusOut: - xw->handleFocusOutEvent(); + if (xw) + xw->handleFocusOutEvent(); + break; + + case PropertyNotify: + break; + + case SelectionClear: + qDebug() << "Selection Clear!!!"; + break; + case SelectionRequest: + handleSelectionRequest(xe); break; + case SelectionNotify: + qDebug() << "Selection Notify!!!!"; + + break; + default: #ifdef MYX11_DEBUG @@ -330,9 +340,43 @@ bool QTestLiteScreen::handleEvent(XEvent *xe) #endif break; } + return quit; } +static Bool checkForClipboardEvents(Display *, XEvent *e, XPointer) +{ + Atom clipboard = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD); + return ((e->type == SelectionRequest && (e->xselectionrequest.selection == XA_PRIMARY + || e->xselectionrequest.selection == clipboard)) + || (e->type == SelectionClear && (e->xselectionclear.selection == XA_PRIMARY + || e->xselectionclear.selection == clipboard))); +} + +bool QTestLiteScreen::waitForClipboardEvent(Window win, int type, XEvent *event, int timeout) +{ + QElapsedTimer timer; + timer.start(); + do { + if (XCheckTypedWindowEvent(mDisplay,win,type,event)) + return true; + + // process other clipboard events, since someone is probably requesting data from us + XEvent e; + if (XCheckIfEvent(mDisplay, &e, checkForClipboardEvents, 0)) + handleEvent(&e); + + XFlush(mDisplay); + + // sleep 50 ms, so we don't use up CPU cycles all the time. + struct timeval usleep_tv; + usleep_tv.tv_sec = 0; + usleep_tv.tv_usec = 50000; + select(0, 0, 0, 0, &usleep_tv); + } while (timer.elapsed() < timeout); + return false; +} + void QTestLiteScreen::eventDispatcher() { ulong marker = XNextRequest(mDisplay); @@ -409,29 +453,16 @@ int QTestLiteScreen::xScreenNumber() const return mScreen; } -Atom QTestLiteScreen::wmProtocolsAtom() const -{ - return mWmProtocolsAtom; -} - -Atom QTestLiteScreen::wmDeleteWindowAtom() const -{ - return mWmDeleteWindowAtom; -} - -void QTestLiteScreen::setWmDeleteWindowAtom(Atom newDeleteWindowAtom) -{ - mWmDeleteWindowAtom = newDeleteWindowAtom; -} - -Atom QTestLiteScreen::atomForMotifWmHints() const +QTestLiteKeyboard * QTestLiteScreen::keyboard() const { - return mWmMotifHintAtom; + return mKeyboard; } -QTestLiteKeyboard * QTestLiteScreen::keyboard() const +void QTestLiteScreen::handleSelectionRequest(XEvent *event) { - return mKeyboard; + QPlatformIntegration *integration = QApplicationPrivate::platformIntegration(); + QTestLiteClipboard *clipboard = static_cast<QTestLiteClipboard *>(integration->clipboard()); + clipboard->handleSelectionRequest(event); } QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestlitescreen.h b/src/plugins/platforms/testlite/qtestlitescreen.h index 9a1a510..860a67c 100644 --- a/src/plugins/platforms/testlite/qtestlitescreen.h +++ b/src/plugins/platforms/testlite/qtestlitescreen.h @@ -58,6 +58,8 @@ public: ~QTestLiteScreen(); + QString displayName() const { return mDisplayName; } + QRect geometry() const { return mGeometry; } int depth() const { return mDepth; } QImage::Format format() const { return mFormat; } @@ -68,6 +70,8 @@ public: unsigned long whitePixel() { return WhitePixel(mDisplay, mScreen); } bool handleEvent(XEvent *xe); + bool waitForClipboardEvent(Window win, int type, XEvent *event, int timeout); + QImage grabWindow(Window window, int x, int y, int w, int h); static QTestLiteScreen *testLiteScreenForWidget(QWidget *widget); @@ -75,18 +79,15 @@ public: Display *display() const; int xScreenNumber() const; - Atom wmProtocolsAtom() const; - Atom wmDeleteWindowAtom() const; - void setWmDeleteWindowAtom(Atom newDeleteWindowAtom); - - Atom atomForMotifWmHints() const; - QTestLiteKeyboard *keyboard() const; public slots: void eventDispatcher(); private: + + void handleSelectionRequest(XEvent *event); + QString mDisplayName; QRect mGeometry; QSize mPhysicalSize; int mDepth; @@ -96,9 +97,6 @@ private: Display * mDisplay; int mScreen; - Atom mWmProtocolsAtom; - Atom mWmDeleteWindowAtom; - Atom mWmMotifHintAtom; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp b/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp new file mode 100644 index 0000000..20d73a2 --- /dev/null +++ b/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp @@ -0,0 +1,417 @@ +#include "qtestlitestaticinfo.h" +#include "qtestlitescreen.h" + +#include <qplatformdefs.h> + +#include <QtGui/private/qapplication_p.h> +#include <QtCore/QBuffer> +#include <QtCore/QLibrary> + +#include <QDebug> + +#ifndef QT_NO_XFIXES +#include <X11/extensions/Xfixes.h> +#endif // QT_NO_XFIXES + +static const char * x11_atomnames = { + // window-manager <-> client protocols + "WM_PROTOCOLS\0" + "WM_DELETE_WINDOW\0" + "WM_TAKE_FOCUS\0" + "_NET_WM_PING\0" + "_NET_WM_CONTEXT_HELP\0" + "_NET_WM_SYNC_REQUEST\0" + "_NET_WM_SYNC_REQUEST_COUNTER\0" + + // ICCCM window state + "WM_STATE\0" + "WM_CHANGE_STATE\0" + + // Session management + "WM_CLIENT_LEADER\0" + "WM_WINDOW_ROLE\0" + "SM_CLIENT_ID\0" + + // Clipboard + "CLIPBOARD\0" + "INCR\0" + "TARGETS\0" + "MULTIPLE\0" + "TIMESTAMP\0" + "SAVE_TARGETS\0" + "CLIP_TEMPORARY\0" + "_QT_SELECTION\0" + "_QT_CLIPBOARD_SENTINEL\0" + "_QT_SELECTION_SENTINEL\0" + "CLIPBOARD_MANAGER\0" + + "RESOURCE_MANAGER\0" + + "_XSETROOT_ID\0" + + "_QT_SCROLL_DONE\0" + "_QT_INPUT_ENCODING\0" + + "_MOTIF_WM_HINTS\0" + + "DTWM_IS_RUNNING\0" + "ENLIGHTENMENT_DESKTOP\0" + "_DT_SAVE_MODE\0" + "_SGI_DESKS_MANAGER\0" + + // EWMH (aka NETWM) + "_NET_SUPPORTED\0" + "_NET_VIRTUAL_ROOTS\0" + "_NET_WORKAREA\0" + + "_NET_MOVERESIZE_WINDOW\0" + "_NET_WM_MOVERESIZE\0" + + "_NET_WM_NAME\0" + "_NET_WM_ICON_NAME\0" + "_NET_WM_ICON\0" + + "_NET_WM_PID\0" + + "_NET_WM_WINDOW_OPACITY\0" + + "_NET_WM_STATE\0" + "_NET_WM_STATE_ABOVE\0" + "_NET_WM_STATE_BELOW\0" + "_NET_WM_STATE_FULLSCREEN\0" + "_NET_WM_STATE_MAXIMIZED_HORZ\0" + "_NET_WM_STATE_MAXIMIZED_VERT\0" + "_NET_WM_STATE_MODAL\0" + "_NET_WM_STATE_STAYS_ON_TOP\0" + "_NET_WM_STATE_DEMANDS_ATTENTION\0" + + "_NET_WM_USER_TIME\0" + "_NET_WM_USER_TIME_WINDOW\0" + "_NET_WM_FULL_PLACEMENT\0" + + "_NET_WM_WINDOW_TYPE\0" + "_NET_WM_WINDOW_TYPE_DESKTOP\0" + "_NET_WM_WINDOW_TYPE_DOCK\0" + "_NET_WM_WINDOW_TYPE_TOOLBAR\0" + "_NET_WM_WINDOW_TYPE_MENU\0" + "_NET_WM_WINDOW_TYPE_UTILITY\0" + "_NET_WM_WINDOW_TYPE_SPLASH\0" + "_NET_WM_WINDOW_TYPE_DIALOG\0" + "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU\0" + "_NET_WM_WINDOW_TYPE_POPUP_MENU\0" + "_NET_WM_WINDOW_TYPE_TOOLTIP\0" + "_NET_WM_WINDOW_TYPE_NOTIFICATION\0" + "_NET_WM_WINDOW_TYPE_COMBO\0" + "_NET_WM_WINDOW_TYPE_DND\0" + "_NET_WM_WINDOW_TYPE_NORMAL\0" + "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE\0" + + "_KDE_NET_WM_FRAME_STRUT\0" + + "_NET_STARTUP_INFO\0" + "_NET_STARTUP_INFO_BEGIN\0" + + "_NET_SUPPORTING_WM_CHECK\0" + + "_NET_WM_CM_S0\0" + + "_NET_SYSTEM_TRAY_VISUAL\0" + + "_NET_ACTIVE_WINDOW\0" + + // Property formats + "COMPOUND_TEXT\0" + "TEXT\0" + "UTF8_STRING\0" + + // xdnd + "XdndEnter\0" + "XdndPosition\0" + "XdndStatus\0" + "XdndLeave\0" + "XdndDrop\0" + "XdndFinished\0" + "XdndTypeList\0" + "XdndActionList\0" + + "XdndSelection\0" + + "XdndAware\0" + "XdndProxy\0" + + "XdndActionCopy\0" + "XdndActionLink\0" + "XdndActionMove\0" + "XdndActionPrivate\0" + + // Motif DND + "_MOTIF_DRAG_AND_DROP_MESSAGE\0" + "_MOTIF_DRAG_INITIATOR_INFO\0" + "_MOTIF_DRAG_RECEIVER_INFO\0" + "_MOTIF_DRAG_WINDOW\0" + "_MOTIF_DRAG_TARGETS\0" + + "XmTRANSFER_SUCCESS\0" + "XmTRANSFER_FAILURE\0" + + // Xkb + "_XKB_RULES_NAMES\0" + + // XEMBED + "_XEMBED\0" + "_XEMBED_INFO\0" + + // Wacom old. (before version 0.10) + "Wacom Stylus\0" + "Wacom Cursor\0" + "Wacom Eraser\0" + + // Tablet + "STYLUS\0" + "ERASER\0" +}; + +/*! + \internal + Try to resolve a \a symbol from \a library with the version specified + by \a vernum. + + Note that, in the case of the Xfixes library, \a vernum is not the same as + \c XFIXES_MAJOR - it is a part of soname and may differ from the Xfixes + version. +*/ +static void* qt_load_library_runtime(const char *library, int vernum, + int highestVernum, const char *symbol) +{ + QList<int> versions; + // we try to load in the following order: + // explicit version -> the default one -> (from the highest (highestVernum) to the lowest (vernum) ) + if (vernum != -1) + versions << vernum; + versions << -1; + if (vernum != -1) { + for(int i = highestVernum; i > vernum; --i) + versions << i; + } + Q_FOREACH(int version, versions) { + QLatin1String libName(library); + QLibrary xfixesLib(libName, version); + void *ptr = xfixesLib.resolve(symbol); + if (ptr) + return ptr; + } + return 0; +} + +# define XFIXES_LOAD_RUNTIME(vernum, symbol, symbol_type) \ + (symbol_type)qt_load_library_runtime("libXfixes", vernum, 4, #symbol); +# define XFIXES_LOAD_V1(symbol) \ + XFIXES_LOAD_RUNTIME(1, symbol, Ptr##symbol) +# define XFIXES_LOAD_V2(symbol) \ + XFIXES_LOAD_RUNTIME(2, symbol, Ptr##symbol) + + +class QTestLiteStaticInfoPrivate +{ +public: + QTestLiteStaticInfoPrivate() + : use_xfixes(false) + , xfixes_major(0) + , xfixes_eventbase(0) + , xfixes_errorbase(0) + { + QTestLiteScreen *screen = qobject_cast<QTestLiteScreen *> (QApplicationPrivate::platformIntegration()->screens().at(0)); + Q_ASSERT(screen); + + initializeAllAtoms(screen); + initializeSupportedAtoms(screen); + + resolveXFixes(screen); + } + + bool isSupportedByWM(Atom atom) + { + if (!m_supportedAtoms) + return false; + + bool supported = false; + int i = 0; + while (m_supportedAtoms[i] != 0) { + if (m_supportedAtoms[i++] == atom) { + supported = true; + break; + } + } + + return supported; + } + + Atom atom(QTestLiteStaticInfo::X11Atom atom) + { + return m_allAtoms[atom]; + } + + bool useXFixes() const { return use_xfixes; } + + int xFixesEventBase() const {return xfixes_eventbase; } + + PtrXFixesSelectSelectionInput xFixesSelectSelectionInput() const + { + return ptrXFixesSelectSelectionInput; + } + +private: + + void initializeAllAtoms(QTestLiteScreen *screen) { + const char *names[QTestLiteStaticInfo::NAtoms]; + const char *ptr = x11_atomnames; + + int i = 0; + while (*ptr) { + names[i++] = ptr; + while (*ptr) + ++ptr; + ++ptr; + } + + Q_ASSERT(i == QTestLiteStaticInfo::NPredefinedAtoms); + + QByteArray settings_atom_name("_QT_SETTINGS_TIMESTAMP_"); + settings_atom_name += XDisplayName(qPrintable(screen->displayName())); + names[i++] = settings_atom_name; + + Q_ASSERT(i == QTestLiteStaticInfo::NAtoms); + #if 0//defined(XlibSpecificationRelease) && (XlibSpecificationRelease >= 6) + XInternAtoms(screen->display(), (char **)names, i, False, m_allAtoms); + #else + for (i = 0; i < QTestLiteStaticInfo::NAtoms; ++i) + m_allAtoms[i] = XInternAtom(screen->display(), (char *)names[i], False); + #endif + } + + void initializeSupportedAtoms(QTestLiteScreen *screen) + { + Atom type; + int format; + long offset = 0; + unsigned long nitems, after; + unsigned char *data = 0; + + int e = XGetWindowProperty(screen->display(), screen->rootWindow(), + this->atom(QTestLiteStaticInfo::_NET_SUPPORTED), 0, 0, + False, XA_ATOM, &type, &format, &nitems, &after, &data); + if (data) + XFree(data); + + if (e == Success && type == XA_ATOM && format == 32) { + QBuffer ts; + ts.open(QIODevice::WriteOnly); + + while (after > 0) { + XGetWindowProperty(screen->display(), screen->rootWindow(), + this->atom(QTestLiteStaticInfo::_NET_SUPPORTED), offset, 1024, + False, XA_ATOM, &type, &format, &nitems, &after, &data); + + if (type == XA_ATOM && format == 32) { + ts.write(reinterpret_cast<char *>(data), nitems * sizeof(long)); + offset += nitems; + } else + after = 0; + if (data) + XFree(data); + } + + // compute nitems + QByteArray buffer(ts.buffer()); + nitems = buffer.size() / sizeof(Atom); + m_supportedAtoms = new Atom[nitems + 1]; + Atom *a = (Atom *) buffer.data(); + uint i; + for (i = 0; i < nitems; i++) + m_supportedAtoms[i] = a[i]; + m_supportedAtoms[nitems] = 0; + + } + } + + void resolveXFixes(QTestLiteScreen *screen) + { +#ifndef QT_NO_XFIXES + // See if Xfixes is supported on the connected display + if (XQueryExtension(screen->display(), "XFIXES", &xfixes_major, + &xfixes_eventbase, &xfixes_errorbase)) { + ptrXFixesQueryExtension = XFIXES_LOAD_V1(XFixesQueryExtension); + ptrXFixesQueryVersion = XFIXES_LOAD_V1(XFixesQueryVersion); + ptrXFixesSetCursorName = XFIXES_LOAD_V2(XFixesSetCursorName); + ptrXFixesSelectSelectionInput = XFIXES_LOAD_V2(XFixesSelectSelectionInput); + + if(ptrXFixesQueryExtension && ptrXFixesQueryVersion + && ptrXFixesQueryExtension(screen->display(), &xfixes_eventbase, + &xfixes_errorbase)) { + // Xfixes is supported. + // Note: the XFixes protocol version is negotiated using QueryVersion. + // We supply the highest version we support, the X server replies with + // the highest version it supports, but no higher than the version we + // asked for. The version sent back is the protocol version the X server + // will use to talk us. If this call is removed, the behavior of the + // X server when it receives an XFixes request is undefined. + int major = 3; + int minor = 0; + ptrXFixesQueryVersion(screen->display(), &major, &minor); + use_xfixes = (major >= 1); + xfixes_major = major; + } + } +#endif // QT_NO_XFIXES + + } + + Atom *m_supportedAtoms; + Atom m_allAtoms[QTestLiteStaticInfo::NAtoms]; + +#ifndef QT_NO_XFIXES + PtrXFixesQueryExtension ptrXFixesQueryExtension; + PtrXFixesQueryVersion ptrXFixesQueryVersion; + PtrXFixesSetCursorName ptrXFixesSetCursorName; + PtrXFixesSelectSelectionInput ptrXFixesSelectSelectionInput; +#endif + + bool use_xfixes; + int xfixes_major; + int xfixes_eventbase; + int xfixes_errorbase; + +}; +Q_GLOBAL_STATIC(QTestLiteStaticInfoPrivate, qTestLiteStaticInfoPrivate); + + +Atom QTestLiteStaticInfo::atom(QTestLiteStaticInfo::X11Atom atom) +{ + return qTestLiteStaticInfoPrivate()->atom(atom); +} + +bool QTestLiteStaticInfo::isSupportedByWM(Atom atom) +{ + return qTestLiteStaticInfoPrivate()->isSupportedByWM(atom); +} + +bool QTestLiteStaticInfo::useXFixes() +{ + return qTestLiteStaticInfoPrivate()->useXFixes(); +} + +int QTestLiteStaticInfo::xFixesEventBase() +{ + return qTestLiteStaticInfoPrivate()->xFixesEventBase(); +} + +#ifndef QT_NO_XFIXES +PtrXFixesSelectSelectionInput QTestLiteStaticInfo::xFixesSelectSelectionInput() +{ + qDebug() << qTestLiteStaticInfoPrivate()->useXFixes(); + if (!qTestLiteStaticInfoPrivate()->useXFixes()) + return 0; + + return qTestLiteStaticInfoPrivate()->xFixesSelectSelectionInput(); +} +#endif //QT_NO_XFIXES diff --git a/src/plugins/platforms/testlite/qtestlitestaticinfo.h b/src/plugins/platforms/testlite/qtestlitestaticinfo.h new file mode 100644 index 0000000..ed0f7bd --- /dev/null +++ b/src/plugins/platforms/testlite/qtestlitestaticinfo.h @@ -0,0 +1,371 @@ +#ifndef QTESTLITESTATICINFO_H +#define QTESTLITESTATICINFO_H + +#include <QtCore/QTextStream> +#include <QtCore/QDataStream> +#include <QtCore/QMetaType> +#include <QtCore/QVariant> + +#if defined(_XLIB_H_) // crude hack, but... +#error "cannot include <X11/Xlib.h> before this file" +#endif +#define XRegisterIMInstantiateCallback qt_XRegisterIMInstantiateCallback +#define XUnregisterIMInstantiateCallback qt_XUnregisterIMInstantiateCallback +#define XSetIMValues qt_XSetIMValues +#include <X11/Xlib.h> +#undef XRegisterIMInstantiateCallback +#undef XUnregisterIMInstantiateCallback +#undef XSetIMValues + +#include <X11/Xutil.h> +#include <X11/Xos.h> +#ifdef index +# undef index +#endif +#ifdef rindex +# undef rindex +#endif +#ifdef Q_OS_VXWORS +# ifdef open +# undef open +# endif +# ifdef getpid +# undef getpid +# endif +#endif // Q_OS_VXWORKS +#include <X11/Xatom.h> + +//#define QT_NO_SHAPE +#ifdef QT_NO_SHAPE +# define XShapeCombineRegion(a,b,c,d,e,f,g) +# define XShapeCombineMask(a,b,c,d,e,f,g) +#else +# include <X11/extensions/shape.h> +#endif // QT_NO_SHAPE + + +#if !defined (QT_NO_TABLET) +# include <X11/extensions/XInput.h> +#if defined (Q_OS_IRIX) +# include <X11/extensions/SGIMisc.h> +# include <wacom.h> +#endif +#endif // QT_NO_TABLET + + +// #define QT_NO_XINERAMA +#ifndef QT_NO_XINERAMA +// XFree86 does not C++ify Xinerama (at least up to XFree86 4.0.3). +extern "C" { +# include <X11/extensions/Xinerama.h> +} +#endif // QT_NO_XINERAMA + +// #define QT_NO_XRANDR +#ifndef QT_NO_XRANDR +# include <X11/extensions/Xrandr.h> +#endif // QT_NO_XRANDR + +// #define QT_NO_XRENDER +#ifndef QT_NO_XRENDER +# include <X11/extensions/Xrender.h> +#endif // QT_NO_XRENDER + +#ifndef QT_NO_XSYNC +extern "C" { +# include "X11/extensions/sync.h" +} +#endif + +// #define QT_NO_XKB +#ifndef QT_NO_XKB +# include <X11/XKBlib.h> +#endif // QT_NO_XKB + + +#if !defined(XlibSpecificationRelease) +# define X11R4 +typedef char *XPointer; +#else +# undef X11R4 +#endif + +#ifndef QT_NO_XFIXES +typedef Bool (*PtrXFixesQueryExtension)(Display *, int *, int *); +typedef Status (*PtrXFixesQueryVersion)(Display *, int *, int *); +typedef void (*PtrXFixesSetCursorName)(Display *dpy, Cursor cursor, const char *name); +typedef void (*PtrXFixesSelectSelectionInput)(Display *dpy, Window win, Atom selection, unsigned long eventMask); +#endif // QT_NO_XFIXES + +#ifndef QT_NO_XCURSOR +#include <X11/Xcursor/Xcursor.h> +typedef Cursor (*PtrXcursorLibraryLoadCursor)(Display *, const char *); +#endif // QT_NO_XCURSOR + +#ifndef QT_NO_XINERAMA +typedef Bool (*PtrXineramaQueryExtension)(Display *dpy, int *event_base, int *error_base); +typedef Bool (*PtrXineramaIsActive)(Display *dpy); +typedef XineramaScreenInfo *(*PtrXineramaQueryScreens)(Display *dpy, int *number); +#endif // QT_NO_XINERAMA + +#ifndef QT_NO_XRANDR +typedef void (*PtrXRRSelectInput)(Display *, Window, int); +typedef int (*PtrXRRUpdateConfiguration)(XEvent *); +typedef int (*PtrXRRRootToScreen)(Display *, Window); +typedef Bool (*PtrXRRQueryExtension)(Display *, int *, int *); +#endif // QT_NO_XRANDR + +#ifndef QT_NO_XINPUT +typedef int (*PtrXCloseDevice)(Display *, XDevice *); +typedef XDeviceInfo* (*PtrXListInputDevices)(Display *, int *); +typedef XDevice* (*PtrXOpenDevice)(Display *, XID); +typedef void (*PtrXFreeDeviceList)(XDeviceInfo *); +typedef int (*PtrXSelectExtensionEvent)(Display *, Window, XEventClass *, int); +#endif // QT_NO_XINPUT + +/* + * Solaris patch 108652-47 and higher fixes crases in + * XRegisterIMInstantiateCallback, but the function doesn't seem to + * work. + * + * Instead, we disabled R6 input, and open the input method + * immediately at application start. + */ + +//######### XFree86 has wrong declarations for XRegisterIMInstantiateCallback +//######### and XUnregisterIMInstantiateCallback in at least version 3.3.2. +//######### Many old X11R6 header files lack XSetIMValues. +//######### Therefore, we have to declare these functions ourselves. + +extern "C" Bool XRegisterIMInstantiateCallback( + Display*, + struct _XrmHashBucketRec*, + char*, + char*, + XIMProc, //XFree86 has XIDProc, which has to be wrong + XPointer +); + +extern "C" Bool XUnregisterIMInstantiateCallback( + Display*, + struct _XrmHashBucketRec*, + char*, + char*, + XIMProc, //XFree86 has XIDProc, which has to be wrong + XPointer +); + +#ifndef X11R4 +# include <X11/Xlocale.h> +#endif // X11R4 + + +#ifndef QT_NO_MITSHM +# include <X11/extensions/XShm.h> +#endif // QT_NO_MITSHM + +// rename a couple of X defines to get rid of name clashes +// resolve the conflict between X11's FocusIn and QEvent::FocusIn +enum { + XFocusOut = FocusOut, + XFocusIn = FocusIn, + XKeyPress = KeyPress, + XKeyRelease = KeyRelease, + XNone = None, + XRevertToParent = RevertToParent, + XGrayScale = GrayScale, + XCursorShape = CursorShape +}; +#undef FocusOut +#undef FocusIn +#undef KeyPress +#undef KeyRelease +#undef None +#undef RevertToParent +#undef GrayScale +#undef CursorShape + +#ifdef FontChange +#undef FontChange +#endif + + +class QTestLiteStaticInfo +{ +public: + enum X11Atom { + // window-manager <-> client protocols + WM_PROTOCOLS, + WM_DELETE_WINDOW, + WM_TAKE_FOCUS, + _NET_WM_PING, + _NET_WM_CONTEXT_HELP, + _NET_WM_SYNC_REQUEST, + _NET_WM_SYNC_REQUEST_COUNTER, + + // ICCCM window state + WM_STATE, + WM_CHANGE_STATE, + + // Session management + WM_CLIENT_LEADER, + WM_WINDOW_ROLE, + SM_CLIENT_ID, + + // Clipboard + CLIPBOARD, + INCR, + TARGETS, + MULTIPLE, + TIMESTAMP, + SAVE_TARGETS, + CLIP_TEMPORARY, + _QT_SELECTION, + _QT_CLIPBOARD_SENTINEL, + _QT_SELECTION_SENTINEL, + CLIPBOARD_MANAGER, + + RESOURCE_MANAGER, + + _XSETROOT_ID, + + _QT_SCROLL_DONE, + _QT_INPUT_ENCODING, + + _MOTIF_WM_HINTS, + + DTWM_IS_RUNNING, + ENLIGHTENMENT_DESKTOP, + _DT_SAVE_MODE, + _SGI_DESKS_MANAGER, + + // EWMH (aka NETWM) + _NET_SUPPORTED, + _NET_VIRTUAL_ROOTS, + _NET_WORKAREA, + + _NET_MOVERESIZE_WINDOW, + _NET_WM_MOVERESIZE, + + _NET_WM_NAME, + _NET_WM_ICON_NAME, + _NET_WM_ICON, + + _NET_WM_PID, + + _NET_WM_WINDOW_OPACITY, + + _NET_WM_STATE, + _NET_WM_STATE_ABOVE, + _NET_WM_STATE_BELOW, + _NET_WM_STATE_FULLSCREEN, + _NET_WM_STATE_MAXIMIZED_HORZ, + _NET_WM_STATE_MAXIMIZED_VERT, + _NET_WM_STATE_MODAL, + _NET_WM_STATE_STAYS_ON_TOP, + _NET_WM_STATE_DEMANDS_ATTENTION, + + _NET_WM_USER_TIME, + _NET_WM_USER_TIME_WINDOW, + _NET_WM_FULL_PLACEMENT, + + _NET_WM_WINDOW_TYPE, + _NET_WM_WINDOW_TYPE_DESKTOP, + _NET_WM_WINDOW_TYPE_DOCK, + _NET_WM_WINDOW_TYPE_TOOLBAR, + _NET_WM_WINDOW_TYPE_MENU, + _NET_WM_WINDOW_TYPE_UTILITY, + _NET_WM_WINDOW_TYPE_SPLASH, + _NET_WM_WINDOW_TYPE_DIALOG, + _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, + _NET_WM_WINDOW_TYPE_POPUP_MENU, + _NET_WM_WINDOW_TYPE_TOOLTIP, + _NET_WM_WINDOW_TYPE_NOTIFICATION, + _NET_WM_WINDOW_TYPE_COMBO, + _NET_WM_WINDOW_TYPE_DND, + _NET_WM_WINDOW_TYPE_NORMAL, + _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, + + _KDE_NET_WM_FRAME_STRUT, + + _NET_STARTUP_INFO, + _NET_STARTUP_INFO_BEGIN, + + _NET_SUPPORTING_WM_CHECK, + + _NET_WM_CM_S0, + + _NET_SYSTEM_TRAY_VISUAL, + + _NET_ACTIVE_WINDOW, + + // Property formats + COMPOUND_TEXT, + TEXT, + UTF8_STRING, + + // Xdnd + XdndEnter, + XdndPosition, + XdndStatus, + XdndLeave, + XdndDrop, + XdndFinished, + XdndTypelist, + XdndActionList, + + XdndSelection, + + XdndAware, + XdndProxy, + + XdndActionCopy, + XdndActionLink, + XdndActionMove, + XdndActionPrivate, + + // Motif DND + _MOTIF_DRAG_AND_DROP_MESSAGE, + _MOTIF_DRAG_INITIATOR_INFO, + _MOTIF_DRAG_RECEIVER_INFO, + _MOTIF_DRAG_WINDOW, + _MOTIF_DRAG_TARGETS, + + XmTRANSFER_SUCCESS, + XmTRANSFER_FAILURE, + + // Xkb + _XKB_RULES_NAMES, + + // XEMBED + _XEMBED, + _XEMBED_INFO, + + XWacomStylus, + XWacomCursor, + XWacomEraser, + + XTabletStylus, + XTabletEraser, + + NPredefinedAtoms, + + _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, + NAtoms + }; + + static Atom atom(X11Atom atom); + static bool isSupportedByWM(Atom atom); + + static bool useXFixes(); + static int xFixesEventBase(); + + #ifndef QT_NO_XFIXES + static PtrXFixesSelectSelectionInput xFixesSelectSelectionInput(); + #endif //QT_NO_XFIXES + + + +}; + +#endif // QTESTLITESTATICINFO_H diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index 6f9ad58..71232ac 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -44,6 +44,7 @@ #include "qtestliteintegration.h" #include "qtestlitescreen.h" #include "qtestlitekeyboard.h" +#include "qtestlitestaticinfo.h" #include <QtGui/QWindowSystemInterface> #include <QSocketNotifier> @@ -101,19 +102,26 @@ QTestLiteWindow::QTestLiteWindow(QWidget *window) XSetWindowBackgroundPixmap(mScreen->display(), x_window, XNone); - XSelectInput(mScreen->display(), x_window, ExposureMask | KeyPressMask | KeyReleaseMask | + XSelectInput(mScreen->display(), x_window, + ExposureMask | KeyPressMask | KeyReleaseMask | EnterWindowMask | LeaveWindowMask | FocusChangeMask | - PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | + PointerMotionMask | ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | PropertyChangeMask | StructureNotifyMask); gc = createGC(); - Atom wmDeleteWindowAtom = mScreen->wmDeleteWindowAtom(); - XChangeProperty (mScreen->display(), x_window, - mScreen->wmProtocolsAtom(), - XA_ATOM, 32, PropModeAppend, - (unsigned char *) &wmDeleteWindowAtom, 1); - mScreen->setWmDeleteWindowAtom(wmDeleteWindowAtom); + Atom protocols[5]; + int n = 0; + protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_DELETE_WINDOW); // support del window protocol + protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_TAKE_FOCUS); // support take focus window protocol + protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_NET_WM_PING); // support _NET_WM_PING protocol +#ifndef QT_NO_XSYNC + protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_NET_WM_SYNC_REQUEST); // support _NET_WM_SYNC_REQUEST protocol +#endif // QT_NO_XSYNC + if (window->windowFlags() & Qt::WindowContextHelpButtonHint) + protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_NET_WM_CONTEXT_HELP); + XSetWMProtocols(mScreen->display(), x_window, protocols, n); } @@ -336,10 +344,11 @@ QtMWMHints QTestLiteWindow::getMWMHints() const int format; ulong nitems, bytesLeft; uchar *data = 0; - if ((XGetWindowProperty(mScreen->display(), x_window, mScreen->atomForMotifWmHints(), 0, 5, false, - mScreen->atomForMotifWmHints(), &type, &format, &nitems, &bytesLeft, + Atom atomForMotifWmHints = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_MOTIF_WM_HINTS); + if ((XGetWindowProperty(mScreen->display(), x_window, atomForMotifWmHints, 0, 5, false, + atomForMotifWmHints, &type, &format, &nitems, &bytesLeft, &data) == Success) - && (type == mScreen->atomForMotifWmHints() + && (type == atomForMotifWmHints && format == 32 && nitems >= 5)) { mwmhints = *(reinterpret_cast<QtMWMHints *>(data)); @@ -359,12 +368,13 @@ QtMWMHints QTestLiteWindow::getMWMHints() const void QTestLiteWindow::setMWMHints(const QtMWMHints &mwmhints) { + Atom atomForMotifWmHints = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_MOTIF_WM_HINTS); if (mwmhints.flags != 0l) { XChangeProperty(mScreen->display(), x_window, - mScreen->atomForMotifWmHints(), mScreen->atomForMotifWmHints(), 32, + atomForMotifWmHints, atomForMotifWmHints, 32, PropModeReplace, (unsigned char *) &mwmhints, 5); } else { - XDeleteProperty(mScreen->display(), x_window, mScreen->atomForMotifWmHints()); + XDeleteProperty(mScreen->display(), x_window, atomForMotifWmHints); } } diff --git a/src/plugins/platforms/testlite/testlite.pro b/src/plugins/platforms/testlite/testlite.pro index d2f2562..9f8075c 100644 --- a/src/plugins/platforms/testlite/testlite.pro +++ b/src/plugins/platforms/testlite/testlite.pro @@ -10,7 +10,10 @@ SOURCES = \ qtestlitewindow.cpp \ qtestlitecursor.cpp \ qtestlitescreen.cpp \ - qtestlitekeyboard.cpp + qtestlitekeyboard.cpp \ + qtestliteclipboard.cpp \ + qtestlitemime.cpp \ + qtestlitestaticinfo.cpp HEADERS = \ qtestliteintegration.h \ @@ -18,7 +21,10 @@ HEADERS = \ qtestlitewindow.h \ qtestlitecursor.h \ qtestlitescreen.h \ - qtestlitekeyboard.h + qtestlitekeyboard.h \ + qtestliteclipboard.h \ + qtestlitemime.h \ + qtestlitestaticinfo.h LIBS += -lX11 -lXext -- cgit v0.12 From afc9371b68d7db91c0874b3923a376224656e4c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= <jorgen.lind@nokia.com> Date: Mon, 3 Jan 2011 16:28:29 +0100 Subject: Renamed QTestLiteStaticInfo to QTestLiteStatic --- .../platforms/testlite/qtestliteclipboard.cpp | 38 +++++------ src/plugins/platforms/testlite/qtestlitemime.cpp | 46 ++++++------- src/plugins/platforms/testlite/qtestlitescreen.cpp | 8 +-- .../platforms/testlite/qtestlitestaticinfo.cpp | 79 ++++++++++++++++++---- .../platforms/testlite/qtestlitestaticinfo.h | 3 +- src/plugins/platforms/testlite/qtestlitewindow.cpp | 14 ++-- 6 files changed, 121 insertions(+), 67 deletions(-) diff --git a/src/plugins/platforms/testlite/qtestliteclipboard.cpp b/src/plugins/platforms/testlite/qtestliteclipboard.cpp index fdd6d30..9e1b387 100644 --- a/src/plugins/platforms/testlite/qtestliteclipboard.cpp +++ b/src/plugins/platforms/testlite/qtestliteclipboard.cpp @@ -28,7 +28,7 @@ const QMimeData * QTestLiteClipboard::mimeData(QClipboard::Mode mode) const QTestLiteClipboard *that = const_cast<QTestLiteClipboard *>(this); that->m_xClipboard = new QTestLiteMime(mode,that); } - Window clipboardOwner = XGetSelectionOwner(screen()->display(),QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD)); + Window clipboardOwner = XGetSelectionOwner(screen()->display(),QTestLiteStatic::atom(QTestLiteStatic::CLIPBOARD)); if (clipboardOwner == owner()) { return m_clientClipboard; } else { @@ -49,7 +49,7 @@ void QTestLiteClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) break; case QClipboard::Clipboard: - modeAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD); + modeAtom = QTestLiteStatic::atom(QTestLiteStatic::CLIPBOARD); d = &m_clientClipboard; break; @@ -131,16 +131,16 @@ Atom QTestLiteClipboard::sendTargetsSelection(QMimeData *d, Window window, Atom QVector<Atom> types; QStringList formats = QInternalMimeData::formatsHelper(d); for (int i = 0; i < formats.size(); ++i) { - QList<Atom> atoms = QTestLiteMime::xdndMimeAtomsForFormat(screen()->display(),formats.at(i)); + QList<Atom> atoms = QTestLiteMime::mimeAtomsForFormat(screen()->display(),formats.at(i)); for (int j = 0; j < atoms.size(); ++j) { if (!types.contains(atoms.at(j))) types.append(atoms.at(j)); } } - types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TARGETS)); - types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::MULTIPLE)); - types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TIMESTAMP)); - types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::SAVE_TARGETS)); + types.append(QTestLiteStatic::atom(QTestLiteStatic::TARGETS)); + types.append(QTestLiteStatic::atom(QTestLiteStatic::MULTIPLE)); + types.append(QTestLiteStatic::atom(QTestLiteStatic::TIMESTAMP)); + types.append(QTestLiteStatic::atom(QTestLiteStatic::SAVE_TARGETS)); XChangeProperty(screen()->display(), window, property, XA_ATOM, 32, PropModeReplace, (uchar *) types.data(), types.size()); @@ -164,7 +164,7 @@ Atom QTestLiteClipboard::sendSelection(QMimeData *d, Atom target, Window window, // don't allow INCR transfers when using MULTIPLE or to // Motif clients (since Motif doesn't support INCR) - static Atom motif_clip_temporary = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIP_TEMPORARY); + static Atom motif_clip_temporary = QTestLiteStatic::atom(QTestLiteStatic::CLIP_TEMPORARY); bool allow_incr = property != motif_clip_temporary; // X_ChangeProperty protocol request is 24 bytes @@ -172,7 +172,7 @@ Atom QTestLiteClipboard::sendSelection(QMimeData *d, Atom target, Window window, if (data.size() > increment && allow_incr) { long bytes = data.size(); XChangeProperty(screen()->display(), window, property, - QTestLiteStaticInfo::atom(QTestLiteStaticInfo::INCR), 32, PropModeReplace, (uchar *) &bytes, 1); + QTestLiteStatic::atom(QTestLiteStatic::INCR), 32, PropModeReplace, (uchar *) &bytes, 1); // (void)new QClipboardINCRTransaction(window, property, atomFormat, dataFormat, data, increment); qDebug() << "not implemented INCRT just YET!"; @@ -212,7 +212,7 @@ void QTestLiteClipboard::handleSelectionRequest(XEvent *xevent) QMimeData *d; if (req->selection == XA_PRIMARY) { d = m_clientSelection; - } else if (req->selection == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD)) { + } else if (req->selection == QTestLiteStatic::atom(QTestLiteStatic::CLIPBOARD)) { d = m_clientClipboard; } else { qWarning("QClipboard: Unknown selection '%lx'", req->selection); @@ -226,9 +226,9 @@ void QTestLiteClipboard::handleSelectionRequest(XEvent *xevent) return; } - Atom xa_targets = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TARGETS); - Atom xa_multiple = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::MULTIPLE); - Atom xa_timestamp = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TIMESTAMP); + Atom xa_targets = QTestLiteStatic::atom(QTestLiteStatic::TARGETS); + Atom xa_multiple = QTestLiteStatic::atom(QTestLiteStatic::MULTIPLE); + Atom xa_timestamp = QTestLiteStatic::atom(QTestLiteStatic::TIMESTAMP); struct AtomPair { Atom target; Atom property; } *multi = 0; Atom multi_type = XNone; @@ -394,7 +394,7 @@ bool QTestLiteClipboard::clipboardReadProperty(Window win, Atom property, bool d XFree((char*)data); } - if (*format == 8 && *type == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) { + if (*format == 8 && *type == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) { // convert COMPOUND_TEXT to a multibyte string XTextProperty textprop; textprop.encoding = *type; @@ -492,8 +492,8 @@ QByteArray QTestLiteClipboard::getDataInFormat(Atom modeAtom, Atom fmtatom) XSelectInput(screen()->display(), win, NoEventMask); // don't listen for any events - XDeleteProperty(screen()->display(), win, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION)); - XConvertSelection(screen()->display(), modeAtom, fmtatom, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION), win, CurrentTime); + XDeleteProperty(screen()->display(), win, QTestLiteStatic::atom(QTestLiteStatic::_QT_SELECTION)); + XConvertSelection(screen()->display(), modeAtom, fmtatom, QTestLiteStatic::atom(QTestLiteStatic::_QT_SELECTION), win, CurrentTime); XSync(screen()->display(), false); XEvent xevent; @@ -505,10 +505,10 @@ QByteArray QTestLiteClipboard::getDataInFormat(Atom modeAtom, Atom fmtatom) Atom type; XSelectInput(screen()->display(), win, PropertyChangeMask); - if (clipboardReadProperty(win, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION), true, &buf, 0, &type, 0)) { - if (type == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::INCR)) { + if (clipboardReadProperty(win, QTestLiteStatic::atom(QTestLiteStatic::_QT_SELECTION), true, &buf, 0, &type, 0)) { + if (type == QTestLiteStatic::atom(QTestLiteStatic::INCR)) { int nbytes = buf.size() >= 4 ? *((int*)buf.data()) : 0; - buf = clipboardReadIncrementalProperty(win, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION), nbytes, false); + buf = clipboardReadIncrementalProperty(win, QTestLiteStatic::atom(QTestLiteStatic::_QT_SELECTION), nbytes, false); } } diff --git a/src/plugins/platforms/testlite/qtestlitemime.cpp b/src/plugins/platforms/testlite/qtestlitemime.cpp index 6261383..6a08b8c 100644 --- a/src/plugins/platforms/testlite/qtestlitemime.cpp +++ b/src/plugins/platforms/testlite/qtestlitemime.cpp @@ -99,7 +99,7 @@ QString QTestLiteMime::xdndMimeAtomToString(Display *display, Atom a) { if (!a) return 0; - if (a == XA_STRING || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)) { + if (a == XA_STRING || a == QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING)) { return "text/plain"; // some Xdnd clients are dumb } char *atom = XGetAtomName(display, a); @@ -123,10 +123,10 @@ QStringList QTestLiteMime::xdndMimeFormatsForAtom(Display *display, Atom a) formats.append(atomName); // special cases for string type - if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING) + if (a == QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING) || a == XA_STRING - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + || a == QTestLiteStatic::atom(QTestLiteStatic::TEXT) + || a == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) formats.append(QLatin1String("text/plain")); // special cases for uris @@ -152,27 +152,27 @@ bool QTestLiteMime::xdndMimeDataForAtom(Display *display, Atom a, QMimeData *mim *dataFormat = 16; ret = true; } else { - if ((a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING) + if ((a == QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING) || a == XA_STRING - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + || a == QTestLiteStatic::atom(QTestLiteStatic::TEXT) + || a == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) && QInternalMimeData::hasFormatHelper(QLatin1String("text/plain"), mimeData)) { - if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)){ + if (a == QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING)){ *data = QInternalMimeData::renderDataHelper(QLatin1String("text/plain"), mimeData); ret = true; } else if (a == XA_STRING) { *data = QString::fromUtf8(QInternalMimeData::renderDataHelper( QLatin1String("text/plain"), mimeData)).toLocal8Bit(); ret = true; - } else if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) { + } else if (a == QTestLiteStatic::atom(QTestLiteStatic::TEXT) + || a == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) { // the ICCCM states that TEXT and COMPOUND_TEXT are in the // encoding of choice, so we choose the encoding of the locale QByteArray strData = QString::fromUtf8(QInternalMimeData::renderDataHelper( QLatin1String("text/plain"), mimeData)).toLocal8Bit(); char *list[] = { strData.data(), NULL }; - XICCEncodingStyle style = (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + XICCEncodingStyle style = (a == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) ? XCompoundTextStyle : XStdICCTextStyle; XTextProperty textprop; if (list[0] != NULL @@ -222,10 +222,10 @@ QList<Atom> QTestLiteMime::xdndMimeAtomsForFormat(Display *display, const QStrin // special cases for strings if (format == QLatin1String("text/plain")) { - atoms.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)); + atoms.append(QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING)); atoms.append(XA_STRING); - atoms.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT)); - atoms.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)); + atoms.append(QTestLiteStatic::atom(QTestLiteStatic::TEXT)); + atoms.append(QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)); } // special cases for uris @@ -262,12 +262,12 @@ QVariant QTestLiteMime::xdndMimeConvertToFormat(Display *display, Atom a, const // special cases for string types if (format == QLatin1String("text/plain")) { - if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)) + if (a == QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING)) return QString::fromUtf8(data); if (a == XA_STRING) return QString::fromLatin1(data); - if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + if (a == QTestLiteStatic::atom(QTestLiteStatic::TEXT) + || a == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) // #### might be wrong for COMPUND_TEXT return QString::fromLocal8Bit(data, data.size()); } @@ -312,12 +312,12 @@ Atom QTestLiteMime::xdndMimeAtomForFormat(Display *display, const QString &forma // find matches for string types if (format == QLatin1String("text/plain")) { - if (atoms.contains(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING))) - return QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING); - if (atoms.contains(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT))) - return QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT); - if (atoms.contains(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT))) - return QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT); + if (atoms.contains(QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING))) + return QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING); + if (atoms.contains(QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT))) + return QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT); + if (atoms.contains(QTestLiteStatic::atom(QTestLiteStatic::TEXT))) + return QTestLiteStatic::atom(QTestLiteStatic::TEXT); if (atoms.contains(XA_STRING)) return XA_STRING; } diff --git a/src/plugins/platforms/testlite/qtestlitescreen.cpp b/src/plugins/platforms/testlite/qtestlitescreen.cpp index 2ae7028..82dab9a 100644 --- a/src/plugins/platforms/testlite/qtestlitescreen.cpp +++ b/src/plugins/platforms/testlite/qtestlitescreen.cpp @@ -248,14 +248,14 @@ QTestLiteScreen::~QTestLiteScreen() bool QTestLiteScreen::handleEvent(XEvent *xe) { int quit = false; - QTestLiteWindow *xw = 0; + QTestLiteWindow *platformWindow = 0; QWidget *widget = QWidget::find(xe->xany.window); if (widget) { xw = static_cast<QTestLiteWindow *>(widget->platformWindow()); } - Atom wmProtocolsAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_PROTOCOLS); - Atom wmDeleteWindowAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_DELETE_WINDOW); + Atom wmProtocolsAtom = QTestLiteStatic::atom(QTestLiteStatic::WM_PROTOCOLS); + Atom wmDeleteWindowAtom = QTestLiteStatic::atom(QTestLiteStatic::WM_DELETE_WINDOW); switch (xe->type) { case ClientMessage: @@ -346,7 +346,7 @@ bool QTestLiteScreen::handleEvent(XEvent *xe) static Bool checkForClipboardEvents(Display *, XEvent *e, XPointer) { - Atom clipboard = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD); + Atom clipboard = QTestLiteStatic::atom(QTestLiteStatic::CLIPBOARD); return ((e->type == SelectionRequest && (e->xselectionrequest.selection == XA_PRIMARY || e->xselectionrequest.selection == clipboard)) || (e->type == SelectionClear && (e->xselectionclear.selection == XA_PRIMARY diff --git a/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp b/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp index 20d73a2..875ac9e 100644 --- a/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp +++ b/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp @@ -246,7 +246,7 @@ public: return supported; } - Atom atom(QTestLiteStaticInfo::X11Atom atom) + Atom atom(QTestLiteStatic::X11Atom atom) { return m_allAtoms[atom]; } @@ -260,10 +260,58 @@ public: return ptrXFixesSelectSelectionInput; } + QImage qimageFromXImage(XImage *xi) + { + QImage::Format format = QImage::Format_ARGB32_Premultiplied; + if (xi->depth == 24) + format = QImage::Format_RGB32; + else if (xi->depth == 16) + format = QImage::Format_RGB16; + + QImage image = QImage((uchar *)xi->data, xi->width, xi->height, xi->bytes_per_line, format).copy(); + + // we may have to swap the byte order + if ((QSysInfo::ByteOrder == QSysInfo::LittleEndian && xi->byte_order == MSBFirst) + || (QSysInfo::ByteOrder == QSysInfo::BigEndian && xi->byte_order == LSBFirst)) + { + for (int i=0; i < image.height(); i++) { + if (xi->depth == 16) { + ushort *p = (ushort*)image.scanLine(i); + ushort *end = p + image.width(); + while (p < end) { + *p = ((*p << 8) & 0xff00) | ((*p >> 8) & 0x00ff); + p++; + } + } else { + uint *p = (uint*)image.scanLine(i); + uint *end = p + image.width(); + while (p < end) { + *p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000) + | ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff); + p++; + } + } + } + } + + // fix-up alpha channel + if (format == QImage::Format_RGB32) { + QRgb *p = (QRgb *)image.bits(); + for (int y = 0; y < xi->height; ++y) { + for (int x = 0; x < xi->width; ++x) + p[x] |= 0xff000000; + p += xi->bytes_per_line / 4; + } + } + + return image; + } + + private: void initializeAllAtoms(QTestLiteScreen *screen) { - const char *names[QTestLiteStaticInfo::NAtoms]; + const char *names[QTestLiteStatic::NAtoms]; const char *ptr = x11_atomnames; int i = 0; @@ -274,17 +322,17 @@ private: ++ptr; } - Q_ASSERT(i == QTestLiteStaticInfo::NPredefinedAtoms); + Q_ASSERT(i == QTestLiteStatic::NPredefinedAtoms); QByteArray settings_atom_name("_QT_SETTINGS_TIMESTAMP_"); settings_atom_name += XDisplayName(qPrintable(screen->displayName())); names[i++] = settings_atom_name; - Q_ASSERT(i == QTestLiteStaticInfo::NAtoms); + Q_ASSERT(i == QTestLiteStatic::NAtoms); #if 0//defined(XlibSpecificationRelease) && (XlibSpecificationRelease >= 6) XInternAtoms(screen->display(), (char **)names, i, False, m_allAtoms); #else - for (i = 0; i < QTestLiteStaticInfo::NAtoms; ++i) + for (i = 0; i < QTestLiteStatic::NAtoms; ++i) m_allAtoms[i] = XInternAtom(screen->display(), (char *)names[i], False); #endif } @@ -298,7 +346,7 @@ private: unsigned char *data = 0; int e = XGetWindowProperty(screen->display(), screen->rootWindow(), - this->atom(QTestLiteStaticInfo::_NET_SUPPORTED), 0, 0, + this->atom(QTestLiteStatic::_NET_SUPPORTED), 0, 0, False, XA_ATOM, &type, &format, &nitems, &after, &data); if (data) XFree(data); @@ -309,7 +357,7 @@ private: while (after > 0) { XGetWindowProperty(screen->display(), screen->rootWindow(), - this->atom(QTestLiteStaticInfo::_NET_SUPPORTED), offset, 1024, + this->atom(QTestLiteStatic::_NET_SUPPORTED), offset, 1024, False, XA_ATOM, &type, &format, &nitems, &after, &data); if (type == XA_ATOM && format == 32) { @@ -367,7 +415,7 @@ private: } Atom *m_supportedAtoms; - Atom m_allAtoms[QTestLiteStaticInfo::NAtoms]; + Atom m_allAtoms[QTestLiteStatic::NAtoms]; #ifndef QT_NO_XFIXES PtrXFixesQueryExtension ptrXFixesQueryExtension; @@ -385,28 +433,28 @@ private: Q_GLOBAL_STATIC(QTestLiteStaticInfoPrivate, qTestLiteStaticInfoPrivate); -Atom QTestLiteStaticInfo::atom(QTestLiteStaticInfo::X11Atom atom) +Atom QTestLiteStatic::atom(QTestLiteStatic::X11Atom atom) { return qTestLiteStaticInfoPrivate()->atom(atom); } -bool QTestLiteStaticInfo::isSupportedByWM(Atom atom) +bool QTestLiteStatic::isSupportedByWM(Atom atom) { return qTestLiteStaticInfoPrivate()->isSupportedByWM(atom); } -bool QTestLiteStaticInfo::useXFixes() +bool QTestLiteStatic::useXFixes() { return qTestLiteStaticInfoPrivate()->useXFixes(); } -int QTestLiteStaticInfo::xFixesEventBase() +int QTestLiteStatic::xFixesEventBase() { return qTestLiteStaticInfoPrivate()->xFixesEventBase(); } #ifndef QT_NO_XFIXES -PtrXFixesSelectSelectionInput QTestLiteStaticInfo::xFixesSelectSelectionInput() +PtrXFixesSelectSelectionInput QTestLiteStatic::xFixesSelectSelectionInput() { qDebug() << qTestLiteStaticInfoPrivate()->useXFixes(); if (!qTestLiteStaticInfoPrivate()->useXFixes()) @@ -414,4 +462,9 @@ PtrXFixesSelectSelectionInput QTestLiteStaticInfo::xFixesSelectSelectionInput() return qTestLiteStaticInfoPrivate()->xFixesSelectSelectionInput(); } + +QImage QTestLiteStatic::qimageFromXImage(XImage *xi) +{ + return qTestLiteStaticInfoPrivate()->qimageFromXImage(xi); +} #endif //QT_NO_XFIXES diff --git a/src/plugins/platforms/testlite/qtestlitestaticinfo.h b/src/plugins/platforms/testlite/qtestlitestaticinfo.h index ed0f7bd..328de60 100644 --- a/src/plugins/platforms/testlite/qtestlitestaticinfo.h +++ b/src/plugins/platforms/testlite/qtestlitestaticinfo.h @@ -190,7 +190,7 @@ enum { #endif -class QTestLiteStaticInfo +class QTestLiteStatic { public: enum X11Atom { @@ -364,6 +364,7 @@ public: static PtrXFixesSelectSelectionInput xFixesSelectSelectionInput(); #endif //QT_NO_XFIXES + static QImage qimageFromXImage(XImage *xi); }; diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index 71232ac..e8d40d7 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -113,14 +113,14 @@ QTestLiteWindow::QTestLiteWindow(QWidget *window) Atom protocols[5]; int n = 0; - protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_DELETE_WINDOW); // support del window protocol - protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_TAKE_FOCUS); // support take focus window protocol - protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_NET_WM_PING); // support _NET_WM_PING protocol + protocols[n++] = QTestLiteStatic::atom(QTestLiteStatic::WM_DELETE_WINDOW); // support del window protocol + protocols[n++] = QTestLiteStatic::atom(QTestLiteStatic::WM_TAKE_FOCUS); // support take focus window protocol + protocols[n++] = QTestLiteStatic::atom(QTestLiteStatic::_NET_WM_PING); // support _NET_WM_PING protocol #ifndef QT_NO_XSYNC - protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_NET_WM_SYNC_REQUEST); // support _NET_WM_SYNC_REQUEST protocol + protocols[n++] = QTestLiteStatic::atom(QTestLiteStatic::_NET_WM_SYNC_REQUEST); // support _NET_WM_SYNC_REQUEST protocol #endif // QT_NO_XSYNC if (window->windowFlags() & Qt::WindowContextHelpButtonHint) - protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_NET_WM_CONTEXT_HELP); + protocols[n++] = QTestLiteStatic::atom(QTestLiteStatic::_NET_WM_CONTEXT_HELP); XSetWMProtocols(mScreen->display(), x_window, protocols, n); } @@ -344,7 +344,7 @@ QtMWMHints QTestLiteWindow::getMWMHints() const int format; ulong nitems, bytesLeft; uchar *data = 0; - Atom atomForMotifWmHints = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_MOTIF_WM_HINTS); + Atom atomForMotifWmHints = QTestLiteStatic::atom(QTestLiteStatic::_MOTIF_WM_HINTS); if ((XGetWindowProperty(mScreen->display(), x_window, atomForMotifWmHints, 0, 5, false, atomForMotifWmHints, &type, &format, &nitems, &bytesLeft, &data) == Success) @@ -368,7 +368,7 @@ QtMWMHints QTestLiteWindow::getMWMHints() const void QTestLiteWindow::setMWMHints(const QtMWMHints &mwmhints) { - Atom atomForMotifWmHints = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_MOTIF_WM_HINTS); + Atom atomForMotifWmHints = QTestLiteStatic::atom(QTestLiteStatic::_MOTIF_WM_HINTS); if (mwmhints.flags != 0l) { XChangeProperty(mScreen->display(), x_window, atomForMotifWmHints, atomForMotifWmHints, 32, -- cgit v0.12 From 6138bcd3543ac605731c9626191e7914f0995858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= <jorgen.lind@nokia.com> Date: Mon, 3 Jan 2011 16:30:32 +0100 Subject: Renamed variable name in TestLite event handling --- src/plugins/platforms/testlite/qtestlitescreen.cpp | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/plugins/platforms/testlite/qtestlitescreen.cpp b/src/plugins/platforms/testlite/qtestlitescreen.cpp index 82dab9a..c211ee6 100644 --- a/src/plugins/platforms/testlite/qtestlitescreen.cpp +++ b/src/plugins/platforms/testlite/qtestlitescreen.cpp @@ -251,7 +251,7 @@ bool QTestLiteScreen::handleEvent(XEvent *xe) QTestLiteWindow *platformWindow = 0; QWidget *widget = QWidget::find(xe->xany.window); if (widget) { - xw = static_cast<QTestLiteWindow *>(widget->platformWindow()); + platformWindow = static_cast<QTestLiteWindow *>(widget->platformWindow()); } Atom wmProtocolsAtom = QTestLiteStatic::atom(QTestLiteStatic::WM_PROTOCOLS); @@ -262,33 +262,33 @@ bool QTestLiteScreen::handleEvent(XEvent *xe) if (xe->xclient.format == 32 && xe->xclient.message_type == wmProtocolsAtom) { Atom a = xe->xclient.data.l[0]; if (a == wmDeleteWindowAtom) - xw->handleCloseEvent(); + platformWindow->handleCloseEvent(); } break; case Expose: - if (xw) + if (platformWindow) if (xe->xexpose.count == 0) - xw->paintEvent(); + platformWindow->paintEvent(); break; case ConfigureNotify: - if (xw) - xw->resizeEvent(&xe->xconfigure); + if (platformWindow) + platformWindow->resizeEvent(&xe->xconfigure); break; case ButtonPress: - if (xw) - xw->mousePressEvent(&xe->xbutton); + if (platformWindow) + platformWindow->mousePressEvent(&xe->xbutton); break; case ButtonRelease: - if (xw) - xw->handleMouseEvent(QEvent::MouseButtonRelease, &xe->xbutton); + if (platformWindow) + platformWindow->handleMouseEvent(QEvent::MouseButtonRelease, &xe->xbutton); break; case MotionNotify: - if (xw) - xw->handleMouseEvent(QEvent::MouseMove, &xe->xbutton); + if (platformWindow) + platformWindow->handleMouseEvent(QEvent::MouseMove, &xe->xbutton); break; case XKeyPress: @@ -300,23 +300,23 @@ bool QTestLiteScreen::handleEvent(XEvent *xe) break; case EnterNotify: - if (xw) - xw->handleEnterEvent(); + if (platformWindow) + platformWindow->handleEnterEvent(); break; case LeaveNotify: - if (xw) - xw->handleLeaveEvent(); + if (platformWindow) + platformWindow->handleLeaveEvent(); break; case XFocusIn: - if (xw) - xw->handleFocusInEvent(); + if (platformWindow) + platformWindow->handleFocusInEvent(); break; case XFocusOut: - if (xw) - xw->handleFocusOutEvent(); + if (platformWindow) + platformWindow->handleFocusOutEvent(); break; case PropertyNotify: -- cgit v0.12 From 0ceed999bbf25d19b3ded8a1b300cf0c6129f775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= <jorgen.lind@nokia.com> Date: Mon, 3 Jan 2011 16:31:44 +0100 Subject: Create clearer sepperation between TestLiteMime and QTestliteClipboard --- .../platforms/testlite/qtestliteclipboard.cpp | 130 +++++++++++++++- .../platforms/testlite/qtestliteclipboard.h | 7 +- src/plugins/platforms/testlite/qtestlitemime.cpp | 173 ++++++--------------- src/plugins/platforms/testlite/qtestlitemime.h | 32 +--- 4 files changed, 181 insertions(+), 161 deletions(-) diff --git a/src/plugins/platforms/testlite/qtestliteclipboard.cpp b/src/plugins/platforms/testlite/qtestliteclipboard.cpp index 9e1b387..25c16ea 100644 --- a/src/plugins/platforms/testlite/qtestliteclipboard.cpp +++ b/src/plugins/platforms/testlite/qtestliteclipboard.cpp @@ -7,6 +7,104 @@ #include <QtCore/QDebug> +class QTestLiteClipboardMime : public QTestLiteMime +{ + Q_OBJECT +public: + QTestLiteClipboardMime(QClipboard::Mode mode, QTestLiteClipboard *clipboard) + : QTestLiteMime() + , m_clipboard(clipboard) + { + switch (mode) { + case QClipboard::Selection: + modeAtom = XA_PRIMARY; + break; + + case QClipboard::Clipboard: + modeAtom = QTestLiteStatic::atom(QTestLiteStatic::CLIPBOARD); + break; + + default: + qWarning("QTestLiteMime: Internal error: Unsupported clipboard mode"); + break; + } + } + +protected: + QStringList formats_sys() const + { + if (empty()) + return QStringList(); + + if (!formatList.count()) { + QTestLiteClipboardMime *that = const_cast<QTestLiteClipboardMime *>(this); + // get the list of targets from the current clipboard owner - we do this + // once so that multiple calls to this function don't require multiple + // server round trips... + that->format_atoms = m_clipboard->getDataInFormat(modeAtom,QTestLiteStatic::atom(QTestLiteStatic::TARGETS)); + + if (format_atoms.size() > 0) { + Atom *targets = (Atom *) format_atoms.data(); + int size = format_atoms.size() / sizeof(Atom); + + for (int i = 0; i < size; ++i) { + if (targets[i] == 0) + continue; + + QStringList formatsForAtom = mimeFormatsForAtom(m_clipboard->screen()->display(),targets[i]); + for (int j = 0; j < formatsForAtom.size(); ++j) { + if (!formatList.contains(formatsForAtom.at(j))) + that->formatList.append(formatsForAtom.at(j)); + } + } + } + } + + return formatList; + } + + bool hasFormat_sys(const QString &format) const + { + QStringList list = formats(); + return list.contains(format); + } + + QVariant retrieveData_sys(const QString &fmt, QVariant::Type requestedType) const + { + if (fmt.isEmpty() || empty()) + return QByteArray(); + + (void)formats(); // trigger update of format list + + QList<Atom> atoms; + Atom *targets = (Atom *) format_atoms.data(); + int size = format_atoms.size() / sizeof(Atom); + for (int i = 0; i < size; ++i) + atoms.append(targets[i]); + + QByteArray encoding; + Atom fmtatom = mimeAtomForFormat(m_clipboard->screen()->display(),fmt, requestedType, atoms, &encoding); + + if (fmtatom == 0) + return QVariant(); + + return mimeConvertToFormat(m_clipboard->screen()->display(),fmtatom, m_clipboard->getDataInFormat(modeAtom,fmtatom), fmt, requestedType, encoding); + } +private: + bool empty() const + { + Window win = XGetSelectionOwner(m_clipboard->screen()->display(), modeAtom); + + return win == XNone; + } + + + Atom modeAtom; + QTestLiteClipboard *m_clipboard; + QStringList formatList; + QByteArray format_atoms; +}; + const int QTestLiteClipboard::clipboard_timeout = 5000; QTestLiteClipboard::QTestLiteClipboard(QTestLiteScreen *screen) @@ -26,7 +124,7 @@ const QMimeData * QTestLiteClipboard::mimeData(QClipboard::Mode mode) const if (mode == QClipboard::Clipboard) { if (!m_xClipboard) { QTestLiteClipboard *that = const_cast<QTestLiteClipboard *>(this); - that->m_xClipboard = new QTestLiteMime(mode,that); + that->m_xClipboard = new QTestLiteClipboardMime(mode,that); } Window clipboardOwner = XGetSelectionOwner(screen()->display(),QTestLiteStatic::atom(QTestLiteStatic::CLIPBOARD)); if (clipboardOwner == owner()) { @@ -34,6 +132,17 @@ const QMimeData * QTestLiteClipboard::mimeData(QClipboard::Mode mode) const } else { return m_xClipboard; } + } else if (mode == QClipboard::Selection) { + if (!m_xSelection) { + QTestLiteClipboard *that = const_cast<QTestLiteClipboard *>(this); + that->m_xSelection = new QTestLiteClipboardMime(mode,that); + } + Window clipboardOwner = XGetSelectionOwner(screen()->display(),XA_PRIMARY); + if (clipboardOwner == owner()) { + return m_clientSelection; + } else { + return m_xSelection; + } } return 0; } @@ -71,14 +180,19 @@ void QTestLiteClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) XSetSelectionOwner(m_screen->display(), modeAtom, newOwner, CurrentTime); if (XGetSelectionOwner(m_screen->display(), modeAtom) != newOwner) { -// qWarning("QClipboard::setData: Cannot set X11 selection owner for %s", -// xdndAtomToString(atom).data()); - *d = 0; - return; + qWarning("QClipboard::setData: Cannot set X11 selection owner"); } } +bool QTestLiteClipboard::supportsMode(QClipboard::Mode mode) const +{ + if (mode == QClipboard::Clipboard || mode == QClipboard::Selection) + return true; + return false; +} + + QTestLiteScreen * QTestLiteClipboard::screen() const { return m_screen; @@ -153,14 +267,14 @@ Atom QTestLiteClipboard::sendSelection(QMimeData *d, Atom target, Window window, int dataFormat = 0; QByteArray data; - QString fmt = QTestLiteMime::xdndMimeAtomToString(screen()->display(), target); + QString fmt = QTestLiteMime::mimeAtomToString(screen()->display(), target); if (fmt.isEmpty()) { // Not a MIME type we have qDebug() << "QClipboard: send_selection(): converting to type '%s' is not supported" << fmt.data(); return XNone; } qDebug() << "QClipboard: send_selection(): converting to type '%s'" << fmt.data(); - if (QTestLiteMime::xdndMimeDataForAtom(screen()->display(),target, d, &data, &atomFormat, &dataFormat)) { + if (QTestLiteMime::mimeDataForAtom(screen()->display(),target, d, &data, &atomFormat, &dataFormat)) { // don't allow INCR transfers when using MULTIPLE or to // Motif clients (since Motif doesn't support INCR) @@ -517,3 +631,5 @@ QByteArray QTestLiteClipboard::getDataInFormat(Atom modeAtom, Atom fmtatom) return buf; } + +#include "qtestliteclipboard.moc" diff --git a/src/plugins/platforms/testlite/qtestliteclipboard.h b/src/plugins/platforms/testlite/qtestliteclipboard.h index 31e42b7..22d3734 100644 --- a/src/plugins/platforms/testlite/qtestliteclipboard.h +++ b/src/plugins/platforms/testlite/qtestliteclipboard.h @@ -5,7 +5,6 @@ #include "qtestlitestaticinfo.h" class QTestLiteScreen; -class QTestLiteMime; class QTestLiteClipboard : public QPlatformClipboard { public: @@ -14,6 +13,8 @@ public: const QMimeData *mimeData(QClipboard::Mode mode) const; void setMimeData(QMimeData *data, QClipboard::Mode mode); + bool supportsMode(QClipboard::Mode mode) const; + QTestLiteScreen *screen() const; Window requestor() const; @@ -36,10 +37,10 @@ private: QTestLiteScreen *m_screen; - QTestLiteMime *m_xClipboard; + QMimeData *m_xClipboard; QMimeData *m_clientClipboard; - QTestLiteMime *m_xSelection; + QMimeData *m_xSelection; QMimeData *m_clientSelection; Window m_requestor; diff --git a/src/plugins/platforms/testlite/qtestlitemime.cpp b/src/plugins/platforms/testlite/qtestlitemime.cpp index 6a08b8c..32cacce 100644 --- a/src/plugins/platforms/testlite/qtestlitemime.cpp +++ b/src/plugins/platforms/testlite/qtestlitemime.cpp @@ -4,98 +4,21 @@ #include "qtestlitescreen.h" #include <QtCore/QTextCodec> +#include <QtGui/QImageWriter> +#include <QtCore/QBuffer> -QTestLiteMime::QTestLiteMime(QClipboard::Mode mode, QTestLiteClipboard *clipboard) - : QInternalMimeData(), m_clipboard(clipboard) -{ - switch (mode) { - case QClipboard::Selection: - modeAtom = XA_PRIMARY; - break; - - case QClipboard::Clipboard: - modeAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD); - break; - - default: - qWarning("QTestLiteMime: Internal error: Unsupported clipboard mode"); - break; - } -} +QTestLiteMime::QTestLiteMime() + : QInternalMimeData() +{ } QTestLiteMime::~QTestLiteMime() -{ -} +{} -bool QTestLiteMime::empty() const -{ - Window win = XGetSelectionOwner(m_clipboard->screen()->display(), modeAtom); - - return win == XNone; -} -QStringList QTestLiteMime::formats_sys() const -{ - if (empty()) - return QStringList(); - if (!formatList.count()) { - // get the list of targets from the current clipboard owner - we do this - // once so that multiple calls to this function don't require multiple - // server round trips... - format_atoms = m_clipboard->getDataInFormat(modeAtom,QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TARGETS)); - if (format_atoms.size() > 0) { - Atom *targets = (Atom *) format_atoms.data(); - int size = format_atoms.size() / sizeof(Atom); - - for (int i = 0; i < size; ++i) { - if (targets[i] == 0) - continue; - - QStringList formatsForAtom = xdndMimeFormatsForAtom(m_clipboard->screen()->display(),targets[i]); - for (int j = 0; j < formatsForAtom.size(); ++j) { - if (!formatList.contains(formatsForAtom.at(j))) - formatList.append(formatsForAtom.at(j)); - } - } - } - } - - return formatList; -} - -bool QTestLiteMime::hasFormat_sys(const QString &format) const -{ - QStringList list = formats(); - return list.contains(format); -} - -QVariant QTestLiteMime::retrieveData_sys(const QString &fmt, QVariant::Type requestedType) const -{ - if (fmt.isEmpty() || empty()) - return QByteArray(); - - (void)formats(); // trigger update of format list - - QList<Atom> atoms; - Atom *targets = (Atom *) format_atoms.data(); - int size = format_atoms.size() / sizeof(Atom); - for (int i = 0; i < size; ++i) - atoms.append(targets[i]); - - QByteArray encoding; - Atom fmtatom = xdndMimeAtomForFormat(m_clipboard->screen()->display(),fmt, requestedType, atoms, &encoding); - - if (fmtatom == 0) - return QVariant(); - - return xdndMimeConvertToFormat(m_clipboard->screen()->display(),fmtatom, m_clipboard->getDataInFormat(modeAtom,fmtatom), fmt, requestedType, encoding); -} - - -QString QTestLiteMime::xdndMimeAtomToString(Display *display, Atom a) +QString QTestLiteMime::mimeAtomToString(Display *display, Atom a) { if (!a) return 0; @@ -108,18 +31,18 @@ QString QTestLiteMime::xdndMimeAtomToString(Display *display, Atom a) return result; } -Atom QTestLiteMime::xdndMimeStringToAtom(Display *display, const QString &mimeType) +Atom QTestLiteMime::mimeStringToAtom(Display *display, const QString &mimeType) { if (mimeType.isEmpty()) return 0; return XInternAtom(display, mimeType.toLatin1().constData(), False); } -QStringList QTestLiteMime::xdndMimeFormatsForAtom(Display *display, Atom a) +QStringList QTestLiteMime::mimeFormatsForAtom(Display *display, Atom a) { QStringList formats; if (a) { - QString atomName = xdndMimeAtomToString(display, a); + QString atomName = mimeAtomToString(display, a); formats.append(atomName); // special cases for string type @@ -140,12 +63,12 @@ QStringList QTestLiteMime::xdndMimeFormatsForAtom(Display *display, Atom a) return formats; } -bool QTestLiteMime::xdndMimeDataForAtom(Display *display, Atom a, QMimeData *mimeData, QByteArray *data, Atom *atomFormat, int *dataFormat) +bool QTestLiteMime::mimeDataForAtom(Display *display, Atom a, QMimeData *mimeData, QByteArray *data, Atom *atomFormat, int *dataFormat) { bool ret = false; *atomFormat = a; *dataFormat = 8; - QString atomName = xdndMimeAtomToString(display, a); + QString atomName = mimeAtomToString(display, a); if (QInternalMimeData::hasFormatHelper(atomName, mimeData)) { *data = QInternalMimeData::renderDataHelper(atomName, mimeData); if (atomName == QLatin1String("application/x-color")) @@ -195,30 +118,16 @@ bool QTestLiteMime::xdndMimeDataForAtom(Display *display, Atom a, QMimeData *mim *data = QByteArray(reinterpret_cast<const char *>(mozUri.utf16()), mozUri.length() * 2); ret = true; } else if ((a == XA_PIXMAP || a == XA_BITMAP) && mimeData->hasImage()) { - QPixmap pm = qvariant_cast<QPixmap>(mimeData->imageData()); - if (a == XA_BITMAP && pm.depth() != 1) { - QImage img = pm.toImage(); - img = img.convertToFormat(QImage::Format_MonoLSB); - pm = QPixmap::fromImage(img); - } -// QDragManager *dm = QDragManager::self(); -// if (dm) { -// Pixmap handle = pm.handle(); -// *data = QByteArray((const char *) &handle, sizeof(Pixmap)); -// dm->xdndMimeTransferedPixmap[dm->xdndMimeTransferedPixmapIndex] = pm; -// dm->xdndMimeTransferedPixmapIndex = -// (dm->xdndMimeTransferedPixmapIndex + 1) % 2; -// ret = true; -// } + ret = true; } } return ret && data != 0; } -QList<Atom> QTestLiteMime::xdndMimeAtomsForFormat(Display *display, const QString &format) +QList<Atom> QTestLiteMime::mimeAtomsForFormat(Display *display, const QString &format) { QList<Atom> atoms; - atoms.append(xdndMimeStringToAtom(display, format)); + atoms.append(mimeStringToAtom(display, format)); // special cases for strings if (format == QLatin1String("text/plain")) { @@ -230,7 +139,7 @@ QList<Atom> QTestLiteMime::xdndMimeAtomsForFormat(Display *display, const QStrin // special cases for uris if (format == QLatin1String("text/uri-list")) { - atoms.append(xdndMimeStringToAtom(display,QLatin1String("text/x-moz-url"))); + atoms.append(mimeStringToAtom(display,QLatin1String("text/x-moz-url"))); } //special cases for images @@ -242,9 +151,9 @@ QList<Atom> QTestLiteMime::xdndMimeAtomsForFormat(Display *display, const QStrin return atoms; } -QVariant QTestLiteMime::xdndMimeConvertToFormat(Display *display, Atom a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding) +QVariant QTestLiteMime::mimeConvertToFormat(Display *display, Atom a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding) { - QString atomName = xdndMimeAtomToString(display,a); + QString atomName = mimeAtomToString(display,a); if (atomName == format) return data; @@ -288,25 +197,35 @@ QVariant QTestLiteMime::xdndMimeConvertToFormat(Display *display, Atom a, const // special cas for images if (format == QLatin1String("image/ppm")) { if (a == XA_PIXMAP && data.size() == sizeof(Pixmap)) { -// Pixmap xpm = *((Pixmap*)data.data()); -// if (!xpm) -// return QByteArray(); -// QPixmap qpm = QPixmap::fromX11Pixmap(xpm); -// QImageWriter imageWriter; -// imageWriter.setFormat("PPMRAW"); -// QImage imageToWrite = qpm.toImage(); -// QBuffer buf; -// buf.open(QIODevice::WriteOnly); -// imageWriter.setDevice(&buf); -// imageWriter.write(imageToWrite); -// return buf.buffer(); - return QVariant(); + Pixmap xpm = *((Pixmap*)data.data()); + if (!xpm) + return QByteArray(); + Window root; + int x; + int y; + uint width; + uint height; + uint border_width; + uint depth; + + XGetGeometry(display, xpm, &root, &x, &y, &width, &height, &border_width, &depth); + XImage *ximg = XGetImage(display,xpm,x,y,width,height,AllPlanes,depth==1 ? XYPixmap : ZPixmap); + QImage qimg = QTestLiteStatic::qimageFromXImage(ximg); + XDestroyImage(ximg); + + QImageWriter imageWriter; + imageWriter.setFormat("PPMRAW"); + QBuffer buf; + buf.open(QIODevice::WriteOnly); + imageWriter.setDevice(&buf); + imageWriter.write(qimg); + return buf.buffer(); } } return QVariant(); } -Atom QTestLiteMime::xdndMimeAtomForFormat(Display *display, const QString &format, QVariant::Type requestedType, const QList<Atom> &atoms, QByteArray *requestedEncoding) +Atom QTestLiteMime::mimeAtomForFormat(Display *display, const QString &format, QVariant::Type requestedType, const QList<Atom> &atoms, QByteArray *requestedEncoding) { requestedEncoding->clear(); @@ -324,10 +243,10 @@ Atom QTestLiteMime::xdndMimeAtomForFormat(Display *display, const QString &forma // find matches for uri types if (format == QLatin1String("text/uri-list")) { - Atom a = xdndMimeStringToAtom(display,format); + Atom a = mimeStringToAtom(display,format); if (a && atoms.contains(a)) return a; - a = xdndMimeStringToAtom(display,QLatin1String("text/x-moz-url")); + a = mimeStringToAtom(display,QLatin1String("text/x-moz-url")); if (a && atoms.contains(a)) return a; } @@ -347,14 +266,14 @@ Atom QTestLiteMime::xdndMimeAtomForFormat(Display *display, const QString &forma QString formatWithCharset = format; formatWithCharset.append(QLatin1String(";charset=utf-8")); - Atom a = xdndMimeStringToAtom(display,formatWithCharset); + Atom a = mimeStringToAtom(display,formatWithCharset); if (a && atoms.contains(a)) { *requestedEncoding = "utf-8"; return a; } } - Atom a = xdndMimeStringToAtom(display,format); + Atom a = mimeStringToAtom(display,format); if (a && atoms.contains(a)) return a; diff --git a/src/plugins/platforms/testlite/qtestlitemime.h b/src/plugins/platforms/testlite/qtestlitemime.h index e5ed7b0..449bbf3 100644 --- a/src/plugins/platforms/testlite/qtestlitemime.h +++ b/src/plugins/platforms/testlite/qtestlitemime.h @@ -11,32 +11,16 @@ class QTestLiteMime : public QInternalMimeData { Q_OBJECT public: - QTestLiteMime(QClipboard::Mode mode, QTestLiteClipboard *clipboard); + QTestLiteMime(); ~QTestLiteMime(); - bool empty() const; - static QList<Atom> xdndMimeAtomsForFormat(Display *display, const QString &format); - static QString xdndMimeAtomToString(Display *display, Atom a); - static bool xdndMimeDataForAtom(Display *display, Atom a, QMimeData *mimeData, QByteArray *data, Atom *atomFormat, int *dataFormat); - static QStringList xdndMimeFormatsForAtom(Display *display, Atom a); - static Atom xdndMimeStringToAtom(Display *display, const QString &mimeType); - - static QVariant xdndMimeConvertToFormat(Display *display, Atom a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); - static Atom xdndMimeAtomForFormat(Display *display, const QString &format, QVariant::Type requestedType, const QList<Atom> &atoms, QByteArray *requestedEncoding); - - -protected: - virtual bool hasFormat_sys(const QString &mimetype) const; - virtual QStringList formats_sys() const; - - QVariant retrieveData_sys(const QString &mimetype, QVariant::Type type) const; - - -private: - QTestLiteClipboard *m_clipboard; - Atom modeAtom; - mutable QStringList formatList; - mutable QByteArray format_atoms; + static QList<Atom> mimeAtomsForFormat(Display *display, const QString &format); + static QString mimeAtomToString(Display *display, Atom a); + static bool mimeDataForAtom(Display *display, Atom a, QMimeData *mimeData, QByteArray *data, Atom *atomFormat, int *dataFormat); + static QStringList mimeFormatsForAtom(Display *display, Atom a); + static Atom mimeStringToAtom(Display *display, const QString &mimeType); + static QVariant mimeConvertToFormat(Display *display, Atom a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); + static Atom mimeAtomForFormat(Display *display, const QString &format, QVariant::Type requestedType, const QList<Atom> &atoms, QByteArray *requestedEncoding); }; #endif // QTESTLITEMIME_H -- cgit v0.12 From 06568ff89c48dee8aab278b8b0538c331aa84595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= <jorgen.lind@nokia.com> Date: Mon, 6 Dec 2010 16:05:55 +0100 Subject: Add styleHint to fallback api for fontdatabases in Lighthouse --- src/gui/text/qfont_qpa.cpp | 2 +- src/gui/text/qfontdatabase_qpa.cpp | 12 ++++++---- src/gui/text/qplatformfontdatabase_qpa.cpp | 3 ++- src/gui/text/qplatformfontdatabase_qpa.h | 2 +- .../fontconfig/qfontconfigdatabase.cpp | 27 +++++++++++++++++++++- .../fontdatabases/fontconfig/qfontconfigdatabase.h | 2 +- 6 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/gui/text/qfont_qpa.cpp b/src/gui/text/qfont_qpa.cpp index 5fed18b..7b09b59 100644 --- a/src/gui/text/qfont_qpa.cpp +++ b/src/gui/text/qfont_qpa.cpp @@ -90,7 +90,7 @@ QString QFont::defaultFamily() const familyName = QString::fromLatin1("helvetica"); } - QStringList list = QApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(familyName,QFont::StyleNormal,QUnicodeTables::Common); + QStringList list = QApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(familyName,QFont::StyleNormal,QFont::StyleHint(d->request.styleHint),QUnicodeTables::Common); if (list.size()) { familyName = list.at(0); } diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index e54093c..e6d99c6 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -80,9 +80,9 @@ Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &fou size->handle = handle; } -static QStringList fallbackFamilies(const QString &family, const QFont::Style &style, const QUnicodeTables::Script &script) +static QStringList fallbackFamilies(const QString &family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) { - QStringList retList = QApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(family,style,script); + QStringList retList = QApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(family,style,styleHint,script); QFontDatabasePrivate *db = privateDb(); QStringList::iterator i; @@ -177,7 +177,11 @@ QFontEngine *loadEngine(int script, const QFontDef &request, && !(request.styleStrategy & QFont::NoFontMerging) && !engine->symbol ) { if (family && !family->askedForFallback) { - family->fallbackFamilies = fallbackFamilies(family->name,QFont::Style(style->key.style),QUnicodeTables::Script(script)); + QFont::Style fontStyle = QFont::Style(style->key.style); + QFont::StyleHint styleHint = QFont::StyleHint(request.styleHint); + if (styleHint == QFont::AnyStyle && request.fixedPitch) + styleHint = QFont::TypeWriter; + family->fallbackFamilies = fallbackFamilies(family->name,fontStyle,styleHint,QUnicodeTables::Script(script)); family->askedForFallback = true; } @@ -287,7 +291,7 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp, if (!engine) { if (!request.family.isEmpty()) { - QStringList fallbacks = fallbackFamilies(request.family,QFont::Style(request.style),QUnicodeTables::Script(script)); + QStringList fallbacks = fallbackFamilies(request.family,QFont::Style(request.style),QFont::StyleHint(request.styleHint),QUnicodeTables::Script(script)); for (int i = 0; i < fallbacks.size(); i++) { QFontDef def = request; def.family = fallbacks.at(i); diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp index d6dff41..afe762a 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.cpp +++ b/src/gui/text/qplatformfontdatabase_qpa.cpp @@ -221,10 +221,11 @@ QFontEngine *QPlatformFontDatabase::fontEngine(const QFontDef &fontDef, QUnicode /*! */ -QStringList QPlatformFontDatabase::fallbacksForFamily(const QString family, const QFont::Style &style, const QUnicodeTables::Script &script) const +QStringList QPlatformFontDatabase::fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const { Q_UNUSED(family); Q_UNUSED(style); + Q_UNUSED(styleHint); Q_UNUSED(script); return QStringList(); } diff --git a/src/gui/text/qplatformfontdatabase_qpa.h b/src/gui/text/qplatformfontdatabase_qpa.h index aa465ab..a1faea9 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.h +++ b/src/gui/text/qplatformfontdatabase_qpa.h @@ -88,7 +88,7 @@ class Q_GUI_EXPORT QPlatformFontDatabase public: virtual void populateFontDatabase(); virtual QFontEngine *fontEngine(const QFontDef &fontDef, QUnicodeTables::Script script, void *handle); - virtual QStringList fallbacksForFamily(const QString family, const QFont::Style &style, const QUnicodeTables::Script &script) const; + virtual QStringList fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const; virtual QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName); virtual void releaseHandle(void *handle); diff --git a/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 92f30fc..9b9be07 100644 --- a/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -274,6 +274,25 @@ static const char *openType[] = { "nko " // N'Ko }; +static const char *getFcFamilyForStyleHint(const QFont::StyleHint style) +{ + const char *stylehint = 0; + switch (style) { + case QFont::SansSerif: + stylehint = "sans-serif"; + break; + case QFont::Serif: + stylehint = "serif"; + break; + case QFont::TypeWriter: + stylehint = "monospace"; + break; + default: + break; + } + return stylehint; +} + void QFontconfigDatabase::populateFontDatabase() { FcFontSet *fonts; @@ -522,7 +541,7 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFontDef &f, QUnicodeTables:: return engine; } -QStringList QFontconfigDatabase::fallbacksForFamily(const QString family, const QFont::Style &style, const QUnicodeTables::Script &script) const +QStringList QFontconfigDatabase::fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const { QStringList fallbackFamilies; FcPattern *pattern = FcPatternCreate(); @@ -550,6 +569,12 @@ QStringList QFontconfigDatabase::fallbacksForFamily(const QString family, const FcLangSetDestroy(ls); } + const char *stylehint = getFcFamilyForStyleHint(styleHint); + if (stylehint) { + value.u.s = (const FcChar8 *)stylehint; + FcPatternAddWeak(pattern, FC_FAMILY, value, FcTrue); + } + FcConfigSubstitute(0, pattern, FcMatchPattern); FcConfigSubstitute(0, pattern, FcMatchFont); diff --git a/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.h b/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.h index 33382dc..cf62b88 100644 --- a/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.h +++ b/src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.h @@ -50,7 +50,7 @@ class QFontconfigDatabase : public QBasicUnixFontDatabase public: void populateFontDatabase(); QFontEngine *fontEngine(const QFontDef &fontDef, QUnicodeTables::Script script, void *handle); - QStringList fallbacksForFamily(const QString family, const QFont::Style &style, const QUnicodeTables::Script &script) const; + QStringList fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const; }; #endif // QFONTCONFIGDATABASE_H -- cgit v0.12 From 7a979f8dab64c33a7088b70ca5bff69b881ee55d Mon Sep 17 00:00:00 2001 From: Michael Brasser <michael.brasser@nokia.com> Date: Wed, 5 Jan 2011 10:40:47 +1000 Subject: Add clarifications to QML SQL docs. Reviewed-by: Bea Lam --- doc/src/declarative/globalobject.qdoc | 7 ++++--- src/declarative/qml/qdeclarativesqldatabase.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index ffc84f9..ef8de5e 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -141,8 +141,9 @@ using the Offline Storage API. \section3 db = openDatabaseSync(identifier, version, description, estimated_size, callback(db)) Returns the database identified by \e identifier. If the database does not already exist, it -is created with the properties \e description and \e estimated_size and the function \e callback -is called with the database as a parameter. +is created, and the function \e callback is called with the database as a parameter. \e description +and \e estimated_size are written to the INI file (described below), but are otherwise currently +unused. May throw exception with code property SQLException.DATABASE_ERR, or SQLException.VERSION_ERR. @@ -153,7 +154,7 @@ When a database is first created, an INI file is also created specifying its cha \row \o Name \o The name of the database passed to \c openDatabase() \row \o Version \o The version of the database passed to \c openDatabase() \row \o Description \o The description of the database passed to \c openDatabase() -\row \o EstimatedSize \o The estimated size of the database passed to \c openDatabase() +\row \o EstimatedSize \o The estimated size (in bytes) of the database passed to \c openDatabase() \row \o Driver \o Currently "QSQLITE" \endtable diff --git a/src/declarative/qml/qdeclarativesqldatabase.cpp b/src/declarative/qml/qdeclarativesqldatabase.cpp index bda02a5..a774c02 100644 --- a/src/declarative/qml/qdeclarativesqldatabase.cpp +++ b/src/declarative/qml/qdeclarativesqldatabase.cpp @@ -351,7 +351,7 @@ static QScriptValue qmlsqldatabase_read_transaction(QScriptContext *context, QSc } /* - Currently documented in doc/src/declarastive/globalobject.qdoc + Currently documented in doc/src/declarative/globalobject.qdoc */ static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEngine *engine) { -- cgit v0.12 From 3f80a24c5d375dd173d18c2a4227301f1afba2e3 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@nokia.com> Date: Mon, 6 Dec 2010 14:23:47 +1000 Subject: Allow a revision to be associated with properties and methods. Allows a revision to be associated with properties via: Q_PROPERTY(int prop READ prop1 REVISION 1) Allows a revision to be associated with methods via either: public slots Q_REVISION(1): void method1(); or: public slots: Q_REVISION void method1(); Private revision() methods are added to QMetaProperty and QMetaMethod to access the revision info. This is private API for use by QML for now. Task-number: QTBUG-13451 Reviewed-by: Kent Hansen --- src/corelib/kernel/qmetaobject.cpp | 48 +++++++++++++ src/corelib/kernel/qmetaobject.h | 3 + src/corelib/kernel/qmetaobject_p.h | 6 +- src/corelib/kernel/qobjectdefs.h | 2 + src/tools/moc/generator.cpp | 36 +++++++++- src/tools/moc/generator.h | 1 + src/tools/moc/keywords.cpp | 20 ++++-- src/tools/moc/moc.cpp | 82 ++++++++++++++++++++-- src/tools/moc/moc.h | 13 +++- src/tools/moc/token.cpp | 1 + src/tools/moc/token.h | 1 + src/tools/moc/util/generate_keywords.cpp | 1 + tests/auto/moc/tst_moc.cpp | 113 +++++++++++++++++++++++++++++++ 13 files changed, 311 insertions(+), 16 deletions(-) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 9854e68..dd5f231 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1369,6 +1369,25 @@ int QMetaMethod::methodIndex() const } /*! + \internal + + Returns the method revision if one was + specified by Q_REVISION, otherwise returns 0. + */ +int QMetaMethod::revision() const +{ + if (!mobj) + return 0; + if ((QMetaMethod::Access)(mobj->d.data[handle + 4] & MethodRevisioned)) { + int offset = priv(mobj->d.data)->methodData + + priv(mobj->d.data)->methodCount * 5 + + (handle - priv(mobj->d.data)->methodData) / 5; + return mobj->d.data[offset]; + } + return 0; +} + +/*! Returns the access specification of this method (private, protected, or public). @@ -2389,6 +2408,35 @@ int QMetaProperty::notifySignalIndex() const } /*! + \internal + + Returns the property revision if one was + specified by REVISION, otherwise returns 0. + */ +int QMetaProperty::revision() const +{ + if (!mobj) + return 0; + int flags = mobj->d.data[handle + 2]; + if (flags & Revisioned) { + int offset = priv(mobj->d.data)->propertyData + + priv(mobj->d.data)->propertyCount * 3 + idx; + // Revision data is placed after NOTIFY data, if present. + // Iterate through properties to discover whether we have NOTIFY signals. + for (int i = 0; i < priv(mobj->d.data)->propertyCount; ++i) { + int handle = priv(mobj->d.data)->propertyData + 3*i; + if (mobj->d.data[handle + 2] & Notify) { + offset += priv(mobj->d.data)->propertyCount; + break; + } + } + return mobj->d.data[offset]; + } else { + return 0; + } +} + +/*! Returns true if this property is writable; otherwise returns false. diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h index b700351..1ab08ee 100644 --- a/src/corelib/kernel/qmetaobject.h +++ b/src/corelib/kernel/qmetaobject.h @@ -70,6 +70,7 @@ public: enum Attributes { Compatibility = 0x1, Cloned = 0x2, Scriptable = 0x4 }; int attributes() const; int methodIndex() const; + int revision() const; inline const QMetaObject *enclosingMetaObject() const { return mobj; } @@ -200,6 +201,8 @@ public: QMetaMethod notifySignal() const; int notifySignalIndex() const; + int revision() const; + QVariant read(const QObject *obj) const; bool write(QObject *obj, const QVariant &value) const; bool reset(QObject *obj) const; diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index 4a03874..7b103e2 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -78,7 +78,8 @@ enum PropertyFlags { ResolveEditable = 0x00080000, User = 0x00100000, ResolveUser = 0x00200000, - Notify = 0x00400000 + Notify = 0x00400000, + Revisioned = 0x00800000 }; enum MethodFlags { @@ -95,7 +96,8 @@ enum MethodFlags { MethodCompatibility = 0x10, MethodCloned = 0x20, - MethodScriptable = 0x40 + MethodScriptable = 0x40, + MethodRevisioned = 0x80 }; enum MetaObjectFlags { diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h index 555a1f5..d1a8f06 100644 --- a/src/corelib/kernel/qobjectdefs.h +++ b/src/corelib/kernel/qobjectdefs.h @@ -79,6 +79,7 @@ class QString; #define Q_INTERFACES(x) #define Q_PROPERTY(text) #define Q_PRIVATE_PROPERTY(d, text) +#define Q_REVISION(v) #define Q_OVERRIDE(text) #define Q_ENUMS(x) #define Q_FLAGS(x) @@ -180,6 +181,7 @@ private: #define Q_INTERFACES(x) Q_INTERFACES(x) #define Q_PROPERTY(text) Q_PROPERTY(text) #define Q_PRIVATE_PROPERTY(d, text) Q_PRIVATE_PROPERTY(d, text) +#define Q_REVISION(v) Q_REVISION(v) #define Q_OVERRIDE(text) Q_OVERRIDE(text) #define Q_ENUMS(x) Q_ENUMS(x) #define Q_FLAGS(x) Q_FLAGS(x) diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index c3bbba1..ea5b474 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -181,10 +181,14 @@ void Generator::generateCode() int methodCount = cdef->signalList.count() + cdef->slotList.count() + cdef->methodList.count(); fprintf(out, " %4d, %4d, // methods\n", methodCount, methodCount ? index : 0); index += methodCount * 5; + if (cdef->revisionedMethods) + index += methodCount; fprintf(out, " %4d, %4d, // properties\n", cdef->propertyList.count(), cdef->propertyList.count() ? index : 0); index += cdef->propertyList.count() * 3; if(cdef->notifyableProperties) index += cdef->propertyList.count(); + if (cdef->revisionedProperties) + index += cdef->propertyList.count(); fprintf(out, " %4d, %4d, // enums/sets\n", cdef->enumList.count(), cdef->enumList.count() ? index : 0); int enumsIndex = index; @@ -217,6 +221,14 @@ void Generator::generateCode() // generateFunctions(cdef->methodList, "method", MethodMethod); +// +// Build method version arrays +// + if (cdef->revisionedMethods) { + generateFunctionRevisions(cdef->signalList, "signal"); + generateFunctionRevisions(cdef->slotList, "slot"); + generateFunctionRevisions(cdef->methodList, "method"); + } // // Build property array @@ -456,7 +468,7 @@ void Generator::generateFunctions(QList<FunctionDef>& list, const char *functype } sig += ')'; - char flags = type; + unsigned char flags = type; if (f.access == FunctionDef::Private) flags |= AccessPrivate; else if (f.access == FunctionDef::Public) @@ -475,11 +487,23 @@ void Generator::generateFunctions(QList<FunctionDef>& list, const char *functype flags |= MethodCloned; if (f.isScriptable) flags |= MethodScriptable; + if (f.revision > 0) + flags |= MethodRevisioned; fprintf(out, " %4d, %4d, %4d, %4d, 0x%02x,\n", strreg(sig), strreg(arguments), strreg(f.normalizedType), strreg(f.tag), flags); } } +void Generator::generateFunctionRevisions(QList<FunctionDef>& list, const char *functype) +{ + if (list.count()) + fprintf(out, "\n // %ss: revision\n", functype); + for (int i = 0; i < list.count(); ++i) { + const FunctionDef &f = list.at(i); + fprintf(out, " %4d,\n", f.revision); + } +} + void Generator::generateProperties() { // @@ -537,6 +561,9 @@ void Generator::generateProperties() if (p.notifyId != -1) flags |= Notify; + if (p.revision > 0) + flags |= Revisioned; + if (p.constant) flags |= Constant; if (p.final) @@ -562,6 +589,13 @@ void Generator::generateProperties() p.notifyId); } } + if (cdef->revisionedProperties) { + fprintf(out, "\n // properties: revision\n"); + for (int i = 0; i < cdef->propertyList.count(); ++i) { + const PropertyDef &p = cdef->propertyList.at(i); + fprintf(out, " %4d,\n", p.revision); + } + } } void Generator::generateEnums(int index) diff --git a/src/tools/moc/generator.h b/src/tools/moc/generator.h index fb6ad747..72b2b17 100644 --- a/src/tools/moc/generator.h +++ b/src/tools/moc/generator.h @@ -58,6 +58,7 @@ public: private: void generateClassInfos(); void generateFunctions(QList<FunctionDef> &list, const char *functype, int type); + void generateFunctionRevisions(QList<FunctionDef>& list, const char *functype); void generateEnums(int index); void generateProperties(); void generateMetacall(); diff --git a/src/tools/moc/keywords.cpp b/src/tools/moc/keywords.cpp index df1ba0d..7b84fd7 100644 --- a/src/tools/moc/keywords.cpp +++ b/src/tools/moc/keywords.cpp @@ -43,12 +43,12 @@ // DO NOT EDIT. static const short keyword_trans[][128] = { - {0,0,0,0,0,0,0,0,0,533,530,0,0,0,0,0, + {0,0,0,0,0,0,0,0,0,541,538,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 533,252,531,534,0,38,239,532,25,26,236,234,30,235,27,237, + 541,252,539,542,0,38,239,540,25,26,236,234,30,235,27,237, 22,22,22,22,22,22,22,22,22,22,34,41,23,39,24,43, 0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,21,8,8,8,8,8,8,8,8,8,31,535,32,238,8, + 8,21,8,8,8,8,8,8,8,8,8,31,543,32,238,8, 0,1,2,3,4,5,6,7,8,9,8,8,10,11,12,13, 14,8,15,16,17,18,19,20,8,8,8,36,245,37,248,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -190,7 +190,7 @@ static const short keyword_trans[][128] = { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,42,0,0,0,28,0, - 538,538,538,538,538,538,538,538,538,538,0,0,0,0,0,0, + 546,546,546,546,546,546,546,546,546,546,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -349,7 +349,7 @@ static const short keyword_trans[][128] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,537,0,0,0,0,536, + 0,0,0,0,0,0,0,0,0,0,545,0,0,0,0,544, 0,0,0,0,0,0,0,0,0,0,0,0,0,258,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -392,7 +392,7 @@ static const short keyword_trans[][128] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,439,388,378,383,364,0,448,0,0,0,0,0,358, - 370,0,0,436,0,0,0,0,0,0,0,0,0,0,0,0, + 370,0,530,436,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -983,6 +983,14 @@ static const struct {CHARACTER, 0, 84, 528, CHARACTER}, {CHARACTER, 0, 89, 529, CHARACTER}, {Q_PRIVATE_PROPERTY_TOKEN, 0, 0, 0, CHARACTER}, + {CHARACTER, 0, 69, 531, CHARACTER}, + {CHARACTER, 0, 86, 532, CHARACTER}, + {CHARACTER, 0, 73, 533, CHARACTER}, + {CHARACTER, 0, 83, 534, CHARACTER}, + {CHARACTER, 0, 73, 535, CHARACTER}, + {CHARACTER, 0, 79, 536, CHARACTER}, + {CHARACTER, 0, 78, 537, CHARACTER}, + {Q_REVISION_TOKEN, 0, 0, 0, CHARACTER}, {NEWLINE, 0, 0, 0, NOTOKEN}, {QUOTE, 0, 0, 0, NOTOKEN}, {SINGLEQUOTE, 0, 0, 0, NOTOKEN}, diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 2c24165..b8b823c 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -335,6 +335,23 @@ bool Moc::testFunctionAttribute(Token tok, FunctionDef *def) return false; } +bool Moc::testFunctionRevision(FunctionDef *def) +{ + if (test(Q_REVISION_TOKEN)) { + next(LPAREN); + QByteArray revision = lexemUntil(RPAREN); + revision.remove(0, 1); + revision.chop(1); + bool ok = false; + def->revision = revision.toInt(&ok); + if (!ok || def->revision < 0) + error("Invalid revision"); + return true; + } + + return false; +} + // returns false if the function should be ignored bool Moc::parseFunction(FunctionDef *def, bool inMacro) { @@ -342,7 +359,7 @@ bool Moc::parseFunction(FunctionDef *def, bool inMacro) //skip modifiers and attributes while (test(INLINE) || test(STATIC) || (test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual - || testFunctionAttribute(def)) {} + || testFunctionAttribute(def) || testFunctionRevision(def)) {} bool templateFunction = (lookup() == TEMPLATE); def->type = parseType(); if (def->type.name.isEmpty()) { @@ -433,7 +450,7 @@ bool Moc::parseMaybeFunction(const ClassDef *cdef, FunctionDef *def) //skip modifiers and attributes while (test(EXPLICIT) || test(INLINE) || test(STATIC) || (test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual - || testFunctionAttribute(def)) {} + || testFunctionAttribute(def) || testFunctionRevision(def)) {} bool tilde = test(TILDE); def->type = parseType(); if (def->type.name.isEmpty()) @@ -694,6 +711,8 @@ void Moc::parse() funcDef.arguments.removeLast(); def.slotList += funcDef; } + if (funcDef.revision > 0) + ++def.revisionedMethods; } else if (funcDef.isSignal) { def.signalList += funcDef; while (funcDef.arguments.size() > 0 && funcDef.arguments.last().isDefault) { @@ -701,6 +720,8 @@ void Moc::parse() funcDef.arguments.removeLast(); def.signalList += funcDef; } + if (funcDef.revision > 0) + ++def.revisionedMethods; } else if (funcDef.isInvokable) { def.methodList += funcDef; while (funcDef.arguments.size() > 0 && funcDef.arguments.last().isDefault) { @@ -708,6 +729,8 @@ void Moc::parse() funcDef.arguments.removeLast(); def.methodList += funcDef; } + if (funcDef.revision > 0) + ++def.revisionedMethods; } } } else { @@ -806,6 +829,18 @@ QList<QMetaObject*> Moc::generate(bool ignoreProperties) void Moc::parseSlots(ClassDef *def, FunctionDef::Access access) { + int defaultRevision = -1; + if (test(Q_REVISION_TOKEN)) { + next(LPAREN); + QByteArray revision = lexemUntil(RPAREN); + revision.remove(0, 1); + revision.chop(1); + bool ok = false; + defaultRevision = revision.toInt(&ok); + if (!ok || defaultRevision < 0) + error("Invalid revision"); + } + next(COLON); while (inClass(def) && hasNext()) { switch (next()) { @@ -831,6 +866,12 @@ void Moc::parseSlots(ClassDef *def, FunctionDef::Access access) funcDef.access = access; if (!parseFunction(&funcDef)) continue; + if (funcDef.revision > 0) { + ++def->revisionedMethods; + } else if (defaultRevision != -1) { + funcDef.revision = defaultRevision; + ++def->revisionedMethods; + } def->slotList += funcDef; while (funcDef.arguments.size() > 0 && funcDef.arguments.last().isDefault) { funcDef.wasCloned = true; @@ -842,6 +883,18 @@ void Moc::parseSlots(ClassDef *def, FunctionDef::Access access) void Moc::parseSignals(ClassDef *def) { + int defaultRevision = -1; + if (test(Q_REVISION_TOKEN)) { + next(LPAREN); + QByteArray revision = lexemUntil(RPAREN); + revision.remove(0, 1); + revision.chop(1); + bool ok = false; + defaultRevision = revision.toInt(&ok); + if (!ok || defaultRevision < 0) + error("Invalid revision"); + } + next(COLON); while (inClass(def) && hasNext()) { switch (next()) { @@ -869,6 +922,12 @@ void Moc::parseSignals(ClassDef *def) warning("Signals cannot be declared virtual"); if (funcDef.inlineCode) error("Not a signal declaration"); + if (funcDef.revision > 0) { + ++def->revisionedMethods; + } else if (defaultRevision != -1) { + funcDef.revision = defaultRevision; + ++def->revisionedMethods; + } def->signalList += funcDef; while (funcDef.arguments.size() > 0 && funcDef.arguments.last().isDefault) { funcDef.wasCloned = true; @@ -911,7 +970,6 @@ void Moc::createPropertyDef(PropertyDef &propDef) propDef.name = lexem(); while (test(IDENTIFIER)) { QByteArray l = lexem(); - if (l[0] == 'C' && l == "CONSTANT") { propDef.constant = true; continue; @@ -923,6 +981,10 @@ void Moc::createPropertyDef(PropertyDef &propDef) QByteArray v, v2; if (test(LPAREN)) { v = lexemUntil(RPAREN); + } else if (test(INTEGER_LITERAL)) { + v = lexem(); + if (l != "REVISION") + error(1); } else { next(IDENTIFIER); v = lexem(); @@ -937,7 +999,12 @@ void Moc::createPropertyDef(PropertyDef &propDef) propDef.read = v; else if (l == "RESET") propDef.reset = v + v2; - else + else if (l == "REVISION") { + bool ok = false; + propDef.revision = v.toInt(&ok); + if (!ok || propDef.revision < 0) + error(1); + } else error(2); break; case 'S': @@ -1002,6 +1069,8 @@ void Moc::parseProperty(ClassDef *def) if(!propDef.notify.isEmpty()) def->notifyableProperties++; + if (propDef.revision > 0) + ++def->revisionedProperties; def->propertyList += propDef; } @@ -1028,6 +1097,8 @@ void Moc::parsePrivateProperty(ClassDef *def) if(!propDef.notify.isEmpty()) def->notifyableProperties++; + if (propDef.revision > 0) + ++def->revisionedProperties; def->propertyList += propDef; } @@ -1177,6 +1248,9 @@ void Moc::parseSlotInPrivate(ClassDef *def, FunctionDef::Access access) funcDef.arguments.removeLast(); def->slotList += funcDef; } + if (funcDef.revision > 0) + ++def->revisionedMethods; + } QByteArray Moc::lexemUntil(Token target) diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h index 5e47d9a..c07ec0b 100644 --- a/src/tools/moc/moc.h +++ b/src/tools/moc/moc.h @@ -86,7 +86,7 @@ struct FunctionDef FunctionDef(): returnTypeIsVolatile(false), access(Private), isConst(false), isVirtual(false), inlineCode(false), wasCloned(false), isCompat(false), isInvokable(false), isScriptable(false), isSlot(false), isSignal(false), - isConstructor(false), isDestructor(false), isAbstract(false) {} + isConstructor(false), isDestructor(false), isAbstract(false), revision(0) {} Type type; QByteArray normalizedType; QByteArray tag; @@ -111,11 +111,13 @@ struct FunctionDef bool isConstructor; bool isDestructor; bool isAbstract; + + int revision; }; struct PropertyDef { - PropertyDef():notifyId(-1), constant(false), final(false), gspec(ValueSpec){} + PropertyDef():notifyId(-1), constant(false), final(false), gspec(ValueSpec), revision(0){} QByteArray name, type, read, write, reset, designable, scriptable, editable, stored, user, notify, inPrivateClass; int notifyId; bool constant; @@ -128,6 +130,7 @@ struct PropertyDef s += name.mid(1); return (s == write); } + int revision; }; @@ -139,7 +142,8 @@ struct ClassInfoDef struct ClassDef { ClassDef(): - hasQObject(false), hasQGadget(false), notifyableProperties(0), begin(0), end(0){} + hasQObject(false), hasQGadget(false), notifyableProperties(0) + , revisionedMethods(0), revisionedProperties(0), begin(0), end(0){} QByteArray classname; QByteArray qualified; QList<QPair<QByteArray, FunctionDef::Access> > superclassList; @@ -164,6 +168,8 @@ struct ClassDef { QMap<QByteArray, bool> enumDeclarations; QList<EnumDef> enumList; QMap<QByteArray, QByteArray> flagAliases; + int revisionedMethods; + int revisionedProperties; int begin; int end; @@ -236,6 +242,7 @@ public: // in FunctionDef accordingly bool testFunctionAttribute(FunctionDef *def); bool testFunctionAttribute(Token tok, FunctionDef *def); + bool testFunctionRevision(FunctionDef *def); void checkSuperClasses(ClassDef *def); void checkProperties(ClassDef* cdef); diff --git a/src/tools/moc/token.cpp b/src/tools/moc/token.cpp index 3da9446..27d5146 100644 --- a/src/tools/moc/token.cpp +++ b/src/tools/moc/token.cpp @@ -180,6 +180,7 @@ const char *tokenTypeName(Token t) case Q_SLOT_TOKEN: return "Q_SLOT_TOKEN"; case Q_PRIVATE_SLOT_TOKEN: return "Q_PRIVATE_SLOT_TOKEN"; case Q_PRIVATE_PROPERTY_TOKEN: return "Q_PRIVATE_PROPERTY_TOKEN"; + case Q_REVISION_TOKEN: return "Q_REVISION_TOKEN"; case SPECIAL_TREATMENT_MARK: return "SPECIAL_TREATMENT_MARK"; case MOC_INCLUDE_BEGIN: return "MOC_INCLUDE_BEGIN"; case MOC_INCLUDE_END: return "MOC_INCLUDE_END"; diff --git a/src/tools/moc/token.h b/src/tools/moc/token.h index 6ca3d84..8b72eb6 100644 --- a/src/tools/moc/token.h +++ b/src/tools/moc/token.h @@ -186,6 +186,7 @@ enum Token { Q_INVOKABLE_TOKEN, Q_SCRIPTABLE_TOKEN, Q_PRIVATE_PROPERTY_TOKEN, + Q_REVISION_TOKEN, Q_META_TOKEN_END, SPECIAL_TREATMENT_MARK = Q_META_TOKEN_END, MOC_INCLUDE_BEGIN, diff --git a/src/tools/moc/util/generate_keywords.cpp b/src/tools/moc/util/generate_keywords.cpp index 88f187d..e9463e1 100644 --- a/src/tools/moc/util/generate_keywords.cpp +++ b/src/tools/moc/util/generate_keywords.cpp @@ -249,6 +249,7 @@ static const Keyword keywords[] = { { "Q_SLOT", "Q_SLOT_TOKEN" }, { "Q_SCRIPTABLE", "Q_SCRIPTABLE_TOKEN" }, { "Q_PRIVATE_PROPERTY", "Q_PRIVATE_PROPERTY_TOKEN" }, + { "Q_REVISION", "Q_REVISION_TOKEN" }, { "\n", "NEWLINE" }, { "\"", "QUOTE" }, { "\'", "SINGLEQUOTE" }, diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp index bb23f49..a634349 100644 --- a/tests/auto/moc/tst_moc.cpp +++ b/tests/auto/moc/tst_moc.cpp @@ -493,6 +493,7 @@ private slots: void QTBUG5590_dummyProperty(); void QTBUG12260_defaultTemplate(); void notifyError(); + void revisions(); signals: void sigWithUnsignedArg(unsigned foo); void sigWithSignedArg(signed foo); @@ -507,6 +508,7 @@ private: bool user2() { return false; }; bool user3() { return false; }; bool userFunction(){ return false; }; + template <class T> void revisions_T(); private: QString qtIncludePath; @@ -1384,6 +1386,117 @@ void tst_Moc::notifyError() #endif } +// If changed, update VersionTestNotify below +class VersionTest : public QObject +{ + Q_OBJECT + Q_PROPERTY(int prop1 READ foo) + Q_PROPERTY(int prop2 READ foo REVISION 2) + Q_ENUMS(TestEnum); + +public: + int foo() const { return 0; } + + Q_INVOKABLE void method1() {} + Q_INVOKABLE Q_REVISION(4) void method2() {} + + enum TestEnum { One, Two }; + +public slots: + void slot1() {} + Q_REVISION(3) void slot2() {} + +signals: + void signal1(); + Q_REVISION(5) void signal2(); + +public slots Q_REVISION(6): + void slot3() {} + void slot4() {} + +signals Q_REVISION(7): + void signal3(); + void signal4(); +}; + +// If changed, update VersionTest above +class VersionTestNotify : public QObject +{ + Q_OBJECT + Q_PROPERTY(int prop1 READ foo NOTIFY fooChanged) + Q_PROPERTY(int prop2 READ foo REVISION 2) + Q_ENUMS(TestEnum); + +public: + int foo() const { return 0; } + + Q_INVOKABLE void method1() {} + Q_INVOKABLE Q_REVISION(4) void method2() {} + + enum TestEnum { One, Two }; + +public slots: + void slot1() {} + Q_REVISION(3) void slot2() {} + +signals: + void fooChanged(); + void signal1(); + Q_REVISION(5) void signal2(); + +public slots Q_REVISION(6): + void slot3() {} + void slot4() {} + +signals Q_REVISION(7): + void signal3(); + void signal4(); +}; + +template <class T> +void tst_Moc::revisions_T() +{ + int idx = T::staticMetaObject.indexOfProperty("prop1"); + QVERIFY(T::staticMetaObject.property(idx).revision() == 0); + idx = T::staticMetaObject.indexOfProperty("prop2"); + QVERIFY(T::staticMetaObject.property(idx).revision() == 2); + + idx = T::staticMetaObject.indexOfMethod("method1()"); + QVERIFY(T::staticMetaObject.method(idx).revision() == 0); + idx = T::staticMetaObject.indexOfMethod("method2()"); + QVERIFY(T::staticMetaObject.method(idx).revision() == 4); + + idx = T::staticMetaObject.indexOfSlot("slot1()"); + QVERIFY(T::staticMetaObject.method(idx).revision() == 0); + idx = T::staticMetaObject.indexOfSlot("slot2()"); + QVERIFY(T::staticMetaObject.method(idx).revision() == 3); + + idx = T::staticMetaObject.indexOfSlot("slot3()"); + QVERIFY(T::staticMetaObject.method(idx).revision() == 6); + idx = T::staticMetaObject.indexOfSlot("slot4()"); + QVERIFY(T::staticMetaObject.method(idx).revision() == 6); + + idx = T::staticMetaObject.indexOfSignal("signal1()"); + QVERIFY(T::staticMetaObject.method(idx).revision() == 0); + idx = T::staticMetaObject.indexOfSignal("signal2()"); + QVERIFY(T::staticMetaObject.method(idx).revision() == 5); + + idx = T::staticMetaObject.indexOfSignal("signal3()"); + QVERIFY(T::staticMetaObject.method(idx).revision() == 7); + idx = T::staticMetaObject.indexOfSignal("signal4()"); + QVERIFY(T::staticMetaObject.method(idx).revision() == 7); + + idx = T::staticMetaObject.indexOfEnumerator("TestEnum"); + QCOMPARE(T::staticMetaObject.enumerator(idx).keyCount(), 2); + QCOMPARE(T::staticMetaObject.enumerator(idx).key(0), "One"); +} + +// test using both class that has properties with and without NOTIFY signals +void tst_Moc::revisions() +{ + revisions_T<VersionTest>(); + revisions_T<VersionTestNotify>(); +} QTEST_APPLESS_MAIN(tst_Moc) #include "tst_moc.moc" -- cgit v0.12 From ffd499eb6ff64df1833625f64dbbf92e0e0746d4 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@nokia.com> Date: Wed, 5 Jan 2011 13:57:17 +1000 Subject: Support property/method versions in QML Use metaobject revisioning to exclude properties/revisions added in later versions from interfering with earlier versions. Task-number: QTBUG-13451 Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarative.h | 77 +++++++++- .../qml/qdeclarativecompiledbindings.cpp | 4 + src/declarative/qml/qdeclarativecompiler.cpp | 17 ++- src/declarative/qml/qdeclarativedata_p.h | 5 +- src/declarative/qml/qdeclarativeinstruction_p.h | 1 + src/declarative/qml/qdeclarativemetatype.cpp | 83 ++++++++++- src/declarative/qml/qdeclarativemetatype_p.h | 5 + .../qml/qdeclarativeobjectscriptclass.cpp | 14 ++ src/declarative/qml/qdeclarativeprivate.h | 1 + src/declarative/qml/qdeclarativepropertycache.cpp | 3 +- src/declarative/qml/qdeclarativepropertycache_p.h | 4 +- src/declarative/qml/qdeclarativescriptparser.cpp | 1 - src/declarative/qml/qdeclarativevaluetype.cpp | 1 + src/declarative/qml/qdeclarativevme.cpp | 4 + src/declarative/qml/qmetaobjectbuilder.cpp | 33 +---- src/declarative/qml/qmetaobjectbuilder_p.h | 2 - .../util/qdeclarativeopenmetaobject.cpp | 1 - .../data/metaobjectRevision.qml | 7 + .../data/metaobjectRevision2.qml | 9 ++ .../data/metaobjectRevision3.qml | 8 + .../data/metaobjectRevisionErrors.qml | 14 ++ .../data/metaobjectRevisionErrors2.qml | 24 +++ .../data/metaobjectRevisionErrors3.qml | 36 +++++ .../qdeclarativeecmascript/testtypes.cpp | 9 ++ .../declarative/qdeclarativeecmascript/testtypes.h | 161 ++++++++++++++++++++ .../tst_qdeclarativeecmascript.cpp | 82 +++++++++++ .../data/metaobjectRevision.1.errors.txt | 1 + .../data/metaobjectRevision.1.qml | 8 + .../data/metaobjectRevision.2.errors.txt | 1 + .../data/metaobjectRevision.2.qml | 7 + .../data/metaobjectRevision.3.errors.txt | 1 + .../data/metaobjectRevision.3.qml | 10 ++ .../qdeclarativelanguage/data/revisions10.qml | 8 + .../qdeclarativelanguage/data/revisions11.qml | 10 ++ .../data/revisionsbasesub11.qml | 16 ++ .../qdeclarativelanguage/data/revisionssub10.qml | 10 ++ .../qdeclarativelanguage/data/revisionssub11.qml | 12 ++ .../declarative/qdeclarativelanguage/testtypes.cpp | 9 ++ .../declarative/qdeclarativelanguage/testtypes.h | 163 +++++++++++++++++++++ .../tst_qdeclarativelanguage.cpp | 62 ++++++++ .../qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp | 12 +- 41 files changed, 883 insertions(+), 53 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/revisions10.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/revisionssub10.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h index f0c62f4..8a6d068 100644 --- a/src/declarative/qml/qdeclarative.h +++ b/src/declarative/qml/qdeclarative.h @@ -113,6 +113,7 @@ int qmlRegisterType() 0, 0, + 0, 0 }; @@ -148,6 +149,7 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin 0, 0, + 0, 0 }; @@ -181,12 +183,82 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c 0, 0, + 0, 0 }; return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); } +template<typename T, int metaObjectRevision> +int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QDeclarativeListProperty<" + name + ">"); + + QDeclarativePrivate::RegisterType type = { + 1, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), + sizeof(T), QDeclarativePrivate::createInto<T>, + QString(), + + uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, + + QDeclarativePrivate::attachedPropertiesFunc<T>(), + QDeclarativePrivate::attachedPropertiesMetaObject<T>(), + + QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), + QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), + QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), + + 0, 0, + + 0, + metaObjectRevision + }; + + return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); +} + +template<typename T, int metaObjectRevision> +int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor) +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QDeclarativeListProperty<" + name + ">"); + + QDeclarativePrivate::RegisterType type = { + 1, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), + sizeof(T), QDeclarativePrivate::createInto<T>, + QString(), + + uri, versionMajor, versionMinor, 0, &T::staticMetaObject, + + QDeclarativePrivate::attachedPropertiesFunc<T>(), + QDeclarativePrivate::attachedPropertiesMetaObject<T>(), + + QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), + QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), + QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), + + 0, 0, + + 0, + metaObjectRevision + }; + + return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); +} + + template<typename T, typename E> int qmlRegisterExtendedType() { @@ -214,6 +286,7 @@ int qmlRegisterExtendedType() QDeclarativePrivate::createParent<E>, &E::staticMetaObject, + 0, 0 }; @@ -255,6 +328,7 @@ int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor, QDeclarativePrivate::createParent<E>, &E::staticMetaObject, + 0, 0 }; @@ -309,7 +383,8 @@ int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor, 0, 0, - parser + parser, + 0 }; return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp index 48f8b84..619016b 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings.cpp +++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp @@ -2527,6 +2527,10 @@ bool QDeclarativeBindingCompilerPrivate::fetch(Result &rv, const QMetaObject *mo rv.metaObject = 0; rv.type = 0; + //XXX binding optimizer doesn't handle properties with a revision + if (prop.revision() > 0) + return false; + int fastFetchIndex = fastProperties()->accessorIndexForProperty(mo, idx); Instr fetch; diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index b2b0990..0c56165 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -902,6 +902,7 @@ void QDeclarativeCompiler::genObject(QDeclarativeParser::Object *obj) create.line = obj->location.start.line; create.createSimple.create = output->types.at(obj->type).type->createFunction(); create.createSimple.typeSize = output->types.at(obj->type).type->createSize(); + create.createSimple.type = obj->type; create.createSimple.column = obj->location.start.column; output->bytecode << create; @@ -1351,7 +1352,8 @@ bool QDeclarativeCompiler::buildSignal(QDeclarativeParser::Property *prop, QDecl if(name[0] >= 'A' && name[0] <= 'Z') name[0] = name[0] - 'A' + 'a'; - int sigIdx = QDeclarativePropertyPrivate::findSignalByName(obj->metaObject(), name).methodIndex(); + QMetaMethod method = QDeclarativePropertyPrivate::findSignalByName(obj->metaObject(), name); + int sigIdx = method.methodIndex(); if (sigIdx == -1) { @@ -1364,6 +1366,13 @@ bool QDeclarativeCompiler::buildSignal(QDeclarativeParser::Property *prop, QDecl if (prop->value || prop->values.count() != 1) COMPILE_EXCEPTION(prop, tr("Incorrectly specified signal assignment")); + if (method.revision() > 0) { + QDeclarativeType *type = output->types.at(obj->type).type; + if (!type->isMethodAvailable(sigIdx, method.revision())) { + COMPILE_EXCEPTION(prop, tr("Signal \"%1\" not available in %2 %3.%4").arg(QString::fromUtf8(prop->name)).arg(QString::fromUtf8(type->qmlTypeName())).arg(obj->majorVersion).arg(obj->minorVersion)); + } + } + prop->index = sigIdx; obj->addSignalProperty(prop); @@ -1481,6 +1490,12 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop, // successful index resolution if (p.name()) { prop->type = p.userType(); + if (p.revision() > 0) { + QDeclarativeType *type = output->types.at(obj->type).type; + if (!type->isPropertyAvailable(prop->index, p.revision())) { + COMPILE_EXCEPTION(prop, tr("Property \"%1\" not available in %2 %3.%4").arg(QString::fromUtf8(prop->name)).arg(QString::fromUtf8(type->qmlTypeName())).arg(obj->majorVersion).arg(obj->minorVersion)); + } + } } // Check if this is an alias diff --git a/src/declarative/qml/qdeclarativedata_p.h b/src/declarative/qml/qdeclarativedata_p.h index 4767169..81f279c 100644 --- a/src/declarative/qml/qdeclarativedata_p.h +++ b/src/declarative/qml/qdeclarativedata_p.h @@ -66,6 +66,7 @@ class QDeclarativePropertyCache; class QDeclarativeContextData; class QDeclarativeNotifier; class QDeclarativeDataExtended; +class QDeclarativeType; // This class is structured in such a way, that simply zero'ing it is the // default state for elemental object allocations. This is crucial in the // workings of the QDeclarativeInstruction::CreateSimpleObject instruction. @@ -77,7 +78,7 @@ public: : ownMemory(true), ownContext(false), indestructible(true), explicitIndestructibleSet(false), context(0), outerContext(0), bindings(0), nextContextObject(0), prevContextObject(0), bindingBitsSize(0), bindingBits(0), lineNumber(0), columnNumber(0), deferredComponent(0), deferredIdx(0), - scriptValue(0), objectDataRefCount(0), propertyCache(0), guards(0), extendedData(0) { + scriptValue(0), objectDataRefCount(0), propertyCache(0), guards(0), type(0), extendedData(0) { init(); } @@ -136,6 +137,8 @@ public: QDeclarativeGuard<QObject> *guards; + const QDeclarativeType *type; + static QDeclarativeData *get(const QObject *object, bool create = false) { QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object)); if (priv->wasDeleted) { diff --git a/src/declarative/qml/qdeclarativeinstruction_p.h b/src/declarative/qml/qdeclarativeinstruction_p.h index 94676fc..4030bab 100644 --- a/src/declarative/qml/qdeclarativeinstruction_p.h +++ b/src/declarative/qml/qdeclarativeinstruction_p.h @@ -182,6 +182,7 @@ public: struct CreateSimpleInstruction { void (*create)(void *); int typeSize; + int type; ushort column; }; struct StoreMetaInstruction { diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index 7a78a1f..1f387c4 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -134,10 +134,13 @@ public: bool m_isInterface : 1; const char *m_iid; + QByteArray m_module; QByteArray m_name; int m_version_maj; int m_version_min; int m_typeId; int m_listId; + int m_revision; + mutable QDeclarativeType *m_superType; int m_allocationSize; void (*m_newFunc)(void *); @@ -155,6 +158,7 @@ public: int m_index; QDeclarativeCustomParser *m_customParser; mutable volatile bool m_isSetup:1; + mutable bool m_haveSuperType : 1; mutable QList<QDeclarativeProxyMetaObject::ProxyData> m_metaObjects; static QHash<const QMetaObject *, int> m_attachedPropertyIds; @@ -163,10 +167,10 @@ public: QHash<const QMetaObject *, int> QDeclarativeTypePrivate::m_attachedPropertyIds; QDeclarativeTypePrivate::QDeclarativeTypePrivate() -: m_isInterface(false), m_iid(0), m_typeId(0), m_listId(0), +: m_isInterface(false), m_iid(0), m_typeId(0), m_listId(0), m_revision(0), m_superType(0), m_allocationSize(0), m_newFunc(0), m_baseMetaObject(0), m_attachedPropertiesFunc(0), m_attachedPropertiesType(0), m_parserStatusCast(-1), m_propertyValueSourceCast(-1), m_propertyValueInterceptorCast(-1), - m_extFunc(0), m_extMetaObject(0), m_index(-1), m_customParser(0), m_isSetup(false) + m_extFunc(0), m_extMetaObject(0), m_index(-1), m_customParser(0), m_isSetup(false), m_haveSuperType(false) { } @@ -192,9 +196,11 @@ QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::Registe if (type.uri) name += '/'; name += type.elementName; + d->m_module = type.uri; d->m_name = name; d->m_version_maj = type.versionMajor; d->m_version_min = type.versionMinor; + d->m_revision = type.revision; d->m_typeId = type.typeId; d->m_listId = type.listId; d->m_allocationSize = type.objectSize; @@ -243,6 +249,56 @@ bool QDeclarativeType::availableInVersion(int vmajor, int vminor) const return vmajor > d->m_version_maj || (vmajor == d->m_version_maj && vminor >= d->m_version_min); } +bool QDeclarativeType::availableInVersion(const QByteArray &module, int vmajor, int vminor) const +{ + return module == d->m_module && (vmajor > d->m_version_maj || (vmajor == d->m_version_maj && vminor >= d->m_version_min)); +} + +// returns the nearest _registered_ super class +QDeclarativeType *QDeclarativeType::superType() const +{ + if (!d->m_haveSuperType) { + const QMetaObject *mo = d->m_baseMetaObject->superClass(); + while (mo && !d->m_superType) { + d->m_superType = QDeclarativeMetaType::qmlType(mo, d->m_module, d->m_version_maj, d->m_version_min); + mo = mo->superClass(); + } + d->m_haveSuperType = true; + } + + return d->m_superType; +} + +bool QDeclarativeType::isPropertyAvailable(int index, int revision) const +{ + if (revision == 0) + return true; + + if (index < d->m_baseMetaObject->propertyOffset()) { + if (QDeclarativeType *super = superType()) + return super->isPropertyAvailable(index, revision); + } else if (index < d->m_baseMetaObject->propertyOffset() + d->m_baseMetaObject->propertyCount()) { + return d->m_revision >= revision; + } + + return false; +} + +bool QDeclarativeType::isMethodAvailable(int index, int revision) const +{ + if (revision == 0) + return true; + + if (index < d->m_baseMetaObject->methodOffset()) { + if (QDeclarativeType *super = superType()) + return super->isMethodAvailable(index, revision); + } else if (index < d->m_baseMetaObject->methodOffset() + d->m_baseMetaObject->methodCount()) { + return d->m_revision >= revision; + } + + return false; +} + static void clone(QMetaObjectBuilder &builder, const QMetaObject *mo, const QMetaObject *ignoreStart, const QMetaObject *ignoreEnd) { @@ -572,7 +628,7 @@ int registerType(const QDeclarativePrivate::RegisterType &type) if (!dtype->qmlTypeName().isEmpty()) data->nameToType.insertMulti(dtype->qmlTypeName(), dtype); - data->metaObjectToType.insert(dtype->baseMetaObject(), dtype); + data->metaObjectToType.insertMulti(dtype->baseMetaObject(), dtype); if (data->objects.size() <= type.typeId) data->objects.resize(type.typeId + 16); @@ -862,6 +918,27 @@ QDeclarativeType *QDeclarativeMetaType::qmlType(const QMetaObject *metaObject) } /*! + Returns the type (if any) that corresponds to the \a metaObject in version specified + by \a version_major and \a version_minor in module specified by \a uri. Returns null if no + type is registered. +*/ +QDeclarativeType *QDeclarativeMetaType::qmlType(const QMetaObject *metaObject, const QByteArray &module, int version_major, int version_minor) +{ + QReadLocker lock(metaTypeDataLock()); + QDeclarativeMetaTypeData *data = metaTypeData(); + + QDeclarativeMetaTypeData::MetaObjects::const_iterator it = data->metaObjectToType.find(metaObject); + while (it != data->metaObjectToType.end() && it.key() == metaObject) { + QDeclarativeType *t = *it; + if (version_major < 0 || t->availableInVersion(module, version_major,version_minor)) + return t; + ++it; + } + + return 0; +} + +/*! Returns the type (if any) that corresponds to the QVariant::Type \a userType. Returns null if no type is registered. */ diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h index 9c486d3..d9a3795 100644 --- a/src/declarative/qml/qdeclarativemetatype_p.h +++ b/src/declarative/qml/qdeclarativemetatype_p.h @@ -76,6 +76,7 @@ public: static QDeclarativeType *qmlType(const QByteArray &, int, int); static QDeclarativeType *qmlType(const QMetaObject *); + static QDeclarativeType *qmlType(const QMetaObject *metaObject, const QByteArray &module, int version_major, int version_minor); static QDeclarativeType *qmlType(int); static QMetaProperty defaultProperty(const QMetaObject *); @@ -115,6 +116,9 @@ public: int majorVersion() const; int minorVersion() const; bool availableInVersion(int vmajor, int vminor) const; + bool availableInVersion(const QByteArray &module, int vmajor, int vminor) const; + bool isPropertyAvailable(int index, int revision) const; + bool isMethodAvailable(int index, int revision) const; QObject *create() const; void create(QObject **, void **, size_t) const; @@ -149,6 +153,7 @@ public: int index() const; private: + QDeclarativeType *superType() const; friend class QDeclarativeTypePrivate; friend struct QDeclarativeMetaTypeData; friend int registerType(const QDeclarativePrivate::RegisterType &); diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index b0bc5bb..090eeda 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -166,6 +166,20 @@ QDeclarativeObjectScriptClass::queryProperty(QObject *obj, const Identifier &nam QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine); lastData = QDeclarativePropertyCache::property(engine, obj, name, local); + if (lastData && lastData->revision > 0 && (hints & ImplicitObject)) { + QDeclarativeData *data = QDeclarativeData::get(obj); + if (data) { + if (!data->type) { + lastData = 0; + } else if (lastData->flags & QDeclarativePropertyCache::Data::IsFunction) { + if (!data->type->isMethodAvailable(lastData->coreIndex, lastData->revision)) + lastData = 0; + } else if (!data->type->isPropertyAvailable(lastData->coreIndex, lastData->revision)) { + lastData = 0; + } + } + } + if (lastData) return QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess; diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h index 388c92e..a4fc4c1 100644 --- a/src/declarative/qml/qdeclarativeprivate.h +++ b/src/declarative/qml/qdeclarativeprivate.h @@ -214,6 +214,7 @@ namespace QDeclarativePrivate const QMetaObject *extensionMetaObject; QDeclarativeCustomParser *customParser; + int revision; }; struct RegisterInterface { diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp index dd9a224..76c9eb9 100644 --- a/src/declarative/qml/qdeclarativepropertycache.cpp +++ b/src/declarative/qml/qdeclarativepropertycache.cpp @@ -88,6 +88,7 @@ void QDeclarativePropertyCache::Data::load(const QMetaProperty &p, QDeclarativeE coreIndex = p.propertyIndex(); notifyIndex = p.notifySignalIndex(); flags = flagsForProperty(p, engine); + revision = p.revision(); } void QDeclarativePropertyCache::Data::load(const QMetaMethod &m) @@ -106,6 +107,7 @@ void QDeclarativePropertyCache::Data::load(const QMetaMethod &m) QList<QByteArray> params = m.parameterTypes(); if (!params.isEmpty()) flags |= Data::HasArguments; + revision = m.revision(); } @@ -235,7 +237,6 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb Data::Flag propertyFlags, Data::Flag methodFlags, Data::Flag signalFlags) { QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine); - int methodCount = metaObject->methodCount(); // 3 to block the destroyed signal and the deleteLater() slot int methodOffset = qMax(3, metaObject->methodOffset()); diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h index f7c5daa..3f7f9ef 100644 --- a/src/declarative/qml/qdeclarativepropertycache_p.h +++ b/src/declarative/qml/qdeclarativepropertycache_p.h @@ -110,6 +110,7 @@ public: int notifyIndex; // When !IsFunction int relatedIndex; // When IsFunction }; + int revision; static Flags flagsForProperty(const QMetaProperty &, QDeclarativeEngine *engine = 0); void load(const QMetaProperty &, QDeclarativeEngine *engine = 0); @@ -176,7 +177,8 @@ bool QDeclarativePropertyCache::Data::operator==(const QDeclarativePropertyCache return flags == other.flags && propType == other.propType && coreIndex == other.coreIndex && - notifyIndex == other.notifyIndex; + notifyIndex == other.notifyIndex && + revision == other.revision; } QDeclarativePropertyCache::Data * diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index 57cc9ab..e32a3d2 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -307,7 +307,6 @@ ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName, obj->location = location; if (propertyCount) { - Property *prop = currentProperty(); Value *v = new Value; v->object = obj; diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp index 5dc6ffd..bf02de8 100644 --- a/src/declarative/qml/qdeclarativevaluetype.cpp +++ b/src/declarative/qml/qdeclarativevaluetype.cpp @@ -71,6 +71,7 @@ int qmlRegisterValueTypeEnums(const char *uri, int versionMajor, int versionMino 0, 0, + 0, 0 }; diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index c742dec..6ee653b 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -194,6 +194,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarativeData *ddata = QDeclarativeData::get(o); Q_ASSERT(ddata); + if (types.at(instr.create.type).type) + ddata->type = types.at(instr.create.type).type; if (stack.isEmpty()) { if (ddata->context) { @@ -249,6 +251,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarativeData *ddata = (QDeclarativeData *)(((const char *)o) + instr.createSimple.typeSize); + if (types.at(instr.createSimple.type).type) + ddata->type = types.at(instr.createSimple.type).type; ddata->lineNumber = instr.line; ddata->columnNumber = instr.createSimple.column; diff --git a/src/declarative/qml/qmetaobjectbuilder.cpp b/src/declarative/qml/qmetaobjectbuilder.cpp index dfe89f8..60cd6a9 100644 --- a/src/declarative/qml/qmetaobjectbuilder.cpp +++ b/src/declarative/qml/qmetaobjectbuilder.cpp @@ -122,7 +122,7 @@ enum PropertyFlags { User = 0x00100000, ResolveUser = 0x00200000, Notify = 0x00400000, - Dynamic = 0x00800000 + Revisioned = 0x00800000 }; enum MethodFlags { @@ -139,7 +139,8 @@ enum MethodFlags { MethodCompatibility = 0x10, MethodCloned = 0x20, - MethodScriptable = 0x40 + MethodScriptable = 0x40, + MethodRevisioned = 0x80 }; struct QMetaObjectPrivate @@ -2277,21 +2278,6 @@ bool QMetaPropertyBuilder::isEnumOrFlag() const } /*! - Returns true if the property has the dynamic flag set; - otherwise returns false. The default value is false. - - \sa setDynamic() -*/ -bool QMetaPropertyBuilder::isDynamic() const -{ - QMetaPropertyBuilderPrivate *d = d_func(); - if (d) - return d->flag(Dynamic); - else - return false; -} - -/*! Sets this property to readable if \a value is true. \sa isReadable(), setWritable() @@ -2415,19 +2401,6 @@ void QMetaPropertyBuilder::setEnumOrFlag(bool value) } /*! - Sets this property to have the dynamic flag if \a value is - true. - - \sa isDynamic() -*/ -void QMetaPropertyBuilder::setDynamic(bool value) -{ - QMetaPropertyBuilderPrivate *d = d_func(); - if (d) - d->setFlag(Dynamic, value); -} - -/*! \class QMetaEnumBuilder \internal \brief The QMetaEnumBuilder class enables modifications to an enumerator definition on a meta object builder. diff --git a/src/declarative/qml/qmetaobjectbuilder_p.h b/src/declarative/qml/qmetaobjectbuilder_p.h index a90ba63..c270f60 100644 --- a/src/declarative/qml/qmetaobjectbuilder_p.h +++ b/src/declarative/qml/qmetaobjectbuilder_p.h @@ -258,7 +258,6 @@ public: bool isUser() const; bool hasStdCppSet() const; bool isEnumOrFlag() const; - bool isDynamic() const; void setReadable(bool value); void setWritable(bool value); @@ -270,7 +269,6 @@ public: void setUser(bool value); void setStdCppSet(bool value); void setEnumOrFlag(bool value); - void setDynamic(bool value); private: const QMetaObjectBuilder *_mobj; diff --git a/src/declarative/util/qdeclarativeopenmetaobject.cpp b/src/declarative/util/qdeclarativeopenmetaobject.cpp index c611435..1426cea 100644 --- a/src/declarative/util/qdeclarativeopenmetaobject.cpp +++ b/src/declarative/util/qdeclarativeopenmetaobject.cpp @@ -97,7 +97,6 @@ int QDeclarativeOpenMetaObjectType::createProperty(const QByteArray &name) int id = d->mob.propertyCount(); d->mob.addSignal("__" + QByteArray::number(id) + "()"); QMetaPropertyBuilder build = d->mob.addProperty(name, "QVariant", id); - build.setDynamic(true); propertyCreated(id, build); qFree(d->mem); d->mem = d->mob.toMetaObject(); diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml new file mode 100644 index 0000000..77accd8 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml @@ -0,0 +1,7 @@ +import Qt.test 1.1 + +MyRevisionedClass +{ + prop1: prop2 + onSignal1: method2() +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml new file mode 100644 index 0000000..36057cb --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml @@ -0,0 +1,9 @@ +import Qt.test 1.1 + +MyRevisionedSubclass +{ + prop1: prop3 + onSignal1: method2() + prop3: prop4 + onSignal3: method4() +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml new file mode 100644 index 0000000..81769e9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml @@ -0,0 +1,8 @@ +import Qt.test 1.0 + +MyRevisionedSubclass +{ + prop1: prop3 + onSignal1: method1() + onSignal3: method3() +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml new file mode 100644 index 0000000..44d421e --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml @@ -0,0 +1,14 @@ +import QtQuick 1.0 +import Qt.test 1.0 + +MyRevisionedClass +{ + // Will not hit optimizer + property real p1: prop1 % 3 + property real p2: prop2 % 3 + + // Should hit optimizer + property real p3: prop2 + + Component.onCompleted: method2() +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml new file mode 100644 index 0000000..121642e --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml @@ -0,0 +1,24 @@ +import QtQuick 1.0 +import Qt.test 1.0 + +MyRevisionedSubclass +{ + // Will not hit optimizer + property real p1: prop1 % 3 + property real p2: prop2 % 3 + property real p3: prop3 % 3 + property real p4: prop4 % 3 + + // Should hit optimizer + property real p5: prop1 + property real p6: prop2 + property real p7: prop3 + property real p8: prop4 + + Component.onCompleted: { + method1() + method2() + method3() + method4() + } +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml new file mode 100644 index 0000000..123650e --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml @@ -0,0 +1,36 @@ +import QtQuick 1.0 +import Qt.test 1.1 + +MyRevisionedSubclass +{ + // Will not hit optimizer + property real pA: propA % 3 + property real pB: propB % 3 + property real pC: propC % 3 + property real pD: propD % 3 + property real p1: prop1 % 3 + property real p2: prop2 % 3 + property real p3: prop3 % 3 + property real p4: prop4 % 3 + + // Should hit optimizer + property real pE: propA + property real pF: propB + property real pG: propC + property real pH: propD + property real p5: prop1 + property real p6: prop2 + property real p7: prop3 + property real p8: prop4 + + Component.onCompleted: { + methodA() + methodB() + methodC() + methodD() + method1() + method2() + method3() + method4() + } +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp index 94135f9..29e5eac 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp @@ -113,6 +113,15 @@ void registerTypes() qmlRegisterType<NumberAssignment>("Qt.test", 1,0, "NumberAssignment"); qmlRegisterExtendedType<DefaultPropertyExtendedObject, DefaultPropertyExtensionObject>("Qt.test", 1,0, "DefaultPropertyExtendedObject"); qmlRegisterType<OverrideDefaultPropertyObject>("Qt.test", 1,0, "OverrideDefaultPropertyObject"); + qmlRegisterType<MyRevisionedClass>("Qt.test",1,0,"MyRevisionedClass"); + qmlRegisterType<MyRevisionedClass,1>("Qt.test",1,1,"MyRevisionedClass"); + + // Register the uncreatable base class + qmlRegisterRevision<MyRevisionedBaseClassRegistered,1>("Qt.test",1,1); + // MyRevisionedSubclass 1.0 uses MyRevisionedClass revision 0 + qmlRegisterType<MyRevisionedSubclass>("Qt.test",1,0,"MyRevisionedSubclass"); + // MyRevisionedSubclass 1.1 uses MyRevisionedClass revision 1 + qmlRegisterType<MyRevisionedSubclass,1>("Qt.test",1,1,"MyRevisionedSubclass"); qmlRegisterExtendedType<QWidget,QWidgetDeclarativeUI>("Qt.test",1,0,"QWidget"); qmlRegisterType<QPlainTextEdit>("Qt.test",1,0,"QPlainTextEdit"); diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h index 15c310f..02a4352 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h @@ -736,6 +736,167 @@ public: OverrideDefaultPropertyObject() {} }; +class MyRevisionedBaseClassRegistered : public QObject +{ +Q_OBJECT + Q_PROPERTY(qreal propA READ propA WRITE setPropA NOTIFY propAChanged) + Q_PROPERTY(qreal propB READ propB WRITE setPropB NOTIFY propBChanged REVISION 1) + +public: + MyRevisionedBaseClassRegistered() : m_pa(1), m_pb(2) {} + + qreal propA() const { return m_pa; } + void setPropA(qreal p) { + if (p != m_pa) { + m_pa = p; + emit propAChanged(); + } + } + qreal propB() const { return m_pb; } + void setPropB(qreal p) { + if (p != m_pb) { + m_pb = p; + emit propBChanged(); + } + } + + Q_INVOKABLE void methodA() { } + Q_INVOKABLE Q_REVISION(1) void methodB() { } + +signals: + void propAChanged(); + void propBChanged(); + + void signalA(); + Q_REVISION(1) void signalB(); + +protected: + qreal m_pa; + qreal m_pb; +}; + +class MyRevisionedBaseClassUnregistered : public MyRevisionedBaseClassRegistered +{ +Q_OBJECT + Q_PROPERTY(qreal propC READ propC WRITE setPropC NOTIFY propCChanged) + Q_PROPERTY(qreal propD READ propD WRITE setPropD NOTIFY propDChanged REVISION 1) + +public: + MyRevisionedBaseClassUnregistered() : m_pc(1), m_pd(2) {} + + qreal propC() const { return m_pc; } + void setPropC(qreal p) { + if (p != m_pc) { + m_pc = p; + emit propCChanged(); + } + } + qreal propD() const { return m_pd; } + void setPropD(qreal p) { + if (p != m_pd) { + m_pd = p; + emit propDChanged(); + } + } + + Q_INVOKABLE void methodC() { } + Q_INVOKABLE Q_REVISION(1) void methodD() { } + +signals: + void propCChanged(); + void propDChanged(); + + void signalC(); + Q_REVISION(1) void signalD(); + +protected: + qreal m_pc; + qreal m_pd; +}; + +class MyRevisionedClass : public MyRevisionedBaseClassUnregistered +{ + Q_OBJECT + Q_PROPERTY(qreal prop1 READ prop1 WRITE setProp1 NOTIFY prop1Changed) + Q_PROPERTY(qreal prop2 READ prop2 WRITE setProp2 NOTIFY prop2Changed REVISION 1) + +public: + MyRevisionedClass() {} + + qreal prop1() const { return m_p1; } + void setProp1(qreal p) { + if (p != m_p1) { + m_p1 = p; + emit prop1Changed(); + } + } + qreal prop2() const { return m_p2; } + void setProp2(qreal p) { + if (p != m_p2) { + m_p2 = p; + emit prop2Changed(); + } + } + + Q_INVOKABLE void method1() { } + Q_INVOKABLE Q_REVISION(1) void method2() { } + +signals: + void prop1Changed(); + void prop2Changed(); + + void signal1(); + Q_REVISION(1) void signal2(); + +protected: + qreal m_p1; + qreal m_p2; +}; + +class MyRevisionedSubclass : public MyRevisionedClass +{ + Q_OBJECT + Q_PROPERTY(qreal prop3 READ prop3 WRITE setProp3 NOTIFY prop3Changed) + Q_PROPERTY(qreal prop4 READ prop4 WRITE setProp4 NOTIFY prop4Changed REVISION 1) + +public: + MyRevisionedSubclass() : m_p3(3), m_p4(4) {} + + qreal prop3() const { return m_p3; } + void setProp3(qreal p) { + if (p != m_p3) { + m_p3 = p; + emit prop3Changed(); + } + } + qreal prop4() const { return m_p4; } + void setProp4(qreal p) { + if (p != m_p4) { + m_p4 = p; + emit prop4Changed(); + } + } + + Q_INVOKABLE void method3() { } + Q_INVOKABLE Q_REVISION(1) void method4() { } + +signals: + void prop3Changed(); + void prop4Changed(); + + void signal3(); + Q_REVISION(1) void signal4(); + +protected: + qreal m_p3; + qreal m_p4; +}; + +QML_DECLARE_TYPE(MyRevisionedBaseClassRegistered) +QML_DECLARE_TYPE(MyRevisionedBaseClassUnregistered) +QML_DECLARE_TYPE(MyRevisionedClass) +QML_DECLARE_TYPE(MyRevisionedSubclass) + void registerTypes(); #endif // TESTTYPES_H diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 4228bc4..a29c459 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -176,6 +176,9 @@ private slots: void callQtInvokables(); void invokableObjectArg(); void invokableObjectRet(); + + void revisionErrors(); + void revision(); private: QDeclarativeEngine engine; }; @@ -2847,6 +2850,85 @@ void tst_qdeclarativeecmascript::aliasWritesOverrideBindings() } } +void tst_qdeclarativeecmascript::revisionErrors() +{ + { + QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevisionErrors.qml")); + QString url = component.url().toString(); + + QString warning1 = url + ":8: ReferenceError: Can't find variable: prop2"; + QString warning2 = url + ":11: ReferenceError: Can't find variable: prop2"; + QString warning3 = url + ":13: ReferenceError: Can't find variable: method2"; + + QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData()); + QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData()); + QTest::ignoreMessage(QtWarningMsg, warning3.toLatin1().constData()); + MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create()); + QVERIFY(object != 0); + } + { + QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevisionErrors2.qml")); + QString url = component.url().toString(); + + // MyRevisionedSubclass 1.0 uses MyRevisionedClass revision 0 + // method2, prop2 from MyRevisionedClass not available + // method4, prop4 from MyRevisionedSubclass not available + QString warning1 = url + ":8: ReferenceError: Can't find variable: prop2"; + QString warning2 = url + ":14: ReferenceError: Can't find variable: prop2"; + QString warning3 = url + ":10: ReferenceError: Can't find variable: prop4"; + QString warning4 = url + ":16: ReferenceError: Can't find variable: prop4"; + QString warning5 = url + ":20: ReferenceError: Can't find variable: method2"; + + QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData()); + QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData()); + QTest::ignoreMessage(QtWarningMsg, warning3.toLatin1().constData()); + QTest::ignoreMessage(QtWarningMsg, warning4.toLatin1().constData()); + QTest::ignoreMessage(QtWarningMsg, warning5.toLatin1().constData()); + MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create()); + QVERIFY(object != 0); + } + { + QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevisionErrors3.qml")); + QString url = component.url().toString(); + + // MyRevisionedSubclass 1.1 uses MyRevisionedClass revision 1 + // All properties/methods available, except MyRevisionedBaseClassUnregistered rev 1 + QString warning1 = url + ":30: ReferenceError: Can't find variable: methodD"; + QString warning2 = url + ":10: ReferenceError: Can't find variable: propD"; + QString warning3 = url + ":20: ReferenceError: Can't find variable: propD"; + QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData()); + QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData()); + QTest::ignoreMessage(QtWarningMsg, warning3.toLatin1().constData()); + MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create()); + QVERIFY(object != 0); + } +} + +void tst_qdeclarativeecmascript::revision() +{ + { + QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevision.qml")); + QString url = component.url().toString(); + + MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create()); + QVERIFY(object != 0); + } + { + QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevision2.qml")); + QString url = component.url().toString(); + + MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create()); + QVERIFY(object != 0); + } + { + QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevision3.qml")); + QString url = component.url().toString(); + + MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create()); + QVERIFY(object != 0); + } +} + QTEST_MAIN(tst_qdeclarativeecmascript) #include "tst_qdeclarativeecmascript.moc" diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.errors.txt new file mode 100644 index 0000000..6ad6bfa --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.errors.txt @@ -0,0 +1 @@ +7:5:Property "prop2" not available in Test/MyRevisionedClass 1.0 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml new file mode 100644 index 0000000..4662d5e --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml @@ -0,0 +1,8 @@ +import QtQuick 1.0 +import Test 1.0 + +MyRevisionedClass +{ + prop1: 1 + prop2: 2 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.errors.txt new file mode 100644 index 0000000..92ccd9a --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.errors.txt @@ -0,0 +1 @@ +6:5:Signal "onSignal2" not available in Test/MyRevisionedClass 1.0 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.qml new file mode 100644 index 0000000..8da7a25 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.qml @@ -0,0 +1,7 @@ +import Test 1.0 + +MyRevisionedClass +{ + onSignal1: prop1 = 2 + onSignal2: prop1 = 3 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.errors.txt new file mode 100644 index 0000000..b3c33c4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.errors.txt @@ -0,0 +1 @@ +9:5:Property "propD" not available in Test/MyRevisionedClass 1.1 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.qml new file mode 100644 index 0000000..195be21 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.qml @@ -0,0 +1,10 @@ +import Test 1.1 + +MyRevisionedClass +{ + propA: 10 + propB: 10 + propC: 10 + // propD is in rev 1 of MyRevisionedClassUnregistered, but not registered in 1.1 + propD: 10 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisions10.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisions10.qml new file mode 100644 index 0000000..c4974cf --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/revisions10.qml @@ -0,0 +1,8 @@ +import QtQuick 1.0 +import Test 1.0 + +MyRevisionedClass +{ + property real prop2: 10 + prop1: 1 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml new file mode 100644 index 0000000..4d3d7d2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml @@ -0,0 +1,10 @@ +import QtQuick 1.0 +import Test 1.1 + +MyRevisionedClass +{ + prop1: 1 + prop2: 10 + + onSignal2: prop2 = 3 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml new file mode 100644 index 0000000..57d76b1 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml @@ -0,0 +1,16 @@ +import QtQuick 1.0 +import Test 1.1 + +MyRevisionedSubclass +{ + propA: 10 + propB: 10 + propC: 10 + // propD is not registered in 1.1 + prop1: 10 + prop2: 10 + prop3: 10 + prop4: 10 + + onSignal4: prop4 = 2 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisionssub10.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisionssub10.qml new file mode 100644 index 0000000..b5de4a3 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/revisionssub10.qml @@ -0,0 +1,10 @@ +import QtQuick 1.0 +import Test 1.0 + +MyRevisionedSubclass +{ + property real prop4: 10 + property real prop2: 10 + prop1: 5 + prop3: 7 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml new file mode 100644 index 0000000..f107356 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml @@ -0,0 +1,12 @@ +import QtQuick 1.0 +import Test 1.1 + +MyRevisionedSubclass +{ + prop1: 10 + prop2: 10 + prop3: 10 + prop4: 10 + + onSignal4: prop4 = 2 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp b/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp index e697aeb..217f54a 100644 --- a/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp @@ -52,6 +52,15 @@ void registerTypes() qmlRegisterType<MyNamespace::MySecondNamespacedType>("Test",1,0,"MySecondNamespacedType"); qmlRegisterType<MyParserStatus>("Test",1,0,"MyParserStatus"); qmlRegisterType<MyGroupedObject>(); + qmlRegisterType<MyRevisionedClass>("Test",1,0,"MyRevisionedClass"); + qmlRegisterType<MyRevisionedClass,1>("Test",1,1,"MyRevisionedClass"); + + // Register the uncreatable base class + qmlRegisterRevision<MyRevisionedBaseClassRegistered,1>("Test",1,1); + // MyRevisionedSubclass 1.0 uses MyRevisionedClass revision 0 + qmlRegisterType<MyRevisionedSubclass>("Test",1,0,"MyRevisionedSubclass"); + // MyRevisionedSubclass 1.1 uses MyRevisionedClass revision 1 + qmlRegisterType<MyRevisionedSubclass,1>("Test",1,1,"MyRevisionedSubclass"); qmlRegisterCustomType<MyCustomParserType>("Test", 1, 0, "MyCustomParserType", new MyCustomParserTypeParser); diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h index f8d785c..4508d01 100644 --- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h +++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h @@ -601,6 +601,169 @@ private: int m_ccc; }; +class MyRevisionedBaseClassRegistered : public QObject +{ + Q_OBJECT + Q_PROPERTY(qreal propA READ propA WRITE setPropA NOTIFY propAChanged) + Q_PROPERTY(qreal propB READ propB WRITE setPropB NOTIFY propBChanged REVISION 1) + +public: + MyRevisionedBaseClassRegistered() : m_pa(1), m_pb(2) {} + + qreal propA() const { return m_pa; } + void setPropA(qreal p) { + if (p != m_pa) { + m_pa = p; + emit propAChanged(); + } + } + qreal propB() const { return m_pb; } + void setPropB(qreal p) { + if (p != m_pb) { + m_pb = p; + emit propBChanged(); + } + } + + Q_INVOKABLE void methodA() { } + Q_INVOKABLE Q_REVISION(1) void methodB() { } + +signals: + void propAChanged(); + void propBChanged(); + + void signalA(); + Q_REVISION(1) void signalB(); + +protected: + qreal m_pa; + qreal m_pb; +}; + +class MyRevisionedBaseClassUnregistered : public MyRevisionedBaseClassRegistered +{ + Q_OBJECT + Q_PROPERTY(qreal propC READ propC WRITE setPropC NOTIFY propCChanged) + Q_PROPERTY(qreal propD READ propD WRITE setPropD NOTIFY propDChanged REVISION 1) + +public: + MyRevisionedBaseClassUnregistered() : m_pc(1), m_pd(2) {} + + qreal propC() const { return m_pc; } + void setPropC(qreal p) { + if (p != m_pc) { + m_pc = p; + emit propCChanged(); + } + } + qreal propD() const { return m_pd; } + void setPropD(qreal p) { + if (p != m_pd) { + m_pd = p; + emit propDChanged(); + } + } + + Q_INVOKABLE void methodC() { } + Q_INVOKABLE Q_REVISION(1) void methodD() { } + +signals: + void propCChanged(); + void propDChanged(); + + void signalC(); + Q_REVISION(1) void signalD(); + +protected: + qreal m_pc; + qreal m_pd; +}; + +class MyRevisionedClass : public MyRevisionedBaseClassUnregistered +{ + Q_OBJECT + Q_PROPERTY(qreal prop1 READ prop1 WRITE setProp1 NOTIFY prop1Changed) + Q_PROPERTY(qreal prop2 READ prop2 WRITE setProp2 NOTIFY prop2Changed REVISION 1) + +public: + MyRevisionedClass() : m_p1(1), m_p2(2) {} + + qreal prop1() const { return m_p1; } + void setProp1(qreal p) { + if (p != m_p1) { + m_p1 = p; + emit prop1Changed(); + } + } + qreal prop2() const { return m_p2; } + void setProp2(qreal p) { + if (p != m_p2) { + m_p2 = p; + emit prop2Changed(); + } + } + + Q_INVOKABLE void method1() { } + Q_INVOKABLE Q_REVISION(1) void method2() { } + +signals: + void prop1Changed(); + void prop2Changed(); + + void signal1(); + Q_REVISION(1) void signal2(); + +protected: + qreal m_p1; + qreal m_p2; +}; + +class MyRevisionedSubclass : public MyRevisionedClass +{ + Q_OBJECT + Q_PROPERTY(qreal prop3 READ prop3 WRITE setProp3 NOTIFY prop3Changed) + Q_PROPERTY(qreal prop4 READ prop4 WRITE setProp4 NOTIFY prop4Changed REVISION 1) + +public: + MyRevisionedSubclass() : m_p3(3), m_p4(4) {} + + qreal prop3() const { return m_p3; } + void setProp3(qreal p) { + if (p != m_p3) { + m_p3 = p; + emit prop3Changed(); + } + } + qreal prop4() const { return m_p4; } + void setProp4(qreal p) { + if (p != m_p4) { + m_p4 = p; + emit prop4Changed(); + } + } + + Q_INVOKABLE void method3() { } + Q_INVOKABLE Q_REVISION(1) void method4() { } + +signals: + void prop3Changed(); + void prop4Changed(); + + void signal3(); + Q_REVISION(1) void signal4(); + +protected: + qreal m_p3; + qreal m_p4; +}; + +QML_DECLARE_TYPE(MyRevisionedBaseClassRegistered) +QML_DECLARE_TYPE(MyRevisionedBaseClassUnregistered) +QML_DECLARE_TYPE(MyRevisionedClass) +QML_DECLARE_TYPE(MyRevisionedSubclass) + + + void registerTypes(); #endif // TESTTYPES_H diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 6410853..298d802 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -153,6 +153,8 @@ private slots: void customOnProperty(); void variantNotify(); + void revisions(); + // regression tests for crashes void crash1(); void crash2(); @@ -421,6 +423,10 @@ void tst_qdeclarativelanguage::errors_data() << "incorrectCase.errors.sensitive.txt" #endif << false; + + QTest::newRow("metaobjectRevision.1") << "metaobjectRevision.1.qml" << "metaobjectRevision.1.errors.txt" << false; + QTest::newRow("metaobjectRevision.2") << "metaobjectRevision.2.qml" << "metaobjectRevision.2.errors.txt" << false; + QTest::newRow("metaobjectRevision.3") << "metaobjectRevision.3.qml" << "metaobjectRevision.3.errors.txt" << false; } @@ -1888,6 +1894,62 @@ void tst_qdeclarativelanguage::variantNotify() delete object; } +void tst_qdeclarativelanguage::revisions() +{ + { + QDeclarativeComponent component(&engine, TEST_FILE("revisions10.qml")); + + VERIFY_ERRORS(0); + MyRevisionedClass *object = qobject_cast<MyRevisionedClass*>(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->prop2(), 2.0); + QCOMPARE(object->property("prop2").toReal(), 10.0); + + delete object; + } + { + QDeclarativeComponent component(&engine, TEST_FILE("revisions11.qml")); + + VERIFY_ERRORS(0); + MyRevisionedClass *object = qobject_cast<MyRevisionedClass*>(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->prop2(), 10.0); + + delete object; + } + { + QDeclarativeComponent component(&engine, TEST_FILE("revisionssub10.qml")); + + VERIFY_ERRORS(0); + MyRevisionedSubclass *object = qobject_cast<MyRevisionedSubclass*>(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->prop2(), 2.0); + QCOMPARE(object->property("prop2").toReal(), 10.0); + + QCOMPARE(object->prop4(), 4.0); + QCOMPARE(object->property("prop4").toReal(), 10.0); + + delete object; + } + { + QDeclarativeComponent component(&engine, TEST_FILE("revisionssub11.qml")); + + VERIFY_ERRORS(0); + MyRevisionedSubclass *object = qobject_cast<MyRevisionedSubclass*>(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->prop1(), 10.0); + QCOMPARE(object->prop2(), 10.0); + QCOMPARE(object->prop3(), 10.0); + QCOMPARE(object->prop4(), 10.0); + + delete object; + } +} + void tst_qdeclarativelanguage::initTestCase() { registerTypes(); diff --git a/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp index 0f6d531..a1f938a 100644 --- a/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp +++ b/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp @@ -546,7 +546,6 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!nullProp.isUser()); QVERIFY(!nullProp.hasStdCppSet()); QVERIFY(!nullProp.isEnumOrFlag()); - QVERIFY(!nullProp.isDynamic()); QCOMPARE(nullProp.index(), 0); // Add a property and check its attributes. @@ -564,7 +563,6 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop1.isUser()); QVERIFY(!prop1.hasStdCppSet()); QVERIFY(!prop1.isEnumOrFlag()); - QVERIFY(!prop1.isDynamic()); QCOMPARE(prop1.index(), 0); QCOMPARE(builder.propertyCount(), 1); @@ -583,7 +581,6 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop2.isUser()); QVERIFY(!prop2.hasStdCppSet()); QVERIFY(!prop2.isEnumOrFlag()); - QVERIFY(!prop2.isDynamic()); QCOMPARE(prop2.index(), 1); QCOMPARE(builder.propertyCount(), 2); @@ -605,7 +602,6 @@ void tst_QMetaObjectBuilder::property() prop1.setUser(true); prop1.setStdCppSet(true); prop1.setEnumOrFlag(true); - prop1.setDynamic(true); // Check that prop1 is changed, but prop2 is not. QCOMPARE(prop1.name(), QByteArray("foo")); @@ -620,7 +616,6 @@ void tst_QMetaObjectBuilder::property() QVERIFY(prop1.isUser()); QVERIFY(prop1.hasStdCppSet()); QVERIFY(prop1.isEnumOrFlag()); - QVERIFY(prop1.isDynamic()); QVERIFY(prop2.isReadable()); QVERIFY(prop2.isWritable()); QCOMPARE(prop2.name(), QByteArray("bar")); @@ -633,7 +628,6 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop2.isUser()); QVERIFY(!prop2.hasStdCppSet()); QVERIFY(!prop2.isEnumOrFlag()); - QVERIFY(!prop2.isDynamic()); // Remove prop1 and check that prop2 becomes index 0. builder.removeProperty(0); @@ -649,7 +643,6 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop2.isUser()); QVERIFY(!prop2.hasStdCppSet()); QVERIFY(!prop2.isEnumOrFlag()); - QVERIFY(!prop2.isDynamic()); QCOMPARE(prop2.index(), 0); // Perform index-based lookup again. @@ -673,7 +666,6 @@ void tst_QMetaObjectBuilder::property() prop2.setUser(false); \ prop2.setStdCppSet(false); \ prop2.setEnumOrFlag(false); \ - prop2.setDynamic(false); \ } while (0) #define COUNT_FLAGS() \ ((prop2.isReadable() ? 1 : 0) + \ @@ -685,8 +677,7 @@ void tst_QMetaObjectBuilder::property() (prop2.isEditable() ? 1 : 0) + \ (prop2.isUser() ? 1 : 0) + \ (prop2.hasStdCppSet() ? 1 : 0) + \ - (prop2.isEnumOrFlag() ? 1 : 0) + \ - (prop2.isDynamic() ? 1 : 0)) + (prop2.isEnumOrFlag() ? 1 : 0)) #define CHECK_FLAG(setFunc,isFunc) \ do { \ CLEAR_FLAGS(); \ @@ -705,7 +696,6 @@ void tst_QMetaObjectBuilder::property() CHECK_FLAG(setUser, isUser); CHECK_FLAG(setStdCppSet, hasStdCppSet); CHECK_FLAG(setEnumOrFlag, isEnumOrFlag); - CHECK_FLAG(setDynamic, isDynamic); // Check that nothing else changed. QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Properties)); -- cgit v0.12 From 810eb8e2bf52a30632abc42618b7f9f4352e2dd9 Mon Sep 17 00:00:00 2001 From: Bea Lam <bea.lam@nokia.com> Date: Wed, 5 Jan 2011 14:01:44 +1000 Subject: Add missing test data file --- .../auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml new file mode 100644 index 0000000..4dbcc02 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml @@ -0,0 +1,8 @@ +import QtQuick 1.0 + +XmlListModel { + query: "/data" + XmlRole { name: "stringValue"; query: "a-string/string()" } + XmlRole { name: "numberValue"; query: "a-number/number()" } +} + -- cgit v0.12 From c3a4ce70e588620393a9a4189f3e429622103406 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@nokia.com> Date: Wed, 5 Jan 2011 17:52:36 +1000 Subject: Test importing version > registered with a matching base class rev. Consieder the case of a BaseClass registered with version 1.1 and the created Class registered with version 1.0. When version 1.1 is imported the Class should be able to use BaseClass properties from version 1.1. This currently fails. Task-number: QTBUG-13451 --- .../qdeclarativelanguage/data/versionedbase.qml | 8 +++++++ .../declarative/qdeclarativelanguage/testtypes.cpp | 3 +++ .../declarative/qdeclarativelanguage/testtypes.h | 26 ++++++++++++++++++++++ .../tst_qdeclarativelanguage.cpp | 17 +++++++++++++- 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml b/tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml new file mode 100644 index 0000000..8c74715 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml @@ -0,0 +1,8 @@ +import QtQuick 1.0 +import Test 1.1 + +MySubclass +{ + prop1: 10 + prop2: 10 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp b/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp index 217f54a..18e3885 100644 --- a/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp @@ -62,6 +62,9 @@ void registerTypes() // MyRevisionedSubclass 1.1 uses MyRevisionedClass revision 1 qmlRegisterType<MyRevisionedSubclass,1>("Test",1,1,"MyRevisionedSubclass"); + // Only version 1.0, but its super class is registered in version 1.1 also + qmlRegisterType<MySubclass>("Test",1,0,"MySubclass"); + qmlRegisterCustomType<MyCustomParserType>("Test", 1, 0, "MyCustomParserType", new MyCustomParserTypeParser); qmlRegisterTypeNotAvailable("Test",1,0,"UnavailableType", "UnavailableType is unavailable for testing"); diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h index 4508d01..48055e8 100644 --- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h +++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h @@ -757,10 +757,36 @@ protected: qreal m_p4; }; +class MySubclass : public MyRevisionedClass +{ + Q_OBJECT + Q_PROPERTY(qreal prop5 READ prop5 WRITE setProp5 NOTIFY prop5Changed) + +public: + MySubclass() : m_p5(5) {} + + qreal prop5() const { return m_p5; } + void setProp5(qreal p) { + if (p != m_p5) { + m_p5 = p; + emit prop5Changed(); + } + } + + Q_INVOKABLE void method5() { } + +signals: + void prop5Changed(); + +protected: + qreal m_p5; +}; + QML_DECLARE_TYPE(MyRevisionedBaseClassRegistered) QML_DECLARE_TYPE(MyRevisionedBaseClassUnregistered) QML_DECLARE_TYPE(MyRevisionedClass) QML_DECLARE_TYPE(MyRevisionedSubclass) +QML_DECLARE_TYPE(MySubclass) diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 298d802..a139d5e 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -1935,7 +1935,8 @@ void tst_qdeclarativelanguage::revisions() delete object; } { - QDeclarativeComponent component(&engine, TEST_FILE("revisionssub11.qml")); + QDeclarativeEngine myEngine; + QDeclarativeComponent component(&myEngine, TEST_FILE("revisionssub11.qml")); VERIFY_ERRORS(0); MyRevisionedSubclass *object = qobject_cast<MyRevisionedSubclass*>(component.create()); @@ -1948,6 +1949,20 @@ void tst_qdeclarativelanguage::revisions() delete object; } + { + // If this is uncommented it will work + // qmlRegisterType<MySubclass,0>("Test",1,1,"MySubclass"); + QDeclarativeComponent component(&engine, TEST_FILE("versionedbase.qml")); + QEXPECT_FAIL("", "Class version 1.0 with base class version 1.1 registered", Abort); + VERIFY_ERRORS(0); + MySubclass *object = qobject_cast<MySubclass*>(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->prop1(), 10.0); + QCOMPARE(object->prop2(), 10.0); + + delete object; + } } void tst_qdeclarativelanguage::initTestCase() -- cgit v0.12 From bc1e4e5bc898519c073b710f64c7a7da54062099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= <morten.sorvig@nokia.com> Date: Wed, 5 Jan 2011 12:36:58 +0100 Subject: Compile on OS X. --- mkspecs/common/mac/qplatformdefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/common/mac/qplatformdefs.h b/mkspecs/common/mac/qplatformdefs.h index 99d64ef..5d1f99a 100644 --- a/mkspecs/common/mac/qplatformdefs.h +++ b/mkspecs/common/mac/qplatformdefs.h @@ -75,7 +75,7 @@ #include <net/if.h> #endif -#include "../common/posix/qplatformdefs.h" +#include "../posix/qplatformdefs.h" #undef QT_OPEN_LARGEFILE #undef QT_SOCKLEN_T -- cgit v0.12 From 4c15dbb1eddb7bb3f3b72508be865feb97679d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= <morten.sorvig@nokia.com> Date: Wed, 5 Jan 2011 14:02:58 +0100 Subject: Build on Mac OS X. --- src/plugins/platforms/testlite/testlite.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/testlite/testlite.pro b/src/plugins/platforms/testlite/testlite.pro index 9f8075c..eb196c3 100644 --- a/src/plugins/platforms/testlite/testlite.pro +++ b/src/plugins/platforms/testlite/testlite.pro @@ -28,6 +28,10 @@ HEADERS = \ LIBS += -lX11 -lXext +mac { + LIBS += -L/usr/X11/lib -lz -framework Carbon +} + include (../fontdatabases/genericunix/genericunix.pri) contains(QT_CONFIG, opengl) { -- cgit v0.12 From 1462a7ba51d25a7d022eab5533885cb1ed1c4c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= <jorgen.lind@nokia.com> Date: Wed, 5 Jan 2011 09:04:37 +0100 Subject: Lighthouse: Make testlite compile on systems where QtOpenGL is ES2 compatible. Ie. it does not have glx. Haven't made the egl integration yet for testlite --- src/plugins/platforms/testlite/qglxintegration.cpp | 3 +++ src/plugins/platforms/testlite/qglxintegration.h | 3 +++ src/plugins/platforms/testlite/qtestliteintegration.cpp | 6 ++++-- src/plugins/platforms/testlite/qtestlitewindow.cpp | 8 ++++---- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/testlite/qglxintegration.cpp b/src/plugins/platforms/testlite/qglxintegration.cpp index 1dffb3e..8023014 100644 --- a/src/plugins/platforms/testlite/qglxintegration.cpp +++ b/src/plugins/platforms/testlite/qglxintegration.cpp @@ -46,6 +46,7 @@ #include "qtestlitewindow.h" #include "qtestlitescreen.h" +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) #include <X11/Xlib.h> #include <X11/Xutil.h> #include <GL/glx.h> @@ -371,3 +372,5 @@ QPlatformWindowFormat QGLXContext::platformWindowFormat() const } QT_END_NAMESPACE + +#endif //!defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) diff --git a/src/plugins/platforms/testlite/qglxintegration.h b/src/plugins/platforms/testlite/qglxintegration.h index 5ae0b2a..abece45 100644 --- a/src/plugins/platforms/testlite/qglxintegration.h +++ b/src/plugins/platforms/testlite/qglxintegration.h @@ -49,6 +49,7 @@ #include <QtCore/QMutex> +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) #include <GL/glx.h> QT_BEGIN_NAMESPACE @@ -88,4 +89,6 @@ private: QT_END_NAMESPACE +#endif //!defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) + #endif diff --git a/src/plugins/platforms/testlite/qtestliteintegration.cpp b/src/plugins/platforms/testlite/qtestliteintegration.cpp index 537e22a..5dbe1e7 100644 --- a/src/plugins/platforms/testlite/qtestliteintegration.cpp +++ b/src/plugins/platforms/testlite/qtestliteintegration.cpp @@ -49,8 +49,10 @@ #include "qtestlitescreen.h" #include "qtestliteclipboard.h" -#ifndef QT_NO_OPENGL +#if !defined(QT_NO_OPENGL) +#if !defined(QT_OPENGL_ES_2) #include <GL/glx.h> +#endif //!defined(QT_OPENGL_ES_2) #include <private/qwindowsurface_gl_p.h> #include <private/qpixmapdata_gl_p.h> #endif //QT_NO_OPENGL @@ -128,7 +130,7 @@ QPlatformClipboard * QTestLiteIntegration::clipboard() const bool QTestLiteIntegration::hasOpenGL() const { -#ifndef QT_NO_OPENGL +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) QTestLiteScreen *screen = static_cast<const QTestLiteScreen *>(mScreens.at(0)); return glXQueryExtension(screen->display(), 0, 0) != 0; #endif diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index e8d40d7..18fab4a 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -54,7 +54,7 @@ #include <QtGui/private/qwindowsurface_p.h> #include <QtGui/private/qapplication_p.h> -#ifndef QT_NO_OPENGL +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) #include "qglxintegration.h" #endif @@ -74,7 +74,7 @@ QTestLiteWindow::QTestLiteWindow(QWidget *window) if(window->platformWindowFormat().windowApi() == QPlatformWindowFormat::OpenGL && QApplicationPrivate::platformIntegration()->hasOpenGL() ) { -#ifndef QT_NO_OPENGL +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) XVisualInfo *visualInfo = QGLXContext::findVisualInfo(mScreen,window->platformWindowFormat()); Colormap cmap = XCreateColormap(mScreen->display(),mScreen->rootWindow(),visualInfo->visual,AllocNone); @@ -83,7 +83,7 @@ QTestLiteWindow::QTestLiteWindow(QWidget *window) x_window = XCreateWindow(mScreen->display(), mScreen->rootWindow(),x, y, w, h, 0, visualInfo->depth, InputOutput, visualInfo->visual, CWColormap, &a); -#endif //QT_NO_OPENGL +#endif //!defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) } else { x_window = XCreateSimpleWindow(mScreen->display(), mScreen->rootWindow(), x, y, w, h, 0 /*border_width*/, @@ -548,7 +548,7 @@ QPlatformGLContext *QTestLiteWindow::glContext() const return 0; if (!mGLContext) { QTestLiteWindow *that = const_cast<QTestLiteWindow *>(this); -#ifndef QT_NO_OPENGL +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) that->mGLContext = new QGLXContext(x_window, mScreen,widget()->platformWindowFormat()); #endif } -- cgit v0.12 From cc8877068dc6ae8f3142ffec0b85f6fbac4a0d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= <jorgen.lind@nokia.com> Date: Wed, 5 Jan 2011 17:14:54 +0100 Subject: Lighthouse: Adding support for EGL to testlite There is really no good way of detecting if to use EGL instead of GLX using qmake. So this is the behavior for now: if QtOpenGL is compiled with "desktop gl" then use GLX if its compiled with OpenGLES2 then use EGL. --- .../platforms/eglconvenience/qeglconvenience.cpp | 8 ++ .../platforms/eglconvenience/qeglconvenience.h | 1 + .../platforms/testlite/qtestliteeglintegration.cpp | 145 +++++++++++++++++++++ .../platforms/testlite/qtestliteeglintegration.h | 13 ++ .../platforms/testlite/qtestliteintegration.cpp | 19 ++- src/plugins/platforms/testlite/qtestlitewindow.cpp | 94 ++++++++++--- src/plugins/platforms/testlite/qtestlitewindow.h | 2 + src/plugins/platforms/testlite/testlite.pro | 37 ++++-- 8 files changed, 287 insertions(+), 32 deletions(-) create mode 100644 src/plugins/platforms/testlite/qtestliteeglintegration.cpp create mode 100644 src/plugins/platforms/testlite/qtestliteeglintegration.h diff --git a/src/plugins/platforms/eglconvenience/qeglconvenience.cpp b/src/plugins/platforms/eglconvenience/qeglconvenience.cpp index b203fe8..1612f79 100644 --- a/src/plugins/platforms/eglconvenience/qeglconvenience.cpp +++ b/src/plugins/platforms/eglconvenience/qeglconvenience.cpp @@ -313,4 +313,12 @@ QPlatformWindowFormat qt_qPlatformWindowFormatFromConfig(EGLDisplay display, con return format; } +bool q_hasEglExtension(EGLDisplay display, const char* extensionName) +{ + QList<QByteArray> extensions = + QByteArray(reinterpret_cast<const char *> + (eglQueryString(display, EGL_EXTENSIONS))).split(' '); + return extensions.contains(extensionName); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglconvenience/qeglconvenience.h b/src/plugins/platforms/eglconvenience/qeglconvenience.h index 604262b..98c30b8 100644 --- a/src/plugins/platforms/eglconvenience/qeglconvenience.h +++ b/src/plugins/platforms/eglconvenience/qeglconvenience.h @@ -53,6 +53,7 @@ QVector<EGLint> q_createConfigAttributesFromFormat(const QPlatformWindowFormat & bool q_reduceConfigAttributes(QVector<EGLint> *configAttributes); EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QPlatformWindowFormat &format); QPlatformWindowFormat qt_qPlatformWindowFormatFromConfig(EGLDisplay display, const EGLConfig config); +bool q_hasEglExtension(EGLDisplay display,const char* extensionName); QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestliteeglintegration.cpp b/src/plugins/platforms/testlite/qtestliteeglintegration.cpp new file mode 100644 index 0000000..3cbcc05 --- /dev/null +++ b/src/plugins/platforms/testlite/qtestliteeglintegration.cpp @@ -0,0 +1,145 @@ +#include "qtestliteeglintegration.h" + +static int countBits(unsigned long mask) +{ + int count = 0; + while (mask != 0) { + if (mask & 1) + ++count; + mask >>= 1; + } + return count; +} + +VisualID QTestLiteEglIntegration::getCompatibleVisualId(Display *display, EGLConfig config) +{ + VisualID visualId = 0; + EGLint eglValue = 0; + + EGLDisplay eglDisplay = eglGetDisplay(display); + + EGLint configRedSize = 0; + eglGetConfigAttrib(eglDisplay, config, EGL_RED_SIZE, &configRedSize); + + EGLint configGreenSize = 0; + eglGetConfigAttrib(eglDisplay, config, EGL_GREEN_SIZE, &configGreenSize); + + EGLint configBlueSize = 0; + eglGetConfigAttrib(eglDisplay, config, EGL_BLUE_SIZE, &configBlueSize); + + EGLint configAlphaSize = 0; + eglGetConfigAttrib(eglDisplay, config, EGL_ALPHA_SIZE, &configAlphaSize); + + eglGetConfigAttrib(eglDisplay, config, EGL_CONFIG_ID, &eglValue); + int configId = eglValue; + + // See if EGL provided a valid VisualID: + eglGetConfigAttrib(eglDisplay, config, EGL_NATIVE_VISUAL_ID, &eglValue); + visualId = (VisualID)eglValue; + if (visualId) { + // EGL has suggested a visual id, so get the rest of the visual info for that id: + XVisualInfo visualInfoTemplate; + memset(&visualInfoTemplate, 0, sizeof(XVisualInfo)); + visualInfoTemplate.visualid = visualId; + + XVisualInfo *chosenVisualInfo; + int matchingCount = 0; + chosenVisualInfo = XGetVisualInfo(display, VisualIDMask, &visualInfoTemplate, &matchingCount); + if (chosenVisualInfo) { + // Skip size checks if implementation supports non-matching visual + // and config (http://bugreports.qt.nokia.com/browse/QTBUG-9444). + if (q_hasEglExtension(eglDisplay,"EGL_NV_post_convert_rounding")) { + XFree(chosenVisualInfo); + return visualId; + } + + int visualRedSize = countBits(chosenVisualInfo->red_mask); + int visualGreenSize = countBits(chosenVisualInfo->green_mask); + int visualBlueSize = countBits(chosenVisualInfo->blue_mask); + int visualAlphaSize = -1; // Need XRender to tell us the alpha channel size + + bool visualMatchesConfig = false; + if ( visualRedSize == configRedSize && + visualGreenSize == configGreenSize && + visualBlueSize == configBlueSize ) + { + // We need XRender to check the alpha channel size of the visual. If we don't have + // the alpha size, we don't check it against the EGL config's alpha size. + if (visualAlphaSize >= 0) + visualMatchesConfig = visualAlphaSize == configAlphaSize; + else + visualMatchesConfig = true; + } + + if (!visualMatchesConfig) { + if (visualAlphaSize >= 0) { + qWarning("Warning: EGL suggested using X Visual ID %d (ARGB%d%d%d%d) for EGL config %d (ARGB%d%d%d%d), but this is incompatable", + (int)visualId, visualAlphaSize, visualRedSize, visualGreenSize, visualBlueSize, + configId, configAlphaSize, configRedSize, configGreenSize, configBlueSize); + } else { + qWarning("Warning: EGL suggested using X Visual ID %d (RGB%d%d%d) for EGL config %d (RGB%d%d%d), but this is incompatable", + (int)visualId, visualRedSize, visualGreenSize, visualBlueSize, + configId, configRedSize, configGreenSize, configBlueSize); + } + visualId = 0; + } + } else { + qWarning("Warning: EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID", + (int)visualId, configId); + visualId = 0; + } + XFree(chosenVisualInfo); + } +#ifdef QT_DEBUG_X11_VISUAL_SELECTION + else + qDebug("EGL did not suggest a VisualID (EGL_NATIVE_VISUAL_ID was zero) for EGLConfig %d", configId); +#endif + + if (visualId) { +#ifdef QT_DEBUG_X11_VISUAL_SELECTION + if (configAlphaSize > 0) + qDebug("Using ARGB Visual ID %d provided by EGL for config %d", (int)visualId, configId); + else + qDebug("Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId); +#endif + return visualId; + } + + // Finally, try to + // use XGetVisualInfo and only use the bit depths to match on: + if (!visualId) { + XVisualInfo visualInfoTemplate; + memset(&visualInfoTemplate, 0, sizeof(XVisualInfo)); + XVisualInfo *matchingVisuals; + int matchingCount = 0; + + visualInfoTemplate.depth = configRedSize + configGreenSize + configBlueSize + configAlphaSize; + matchingVisuals = XGetVisualInfo(display, + VisualDepthMask, + &visualInfoTemplate, + &matchingCount); + if (!matchingVisuals) { + // Try again without taking the alpha channel into account: + visualInfoTemplate.depth = configRedSize + configGreenSize + configBlueSize; + matchingVisuals = XGetVisualInfo(display, + VisualDepthMask, + &visualInfoTemplate, + &matchingCount); + } + + if (matchingVisuals) { + visualId = matchingVisuals[0].visualid; + XFree(matchingVisuals); + } + } + + if (visualId) { +#ifdef QT_DEBUG_X11_VISUAL_SELECTION + qDebug("Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, configId); +#endif + return visualId; + } + + qWarning("Unable to find an X11 visual which matches EGL config %d", configId); + return (VisualID)0; +} diff --git a/src/plugins/platforms/testlite/qtestliteeglintegration.h b/src/plugins/platforms/testlite/qtestliteeglintegration.h new file mode 100644 index 0000000..3717976 --- /dev/null +++ b/src/plugins/platforms/testlite/qtestliteeglintegration.h @@ -0,0 +1,13 @@ +#ifndef QTESTLITEEGLINTEGRATION_H +#define QTESTLITEEGLINTEGRATION_H + +#include "qtestlitestaticinfo.h" +#include "../eglconvenience/qeglconvenience.h" + +class QTestLiteEglIntegration +{ +public: + static VisualID getCompatibleVisualId(Display *display, EGLConfig config); +}; + +#endif // QTESTLITEEGLINTEGRATION_H diff --git a/src/plugins/platforms/testlite/qtestliteintegration.cpp b/src/plugins/platforms/testlite/qtestliteintegration.cpp index 5dbe1e7..9b641d1 100644 --- a/src/plugins/platforms/testlite/qtestliteintegration.cpp +++ b/src/plugins/platforms/testlite/qtestliteintegration.cpp @@ -52,6 +52,8 @@ #if !defined(QT_NO_OPENGL) #if !defined(QT_OPENGL_ES_2) #include <GL/glx.h> +#else +#include <EGL/egl.h> #endif //!defined(QT_OPENGL_ES_2) #include <private/qwindowsurface_gl_p.h> #include <private/qpixmapdata_gl_p.h> @@ -59,7 +61,6 @@ QT_BEGIN_NAMESPACE - QTestLiteIntegration::QTestLiteIntegration(bool useOpenGL) : mUseOpenGL(useOpenGL) , mFontDb(new QGenericUnixFontDatabase()) @@ -130,9 +131,23 @@ QPlatformClipboard * QTestLiteIntegration::clipboard() const bool QTestLiteIntegration::hasOpenGL() const { -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) +#if !defined(QT_OPENGL_ES_2) QTestLiteScreen *screen = static_cast<const QTestLiteScreen *>(mScreens.at(0)); return glXQueryExtension(screen->display(), 0, 0) != 0; +#else + static bool eglHasbeenInitialized = false; + static bool wasEglInitialized = false; + if (!eglHasbeenInitialized) { + eglHasbeenInitialized = true; + QTestLiteScreen *screen = static_cast<const QTestLiteScreen *>(mScreens.at(0)); + EGLint major, minor; + eglBindAPI(EGL_OPENGL_ES_API); + EGLDisplay disp = eglGetDisplay(screen->display()); + wasEglInitialized = eglInitialize(disp,&major,&minor); + } + return wasEglInitialized; +#endif #endif return false; } diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index 18fab4a..d9c69e3 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -54,9 +54,15 @@ #include <QtGui/private/qwindowsurface_p.h> #include <QtGui/private/qapplication_p.h> -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) +#if !defined(QT_OPENGL_ES_2) #include "qglxintegration.h" -#endif +#else +#include "../eglconvenience/qeglconvenience.h" +#include "../eglconvenience/qeglplatformcontext.h" +#include "qtestliteeglintegration.h" +#endif //QT_OPENGL_ES_2 +#endif //QT_NO_OPENGL //#define MYX11_DEBUG @@ -74,16 +80,36 @@ QTestLiteWindow::QTestLiteWindow(QWidget *window) if(window->platformWindowFormat().windowApi() == QPlatformWindowFormat::OpenGL && QApplicationPrivate::platformIntegration()->hasOpenGL() ) { -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) + #if !defined(QT_NO_OPENGL) +#if !defined(QT_OPENGL_ES_2) XVisualInfo *visualInfo = QGLXContext::findVisualInfo(mScreen,window->platformWindowFormat()); - Colormap cmap = XCreateColormap(mScreen->display(),mScreen->rootWindow(),visualInfo->visual,AllocNone); - - XSetWindowAttributes a; - a.colormap = cmap; - x_window = XCreateWindow(mScreen->display(), mScreen->rootWindow(),x, y, w, h, - 0, visualInfo->depth, InputOutput, visualInfo->visual, - CWColormap, &a); -#endif //!defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#else + QPlatformWindowFormat windowFormat = correctColorBuffers(window->platformWindowFormat()); + + EGLDisplay eglDisplay = eglGetDisplay(mScreen->display()); + EGLConfig eglConfig = q_configFromQPlatformWindowFormat(eglDisplay,windowFormat); + VisualID id = QTestLiteEglIntegration::getCompatibleVisualId(mScreen->display(),eglConfig); + + XVisualInfo visualInfoTemplate; + memset(&visualInfoTemplate, 0, sizeof(XVisualInfo)); + visualInfoTemplate.visualid = id; + + XVisualInfo *visualInfo; + int matchingCount = 0; + visualInfo = XGetVisualInfo(mScreen->display(), VisualIDMask, &visualInfoTemplate, &matchingCount); +#endif //!defined(QT_OPENGL_ES_2) + if (visualInfo) { + Colormap cmap = XCreateColormap(mScreen->display(),mScreen->rootWindow(),visualInfo->visual,AllocNone); + + XSetWindowAttributes a; + a.colormap = cmap; + x_window = XCreateWindow(mScreen->display(), mScreen->rootWindow(),x, y, w, h, + 0, visualInfo->depth, InputOutput, visualInfo->visual, + CWColormap, &a); + } else { + qFatal("no window!"); + } +#endif //!defined(QT_NO_OPENGL) } else { x_window = XCreateSimpleWindow(mScreen->display(), mScreen->rootWindow(), x, y, w, h, 0 /*border_width*/, @@ -93,12 +119,6 @@ QTestLiteWindow::QTestLiteWindow(QWidget *window) #ifdef MYX11_DEBUG qDebug() << "QTestLiteWindow::QTestLiteWindow creating" << hex << x_window << window; #endif -// } - -// width = -1; -// height = -1; -// xpos = -1; -// ypos = -1; XSetWindowBackgroundPixmap(mScreen->display(), x_window, XNone); @@ -548,8 +568,23 @@ QPlatformGLContext *QTestLiteWindow::glContext() const return 0; if (!mGLContext) { QTestLiteWindow *that = const_cast<QTestLiteWindow *>(this); -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) +#if !defined(QT_OPENGL_ES_2) that->mGLContext = new QGLXContext(x_window, mScreen,widget()->platformWindowFormat()); +#else + EGLDisplay display = eglGetDisplay(mScreen->display()); + + QPlatformWindowFormat windowFormat = correctColorBuffers(widget()->platformWindowFormat()); + + EGLConfig config = q_configFromQPlatformWindowFormat(display,windowFormat); + QVector<EGLint> eglContextAttrs; + eglContextAttrs.append(EGL_CONTEXT_CLIENT_VERSION); + eglContextAttrs.append(2); + eglContextAttrs.append(EGL_NONE); + + EGLSurface eglSurface = eglCreateWindowSurface(display,config,(EGLNativeWindowType)x_window,0); + that->mGLContext = new QEGLPlatformContext(display, config, eglContextAttrs.data(), eglSurface, EGL_OPENGL_ES_API); +#endif #endif } return mGLContext; @@ -584,4 +619,27 @@ void QTestLiteWindow::doSizeHints() XSetWMNormalHints(mScreen->display(), x_window, &s); } +QPlatformWindowFormat QTestLiteWindow::correctColorBuffers(const QPlatformWindowFormat &platformWindowFormat) const +{ + // I have only tested this setup on a dodgy intel setup, where I didn't use standard libs, + // so this might be not what we want to do :) + if ( !(platformWindowFormat.redBufferSize() == -1 && + platformWindowFormat.greenBufferSize() == -1 && + platformWindowFormat.blueBufferSize() == -1)) + return platformWindowFormat; + + QPlatformWindowFormat windowFormat = platformWindowFormat; + if (mScreen->depth() == 16) { + windowFormat.setRedBufferSize(5); + windowFormat.setGreenBufferSize(6); + windowFormat.setBlueBufferSize(5); + } else { + windowFormat.setRedBufferSize(8); + windowFormat.setGreenBufferSize(8); + windowFormat.setBlueBufferSize(8); + } + + return windowFormat; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/testlite/qtestlitewindow.h b/src/plugins/platforms/testlite/qtestlitewindow.h index 4b952dc..e45c3fd 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.h +++ b/src/plugins/platforms/testlite/qtestlitewindow.h @@ -129,6 +129,8 @@ protected: void doSizeHints(); private: + QPlatformWindowFormat correctColorBuffers(const QPlatformWindowFormat &windowFormat)const; + Window x_window; GC gc; diff --git a/src/plugins/platforms/testlite/testlite.pro b/src/plugins/platforms/testlite/testlite.pro index eb196c3..7fb3304 100644 --- a/src/plugins/platforms/testlite/testlite.pro +++ b/src/plugins/platforms/testlite/testlite.pro @@ -9,22 +9,22 @@ SOURCES = \ qtestlitewindowsurface.cpp \ qtestlitewindow.cpp \ qtestlitecursor.cpp \ - qtestlitescreen.cpp \ - qtestlitekeyboard.cpp \ - qtestliteclipboard.cpp \ - qtestlitemime.cpp \ - qtestlitestaticinfo.cpp + qtestlitescreen.cpp \ + qtestlitekeyboard.cpp \ + qtestliteclipboard.cpp \ + qtestlitemime.cpp \ + qtestlitestaticinfo.cpp HEADERS = \ qtestliteintegration.h \ qtestlitewindowsurface.h \ qtestlitewindow.h \ qtestlitecursor.h \ - qtestlitescreen.h \ - qtestlitekeyboard.h \ - qtestliteclipboard.h \ - qtestlitemime.h \ - qtestlitestaticinfo.h + qtestlitescreen.h \ + qtestlitekeyboard.h \ + qtestliteclipboard.h \ + qtestlitemime.h \ + qtestlitestaticinfo.h LIBS += -lX11 -lXext @@ -36,8 +36,21 @@ include (../fontdatabases/genericunix/genericunix.pri) contains(QT_CONFIG, opengl) { QT += opengl - HEADERS += qglxintegration.h - SOURCES += qglxintegration.cpp + !contains(QT_CONFIG, opengles2) { + HEADERS += qglxintegration.h + SOURCES += qglxintegration.cpp + } else { # There is no easy way to detect if we'r suppose to use glx or not + HEADERS += \ + ../eglconvenience/qeglplatformcontext.h \ + ../eglconvenience/qeglconvenience.h \ + qtestliteeglintegration.h + + SOURCES += \ + ../eglconvenience/qeglplatformcontext.cpp \ + ../eglconvenience/qeglconvenience.cpp \ + qtestliteeglintegration.cpp + LIBS += -lEGL + } } target.path += $$[QT_INSTALL_PLUGINS]/platforms -- cgit v0.12 From 5c11ca38c441dd0e4e105ca0b5372dc917cf31b1 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@nokia.com> Date: Thu, 6 Jan 2011 10:56:06 +1000 Subject: Ensure QDeclarativePrivate::RegisterType version is updated and checked. Also exclude from bic check since we expect its size to increase from time to time. Task-number: QTBUG-13451 Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarative.h | 4 ++-- src/declarative/qml/qdeclarativemetatype.cpp | 3 ++- src/declarative/qml/qdeclarativeprivate.h | 1 + tests/auto/bic/tst_bic.cpp | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h index 8a6d068..cdd7202 100644 --- a/src/declarative/qml/qdeclarative.h +++ b/src/declarative/qml/qdeclarative.h @@ -199,7 +199,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c QByteArray listName("QDeclarativeListProperty<" + name + ">"); QDeclarativePrivate::RegisterType type = { - 1, + 2, qRegisterMetaType<T *>(pointerName.constData()), qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), @@ -233,7 +233,7 @@ int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor) QByteArray listName("QDeclarativeListProperty<" + name + ">"); QDeclarativePrivate::RegisterType type = { - 1, + 2, qRegisterMetaType<T *>(pointerName.constData()), qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index 1f387c4..e90fa40 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -200,7 +200,8 @@ QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::Registe d->m_name = name; d->m_version_maj = type.versionMajor; d->m_version_min = type.versionMinor; - d->m_revision = type.revision; + if (type.version > 1) // revisions added in version 2 + d->m_revision = type.revision; d->m_typeId = type.typeId; d->m_listId = type.listId; d->m_allocationSize = type.objectSize; diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h index a4fc4c1..981df78 100644 --- a/src/declarative/qml/qdeclarativeprivate.h +++ b/src/declarative/qml/qdeclarativeprivate.h @@ -215,6 +215,7 @@ namespace QDeclarativePrivate QDeclarativeCustomParser *customParser; int revision; + // If this is extended ensure "version" is bumped!!! }; struct RegisterInterface { diff --git a/tests/auto/bic/tst_bic.cpp b/tests/auto/bic/tst_bic.cpp index cd1d5ca..74fa252 100644 --- a/tests/auto/bic/tst_bic.cpp +++ b/tests/auto/bic/tst_bic.cpp @@ -135,6 +135,9 @@ tst_Bic::tst_Bic() /* This structure is semi-private and should never shrink */ bic.addBlacklistedClass(QLatin1String("QVFbHeader")); + + /* This structure has a version field that allows extension */ + bic.addBlacklistedClass(QLatin1String("QDeclarativePrivate::RegisterType")); } void tst_Bic::initTestCase_data() -- cgit v0.12 From fa5c838636a8cf4e483706696d19afef495da994 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@nokia.com> Date: Thu, 6 Jan 2011 11:10:38 +1000 Subject: Fix version in previous commit. Had already been bumped. The version had already been bumped from 0 to 1. Only the version check was required. Task-number: QTBUG-13451 Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarative.h | 4 ++-- src/declarative/qml/qdeclarativemetatype.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h index cdd7202..8a6d068 100644 --- a/src/declarative/qml/qdeclarative.h +++ b/src/declarative/qml/qdeclarative.h @@ -199,7 +199,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c QByteArray listName("QDeclarativeListProperty<" + name + ">"); QDeclarativePrivate::RegisterType type = { - 2, + 1, qRegisterMetaType<T *>(pointerName.constData()), qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), @@ -233,7 +233,7 @@ int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor) QByteArray listName("QDeclarativeListProperty<" + name + ">"); QDeclarativePrivate::RegisterType type = { - 2, + 1, qRegisterMetaType<T *>(pointerName.constData()), qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index e90fa40..48a63bb 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -200,7 +200,7 @@ QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::Registe d->m_name = name; d->m_version_maj = type.versionMajor; d->m_version_min = type.versionMinor; - if (type.version > 1) // revisions added in version 2 + if (type.version >= 1) // revisions added in version 1 d->m_revision = type.revision; d->m_typeId = type.typeId; d->m_listId = type.listId; -- cgit v0.12 From c1a87921c8a85d5ecee9aba3b3578ae8d042c28a Mon Sep 17 00:00:00 2001 From: Bea Lam <bea.lam@nokia.com> Date: Thu, 6 Jan 2011 14:22:35 +1000 Subject: Add Repeater itemAdded(), itemRemoved() signals and itemAt() method Task-number: QTBUG-15161 Reviewed-by: Martin Jones --- doc/src/declarative/qdeclarativemodels.qdoc | 4 +- .../graphicsitems/qdeclarativerepeater.cpp | 123 ++++++++---- .../graphicsitems/qdeclarativerepeater_p.h | 6 + .../tst_qdeclarativerepeater.cpp | 216 +++++++++++++++++++-- 4 files changed, 293 insertions(+), 56 deletions(-) diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc index e11cd56..9fc6696 100644 --- a/doc/src/declarative/qdeclarativemodels.qdoc +++ b/doc/src/declarative/qdeclarativemodels.qdoc @@ -161,7 +161,7 @@ while QAbstractItemModel provides a more flexible solution for more complex models. -\section2 QStringList +\section2 QStringList-based model A model may be a simple QStringList, which provides the contents of the list via the \e modelData role. @@ -182,7 +182,7 @@ have changed. If the QStringList changes, it will be necessary to reset the model by calling QDeclarativeContext::setContextProperty() again. -\section2 QList<QObject*> +\section2 QObjectList-based model A list of QObject* values can also be used as a model. A QList<QObject*> provides the properties of the objects in the list as roles. diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp index 6f46c7b..fa684c1 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp +++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp @@ -84,43 +84,23 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() \image repeater-simple.png - The \l model of a Repeater can be any of the supported \l {qmlmodels}{Data Models}. + A Repeater's \l model can be any of the supported \l {qmlmodels}{data models}. + Additionally, like delegates for other views, a Repeater delegate can access + its index within the repeater, as well as the model data relevant to the + delegate. See the \l delegate property documentation for details. Items instantiated by the Repeater are inserted, in order, as children of the Repeater's parent. The insertion starts immediately after the repeater's position in its parent stacking list. This allows a Repeater to be used inside a layout. For example, the following Repeater's items are stacked between a red rectangle and a blue rectangle: - + \snippet doc/src/snippets/declarative/repeaters/repeater.qml layout \image repeater.png - \section2 The \c index and \c modelData properties - - The index of a delegate is exposed as an accessible \c index property in the delegate. - Properties of the model are also available depending upon the type of \l {qmlmodels}{Data Model}. - - Here is a Repeater that uses the \c index property inside the instantiated items: - - \table - \row - \o \snippet doc/src/snippets/declarative/repeaters/repeater.qml index - \o \image repeater-index.png - \endtable - - Here is another Repeater that uses the \c modelData property to reference the data for a - particular index: - - \table - \row - \o \snippet doc/src/snippets/declarative/repeaters/repeater.qml modeldata - \o \image repeater-modeldata.png - \endtable - - - A Repeater item owns all items it instantiates. Removing or dynamically destroying + \note A Repeater item owns all items it instantiates. Removing or dynamically destroying an item created by a Repeater results in unpredictable behavior. @@ -146,6 +126,27 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() \endcode */ +/*! + \qmlsignal Repeater::onItemAdded(int index, Item item) + \since Quick 1.1 + + This handler is called when an item is added to the repeater. The \a index + parameter holds the index at which the item has been inserted within the + repeater, and the \a item parameter holds the \l Item that has been added. +*/ + +/*! + \qmlsignal Repeater::onItemRemoved(int index, Item item) + \since Quick 1.1 + + This handler is called when an item is removed from the repeater. The \a index + parameter holds the index at which the item was removed from the repeater, + and the \a item parameter holds the \l Item that was removed. + + Do not keep a reference to \a item if it was created by this repeater, as + in these cases it will be deleted shortly after the handler is called. +*/ + QDeclarativeRepeater::QDeclarativeRepeater(QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativeRepeaterPrivate), parent) { @@ -160,26 +161,16 @@ QDeclarativeRepeater::~QDeclarativeRepeater() The model providing data for the repeater. - This property can be set to any of the following: + This property can be set to any of the supported \l {qmlmodels}{data models}: \list - \o A number that indicates the number of delegates to be created + \o A number that indicates the number of delegates to be created by the repeater \o A model (e.g. a ListModel item, or a QAbstractItemModel subclass) \o A string list \o An object list \endlist - In each case, the data element and the index is exposed to each instantiated - component. The index is always exposed as an accessible \c index property. - In the case of an object or string list, the data element (of type string - or object) is available as the \c modelData property. In the case of a Qt model, - all roles are available as named properties just like in the view classes. - - As a special case the model can also be merely a number. In this case it will - create that many instances of the component. They will also be assigned an index - based on the order they are created. - - Models can also be created directly in QML, using a \l{ListModel} or \l{XmlListModel}. + The type of model affects the properties that are exposed to the \l delegate. \sa {qmlmodels}{Data Models} */ @@ -243,8 +234,33 @@ void QDeclarativeRepeater::setModel(const QVariant &model) \default The delegate provides a template defining each item instantiated by the repeater. - The index is exposed as an accessible \c index property. Properties of the - model are also available depending upon the type of \l {qmlmodels}{Data Model}. + + Delegates are exposed to a read-only \c index property that indicates the index + of the delegate within the repeater. For example, the following \l Text delegate + displays the index of each repeated item: + + \table + \row + \o \snippet doc/src/snippets/declarative/repeaters/repeater.qml index + \o \image repeater-index.png + \endtable + + If the \l model is a \l{QStringList-based model}{string list} or + \l{QObjectList-based model}{object list}, the delegate is also exposed to + a read-only \c modelData property that holds the string or object data. For + example: + + \table + \row + \o \snippet doc/src/snippets/declarative/repeaters/repeater.qml modeldata + \o \image repeater-modeldata.png + \endtable + + If the \l model is a model object (such as a \l ListModel) the delegate + can access all model roles as named properties, in the same way that delegates + do for view classes like ListView. + + \sa {QML Data Models} */ QDeclarativeComponent *QDeclarativeRepeater::delegate() const { @@ -288,6 +304,21 @@ int QDeclarativeRepeater::count() const return 0; } +/*! + \qmlmethod Item Repeater::itemAt(index) + \since Quick 1.1 + + Returns the \l Item that has been created at the given \a index, or \c null + if no item exists at \a index. +*/ +QDeclarativeItem *QDeclarativeRepeater::itemAt(int index) const +{ + Q_D(const QDeclarativeRepeater); + if (index >= 0 && index < d->deletables.count()) + return d->deletables[index]; + return 0; + +} void QDeclarativeRepeater::componentComplete() { @@ -309,8 +340,13 @@ QVariant QDeclarativeRepeater::itemChange(GraphicsItemChange change, void QDeclarativeRepeater::clear() { Q_D(QDeclarativeRepeater); + bool complete = isComponentComplete(); + if (d->model) { - foreach (QDeclarativeItem *item, d->deletables) { + while (d->deletables.count() > 0) { + QDeclarativeItem *item = d->deletables.takeLast(); + if (complete) + emit itemRemoved(d->deletables.count()-1, item); d->model->release(item); } } @@ -335,6 +371,7 @@ void QDeclarativeRepeater::regenerate() item->setParentItem(parentItem()); item->stackBefore(this); d->deletables << item; + emit itemAdded(ii, item); } } } @@ -355,6 +392,7 @@ void QDeclarativeRepeater::itemsInserted(int index, int count) else item->stackBefore(this); d->deletables.insert(modelIndex, item); + emit itemAdded(modelIndex, item); } } emit countChanged(); @@ -367,6 +405,7 @@ void QDeclarativeRepeater::itemsRemoved(int index, int count) return; while (count--) { QDeclarativeItem *item = d->deletables.takeAt(index); + emit itemRemoved(index, item); if (item) d->model->release(item); else diff --git a/src/declarative/graphicsitems/qdeclarativerepeater_p.h b/src/declarative/graphicsitems/qdeclarativerepeater_p.h index ff58fa0..62552a6 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater_p.h +++ b/src/declarative/graphicsitems/qdeclarativerepeater_p.h @@ -72,10 +72,16 @@ public: int count() const; + Q_INVOKABLE Q_REVISION(1) QDeclarativeItem *itemAt(int index) const; + Q_SIGNALS: void modelChanged(); void delegateChanged(); void countChanged(); + + Q_REVISION(1) void itemAdded(int index, QDeclarativeItem *item); + Q_REVISION(1) void itemRemoved(int index, QDeclarativeItem *item); + private: void clear(); void regenerate(); diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp index 91a4d68..1b38c11 100644 --- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp +++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp @@ -69,8 +69,11 @@ private slots: void numberModel(); void objectList(); void stringList(); - void dataModel(); + void dataModel_adding(); + void dataModel_removing(); + void dataModel_changes(); void itemModel(); + void resetModel(); void properties(); private: @@ -186,6 +189,11 @@ void tst_QDeclarativeRepeater::numberModel() QVERIFY(repeater != 0); QCOMPARE(repeater->parentItem()->childItems().count(), 5+1); + QVERIFY(!repeater->itemAt(-1)); + for (int i=0; i<repeater->count(); i++) + QCOMPARE(repeater->itemAt(i), repeater->parentItem()->childItems().at(i)); + QVERIFY(!repeater->itemAt(repeater->count())); + QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties"); QVERIFY(testObject->error() == false); @@ -223,6 +231,17 @@ void tst_QDeclarativeRepeater::objectList() QCOMPARE(repeater->property("errors").toInt(), 0);//If this fails either they are out of order or can't find the object's data QCOMPARE(repeater->property("instantiated").toInt(), 100); + QVERIFY(!repeater->itemAt(-1)); + for (int i=0; i<data.count(); i++) + QCOMPARE(repeater->itemAt(i), repeater->parentItem()->childItems().at(i)); + QVERIFY(!repeater->itemAt(data.count())); + + QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QDeclarativeItem*))); + QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QDeclarativeItem*))); + ctxt->setContextProperty("testData", QVariant::fromValue(data)); + QCOMPARE(addedSpy.count(), data.count()); + QCOMPARE(removedSpy.count(), data.count()); + qDeleteAll(data); delete canvas; } @@ -284,7 +303,69 @@ void tst_QDeclarativeRepeater::stringList() delete canvas; } -void tst_QDeclarativeRepeater::dataModel() +void tst_QDeclarativeRepeater::dataModel_adding() +{ + QDeclarativeView *canvas = createView(); + QDeclarativeContext *ctxt = canvas->rootContext(); + TestObject *testObject = new TestObject; + ctxt->setContextProperty("testObject", testObject); + + TestModel testModel; + ctxt->setContextProperty("testData", &testModel); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater2.qml")); + qApp->processEvents(); + + QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater"); + QVERIFY(repeater != 0); + QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container"); + QVERIFY(container != 0); + + QVERIFY(!repeater->itemAt(0)); + + QSignalSpy countSpy(repeater, SIGNAL(countChanged())); + QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QDeclarativeItem*))); + + // add to empty model + testModel.addItem("two", "2"); + QCOMPARE(repeater->itemAt(0), container->childItems().at(0)); + QCOMPARE(countSpy.count(), 1); countSpy.clear(); + QCOMPARE(addedSpy.count(), 1); + QCOMPARE(addedSpy.at(0).at(0).toInt(), 0); + QCOMPARE(addedSpy.at(0).at(1).value<QDeclarativeItem*>(), container->childItems().at(0)); + addedSpy.clear(); + + // insert at start + testModel.insertItem(0, "one", "1"); + QCOMPARE(repeater->itemAt(0), container->childItems().at(0)); + QCOMPARE(countSpy.count(), 1); countSpy.clear(); + QCOMPARE(addedSpy.count(), 1); + QCOMPARE(addedSpy.at(0).at(0).toInt(), 0); + QCOMPARE(addedSpy.at(0).at(1).value<QDeclarativeItem*>(), container->childItems().at(0)); + addedSpy.clear(); + + // insert at end + testModel.insertItem(2, "four", "4"); + QCOMPARE(repeater->itemAt(2), container->childItems().at(2)); + QCOMPARE(countSpy.count(), 1); countSpy.clear(); + QCOMPARE(addedSpy.count(), 1); + QCOMPARE(addedSpy.at(0).at(0).toInt(), 2); + QCOMPARE(addedSpy.at(0).at(1).value<QDeclarativeItem*>(), container->childItems().at(2)); + addedSpy.clear(); + + // insert in middle + testModel.insertItem(2, "three", "3"); + QCOMPARE(repeater->itemAt(2), container->childItems().at(2)); + QCOMPARE(countSpy.count(), 1); countSpy.clear(); + QCOMPARE(addedSpy.count(), 1); + QCOMPARE(addedSpy.at(0).at(0).toInt(), 2); + QCOMPARE(addedSpy.at(0).at(1).value<QDeclarativeItem*>(), container->childItems().at(2)); + addedSpy.clear(); + + delete testObject; + delete canvas; +} + +void tst_QDeclarativeRepeater::dataModel_removing() { QDeclarativeView *canvas = createView(); QDeclarativeContext *ctxt = canvas->rootContext(); @@ -295,28 +376,84 @@ void tst_QDeclarativeRepeater::dataModel() testModel.addItem("one", "1"); testModel.addItem("two", "2"); testModel.addItem("three", "3"); + testModel.addItem("four", "4"); + testModel.addItem("five", "5"); ctxt->setContextProperty("testData", &testModel); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater2.qml")); qApp->processEvents(); QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater"); QVERIFY(repeater != 0); - QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container"); QVERIFY(container != 0); + QCOMPARE(container->childItems().count(), repeater->count()+1); + + QSignalSpy countSpy(repeater, SIGNAL(countChanged())); + QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QDeclarativeItem*))); + + // remove at start + QDeclarativeItem *item = repeater->itemAt(0); + QCOMPARE(item, container->childItems().at(0)); + + testModel.removeItem(0); + QVERIFY(repeater->itemAt(0) != item); + QCOMPARE(countSpy.count(), 1); countSpy.clear(); + QCOMPARE(removedSpy.count(), 1); + QCOMPARE(removedSpy.at(0).at(0).toInt(), 0); + QCOMPARE(removedSpy.at(0).at(1).value<QDeclarativeItem*>(), item); + removedSpy.clear(); + + // remove at end + int lastIndex = testModel.count()-1; + item = repeater->itemAt(lastIndex); + QCOMPARE(item, container->childItems().at(lastIndex)); + + testModel.removeItem(lastIndex); + QVERIFY(repeater->itemAt(lastIndex) != item); + QCOMPARE(countSpy.count(), 1); countSpy.clear(); + QCOMPARE(removedSpy.count(), 1); + QCOMPARE(removedSpy.at(0).at(0).toInt(), lastIndex); + QCOMPARE(removedSpy.at(0).at(1).value<QDeclarativeItem*>(), item); + removedSpy.clear(); + + // remove from middle + item = repeater->itemAt(1); + QCOMPARE(item, container->childItems().at(1)); + + testModel.removeItem(1); + QVERIFY(repeater->itemAt(lastIndex) != item); + QCOMPARE(countSpy.count(), 1); countSpy.clear(); + QCOMPARE(removedSpy.count(), 1); + QCOMPARE(removedSpy.at(0).at(0).toInt(), 1); + QCOMPARE(removedSpy.at(0).at(1).value<QDeclarativeItem*>(), item); + removedSpy.clear(); - QCOMPARE(container->childItems().count(), 4); + delete testObject; + delete canvas; +} - QSignalSpy repeaterSpy(repeater, SIGNAL(countChanged())); - testModel.addItem("four", "4"); - QCOMPARE(container->childItems().count(), 5); - QCOMPARE(repeaterSpy.count(),1); +void tst_QDeclarativeRepeater::dataModel_changes() +{ + QDeclarativeView *canvas = createView(); + QDeclarativeContext *ctxt = canvas->rootContext(); + TestObject *testObject = new TestObject; + ctxt->setContextProperty("testObject", testObject); - testModel.removeItem(2); - QCOMPARE(container->childItems().count(), 4); - QCOMPARE(repeaterSpy.count(),2); + TestModel testModel; + testModel.addItem("one", "1"); + testModel.addItem("two", "2"); + testModel.addItem("three", "3"); + + ctxt->setContextProperty("testData", &testModel); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater2.qml")); + qApp->processEvents(); + + QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater"); + QVERIFY(repeater != 0); + QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container"); + QVERIFY(container != 0); + QCOMPARE(container->childItems().count(), repeater->count()+1); // Check that model changes are propagated QDeclarativeText *text = findItem<QDeclarativeText>(canvas->rootObject(), "myName", 1); @@ -377,6 +514,61 @@ void tst_QDeclarativeRepeater::itemModel() delete canvas; } +void tst_QDeclarativeRepeater::resetModel() +{ + QDeclarativeView *canvas = createView(); + + QStringList dataA; + for (int i=0; i<10; i++) + dataA << QString::number(i); + + QDeclarativeContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testData", dataA); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater1.qml")); + qApp->processEvents(); + QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater"); + QVERIFY(repeater != 0); + QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container"); + QVERIFY(container != 0); + + QCOMPARE(repeater->count(), dataA.count()); + + QSignalSpy countSpy(repeater, SIGNAL(countChanged())); + QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QDeclarativeItem*))); + QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QDeclarativeItem*))); + + QStringList dataB; + for (int i=0; i<20; i++) + dataB << QString::number(i); + + // reset context property + ctxt->setContextProperty("testData", dataB); + QCOMPARE(repeater->count(), dataB.count()); + + QCOMPARE(countSpy.count(), 1); + QCOMPARE(removedSpy.count(), dataA.count()); + QCOMPARE(addedSpy.count(), dataB.count()); + for (int i=0; i<dataB.count(); i++) { + QCOMPARE(addedSpy.at(i).at(0).toInt(), i); + QCOMPARE(addedSpy.at(i).at(1).value<QDeclarativeItem*>(), repeater->itemAt(i)); + } + countSpy.clear(); + removedSpy.clear(); + addedSpy.clear(); + + // reset via setModel() + repeater->setModel(dataA); + QCOMPARE(repeater->count(), dataA.count()); + + QCOMPARE(countSpy.count(), 1); + QCOMPARE(removedSpy.count(), dataB.count()); + QCOMPARE(addedSpy.count(), dataA.count()); + for (int i=0; i<dataA.count(); i++) { + QCOMPARE(addedSpy.at(i).at(0).toInt(), i); + QCOMPARE(addedSpy.at(i).at(1).value<QDeclarativeItem*>(), repeater->itemAt(i)); + } +} + void tst_QDeclarativeRepeater::properties() { QDeclarativeEngine engine; -- cgit v0.12 From c527a1ee371c4758776217e7d16c75e20fe6f5aa Mon Sep 17 00:00:00 2001 From: Bea Lam <bea.lam@nokia.com> Date: Fri, 7 Jan 2011 10:24:54 +1000 Subject: Fix to register Repeater for QtQuick 1.1 Task-number: QTBUG-15161 Reviewed-by: Martin Jones --- .../graphicsitems/qdeclarativeitemsmodule.cpp | 4 ++ .../tst_qdeclarativerepeater.cpp | 46 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index a462763..f06b256 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -175,6 +175,10 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType<QGraphicsEffect>(); #endif + // QtQuick 1.1 items + qmlRegisterType<QDeclarativeRepeater, 1>("QtQuick",1,1,"Repeater"); + + qmlRegisterUncreatableType<QDeclarativeKeyNavigationAttached>("QtQuick",1,0,"KeyNavigation",QDeclarativeKeyNavigationAttached::tr("KeyNavigation is only available via attached properties")); qmlRegisterUncreatableType<QDeclarativeKeysAttached>("QtQuick",1,0,"Keys",QDeclarativeKeysAttached::tr("Keys is only available via attached properties")); diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp index 1b38c11..0629076 100644 --- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp +++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp @@ -75,6 +75,8 @@ private slots: void itemModel(); void resetModel(); void properties(); + void testQtQuick11Attributes(); + void testQtQuick11Attributes_data(); private: QDeclarativeView *createView(); @@ -599,6 +601,50 @@ void tst_QDeclarativeRepeater::properties() delete rootObject; } +void tst_QDeclarativeRepeater::testQtQuick11Attributes() +{ + QFETCH(QString, code); + QFETCH(QString, warning); + QFETCH(QString, error); + + QDeclarativeEngine engine; + QObject *obj; + + QDeclarativeComponent invalid(&engine); + invalid.setData("import QtQuick 1.0; Repeater { " + code.toUtf8() + " }", QUrl("")); + QTest::ignoreMessage(QtWarningMsg, warning.toUtf8()); + obj = invalid.create(); + QCOMPARE(invalid.errorString(), error); + delete obj; + + QDeclarativeComponent valid(&engine); + valid.setData("import QtQuick 1.1; Repeater { " + code.toUtf8() + " }", QUrl("")); + obj = valid.create(); + QVERIFY(obj); + QVERIFY(valid.errorString().isEmpty()); + delete obj; +} + +void tst_QDeclarativeRepeater::testQtQuick11Attributes_data() +{ + QTest::addColumn<QString>("code"); + QTest::addColumn<QString>("warning"); + QTest::addColumn<QString>("error"); + + QTest::newRow("itemAdded") << "onItemAdded: count" + << "QDeclarativeComponent: Component is not ready" + << ":1 Signal \"onItemAdded\" not available in QtQuick/Repeater 1.0\n"; + + QTest::newRow("itemRemoved") << "onItemRemoved: count" + << "QDeclarativeComponent: Component is not ready" + << ":1 Signal \"onItemRemoved\" not available in QtQuick/Repeater 1.0\n"; + + QTest::newRow("itemAt") << "Component.onCompleted: itemAt(0)" + << "<Unknown File>:1: ReferenceError: Can't find variable: itemAt" + << ""; +} + + QDeclarativeView *tst_QDeclarativeRepeater::createView() { QDeclarativeView *canvas = new QDeclarativeView(0); -- cgit v0.12 From 8b45ca46095020c495b44d764bb439018a87d22a Mon Sep 17 00:00:00 2001 From: Alan Alpert <alan.alpert@nokia.com> Date: Fri, 7 Jan 2011 10:36:01 +1000 Subject: Add linkActivated signal to TextEdit Since TextEdit can also contain rich text with anchors, it should also have a linkActivated signal like Text does. Task-number: QTBUG-15283 Reviewed-by: Martin Jones --- .../graphicsitems/qdeclarativeitemsmodule.cpp | 1 + .../graphicsitems/qdeclarativetextedit.cpp | 16 +- .../graphicsitems/qdeclarativetextedit_p.h | 1 + .../data-X11/linkActivated.0.png | Bin 0 -> 609 bytes .../data-X11/linkActivated.1.png | Bin 0 -> 677 bytes .../data-X11/linkActivated.qml | 191 +++++++++++++++++++++ .../qdeclarativetextedit/data/linkActivated.0.png | Bin 0 -> 609 bytes .../qdeclarativetextedit/data/linkActivated.1.png | Bin 0 -> 677 bytes .../qdeclarativetextedit/data/linkActivated.qml | 191 +++++++++++++++++++++ .../qdeclarativetextedit/linkActivated.qml | 15 ++ 10 files changed, 412 insertions(+), 3 deletions(-) create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.0.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.1.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.qml create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.0.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.1.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.qml create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextedit/linkActivated.qml diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index a462763..752e239 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -142,6 +142,7 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType<QGraphicsScale>("QtQuick",1,0,"Scale"); qmlRegisterType<QDeclarativeText>("QtQuick",1,0,"Text"); qmlRegisterType<QDeclarativeTextEdit>("QtQuick",1,0,"TextEdit"); + qmlRegisterType<QDeclarativeTextEdit,1>("QtQuick",1,1,"TextEdit"); #ifndef QT_NO_LINEEDIT qmlRegisterType<QDeclarativeTextInput>("QtQuick",1,0,"TextInput"); #endif diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index c1314ff..c71fd98 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -103,6 +103,14 @@ TextEdit { \sa Text, TextInput, {declarative/text/textselection}{Text Selection example} */ +/*! + \qmlsignal TextEdit::onLinkActivated(string link) + \since Quick 1.1 + + This handler is called when the user clicks on a link embedded in the text. + The link must be in rich text or HTML format and the + \a link string provides access to the particular link. +*/ QDeclarativeTextEdit::QDeclarativeTextEdit(QDeclarativeItem *parent) : QDeclarativePaintedItem(*(new QDeclarativeTextEditPrivate), parent) { @@ -894,11 +902,11 @@ void QDeclarativeTextEdit::setReadOnly(bool r) return; - Qt::TextInteractionFlags flags = Qt::NoTextInteraction; + Qt::TextInteractionFlags flags = Qt::LinksAccessibleByMouse; if (r) { - flags = Qt::TextSelectableByMouse; + flags = flags | Qt::TextSelectableByMouse; } else { - flags = Qt::TextEditorInteraction; + flags = flags | Qt::TextEditorInteraction; } d->control->setTextInteractionFlags(flags); if (!r) @@ -1260,6 +1268,7 @@ void QDeclarativeTextEditPrivate::init() control = new QTextControl(q); control->setIgnoreUnusedNavigationEvents(true); + control->setTextInteractionFlags(control->textInteractionFlags() | Qt::LinksAccessibleByMouse); // QTextControl follows the default text color // defined by the platform, declarative text @@ -1278,6 +1287,7 @@ void QDeclarativeTextEditPrivate::init() QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SLOT(updateSelectionMarkers())); QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SIGNAL(cursorPositionChanged())); QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SIGNAL(cursorRectangleChanged())); + QObject::connect(control, SIGNAL(linkActivated(QString)), q, SIGNAL(linkActivated(QString))); document = control->document(); document->setDefaultFont(font); diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h index 691d995..37b24f7 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h @@ -221,6 +221,7 @@ Q_SIGNALS: void persistentSelectionChanged(bool isPersistentSelection); void textMarginChanged(qreal textMargin); void selectByMouseChanged(bool selectByMouse); + Q_REVISION(1) void linkActivated(const QString &link); public Q_SLOTS: void deselect(); diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.0.png new file mode 100644 index 0000000..7d0d0ae Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.0.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.1.png new file mode 100644 index 0000000..7d612bf Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.1.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.qml new file mode 100644 index 0000000..8c7e380 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.qml @@ -0,0 +1,191 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "linkActivated.0.png" + } + Frame { + msec: 32 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 48 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 64 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 80 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 96 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 112 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 128 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 144 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 160 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 176 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 192 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 208 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 224 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 240 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 256 + hash: "53d97d0966197ea41364511dea13752f" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 21; y: 13 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 272 + hash: "9482227cbc77e9083218c1452e8644d8" + } + Frame { + msec: 288 + hash: "9482227cbc77e9083218c1452e8644d8" + } + Frame { + msec: 304 + hash: "9482227cbc77e9083218c1452e8644d8" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 22; y: 11 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 320 + hash: "9482227cbc77e9083218c1452e8644d8" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 23; y: 10 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 23; y: 10 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 336 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 352 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 368 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 384 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 400 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 416 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 432 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 448 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 464 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 480 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 496 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 512 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 528 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 544 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 560 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 576 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 592 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 608 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.0.png new file mode 100644 index 0000000..7d0d0ae Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.0.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.1.png new file mode 100644 index 0000000..7d612bf Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.1.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.qml new file mode 100644 index 0000000..8c7e380 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.qml @@ -0,0 +1,191 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "linkActivated.0.png" + } + Frame { + msec: 32 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 48 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 64 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 80 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 96 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 112 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 128 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 144 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 160 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 176 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 192 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 208 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 224 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 240 + hash: "53d97d0966197ea41364511dea13752f" + } + Frame { + msec: 256 + hash: "53d97d0966197ea41364511dea13752f" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 21; y: 13 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 272 + hash: "9482227cbc77e9083218c1452e8644d8" + } + Frame { + msec: 288 + hash: "9482227cbc77e9083218c1452e8644d8" + } + Frame { + msec: 304 + hash: "9482227cbc77e9083218c1452e8644d8" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 22; y: 11 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 320 + hash: "9482227cbc77e9083218c1452e8644d8" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 23; y: 10 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 23; y: 10 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 336 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 352 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 368 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 384 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 400 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 416 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 432 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 448 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 464 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 480 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 496 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 512 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 528 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 544 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 560 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 576 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 592 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } + Frame { + msec: 608 + hash: "29c47cec5d015e6cab0762c3db0fa714" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/linkActivated.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/linkActivated.qml new file mode 100644 index 0000000..177d475 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/linkActivated.qml @@ -0,0 +1,15 @@ +import QtQuick 1.1 + +Rectangle{ + width: 100 + height: 100 + TextEdit{ + text: '<a href="clicked">Click Me</a> ' + onLinkActivated: txt.text=link; + } + Text{ + id: txt + y:50 + text: "unknown" + } +} -- cgit v0.12 From 9a186ba66506963b9d88518d5cea0846825ba494 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@nokia.com> Date: Fri, 7 Jan 2011 11:27:25 +1000 Subject: Add PinchArea autotests. Task-number: QTBUG-15491 --- tests/auto/declarative/declarative.pro | 1 + .../declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index f0fcfa9..51597bd 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -45,6 +45,7 @@ SUBDIRS += \ qdeclarativemousearea \ qdeclarativeparticles \ qdeclarativepathview \ + qdeclarativepincharea \ qdeclarativepixmapcache \ qdeclarativepositioners \ qdeclarativeproperty \ diff --git a/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp b/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp index d1015fc..f175033 100644 --- a/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp +++ b/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp @@ -229,7 +229,7 @@ void tst_QDeclarativePinchArea::scale() QTest::touchEvent(vp).move(0, p1).move(1, p2); QCOMPARE(root->property("scale").toReal(), 1.5); - QCOMPARE(root->property("center").toPointF(), QPointF(90, 90)); + QCOMPARE(root->property("center").toPointF(), QPointF(40, 40)); // blackrect is at 50,50 QCOMPARE(blackRect->scale(), 1.5); // scale beyond bound @@ -283,7 +283,7 @@ void tst_QDeclarativePinchArea::pan() p2 += QPoint(10,10); QTest::touchEvent(vp).move(0, p1).move(1, p2); - QCOMPARE(root->property("center").toPointF(), QPointF(110, 110)); + QCOMPARE(root->property("center").toPointF(), QPointF(60, 60)); // blackrect is at 50,50 QCOMPARE(blackRect->x(), 60.0); QCOMPARE(blackRect->y(), 60.0); -- cgit v0.12 From d57baa9be741e0db90e08cc39ba8d488f58c40f5 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@nokia.com> Date: Fri, 7 Jan 2011 14:10:08 +1000 Subject: PinchArea API changes following review. Task-number: QTBUG-15491 Reviewed-by: Michael Brasser --- .../touchinteraction/pincharea/flickresize.qml | 6 ++-- .../graphicsitems/qdeclarativepincharea.cpp | 42 +++++++++++----------- .../graphicsitems/qdeclarativepincharea_p.h | 20 +++++------ .../qdeclarativepincharea/data/pinchproperties.qml | 2 +- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/examples/declarative/touchinteraction/pincharea/flickresize.qml b/examples/declarative/touchinteraction/pincharea/flickresize.qml index 8f29d6d..aa426e7 100644 --- a/examples/declarative/touchinteraction/pincharea/flickresize.qml +++ b/examples/declarative/touchinteraction/pincharea/flickresize.qml @@ -56,11 +56,11 @@ Rectangle { height: Math.max(flick.contentHeight, flick.height) onPinchChanged: { // adjust content pos due to drag - flick.contentX += pinch.lastCenter.x - pinch.center.x - flick.contentY += pinch.lastCenter.y - pinch.center.y + flick.contentX += pinch.previousCenter.x - pinch.center.x + flick.contentY += pinch.previousCenter.y - pinch.center.y // resize content - var scale = 1.0 + pinch.scale - pinch.lastScale + var scale = 1.0 + pinch.scale - pinch.previousScale flick.resizeContent(flick.contentWidth * scale, flick.contentHeight * scale, pinch.center) } diff --git a/src/declarative/graphicsitems/qdeclarativepincharea.cpp b/src/declarative/graphicsitems/qdeclarativepincharea.cpp index 998c30d..436099e 100644 --- a/src/declarative/graphicsitems/qdeclarativepincharea.cpp +++ b/src/declarative/graphicsitems/qdeclarativepincharea.cpp @@ -58,11 +58,11 @@ QT_BEGIN_NAMESPACE \bold {The PinchEvent element was added in QtQuick 1.1} - The \c center, \c startCenter, \c lastCenter properties provide the center position between the two touch points. + The \c center, \c startCenter, \c previousCenter properties provide the center position between the two touch points. - The \c scale and \c lastScale properties provide the scale factor. + The \c scale and \c previousScale properties provide the scale factor. - The \c angle, \c lastAngle and \c rotation properties provide the angle between the two points and the amount of rotation. + The \c angle, \c previousAngle and \c rotation properties provide the angle between the two points and the amount of rotation. The \c point1, \c point2, \c startPoint1, \c startPoint2 properties provide the positions of the touch points. @@ -75,26 +75,26 @@ QT_BEGIN_NAMESPACE /*! \qmlproperty QPointF PinchEvent::center \qmlproperty QPointF PinchEvent::startCenter - \qmlproperty QPointF PinchEvent::lastCenter + \qmlproperty QPointF PinchEvent::previousCenter These properties hold the position of the center point between the two touch points. \list \o \c center is the current center point - \o \c lastCenter is the center point of the previous event. + \o \c previousCenter is the center point of the previous event. \o \c startCenter is the center point when the gesture began \endlist */ /*! \qmlproperty real PinchEvent::scale - \qmlproperty real PinchEvent::lastScale + \qmlproperty real PinchEvent::previousScale These properties hold the scale factor determined by the change in distance between the two touch points. \list \o \c scale is the current scale factor. - \o \c lastScale is the scale factor of the previous event. + \o \c previousScale is the scale factor of the previous event. \endlist When a pinch gesture is started, the scale is 1.0. @@ -102,14 +102,14 @@ QT_BEGIN_NAMESPACE /*! \qmlproperty real PinchEvent::angle - \qmlproperty real PinchEvent::lastAngle + \qmlproperty real PinchEvent::previousAngle \qmlproperty real PinchEvent::rotation These properties hold the angle between the two touch points. \list \o \c angle is the current angle between the two points in the range -180 to 180. - \o \c lastAngle is the angle of the previous event. + \o \c previousAngle is the angle of the previous event. \o \c rotation is the total rotation since the pinch gesture started. \endlist @@ -169,7 +169,7 @@ QDeclarativePinchAreaPrivate::~QDeclarativePinchAreaPrivate() \list \o setting a \c pinch.target to provide automatic interaction with an element - \o using the onPinchStarted, onPinchChanged and onPinchFinished handlers + \o using the onPinchStarted, onPinchUpdated and onPinchFinished handlers \endlist \sa PinchEvent @@ -188,7 +188,7 @@ QDeclarativePinchAreaPrivate::~QDeclarativePinchAreaPrivate() */ /*! - \qmlsignal PinchArea::onPinchChanged() + \qmlsignal PinchArea::onPinchUpdated() This handler is called when the pinch area detects that a pinch gesture has changed. @@ -304,9 +304,9 @@ void QDeclarativePinchArea::updatePinch() QPointF pinchCenter = mapFromScene(d->sceneLastCenter); QDeclarativePinchEvent pe(pinchCenter, d->pinchLastScale, d->pinchLastAngle, rotationAngle); pe.setStartCenter(d->pinchStartCenter); - pe.setLastCenter(pinchCenter); - pe.setLastAngle(d->pinchLastAngle); - pe.setLastScale(d->pinchLastScale); + pe.setPreviousCenter(pinchCenter); + pe.setPreviousAngle(d->pinchLastAngle); + pe.setPreviousScale(d->pinchLastScale); pe.setStartPoint1(mapFromScene(d->sceneStartPoint1)); pe.setStartPoint2(mapFromScene(d->sceneStartPoint2)); pe.setPoint1(d->lastPoint1); @@ -352,9 +352,9 @@ void QDeclarativePinchArea::updatePinch() d->lastPoint2 = d->touchPoints.at(1).pos(); QDeclarativePinchEvent pe(d->pinchStartCenter, 1.0, angle, 0.0); pe.setStartCenter(d->pinchStartCenter); - pe.setLastCenter(d->pinchStartCenter); - pe.setLastAngle(d->pinchLastAngle); - pe.setLastScale(d->pinchLastScale); + pe.setPreviousCenter(d->pinchStartCenter); + pe.setPreviousAngle(d->pinchLastAngle); + pe.setPreviousScale(d->pinchLastScale); pe.setStartPoint1(mapFromScene(d->sceneStartPoint1)); pe.setStartPoint2(mapFromScene(d->sceneStartPoint2)); pe.setPoint1(d->lastPoint1); @@ -383,9 +383,9 @@ void QDeclarativePinchArea::updatePinch() QPointF pinchCenter = mapFromScene(sceneCenter); QDeclarativePinchEvent pe(pinchCenter, scale, angle, rotationAngle); pe.setStartCenter(d->pinchStartCenter); - pe.setLastCenter(mapFromScene(d->sceneLastCenter)); - pe.setLastAngle(d->pinchLastAngle); - pe.setLastScale(d->pinchLastScale); + pe.setPreviousCenter(mapFromScene(d->sceneLastCenter)); + pe.setPreviousAngle(d->pinchLastAngle); + pe.setPreviousScale(d->pinchLastScale); pe.setStartPoint1(mapFromScene(d->sceneStartPoint1)); pe.setStartPoint2(mapFromScene(d->sceneStartPoint2)); pe.setPoint1(d->touchPoints.at(0).pos()); @@ -395,7 +395,7 @@ void QDeclarativePinchArea::updatePinch() d->pinchLastAngle = angle; d->lastPoint1 = d->touchPoints.at(0).pos(); d->lastPoint2 = d->touchPoints.at(1).pos(); - emit pinchChanged(&pe); + emit pinchUpdated(&pe); if (d->pinch && d->pinch->target()) { qreal s = d->pinchStartScale * scale; s = qMin(qMax(pinch()->minimumScale(),s), pinch()->maximumScale()); diff --git a/src/declarative/graphicsitems/qdeclarativepincharea_p.h b/src/declarative/graphicsitems/qdeclarativepincharea_p.h index 9a73a17..cd5423d 100644 --- a/src/declarative/graphicsitems/qdeclarativepincharea_p.h +++ b/src/declarative/graphicsitems/qdeclarativepincharea_p.h @@ -193,11 +193,11 @@ class Q_AUTOTEST_EXPORT QDeclarativePinchEvent : public QObject Q_PROPERTY(QPointF center READ center) Q_PROPERTY(QPointF startCenter READ startCenter) - Q_PROPERTY(QPointF lastCenter READ lastCenter) + Q_PROPERTY(QPointF previousCenter READ previousCenter) Q_PROPERTY(qreal scale READ scale) - Q_PROPERTY(qreal lastScale READ lastScale) + Q_PROPERTY(qreal previousScale READ previousScale) Q_PROPERTY(qreal angle READ angle) - Q_PROPERTY(qreal lastAngle READ lastAngle) + Q_PROPERTY(qreal previousAngle READ previousAngle) Q_PROPERTY(qreal rotation READ rotation) Q_PROPERTY(QPointF point1 READ point1) Q_PROPERTY(QPointF startPoint1 READ startPoint1) @@ -212,14 +212,14 @@ public: QPointF center() const { return m_center; } QPointF startCenter() const { return m_startCenter; } void setStartCenter(QPointF c) { m_startCenter = c; } - QPointF lastCenter() const { return m_lastCenter; } - void setLastCenter(QPointF c) { m_lastCenter = c; } + QPointF previousCenter() const { return m_lastCenter; } + void setPreviousCenter(QPointF c) { m_lastCenter = c; } qreal scale() const { return m_scale; } - qreal lastScale() const { return m_lastScale; } - void setLastScale(qreal s) { m_lastScale = s; } + qreal previousScale() const { return m_lastScale; } + void setPreviousScale(qreal s) { m_lastScale = s; } qreal angle() const { return m_angle; } - qreal lastAngle() const { return m_lastAngle; } - void setLastAngle(qreal a) { m_lastAngle = a; } + qreal previousAngle() const { return m_lastAngle; } + void setPreviousAngle(qreal a) { m_lastAngle = a; } qreal rotation() const { return m_rotation; } QPointF point1() const { return m_point1; } void setPoint1(QPointF p) { m_point1 = p; } @@ -271,7 +271,7 @@ public: Q_SIGNALS: void enabledChanged(); void pinchStarted(QDeclarativePinchEvent *pinch); - void pinchChanged(QDeclarativePinchEvent *pinch); + void pinchUpdated(QDeclarativePinchEvent *pinch); void pinchFinished(QDeclarativePinchEvent *pinch); protected: diff --git a/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml b/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml index f39ea06..0b59d9d 100644 --- a/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml +++ b/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml @@ -33,7 +33,7 @@ Rectangle { whiteRect.center = pinch.center whiteRect.scale = pinch.scale } - onPinchChanged: { + onPinchUpdated: { whiteRect.center = pinch.center whiteRect.scale = pinch.scale } -- cgit v0.12 From 5f4bf308ac7d4c81374f651103f85d45e0065d05 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@nokia.com> Date: Fri, 7 Jan 2011 14:11:43 +1000 Subject: Group all QtQuick 1.1 registrations together Task-number: QTBUG-15279 --- src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 5e04168..7db4d85 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -142,20 +142,16 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType<QGraphicsScale>("QtQuick",1,0,"Scale"); qmlRegisterType<QDeclarativeText>("QtQuick",1,0,"Text"); qmlRegisterType<QDeclarativeTextEdit>("QtQuick",1,0,"TextEdit"); - qmlRegisterType<QDeclarativeTextEdit,1>("QtQuick",1,1,"TextEdit"); #ifndef QT_NO_LINEEDIT qmlRegisterType<QDeclarativeTextInput>("QtQuick",1,0,"TextInput"); #endif qmlRegisterType<QDeclarativeViewSection>("QtQuick",1,0,"ViewSection"); qmlRegisterType<QDeclarativeVisualDataModel>("QtQuick",1,0,"VisualDataModel"); qmlRegisterType<QDeclarativeVisualItemModel>("QtQuick",1,0,"VisualItemModel"); - qmlRegisterType<QDeclarativePinchArea>("QtQuick",1,1,"PinchArea"); - qmlRegisterType<QDeclarativePinch>(); qmlRegisterType<QDeclarativeAnchors>(); qmlRegisterType<QDeclarativeKeyEvent>(); qmlRegisterType<QDeclarativeMouseEvent>(); - qmlRegisterType<QDeclarativePinchEvent>(); qmlRegisterType<QGraphicsObject>(); qmlRegisterType<QGraphicsWidget>("QtQuick",1,0,"QGraphicsWidget"); qmlRegisterExtendedType<QGraphicsWidget,QDeclarativeGraphicsWidget>("QtQuick",1,0,"QGraphicsWidget"); @@ -176,13 +172,16 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType<QGraphicsEffect>(); #endif - // QtQuick 1.1 items - qmlRegisterType<QDeclarativeRepeater, 1>("QtQuick",1,1,"Repeater"); - - qmlRegisterUncreatableType<QDeclarativeKeyNavigationAttached>("QtQuick",1,0,"KeyNavigation",QDeclarativeKeyNavigationAttached::tr("KeyNavigation is only available via attached properties")); qmlRegisterUncreatableType<QDeclarativeKeysAttached>("QtQuick",1,0,"Keys",QDeclarativeKeysAttached::tr("Keys is only available via attached properties")); + // QtQuick 1.1 items + qmlRegisterType<QDeclarativePinchArea>("QtQuick",1,1,"PinchArea"); + qmlRegisterType<QDeclarativePinch>("QtQuick",1,1,"Pinch"); + qmlRegisterType<QDeclarativePinchEvent>(); + qmlRegisterType<QDeclarativeRepeater, 1>("QtQuick",1,1,"Repeater"); + qmlRegisterType<QDeclarativeTextEdit,1>("QtQuick",1,1,"TextEdit"); + #ifndef QT_NO_IMPORT_QT47_QML #ifdef QT_NO_MOVIE qmlRegisterTypeNotAvailable("Qt",4,7,"AnimatedImage", -- cgit v0.12 From d3a6fcd9174b893aaac9db7d5e541ceb54b12402 Mon Sep 17 00:00:00 2001 From: Joona Petrell <joona.t.petrell@nokia.com> Date: Thu, 23 Dec 2010 12:24:47 +1000 Subject: Introduce Qt.application.active property Replaces qmlviewer's runtime.activeWindow property. Task-number: QTBUG-13351 Reviewed-by: Martin Jones --- demos/declarative/snake/snake.qml | 2 +- doc/src/snippets/declarative/application.qml | 53 +++++++++ src/declarative/qml/qdeclarativeengine.cpp | 4 + src/declarative/util/qdeclarativeapplication.cpp | 118 +++++++++++++++++++++ src/declarative/util/qdeclarativeapplication_p.h | 83 +++++++++++++++ src/declarative/util/qdeclarativeutilmodule.cpp | 3 + src/declarative/util/util.pri | 2 + tests/auto/declarative/declarative.pro | 1 + .../qdeclarativeapplication.pro | 5 + .../tst_qdeclarativeapplication.cpp | 96 +++++++++++++++++ 10 files changed, 366 insertions(+), 1 deletion(-) create mode 100644 doc/src/snippets/declarative/application.qml create mode 100644 src/declarative/util/qdeclarativeapplication.cpp create mode 100644 src/declarative/util/qdeclarativeapplication_p.h create mode 100644 tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro create mode 100644 tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml index af86aac..366c172 100644 --- a/demos/declarative/snake/snake.qml +++ b/demos/declarative/snake/snake.qml @@ -105,7 +105,7 @@ Rectangle { source: "content/pics/pause.png" anchors.centerIn: parent; //opacity is deliberately not animated - opacity: activeGame && !runtime.isActiveWindow + opacity: activeGame && !Qt.application.active } Image { diff --git a/doc/src/snippets/declarative/application.qml b/doc/src/snippets/declarative/application.qml new file mode 100644 index 0000000..2820ff2 --- /dev/null +++ b/doc/src/snippets/declarative/application.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [document] +import QtQuick 1.1 + +Rectangle { + width: 300; height: 55 + color: Qt.application.active ? "white" : "lightgray" + Text { + text: "Application " + (Qt.application.active ? "active" : "inactive") + opacity: Qt.application.active ? 1.0 : 0.5 + anchors.centerIn: parent + } +} +//! [document] diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 0a008ff..b940457 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -70,6 +70,7 @@ #include "private/qdeclarativeinclude_p.h" #include "private/qdeclarativenotifier_p.h" #include "private/qdeclarativedebugtrace_p.h" +#include "private/qdeclarativeapplication_p.h" #include <QtCore/qmetaobject.h> #include <QScriptClass> @@ -521,6 +522,9 @@ void QDeclarativeEnginePrivate::init() listClass = new QDeclarativeListScriptClass(q); rootContext = new QDeclarativeContext(q,true); + QScriptValue applicationObject = objectClass->newQObject(new QDeclarativeApplication(q)); + scriptEngine.globalObject().property(QLatin1String("Qt")).setProperty(QLatin1String("application"), applicationObject); + if (QCoreApplication::instance()->thread() == q->thread() && QDeclarativeEngineDebugServer::isDebuggingEnabled()) { isDebugging = true; diff --git a/src/declarative/util/qdeclarativeapplication.cpp b/src/declarative/util/qdeclarativeapplication.cpp new file mode 100644 index 0000000..53d196f --- /dev/null +++ b/src/declarative/util/qdeclarativeapplication.cpp @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdeclarativeapplication_p.h" +#include <private/qobject_p.h> +#include <QtGui/QApplication> + +class QDeclarativeApplicationPrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QDeclarativeApplication) +public: + QDeclarativeApplicationPrivate() : active(QApplication::activeWindow() != 0) {} + bool active; +}; + +/*! + \qmlclass Application QDeclarativeApplication + \since QtQuick 1.1 + \ingroup qml-utility-elements + \brief The Application element provides access to global application + state properties shared by many QML components. + + These properties include application activity property \c active. + + \section1 Example Usage + + The following example shows the simplest usage of the Application element. + + \snippet doc/src/snippets/declarative/application.qml document + +*/ + +QDeclarativeApplication::QDeclarativeApplication(QObject *parent) : QObject(*new QDeclarativeApplicationPrivate(), parent) +{ + if (qApp) + qApp->installEventFilter(this); +} + +QDeclarativeApplication::~QDeclarativeApplication() +{ +} + +/*! + \qmlproperty bool Application::active + + This property indicates whether the application is the top-most and focused + application, and user is able to interact with the application. The property + is false when the application is on the background, device keylock or screen + saver is active, the screen backlight is turned off, or global system dialog + is being displayed on top of the application. It can be used for stopping and + pausing animations, timers, active processing of data to save device battery + and free device memory and processor load when the application is not active. + This property is readonly. + +*/ +bool QDeclarativeApplication::active() const +{ + Q_D(const QDeclarativeApplication); + return d->active; +} + +bool QDeclarativeApplication::eventFilter(QObject *obj, QEvent *event) +{ + Q_UNUSED(obj) + Q_D(QDeclarativeApplication); + if (event->type() == QEvent::ApplicationActivate + || event->type() == QEvent::ApplicationDeactivate) { + bool active = d->active; + if (event->type() == QEvent::ApplicationActivate) + active = true; + else if (event->type() == QEvent::ApplicationDeactivate) + active = false; + + if (d->active != active) { + d->active = active; + emit activeChanged(); + } + } + return false; +} diff --git a/src/declarative/util/qdeclarativeapplication_p.h b/src/declarative/util/qdeclarativeapplication_p.h new file mode 100644 index 0000000..59ea7fe --- /dev/null +++ b/src/declarative/util/qdeclarativeapplication_p.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEAPPLICATION_P_H +#define QDECLARATIVEAPPLICATION_P_H + +#include <QtCore/QObject> +#include <qdeclarative.h> +#include <private/qdeclarativeglobal_p.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeApplicationPrivate; +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeApplication : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool active READ active NOTIFY activeChanged) + +public: + explicit QDeclarativeApplication(QObject *parent = 0); + virtual ~QDeclarativeApplication(); + bool active() const; + +protected: + bool eventFilter(QObject *obj, QEvent *event); + +Q_SIGNALS: + void activeChanged(); + +private: + Q_DISABLE_COPY(QDeclarativeApplication) + Q_DECLARE_PRIVATE(QDeclarativeApplication) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QDeclarativeApplication) + +QT_END_HEADER + +#endif // QDECLARATIVEAPPLICATION_P_H diff --git a/src/declarative/util/qdeclarativeutilmodule.cpp b/src/declarative/util/qdeclarativeutilmodule.cpp index 0544f22..5abf085 100644 --- a/src/declarative/util/qdeclarativeutilmodule.cpp +++ b/src/declarative/util/qdeclarativeutilmodule.cpp @@ -66,6 +66,7 @@ #include "private/qdeclarativetimer_p.h" #include "private/qdeclarativetransitionmanager_p_p.h" #include "private/qdeclarativetransition_p.h" +#include "private/qdeclarativeapplication_p.h" #include "qdeclarativeview.h" #include "qdeclarativeinfo.h" #include "private/qdeclarativetypenotavailable_p.h" @@ -75,6 +76,8 @@ void QDeclarativeUtilModule::defineModule() { + qmlRegisterUncreatableType<QDeclarativeApplication>("QtQuick",1,1,"Application", "Application is an abstract class"); + qmlRegisterType<QDeclarativeAnchorAnimation>("QtQuick",1,0,"AnchorAnimation"); qmlRegisterType<QDeclarativeAnchorChanges>("QtQuick",1,0,"AnchorChanges"); qmlRegisterType<QDeclarativeBehavior>("QtQuick",1,0,"Behavior"); diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri index fd57144..62fa8f1 100644 --- a/src/declarative/util/util.pri +++ b/src/declarative/util/util.pri @@ -1,6 +1,7 @@ INCLUDEPATH += $$PWD SOURCES += \ + $$PWD/qdeclarativeapplication.cpp \ $$PWD/qdeclarativeutilmodule.cpp\ $$PWD/qdeclarativeview.cpp \ $$PWD/qdeclarativeconnections.cpp \ @@ -30,6 +31,7 @@ SOURCES += \ $$PWD/qlistmodelinterface.cpp HEADERS += \ + $$PWD/qdeclarativeapplication_p.h \ $$PWD/qdeclarativeutilmodule_p.h\ $$PWD/qdeclarativeview.h \ $$PWD/qdeclarativeconnections_p.h \ diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 51597bd..1f0d32a 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -11,6 +11,7 @@ SUBDIRS += \ qdeclarativeanchors \ qdeclarativeanimatedimage \ qdeclarativeanimations \ + qdeclarativeapplication \ qdeclarativebehaviors \ qdeclarativebinding \ qdeclarativeborderimage \ diff --git a/tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro b/tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro new file mode 100644 index 0000000..91e5468 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro @@ -0,0 +1,5 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qdeclarativeapplication.cpp diff --git a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp new file mode 100644 index 0000000..0d069dc --- /dev/null +++ b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qtest.h> +#include "../../../shared/util.h" +#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtDeclarative/qdeclarativeengine.h> +#include <QtDeclarative/qdeclarativeitem.h> +#include <QtGui/qgraphicsview.h> +#include <QtGui/qgraphicsscene.h> + +class tst_qdeclarativeapplication : public QObject +{ + Q_OBJECT +public: + tst_qdeclarativeapplication(); + +private slots: + void active(); + +private: + QDeclarativeEngine engine; +}; + +tst_qdeclarativeapplication::tst_qdeclarativeapplication() +{ +} + +void tst_qdeclarativeapplication::active() +{ + QDeclarativeComponent component(&engine); + component.setData("import QtQuick 1.0; Item { property bool active: Qt.application.active }", QUrl::fromLocalFile("")); + QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create()); + QVERIFY(item); + QGraphicsScene scene; + QGraphicsView view(&scene); + scene.addItem(item); + + // not active + QVERIFY(!item->property("active").toBool()); + QCOMPARE(item->property("active").toBool(), QApplication::activeWindow() != 0); + + // active + view.show(); + QApplication::setActiveWindow(&view); + QTest::qWaitForWindowShown(&view); + QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view)); + QCOMPARE(item->property("active").toBool(), QApplication::activeWindow() != 0); + + // not active again + QApplication::setActiveWindow(0); + QVERIFY(!item->property("active").toBool()); + QCOMPARE(item->property("active").toBool(), QApplication::activeWindow() != 0); +} + +QTEST_MAIN(tst_qdeclarativeapplication) + +#include "tst_qdeclarativeapplication.moc" -- cgit v0.12 From 0371e80ba76b7dcaf1809ba9345fd96610390222 Mon Sep 17 00:00:00 2001 From: Joona Petrell <joona.t.petrell@nokia.com> Date: Tue, 4 Jan 2011 17:25:48 +1000 Subject: Add layoutDirection property to Qt.application element Task-number: QTBUG-16424 Reviewed-by: Martin Jones --- src/declarative/util/qdeclarativeapplication.cpp | 32 ++++++++++++++++++++-- src/declarative/util/qdeclarativeapplication_p.h | 3 ++ .../tst_qdeclarativeapplication.cpp | 23 ++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/src/declarative/util/qdeclarativeapplication.cpp b/src/declarative/util/qdeclarativeapplication.cpp index 53d196f..f724c16 100644 --- a/src/declarative/util/qdeclarativeapplication.cpp +++ b/src/declarative/util/qdeclarativeapplication.cpp @@ -47,8 +47,10 @@ class QDeclarativeApplicationPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QDeclarativeApplication) public: - QDeclarativeApplicationPrivate() : active(QApplication::activeWindow() != 0) {} + QDeclarativeApplicationPrivate() : active(QApplication::activeWindow() != 0), + layoutDirection(QApplication::layoutDirection()) {} bool active; + Qt::LayoutDirection layoutDirection; }; /*! @@ -58,7 +60,8 @@ public: \brief The Application element provides access to global application state properties shared by many QML components. - These properties include application activity property \c active. + These properties include application activity property \c active, + and default layout direction property \c layoutDirection. \section1 Example Usage @@ -97,6 +100,24 @@ bool QDeclarativeApplication::active() const return d->active; } +/*! + \qmlproperty bool Application::layoutDirection + + This property can be used to query the default layout direction of the + application. On system start-up, the default layout direction depends on the + application's language. The property has a value Qt.RightToLeft in locales + where text and graphic elements are read from right to left, and Qt.LeftToRight + where the reading direction flows from left to right. You can bind to the + property to customize your application layouts to support both layout + directions. This property is readonly. + +*/ +bool QDeclarativeApplication::layoutDirection() const +{ + Q_D(const QDeclarativeApplication); + return d->layoutDirection; +} + bool QDeclarativeApplication::eventFilter(QObject *obj, QEvent *event) { Q_UNUSED(obj) @@ -114,5 +135,12 @@ bool QDeclarativeApplication::eventFilter(QObject *obj, QEvent *event) emit activeChanged(); } } + if (event->type() == QEvent::LayoutDirectionChange) { + Qt::LayoutDirection direction = QApplication::layoutDirection(); + if (d->layoutDirection != direction) { + d->layoutDirection = direction; + emit layoutDirectionChanged(); + } + } return false; } diff --git a/src/declarative/util/qdeclarativeapplication_p.h b/src/declarative/util/qdeclarativeapplication_p.h index 59ea7fe..c5cd227 100644 --- a/src/declarative/util/qdeclarativeapplication_p.h +++ b/src/declarative/util/qdeclarativeapplication_p.h @@ -57,17 +57,20 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeApplication : public QObject { Q_OBJECT Q_PROPERTY(bool active READ active NOTIFY activeChanged) + Q_PROPERTY(bool layoutDirection READ layoutDirection NOTIFY layoutDirectionChanged) public: explicit QDeclarativeApplication(QObject *parent = 0); virtual ~QDeclarativeApplication(); bool active() const; + bool layoutDirection() const; protected: bool eventFilter(QObject *obj, QEvent *event); Q_SIGNALS: void activeChanged(); + void layoutDirectionChanged(); private: Q_DISABLE_COPY(QDeclarativeApplication) diff --git a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp index 0d069dc..3011257 100644 --- a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp +++ b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp @@ -55,6 +55,7 @@ public: private slots: void active(); + void layoutDirection(); private: QDeclarativeEngine engine; @@ -91,6 +92,28 @@ void tst_qdeclarativeapplication::active() QCOMPARE(item->property("active").toBool(), QApplication::activeWindow() != 0); } +void tst_qdeclarativeapplication::layoutDirection() +{ + QDeclarativeComponent component(&engine); + component.setData("import QtQuick 1.0; Item { property bool layoutDirection: Qt.application.layoutDirection }", QUrl::fromLocalFile("")); + QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create()); + QVERIFY(item); + QGraphicsScene scene; + QGraphicsView view(&scene); + scene.addItem(item); + + // not mirrored + QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::LeftToRight); + + // mirrored + QApplication::setLayoutDirection(Qt::RightToLeft); + QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::RightToLeft); + + // not mirrored again + QApplication::setLayoutDirection(Qt::LeftToRight); + QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::LeftToRight); +} + QTEST_MAIN(tst_qdeclarativeapplication) #include "tst_qdeclarativeapplication.moc" -- cgit v0.12 From e24d7c9cab4a50fe682478d43ac74e867666d48b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= <morten.sorvig@nokia.com> Date: Thu, 6 Jan 2011 10:30:18 +0100 Subject: Lighthouse: Support external plugins. Add -platformpluginpath command line option that spesifies an additional directory to scan for plugins. Also read QT_QPA_PLATFORM_PLUGIN_PATH. QlatformIntegrationFacgtory::create() now tries to load the plugin from the external path first. Similarly, keys() returns the keys from the extra path in addition to the "internal" keys API changes: QPlatformIntegration::create() and keys() now take an optional const QString &platformPluginPath. New file: externalplugin.pri, contains instructions and a base setup for building external plugins. --- src/gui/kernel/qapplication_qpa.cpp | 12 ++++++--- src/gui/kernel/qplatformintegrationfactory_qpa.cpp | 27 +++++++++++++++++--- src/gui/kernel/qplatformintegrationfactory_qpa_p.h | 4 +-- src/plugins/platforms/externalplugin.pri | 29 ++++++++++++++++++++++ 4 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 src/plugins/platforms/externalplugin.pri diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp index a164c2d..fdbb931 100644 --- a/src/gui/kernel/qapplication_qpa.cpp +++ b/src/gui/kernel/qapplication_qpa.cpp @@ -444,11 +444,11 @@ void QApplication::alert(QWidget *, int) { } -static void init_platform(const QString &name) +static void init_platform(const QString &name, const QString &platformPluginPath) { - QApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name); + QApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, platformPluginPath); if (!QApplicationPrivate::platform_integration) { - QStringList keys = QPlatformIntegrationFactory::keys(); + QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath); QString fatalMessage = QString::fromLatin1("Failed to load platform plugin \"%1\". Available platforms are: \n").arg(name); foreach(QString key, keys) { @@ -513,6 +513,7 @@ void qt_init(QApplicationPrivate *priv, int type) } QList<QByteArray> pluginList; + QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH")); QString platformName = QLatin1String(qgetenv("QT_QPA_PLATFORM")); // Get command line params @@ -527,6 +528,9 @@ void qt_init(QApplicationPrivate *priv, int type) if (arg == "-fn" || arg == "-font") { if (++i < argc) appFont = QString::fromLocal8Bit(argv[i]); + } else if (arg == "-platformpluginpath") { + if (++i < argc) + platformPluginPath = QLatin1String(argv[i]); } else if (arg == "-platform") { if (++i < argc) platformName = QLatin1String(argv[i]); @@ -550,7 +554,7 @@ void qt_init(QApplicationPrivate *priv, int type) } #endif - init_platform(platformName); + init_platform(platformName, platformPluginPath); init_plugins(pluginList); QColormap::initialize(); diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp index 9122e1a..17a130d 100644 --- a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp +++ b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp @@ -52,15 +52,27 @@ QT_BEGIN_NAMESPACE #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QPlatformIntegrationFactoryInterface_iid, QLatin1String("/platforms"), Qt::CaseInsensitive)) +Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, + (QPlatformIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) #endif -QPlatformIntegration *QPlatformIntegrationFactory::create(const QString& key) +QPlatformIntegration *QPlatformIntegrationFactory::create(const QString& key, const QString &platformPluginPath) { QPlatformIntegration *ret = 0; QStringList paramList = key.split(QLatin1Char(':')); QString platform = paramList.takeFirst().toLower(); #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) + // Try loading the plugin from platformPluginPath first: + if (!platformPluginPath.isEmpty()) { + QCoreApplication::addLibraryPath(platformPluginPath); + if (QPlatformIntegrationFactoryInterface *factory = + qobject_cast<QPlatformIntegrationFactoryInterface*>(directLoader()->instance(platform))) + ret = factory->create(key, paramList); + + if (ret) + return ret; + } if (QPlatformIntegrationFactoryInterface *factory = qobject_cast<QPlatformIntegrationFactoryInterface*>(loader()->instance(platform))) ret = factory->create(platform, paramList); #endif @@ -74,10 +86,19 @@ QPlatformIntegration *QPlatformIntegrationFactory::create(const QString& key) \sa create() */ -QStringList QPlatformIntegrationFactory::keys() +QStringList QPlatformIntegrationFactory::keys(const QString &platformPluginPath) { #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) - QStringList list = loader()->keys(); + QStringList list; + + if (!platformPluginPath.isEmpty()) { + QCoreApplication::addLibraryPath(platformPluginPath); + foreach (const QString &key, directLoader()->keys()) { + list += key + QString(QLatin1String(" (from %1)")).arg(platformPluginPath); + } + } + + list += loader()->keys(); #else QStringList list; #endif diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa_p.h b/src/gui/kernel/qplatformintegrationfactory_qpa_p.h index ba02d2c..77e1da1 100644 --- a/src/gui/kernel/qplatformintegrationfactory_qpa_p.h +++ b/src/gui/kernel/qplatformintegrationfactory_qpa_p.h @@ -66,8 +66,8 @@ class QPlatformIntegration; class QPlatformIntegrationFactory { public: - static QStringList keys(); - static QPlatformIntegration *create(const QString&); + static QStringList keys(const QString &platformPluginPath = QString()); + static QPlatformIntegration *create(const QString &key, const QString &platformPluginPath = QString()); }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/externalplugin.pri b/src/plugins/platforms/externalplugin.pri new file mode 100644 index 0000000..54da4d9 --- /dev/null +++ b/src/plugins/platforms/externalplugin.pri @@ -0,0 +1,29 @@ +# +# Lighthouse now has preliminarily support for building and +# loading platform plugins from outside the Qt source/build +# tree. +# +# 1) Building external plugins: +# Set QTDIR to the Qt build directory, copy this file to +# the plugin source repository and include it at the top +# of the plugin's pro file. Use QT_SOURCE_TREE if you +# want to pull in source code from Qt: +# +# include($$QT_SOURCE_TREE/src/plugins/platforms/fontdatabases/genericunix/genericunix.pri) +# +# 2) Loading external plugins: +# Specify the path to the directory containing the +# plugin on the command line, in addition to the +# platform name. +# +# ./wiggly -platformPluginPath /path/to/myPlugin -platform gullfaksA +# + +!exists($$(QTDIR)/.qmake.cache) { + error("Please set QTDIR to the Qt build directory") +} + +QT_SOURCE_TREE = $$fromfile($$(QTDIR)/.qmake.cache,QT_SOURCE_TREE) +QT_BUILD_TREE = $$fromfile($$(QTDIR)/.qmake.cache,QT_BUILD_TREE) + +include($$QT_SOURCE_TREE/src/plugins/qpluginbase.pri) -- cgit v0.12 From eea1c1a0d12920e3c0a0ffe5339e33055ffe0fdd Mon Sep 17 00:00:00 2001 From: Joona Petrell <joona.t.petrell@nokia.com> Date: Fri, 7 Jan 2011 18:37:47 +1000 Subject: Add missing Qt namespaces macros to qdeclarativeapplication.cpp source file Task-number: Reviewed-by: Aaron Kennedy --- src/declarative/util/qdeclarativeapplication.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/declarative/util/qdeclarativeapplication.cpp b/src/declarative/util/qdeclarativeapplication.cpp index f724c16..7559aa9 100644 --- a/src/declarative/util/qdeclarativeapplication.cpp +++ b/src/declarative/util/qdeclarativeapplication.cpp @@ -43,6 +43,8 @@ #include <private/qobject_p.h> #include <QtGui/QApplication> +QT_BEGIN_NAMESPACE + class QDeclarativeApplicationPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QDeclarativeApplication) @@ -144,3 +146,5 @@ bool QDeclarativeApplication::eventFilter(QObject *obj, QEvent *event) } return false; } + +QT_END_NAMESPACE -- cgit v0.12 From 59b9bce59aacc2cf68a3800f4fcb486d136b91f9 Mon Sep 17 00:00:00 2001 From: Jerome Pasion <jerome.pasion@nokia.com> Date: Fri, 7 Jan 2011 09:54:35 +0100 Subject: Adding a link to the coding style wiki page. --- doc/src/qt-webpages.qdoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc index 0a03157..5799d69 100644 --- a/doc/src/qt-webpages.qdoc +++ b/doc/src/qt-webpages.qdoc @@ -244,3 +244,8 @@ \externalpage http://labs.qt.nokia.com \title Qt Labs */ + +/*! + \externalpage http://qt.gitorious.org/qt/pages/QtCodingStyle + \title Qt Coding Style +*/ -- cgit v0.12 From 30080bdcb226a5a815465299bcb0dbb6a347cb1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= <jorgen.lind@nokia.com> Date: Fri, 7 Jan 2011 12:12:35 +0100 Subject: Lighthouse: Fix keyboard modifier handling QApplication allready knows the modifiers --- src/gui/kernel/qapplication_qpa.cpp | 8 +++--- .../platforms/testlite/qtestlitekeyboard.cpp | 29 ++++++++++++++-------- src/plugins/platforms/testlite/qtestlitekeyboard.h | 1 + 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp index fdbb931..cd76adf 100644 --- a/src/gui/kernel/qapplication_qpa.cpp +++ b/src/gui/kernel/qapplication_qpa.cpp @@ -79,7 +79,6 @@ int qt_last_x = 0; int qt_last_y = 0; QPointer<QWidget> qt_last_mouse_receiver = 0; -static Qt::KeyboardModifiers modifiers = Qt::NoModifier; static Qt::MouseButtons buttons = Qt::NoButton; static ulong mousePressTime; static Qt::MouseButton mousePressButton = Qt::NoButton; @@ -731,7 +730,7 @@ void QApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mouse // qDebug() << "sending mouse ev." << ev.type() << localPoint << globalPoint << ev.button() << ev.buttons() << mouseWidget << "mouse grabber" << implicit_mouse_grabber; - QMouseEvent ev(type, localPoint, globalPoint, button, buttons, modifiers); + QMouseEvent ev(type, localPoint, globalPoint, button, buttons, QApplication::keyboardModifiers()); QList<QWeakPointer<QPlatformCursor> > cursors = QPlatformCursorPrivate::getInstances(); foreach (QWeakPointer<QPlatformCursor> cursor, cursors) { @@ -744,7 +743,7 @@ void QApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mouse #ifndef QT_NO_CONTEXTMENU if (type == QEvent::MouseButtonPress && button == Qt::RightButton && (openPopupCount == oldOpenPopupCount)) { - QContextMenuEvent e(QContextMenuEvent::Mouse, localPoint, globalPoint, modifiers); + QContextMenuEvent e(QContextMenuEvent::Mouse, localPoint, globalPoint, QApplication::keyboardModifiers()); QApplication::sendSpontaneousEvent(mouseWidget, &e); } #endif // QT_NO_CONTEXTMENU @@ -786,7 +785,7 @@ void QApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wheel p = mouseWidget->mapFromGlobal(globalPoint); } - QWheelEvent ev(p, globalPoint, e->delta, buttons, modifiers, + QWheelEvent ev(p, globalPoint, e->delta, buttons, QApplication::keyboardModifiers(), e->orient); QApplication::sendSpontaneousEvent(mouseWidget, &ev); } @@ -817,7 +816,6 @@ void QApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEven if (app_do_modal && !qt_try_modal(focusW, e->keyType)) return; - modifiers = e->modifiers; QKeyEvent ev(e->keyType, e->key, e->modifiers, e->unicode, e->repeat, e->repeatCount); QApplication::sendSpontaneousEvent(focusW, &ev); } diff --git a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp index 93d21b3..ca4c203 100644 --- a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp +++ b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp @@ -1,5 +1,7 @@ #include "qtestlitekeyboard.h" +#include <QDebug> + #include "qtestlitescreen.h" #include <QtGui/QWindowSystemInterface> @@ -710,8 +712,8 @@ Qt::KeyboardModifiers QTestLiteKeyboard::translateModifiers(int s) ret |= Qt::AltModifier; if (s & m_meta_mask) ret |= Qt::MetaModifier; - if (s & m_mode_switch_mask) - ret |= Qt::GroupSwitchModifier; +// if (s & m_mode_switch_mask) //doesn't seem to work correctly +// ret |= Qt::GroupSwitchModifier; return ret; } @@ -947,14 +949,21 @@ static Qt::KeyboardModifiers modifierFromKeyCode(int qtcode) void QTestLiteKeyboard::handleKeyEvent(QWidget *widget, QEvent::Type type, XKeyEvent *ev) { - int qtcode = 0; - Qt::KeyboardModifiers modifiers = translateModifiers(ev->state); + const int xkeycode = ev->keycode; + const uint xmodifiers = ev->state; + + KeySym baseKeySym; + uint consumedModifiers; + if (!XkbLookupKeySym(m_screen->display(), xkeycode, (xmodifiers & (LockMask | m_num_lock_mask)), + &consumedModifiers, &baseKeySym)) + return; + + Qt::KeyboardModifiers baseModifiers = 0; + int baseCode = -1; QByteArray chars; - chars.resize(513); int count = 0; - KeySym keySym; - count = XLookupString(ev,chars.data(),chars.size(),&keySym,0); - QString text = translateKeySym(keySym,ev->state,qtcode,modifiers,chars,count); - modifiers ^= modifierFromKeyCode(qtcode); - QWindowSystemInterface::handleKeyEvent(widget,ev->time,type,qtcode,modifiers,text.left(count)); + QString text = translateKeySym(baseKeySym, xmodifiers, baseCode, baseModifiers, chars, count); + + QWindowSystemInterface::handleKeyEvent(widget,ev->time,type,baseCode,baseModifiers,text.left(count)); + } diff --git a/src/plugins/platforms/testlite/qtestlitekeyboard.h b/src/plugins/platforms/testlite/qtestlitekeyboard.h index 65ead16..4e9d98d 100644 --- a/src/plugins/platforms/testlite/qtestlitekeyboard.h +++ b/src/plugins/platforms/testlite/qtestlitekeyboard.h @@ -14,6 +14,7 @@ public: Qt::KeyboardModifiers translateModifiers(int s); + enum { MaxBits = sizeof(uint) * 8 }; private: void setMask(KeySym sym, uint mask); -- cgit v0.12 From 2bc7d2af6be2b09c38e989f339ec2ee33cc204eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= <jorgen.lind@nokia.com> Date: Fri, 7 Jan 2011 17:38:59 +0100 Subject: Lighthouse: Fix keyboard on testlite Remove code which was wrong --- .../platforms/testlite/qtestlitekeyboard.cpp | 24 +++++++--------------- src/plugins/platforms/testlite/qtestlitekeyboard.h | 1 - 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp index ca4c203..72e6d50 100644 --- a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp +++ b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp @@ -1,7 +1,5 @@ #include "qtestlitekeyboard.h" -#include <QDebug> - #include "qtestlitescreen.h" #include <QtGui/QWindowSystemInterface> @@ -949,21 +947,13 @@ static Qt::KeyboardModifiers modifierFromKeyCode(int qtcode) void QTestLiteKeyboard::handleKeyEvent(QWidget *widget, QEvent::Type type, XKeyEvent *ev) { - const int xkeycode = ev->keycode; - const uint xmodifiers = ev->state; - - KeySym baseKeySym; - uint consumedModifiers; - if (!XkbLookupKeySym(m_screen->display(), xkeycode, (xmodifiers & (LockMask | m_num_lock_mask)), - &consumedModifiers, &baseKeySym)) - return; - - Qt::KeyboardModifiers baseModifiers = 0; - int baseCode = -1; + int qtcode = 0; + Qt::KeyboardModifiers modifiers = translateModifiers(ev->state); QByteArray chars; + chars.resize(513); int count = 0; - QString text = translateKeySym(baseKeySym, xmodifiers, baseCode, baseModifiers, chars, count); - - QWindowSystemInterface::handleKeyEvent(widget,ev->time,type,baseCode,baseModifiers,text.left(count)); - + KeySym keySym; + count = XLookupString(ev,chars.data(),chars.size(),&keySym,0); + QString text = translateKeySym(keySym,ev->state,qtcode,modifiers,chars,count); + QWindowSystemInterface::handleKeyEvent(widget,ev->time,type,qtcode,modifiers,text.left(count)); } diff --git a/src/plugins/platforms/testlite/qtestlitekeyboard.h b/src/plugins/platforms/testlite/qtestlitekeyboard.h index 4e9d98d..65ead16 100644 --- a/src/plugins/platforms/testlite/qtestlitekeyboard.h +++ b/src/plugins/platforms/testlite/qtestlitekeyboard.h @@ -14,7 +14,6 @@ public: Qt::KeyboardModifiers translateModifiers(int s); - enum { MaxBits = sizeof(uint) * 8 }; private: void setMask(KeySym sym, uint mask); -- cgit v0.12 From 6db61ce39aa2fefaa9e22ca84edd8d140a5c6449 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@nokia.com> Date: Mon, 10 Jan 2011 13:00:54 +1000 Subject: Document property/method versioning in QML. Task-number: QTBUG-13451 Reviewed-by: Bea Lam --- doc/src/declarative/extending.qdoc | 69 ++++++++++++++++++++++++++++++++++ doc/src/declarative/qtdeclarative.qdoc | 15 ++++++++ 2 files changed, 84 insertions(+) diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index ff519f6..429997f 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -112,6 +112,75 @@ Person { \l {Extending QML - Adding Types Example} shows the complete code used to create the \c Person type. +\section1 QML Type Versioning + +In C++ adding a new method or property cannot break old applications. +In QML, however, new methods and properties can change what a name previously +resolved to to within a scope chain. + +For example, consider these two QML files + +\code +// main.qml +import QtQuick 1.0 +Item { + id: root + MyComponent {} +} +\endcode + +\code +// MyComponent.qml +import MyModule 1.0 +CppItem { + value: root.x +} +\endcode + +where CppItem maps to the C++ class QCppItem. + +If the author of QCppItem adds a "root" property to QCppItem in a new version of the module, +it will break the above program as \c root.x now resolves to a different value. +The solution is to allow the author of QCppItem to state that the new \c root property is +only available from a particular version of QCppItem onwards. This permits new properties +and features to be added to existing elements without breaking existing programs. + +QML enables this by allowing the properties, methods and signals of a class to be tagged with +a particular \e revision, so that they are only accessible if the relevant module version +is imported. In this case, the author can tag the \c root property as being added in +\e {revision 1} of the class, and register that revision in version 1.1 of the module. + +The REVISION tag is used to mark the \c root property as added in revision 1 of the class. +Methods such as Q_INVOKABLE's, signals and slots can also be tagged for a +revision using the \c Q_REVISION(x) macro: + +\code +class CppItem : public QObject +{ + Q_OBJECT + Q_PROPERTY(int root READ root WRITE setRoot NOTIFY rootChanged REVISION 1) + +signals: + Q_REVISION(1) void rootChanged(); +}; +\endcode + +To register the new class revision to a particular version the following function is used: + +\code +template<typename T, int metaObjectRevision> +int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) +\endcode + +To register \c CppItem version 1 for \c {MyModule 1.1}: + +\code +qmlRegisterType<QCppItem,1>("MyModule", 1, 1, "CppItem") +\endcode + +\c root is only available when MyModule 1.1 is imported. + + \section1 Object and List Property Types \snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0 diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc index b0c6e06..5ab4319 100644 --- a/doc/src/declarative/qtdeclarative.qdoc +++ b/doc/src/declarative/qtdeclarative.qdoc @@ -85,6 +85,21 @@ Returns the QML type id. + There are two forms of this template function: + + \code + template<typename T> + int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName); + + template<typename T, int metaObjectRevision> + int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName); + \endcode + + The former is the standard form which registers the type \e T as a new type. + The latter allows a particular revision of a class to be registered in + a specified version (see \l {QML Type Versioning}). + + For example, this registers a C++ class \c MySliderItem as a QML type named \c Slider for version 1.0 of a \l{QML Modules}{module} called "com.mycompany.qmlcomponents": -- cgit v0.12 From cbf6bfbff8c0643bc82bb2456214994931052bd6 Mon Sep 17 00:00:00 2001 From: Andrew den Exter <andrew.den-exter@nokia.com> Date: Fri, 7 Jan 2011 17:42:12 +1000 Subject: Add selection modes to TextEdit and TextInput. Add an overload for moveCursorSelection which takes a parameter specifying whether to update the selection with individual characters or whole words. Task-number: QTBUG-16283 Reviewed-by: Martin Jones --- .../graphicsitems/qdeclarativetextedit.cpp | 89 +++++++++-- .../graphicsitems/qdeclarativetextedit_p.h | 7 + .../graphicsitems/qdeclarativetextinput.cpp | 101 ++++++++++++- .../graphicsitems/qdeclarativetextinput_p.h | 7 + .../tst_qdeclarativetextedit.cpp | 164 ++++++++++++++++++++- .../tst_qdeclarativetextinput.cpp | 163 +++++++++++++++++++- 6 files changed, 512 insertions(+), 19 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 6a51a3c..7ea3dec 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -579,37 +579,108 @@ int QDeclarativeTextEdit::positionAt(int x, int y) const return r; } +void QDeclarativeTextEdit::moveCursorSelection(int pos) +{ + //Note that this is the same as setCursorPosition but with the KeepAnchor flag set + Q_D(QDeclarativeTextEdit); + QTextCursor cursor = d->control->textCursor(); + if (cursor.position() == pos) + return; + cursor.setPosition(pos, QTextCursor::KeepAnchor); + d->control->setTextCursor(cursor); +} + /*! - \qmlmethod int TextEdit::moveCursorSelection(int pos) + \qmlmethod void TextEdit::moveCursorSelection(int position, SelectionMode mode = TextEdit.SelectCharacters) + \since Quick 1.1 - Moves the cursor to \a position and updates the selection accordingly. - (To only move the cursor, set the \l cursorPosition property.) + Moves the cursor to \a position and updates the selection according to the optional \a mode + parameter. (To only move the cursor, set the \l cursorPosition property.) When this method is called it additionally sets either the selectionStart or the selectionEnd (whichever was at the previous cursor position) to the specified position. This allows you to easily extend and contract the selected text range. + The selection mode specifies whether the selection is updated on a per character or a per word + basis. If not specified the selection mode will default to TextEdit.SelectCharacters. + + \list + \o TextEdit.SelectCharacters - Sets either the selectionStart or selectionEnd (whichever was at + the previous cursor position) to the specified position. + \o TextEdit.SelectWords - Sets the selectionStart and selectionEnd to include all + words between the specified postion and the previous cursor position. Words partially in the + range are included. + \endlist + For example, take this sequence of calls: \code cursorPosition = 5 - moveCursorSelection(9) - moveCursorSelection(7) + moveCursorSelection(9, TextEdit.SelectCharacters) + moveCursorSelection(7, TextEdit.SelectCharacters) \endcode This moves the cursor to position 5, extend the selection end from 5 to 9 and then retract the selection end from 9 to 7, leaving the text from position 5 to 7 selected (the 6th and 7th characters). + + The same sequence with TextEdit.SelectWords will extend the selection start to a word boundary + before or on position 5 and extend the selection end to a word boundary past position 9, and + then if there is a word boundary between position 7 and 8 retract the selection end to that + boundary. If there is whitespace at position 7 the selection will be retracted further. */ -void QDeclarativeTextEdit::moveCursorSelection(int pos) +void QDeclarativeTextEdit::moveCursorSelection(int pos, SelectionMode mode) { - //Note that this is the same as setCursorPosition but with the KeepAnchor flag set Q_D(QDeclarativeTextEdit); QTextCursor cursor = d->control->textCursor(); if (cursor.position() == pos) return; - cursor.setPosition(pos, QTextCursor::KeepAnchor); + if (mode == SelectCharacters) { + cursor.setPosition(pos, QTextCursor::KeepAnchor); + } else if (cursor.anchor() < pos) { + cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor); + cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); + if (cursor.position() == cursor.anchor()) { + cursor.movePosition(QTextCursor::NextWord, QTextCursor::MoveAnchor); + } else { + cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::MoveAnchor); + cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::MoveAnchor); + } + cursor.setPosition(pos, QTextCursor::KeepAnchor); + cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::KeepAnchor); + if (cursor.position() == pos) { + cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor); + cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); + + if (cursor.anchor() > cursor.position()) + cursor.setPosition(pos, QTextCursor::MoveAnchor); + } else { + cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); + } + } else if (cursor.anchor() > pos) { + cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor); + cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::KeepAnchor); + if (cursor.position() == cursor.anchor()) { + cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::MoveAnchor); + cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::MoveAnchor); + } else { + cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::MoveAnchor); + } + cursor.setPosition(pos, QTextCursor::KeepAnchor); + cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); + if (cursor.position() == pos) { + cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor); + + if (cursor.anchor() < cursor.position()) + cursor.setPosition(pos, QTextCursor::MoveAnchor); + } else { + cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor); + cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::KeepAnchor); + } + } else { + cursor.setPosition(pos, QTextCursor::MoveAnchor); + } d->control->setTextCursor(cursor); } @@ -655,7 +726,7 @@ void QDeclarativeTextEdit::setCursorPosition(int pos) if (pos < 0 || pos > d->text.length()) return; QTextCursor cursor = d->control->textCursor(); - if (cursor.position() == pos) + if (cursor.position() == pos && cursor.anchor() == pos) return; cursor.setPosition(pos); d->control->setTextCursor(cursor); diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h index 37b24f7..6a05aa8 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h @@ -65,6 +65,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativePaintedItem Q_ENUMS(HAlignment) Q_ENUMS(TextFormat) Q_ENUMS(WrapMode) + Q_ENUMS(SelectionMode) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) @@ -120,6 +121,11 @@ public: Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere }; + enum SelectionMode { + SelectCharacters, + SelectWords + }; + Q_INVOKABLE void openSoftwareInputPanel(); Q_INVOKABLE void closeSoftwareInputPanel(); @@ -195,6 +201,7 @@ public: Q_INVOKABLE QRectF positionToRectangle(int) const; Q_INVOKABLE int positionAt(int x, int y) const; Q_INVOKABLE void moveCursorSelection(int pos); + Q_INVOKABLE Q_REVISION(1) void moveCursorSelection(int pos, SelectionMode mode); QRectF boundingRect() const; diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index ac07d4b..491d219c4 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -50,6 +50,7 @@ #include <QApplication> #include <QFontMetrics> #include <QPainter> +#include <QTextBoundaryFinder> #ifndef QT_NO_LINEEDIT @@ -1320,35 +1321,119 @@ void QDeclarativeTextInput::setSelectByMouse(bool on) } } +void QDeclarativeTextInput::moveCursorSelection(int position) +{ + Q_D(QDeclarativeTextInput); + d->control->moveCursor(position, true); + d->updateHorizontalScroll(); +} /*! - \qmlmethod void TextInput::moveCursorSelection(int position) + \qmlmethod void TextInput::moveCursorSelection(int position, SelectionMode mode = TextInput.SelectCharacters) + \since Quick 1.1 - Moves the cursor to \a position and updates the selection accordingly. - (To only move the cursor, set the \l cursorPosition property.) + Moves the cursor to \a position and updates the selection according to the optional \a mode + parameter. (To only move the cursor, set the \l cursorPosition property.) When this method is called it additionally sets either the selectionStart or the selectionEnd (whichever was at the previous cursor position) to the specified position. This allows you to easily extend and contract the selected text range. + The selection mode specifies whether the selection is updated on a per character or a per word + basis. If not specified the selection mode will default to TextInput.SelectCharacters. + + \list + \o TextEdit.SelectCharacters - Sets either the selectionStart or selectionEnd (whichever was at + the previous cursor position) to the specified position. + \o TextEdit.SelectWords - Sets the selectionStart and selectionEnd to include all + words between the specified postion and the previous cursor position. Words partially in the + range are included. + \endlist + For example, take this sequence of calls: \code cursorPosition = 5 - moveCursorSelection(9) - moveCursorSelection(7) + moveCursorSelection(9, TextInput.SelectCharacters) + moveCursorSelection(7, TextInput.SelectCharacters) \endcode This moves the cursor to position 5, extend the selection end from 5 to 9 and then retract the selection end from 9 to 7, leaving the text from position 5 to 7 selected (the 6th and 7th characters). + + The same sequence with TextInput.SelectWords will extend the selection start to a word boundary + before or on position 5 and extend the selection end to a word boundary past position 9, and + then if there is a word boundary between position 7 and 8 retract the selection end to that + boundary. If there is whitespace at position 7 the selection will be retracted further. */ -void QDeclarativeTextInput::moveCursorSelection(int position) +void QDeclarativeTextInput::moveCursorSelection(int pos, SelectionMode mode) { Q_D(QDeclarativeTextInput); - d->control->moveCursor(position, true); - d->updateHorizontalScroll(); + + if (mode == SelectCharacters) { + d->control->moveCursor(pos, true); + } else if (pos != d->control->cursor()){ + int anchor; + if (!d->control->hasSelectedText()) + anchor = d->control->cursor(); + else if (d->control->selectionStart() == d->control->cursor()) + anchor = d->control->selectionEnd(); + else + anchor = d->control->selectionStart(); + + if (anchor < pos) { + QTextBoundaryFinder finder(QTextBoundaryFinder::Word, d->control->text()); + finder.setPosition(anchor); + + if (!(finder.boundaryReasons() & QTextBoundaryFinder::StartWord)) { + finder.toNextBoundary(); + if (finder.boundaryReasons() != QTextBoundaryFinder::StartWord) + finder.toPreviousBoundary(); + } + anchor = finder.position(); + + finder.setPosition(pos); + if (!(finder.boundaryReasons() & QTextBoundaryFinder::EndWord)) { + finder.toPreviousBoundary(); + if (finder.boundaryReasons() != QTextBoundaryFinder::EndWord) + finder.toNextBoundary(); + } + int cursor = finder.position(); + + if (anchor < cursor) + d->control->setSelection(anchor, cursor - anchor); + else + d->control->moveCursor(pos, false); + + } else if (anchor > pos) { + QTextBoundaryFinder finder(QTextBoundaryFinder::Word, d->control->text()); + + finder.setPosition(anchor); + if (!(finder.boundaryReasons() & QTextBoundaryFinder::EndWord)) { + finder.toPreviousBoundary(); + if (finder.boundaryReasons() != QTextBoundaryFinder::EndWord) + finder.toNextBoundary(); + } + anchor = finder.position(); + + finder.setPosition(pos); + if (!(finder.boundaryReasons() & QTextBoundaryFinder::StartWord)) { + finder.toNextBoundary(); + if (finder.boundaryReasons() != QTextBoundaryFinder::StartWord) + finder.toPreviousBoundary(); + } + int cursor = finder.position(); + + if (anchor > cursor) + d->control->setSelection(anchor, cursor - anchor); + else + d->control->moveCursor(pos, false); + } else { + d->control->moveCursor(pos, false); + } + } } /*! diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h index 878f040..25b8e66 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h @@ -63,6 +63,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativePaintedItem Q_OBJECT Q_ENUMS(HAlignment) Q_ENUMS(EchoMode) + Q_ENUMS(SelectionMode) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) @@ -112,10 +113,16 @@ public: AlignHCenter = Qt::AlignHCenter }; + enum SelectionMode { + SelectCharacters, + SelectWords + }; + //Auxilliary functions needed to control the TextInput from QML Q_INVOKABLE int positionAt(int x) const; Q_INVOKABLE QRectF positionToRectangle(int pos) const; Q_INVOKABLE void moveCursorSelection(int pos); + Q_INVOKABLE Q_REVISION(1) void moveCursorSelection(int pos, SelectionMode mode); Q_INVOKABLE void openSoftwareInputPanel(); Q_INVOKABLE void closeSoftwareInputPanel(); diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 23c8a1b..7af008f 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -66,6 +66,8 @@ #define SRCDIR "." #endif +Q_DECLARE_METATYPE(QDeclarativeTextEdit::SelectionMode) + QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& actual) { // XXX This will be replaced by some clever persistent platform image store. @@ -107,6 +109,8 @@ private slots: void persistentSelection(); void focusOnPress(); void selection(); + void moveCursorSelection_data(); + void moveCursorSelection(); void mouseSelection_data(); void mouseSelection(); void inputMethodHints(); @@ -144,7 +148,9 @@ private: tst_qdeclarativetextedit::tst_qdeclarativetextedit() { standard << "the quick brown fox jumped over the lazy dog" - << "the quick brown fox\n jumped over the lazy dog"; + << "the quick brown fox\n jumped over the lazy dog" + << "Hello, world!" + << "!dlrow ,olleH"; richText << "<i>the <b>quick</b> brown <a href=\\\"http://www.google.com\\\">fox</a> jumped over the <b>lazy</b> dog</i>" << "<i>the <b>quick</b> brown <a href=\\\"http://www.google.com\\\">fox</a><br>jumped over the <b>lazy</b> dog</i>"; @@ -711,6 +717,162 @@ void tst_qdeclarativetextedit::selection() QVERIFY(textEditObject->selectedText().isNull()); } +void tst_qdeclarativetextedit::moveCursorSelection_data() +{ + QTest::addColumn<QString>("testStr"); + QTest::addColumn<int>("cursorPosition"); + QTest::addColumn<int>("movePosition"); + QTest::addColumn<QDeclarativeTextEdit::SelectionMode>("mode"); + QTest::addColumn<int>("selectionStart"); + QTest::addColumn<int>("selectionEnd"); + QTest::addColumn<bool>("reversible"); + + QTest::newRow("(t)he|characters") + << standard[0] << 0 << 1 << QDeclarativeTextEdit::SelectCharacters << 0 << 1 << true; + QTest::newRow("do(g)|characters") + << standard[0] << 43 << 44 << QDeclarativeTextEdit::SelectCharacters << 43 << 44 << true; + QTest::newRow("jum(p)ed|characters") + << standard[0] << 23 << 24 << QDeclarativeTextEdit::SelectCharacters << 23 << 24 << true; + QTest::newRow("jumped( )over|characters") + << standard[0] << 26 << 27 << QDeclarativeTextEdit::SelectCharacters << 26 << 27 << true; + QTest::newRow("(the )|characters") + << standard[0] << 0 << 4 << QDeclarativeTextEdit::SelectCharacters << 0 << 4 << true; + QTest::newRow("( dog)|characters") + << standard[0] << 40 << 44 << QDeclarativeTextEdit::SelectCharacters << 40 << 44 << true; + QTest::newRow("( jumped )|characters") + << standard[0] << 19 << 27 << QDeclarativeTextEdit::SelectCharacters << 19 << 27 << true; + QTest::newRow("th(e qu)ick|characters") + << standard[0] << 2 << 6 << QDeclarativeTextEdit::SelectCharacters << 2 << 6 << true; + QTest::newRow("la(zy d)og|characters") + << standard[0] << 38 << 42 << QDeclarativeTextEdit::SelectCharacters << 38 << 42 << true; + QTest::newRow("jum(ped ov)er|characters") + << standard[0] << 23 << 29 << QDeclarativeTextEdit::SelectCharacters << 23 << 29 << true; + QTest::newRow("()the|characters") + << standard[0] << 0 << 0 << QDeclarativeTextEdit::SelectCharacters << 0 << 0 << true; + QTest::newRow("dog()|characters") + << standard[0] << 44 << 44 << QDeclarativeTextEdit::SelectCharacters << 44 << 44 << true; + QTest::newRow("jum()ped|characters") + << standard[0] << 23 << 23 << QDeclarativeTextEdit::SelectCharacters << 23 << 23 << true; + + QTest::newRow("(t)he|words") + << standard[0] << 0 << 1 << QDeclarativeTextEdit::SelectWords << 0 << 3 << true; + QTest::newRow("do(g)|words") + << standard[0] << 43 << 44 << QDeclarativeTextEdit::SelectWords << 41 << 44 << true; + QTest::newRow("jum(p)ed|words") + << standard[0] << 23 << 24 << QDeclarativeTextEdit::SelectWords << 20 << 26 << true; + QTest::newRow("jumped( )over|words") + << standard[0] << 26 << 27 << QDeclarativeTextEdit::SelectWords << 27 << 27 << false; + QTest::newRow("jumped( )over|words,reversed") + << standard[0] << 27 << 26 << QDeclarativeTextEdit::SelectWords << 26 << 26 << false; + QTest::newRow("(the )|words") + << standard[0] << 0 << 4 << QDeclarativeTextEdit::SelectWords << 0 << 3 << true; + QTest::newRow("( dog)|words") + << standard[0] << 40 << 44 << QDeclarativeTextEdit::SelectWords << 41 << 44 << true; + QTest::newRow("( jumped )|words") + << standard[0] << 19 << 27 << QDeclarativeTextEdit::SelectWords << 20 << 26 << true; + QTest::newRow("th(e qu)ick|words") + << standard[0] << 2 << 6 << QDeclarativeTextEdit::SelectWords << 0 << 9 << true; + QTest::newRow("la(zy d)og|words") + << standard[0] << 38 << 42 << QDeclarativeTextEdit::SelectWords << 36 << 44 << true; + QTest::newRow("jum(ped ov)er|words") + << standard[0] << 23 << 29 << QDeclarativeTextEdit::SelectWords << 20 << 31 << true; + QTest::newRow("()the|words") + << standard[0] << 0 << 0 << QDeclarativeTextEdit::SelectWords << 0 << 0 << true; + QTest::newRow("dog()|words") + << standard[0] << 44 << 44 << QDeclarativeTextEdit::SelectWords << 44 << 44 << true; + QTest::newRow("jum()ped|words") + << standard[0] << 23 << 23 << QDeclarativeTextEdit::SelectWords << 23 << 23 << true; + + QTest::newRow("Hello(,) |words") + << standard[2] << 5 << 6 << QDeclarativeTextEdit::SelectWords << 5 << 6 << true; + QTest::newRow("Hello(, )|words") + << standard[2] << 5 << 7 << QDeclarativeTextEdit::SelectWords << 5 << 6 << true; + QTest::newRow("Hel(lo, )|words") + << standard[2] << 3 << 7 << QDeclarativeTextEdit::SelectWords << 0 << 6 << true; + QTest::newRow("Hel(lo),|words") + << standard[2] << 3 << 5 << QDeclarativeTextEdit::SelectWords << 0 << 5 << true; + QTest::newRow("Hello(),|words") + << standard[2] << 5 << 5 << QDeclarativeTextEdit::SelectWords << 5 << 5 << true; + QTest::newRow("Hello,()|words") + << standard[2] << 6 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 6 << true; + QTest::newRow("Hello,( )|words") + << standard[2] << 6 << 7 << QDeclarativeTextEdit::SelectWords << 7 << 7 << false; + QTest::newRow("Hello,( )|words") + << standard[2] << 7 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 6 << false; + QTest::newRow("Hello,( world)|words") + << standard[2] << 6 << 12 << QDeclarativeTextEdit::SelectWords << 7 << 12 << true; + QTest::newRow("Hello,( world!)|words") + << standard[2] << 6 << 13 << QDeclarativeTextEdit::SelectWords << 7 << 13 << true; + QTest::newRow("Hello(, world!)|words") + << standard[2] << 5 << 13 << QDeclarativeTextEdit::SelectWords << 5 << 13 << true; + QTest::newRow("world(!)|words") + << standard[2] << 12 << 13 << QDeclarativeTextEdit::SelectWords << 12 << 13 << true; + QTest::newRow("world!())|words") + << standard[2] << 13 << 13 << QDeclarativeTextEdit::SelectWords << 13 << 13 << true; + QTest::newRow("world()!)|words") + << standard[2] << 12 << 12 << QDeclarativeTextEdit::SelectWords << 12 << 12 << true; + + QTest::newRow("(,)olleH |words") + << standard[3] << 7 << 8 << QDeclarativeTextEdit::SelectWords << 7 << 8 << true; + QTest::newRow("( ,)olleH|words") + << standard[3] << 6 << 8 << QDeclarativeTextEdit::SelectWords << 7 << 8 << true; + QTest::newRow("( ,ol)leH|words") + << standard[3] << 6 << 10 << QDeclarativeTextEdit::SelectWords << 7 << 13 << true; + QTest::newRow(",(ol)leH,|words") + << standard[3] << 8 << 10 << QDeclarativeTextEdit::SelectWords << 8 << 13 << true; + QTest::newRow(",()olleH|words") + << standard[3] << 8 << 8 << QDeclarativeTextEdit::SelectWords << 8 << 8 << true; + QTest::newRow("(),olleH|words") + << standard[3] << 7 << 7 << QDeclarativeTextEdit::SelectWords << 7 << 7 << true; + QTest::newRow("( ),olleH|words") + << standard[3] << 6 << 7 << QDeclarativeTextEdit::SelectWords << 7 << 7 << false; + QTest::newRow("( ),olleH|words,reversed") + << standard[3] << 7 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 6 << false; + QTest::newRow("(dlrow ),olleH|words") + << standard[3] << 1 << 7 << QDeclarativeTextEdit::SelectWords << 1 << 6 << true; + QTest::newRow("(!dlrow ),olleH|words") + << standard[3] << 0 << 7 << QDeclarativeTextEdit::SelectWords << 0 << 6 << true; + QTest::newRow("(!dlrow ,)olleH|words") + << standard[3] << 0 << 8 << QDeclarativeTextEdit::SelectWords << 0 << 8 << true; + QTest::newRow("(!)dlrow|words") + << standard[3] << 0 << 1 << QDeclarativeTextEdit::SelectWords << 0 << 1 << true; + QTest::newRow("()!dlrow|words") + << standard[3] << 0 << 0 << QDeclarativeTextEdit::SelectWords << 0 << 0 << true; + QTest::newRow("!()dlrow|words") + << standard[3] << 1 << 1 << QDeclarativeTextEdit::SelectWords << 1 << 1 << true; +} + +void tst_qdeclarativetextedit::moveCursorSelection() +{ + QFETCH(QString, testStr); + QFETCH(int, cursorPosition); + QFETCH(int, movePosition); + QFETCH(QDeclarativeTextEdit::SelectionMode, mode); + QFETCH(int, selectionStart); + QFETCH(int, selectionEnd); + QFETCH(bool, reversible); + + QString componentStr = "import QtQuick 1.1\nTextEdit { text: \""+ testStr +"\"; }"; + QDeclarativeComponent textinputComponent(&engine); + textinputComponent.setData(componentStr.toLatin1(), QUrl()); + QDeclarativeTextEdit *texteditObject = qobject_cast<QDeclarativeTextEdit*>(textinputComponent.create()); + QVERIFY(texteditObject != 0); + + texteditObject->setCursorPosition(cursorPosition); + texteditObject->moveCursorSelection(movePosition, mode); + + QCOMPARE(texteditObject->selectionStart(), selectionStart); + QCOMPARE(texteditObject->selectionEnd(), selectionEnd); + + if (reversible) { + texteditObject->setCursorPosition(movePosition); + texteditObject->moveCursorSelection(cursorPosition, mode); + + QCOMPARE(texteditObject->selectionStart(), selectionStart); + QCOMPARE(texteditObject->selectionEnd(), selectionEnd); + } +} + void tst_qdeclarativetextedit::mouseSelection_data() { QTest::addColumn<QString>("qmlfile"); diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 160c3b6..1de695e 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -57,6 +57,8 @@ #define SRCDIR "." #endif +Q_DECLARE_METATYPE(QDeclarativeTextInput::SelectionMode) + QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& actual) { // XXX This will be replaced by some clever persistent platform image store. @@ -87,6 +89,8 @@ private slots: void font(); void color(); void selection(); + void moveCursorSelection_data(); + void moveCursorSelection(); void horizontalAlignment_data(); void horizontalAlignment(); @@ -124,7 +128,8 @@ tst_qdeclarativetextinput::tst_qdeclarativetextinput() { standard << "the quick brown fox jumped over the lazy dog" << "It's supercalifragisiticexpialidocious!" - << "Hello, world!"; + << "Hello, world!" + << "!dlrow ,olleH"; colorStrings << "aliceblue" << "antiquewhite" @@ -415,6 +420,162 @@ void tst_qdeclarativetextinput::selection() delete textinputObject; } +void tst_qdeclarativetextinput::moveCursorSelection_data() +{ + QTest::addColumn<QString>("testStr"); + QTest::addColumn<int>("cursorPosition"); + QTest::addColumn<int>("movePosition"); + QTest::addColumn<QDeclarativeTextInput::SelectionMode>("mode"); + QTest::addColumn<int>("selectionStart"); + QTest::addColumn<int>("selectionEnd"); + QTest::addColumn<bool>("reversible"); + + QTest::newRow("(t)he|characters") + << standard[0] << 0 << 1 << QDeclarativeTextInput::SelectCharacters << 0 << 1 << true; + QTest::newRow("do(g)|characters") + << standard[0] << 43 << 44 << QDeclarativeTextInput::SelectCharacters << 43 << 44 << true; + QTest::newRow("jum(p)ed|characters") + << standard[0] << 23 << 24 << QDeclarativeTextInput::SelectCharacters << 23 << 24 << true; + QTest::newRow("jumped( )over|characters") + << standard[0] << 26 << 27 << QDeclarativeTextInput::SelectCharacters << 26 << 27 << true; + QTest::newRow("(the )|characters") + << standard[0] << 0 << 4 << QDeclarativeTextInput::SelectCharacters << 0 << 4 << true; + QTest::newRow("( dog)|characters") + << standard[0] << 40 << 44 << QDeclarativeTextInput::SelectCharacters << 40 << 44 << true; + QTest::newRow("( jumped )|characters") + << standard[0] << 19 << 27 << QDeclarativeTextInput::SelectCharacters << 19 << 27 << true; + QTest::newRow("th(e qu)ick|characters") + << standard[0] << 2 << 6 << QDeclarativeTextInput::SelectCharacters << 2 << 6 << true; + QTest::newRow("la(zy d)og|characters") + << standard[0] << 38 << 42 << QDeclarativeTextInput::SelectCharacters << 38 << 42 << true; + QTest::newRow("jum(ped ov)er|characters") + << standard[0] << 23 << 29 << QDeclarativeTextInput::SelectCharacters << 23 << 29 << true; + QTest::newRow("()the|characters") + << standard[0] << 0 << 0 << QDeclarativeTextInput::SelectCharacters << 0 << 0 << true; + QTest::newRow("dog()|characters") + << standard[0] << 44 << 44 << QDeclarativeTextInput::SelectCharacters << 44 << 44 << true; + QTest::newRow("jum()ped|characters") + << standard[0] << 23 << 23 << QDeclarativeTextInput::SelectCharacters << 23 << 23 << true; + + QTest::newRow("(t)he|words") + << standard[0] << 0 << 1 << QDeclarativeTextInput::SelectWords << 0 << 3 << true; + QTest::newRow("do(g)|words") + << standard[0] << 43 << 44 << QDeclarativeTextInput::SelectWords << 41 << 44 << true; + QTest::newRow("jum(p)ed|words") + << standard[0] << 23 << 24 << QDeclarativeTextInput::SelectWords << 20 << 26 << true; + QTest::newRow("jumped( )over|words") + << standard[0] << 26 << 27 << QDeclarativeTextInput::SelectWords << 27 << 27 << false; + QTest::newRow("jumped( )over|words,reversed") + << standard[0] << 27 << 26 << QDeclarativeTextInput::SelectWords << 26 << 26 << false; + QTest::newRow("(the )|words") + << standard[0] << 0 << 4 << QDeclarativeTextInput::SelectWords << 0 << 3 << true; + QTest::newRow("( dog)|words") + << standard[0] << 40 << 44 << QDeclarativeTextInput::SelectWords << 41 << 44 << true; + QTest::newRow("( jumped )|words") + << standard[0] << 19 << 27 << QDeclarativeTextInput::SelectWords << 20 << 26 << true; + QTest::newRow("th(e qu)ick|words") + << standard[0] << 2 << 6 << QDeclarativeTextInput::SelectWords << 0 << 9 << true; + QTest::newRow("la(zy d)og|words") + << standard[0] << 38 << 42 << QDeclarativeTextInput::SelectWords << 36 << 44 << true; + QTest::newRow("jum(ped ov)er|words") + << standard[0] << 23 << 29 << QDeclarativeTextInput::SelectWords << 20 << 31 << true; + QTest::newRow("()the|words") + << standard[0] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << true; + QTest::newRow("dog()|words") + << standard[0] << 44 << 44 << QDeclarativeTextInput::SelectWords << 44 << 44 << true; + QTest::newRow("jum()ped|words") + << standard[0] << 23 << 23 << QDeclarativeTextInput::SelectWords << 23 << 23 << true; + + QTest::newRow("Hello(,) |words") + << standard[2] << 5 << 6 << QDeclarativeTextInput::SelectWords << 5 << 6 << true; + QTest::newRow("Hello(, )|words") + << standard[2] << 5 << 7 << QDeclarativeTextInput::SelectWords << 5 << 6 << true; + QTest::newRow("Hel(lo, )|words") + << standard[2] << 3 << 7 << QDeclarativeTextInput::SelectWords << 0 << 6 << true; + QTest::newRow("Hel(lo),|words") + << standard[2] << 3 << 5 << QDeclarativeTextInput::SelectWords << 0 << 5 << true; + QTest::newRow("Hello(),|words") + << standard[2] << 5 << 5 << QDeclarativeTextInput::SelectWords << 5 << 5 << true; + QTest::newRow("Hello,()|words") + << standard[2] << 6 << 6 << QDeclarativeTextInput::SelectWords << 6 << 6 << true; + QTest::newRow("Hello,( )|words") + << standard[2] << 6 << 7 << QDeclarativeTextInput::SelectWords << 7 << 7 << false; + QTest::newRow("Hello,( )|words,reversed") + << standard[2] << 7 << 6 << QDeclarativeTextInput::SelectWords << 6 << 6 << false; + QTest::newRow("Hello,( world)|words") + << standard[2] << 6 << 12 << QDeclarativeTextInput::SelectWords << 7 << 12 << true; + QTest::newRow("Hello,( world!)|words") + << standard[2] << 6 << 13 << QDeclarativeTextInput::SelectWords << 7 << 13 << true; + QTest::newRow("Hello(, world!)|words") + << standard[2] << 5 << 13 << QDeclarativeTextInput::SelectWords << 5 << 13 << true; + QTest::newRow("world(!)|words") + << standard[2] << 12 << 13 << QDeclarativeTextInput::SelectWords << 12 << 13 << true; + QTest::newRow("world!())|words") + << standard[2] << 13 << 13 << QDeclarativeTextInput::SelectWords << 13 << 13 << true; + QTest::newRow("world()!)|words") + << standard[2] << 12 << 12 << QDeclarativeTextInput::SelectWords << 12 << 12 << true; + + QTest::newRow("(,)olleH |words") + << standard[3] << 7 << 8 << QDeclarativeTextInput::SelectWords << 7 << 8 << true; + QTest::newRow("( ,)olleH|words") + << standard[3] << 6 << 8 << QDeclarativeTextInput::SelectWords << 7 << 8 << true; + QTest::newRow("( ,ol)leH|words") + << standard[3] << 6 << 10 << QDeclarativeTextInput::SelectWords << 7 << 13 << true; + QTest::newRow(",(ol)leH,|words") + << standard[3] << 8 << 10 << QDeclarativeTextInput::SelectWords << 8 << 13 << true; + QTest::newRow(",()olleH|words") + << standard[3] << 8 << 8 << QDeclarativeTextInput::SelectWords << 8 << 8 << true; + QTest::newRow("(),olleH|words") + << standard[3] << 7 << 7 << QDeclarativeTextInput::SelectWords << 7 << 7 << true; + QTest::newRow("( ),olleH|words") + << standard[3] << 6 << 7 << QDeclarativeTextInput::SelectWords << 7 << 7 << false; + QTest::newRow("( ),olleH|words,reversed") + << standard[3] << 7 << 6 << QDeclarativeTextInput::SelectWords << 6 << 6 << false; + QTest::newRow("(dlrow ),olleH|words") + << standard[3] << 1 << 7 << QDeclarativeTextInput::SelectWords << 1 << 6 << true; + QTest::newRow("(!dlrow ),olleH|words") + << standard[3] << 0 << 7 << QDeclarativeTextInput::SelectWords << 0 << 6 << true; + QTest::newRow("(!dlrow ,)olleH|words") + << standard[3] << 0 << 8 << QDeclarativeTextInput::SelectWords << 0 << 8 << true; + QTest::newRow("(!)dlrow|words") + << standard[3] << 0 << 1 << QDeclarativeTextInput::SelectWords << 0 << 1 << true; + QTest::newRow("()!dlrow|words") + << standard[3] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << true; + QTest::newRow("!()dlrow|words") + << standard[3] << 1 << 1 << QDeclarativeTextInput::SelectWords << 1 << 1 << true; +} + +void tst_qdeclarativetextinput::moveCursorSelection() +{ + QFETCH(QString, testStr); + QFETCH(int, cursorPosition); + QFETCH(int, movePosition); + QFETCH(QDeclarativeTextInput::SelectionMode, mode); + QFETCH(int, selectionStart); + QFETCH(int, selectionEnd); + QFETCH(bool, reversible); + + QString componentStr = "import QtQuick 1.1\nTextInput { text: \""+ testStr +"\"; }"; + QDeclarativeComponent textinputComponent(&engine); + textinputComponent.setData(componentStr.toLatin1(), QUrl()); + QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create()); + QVERIFY(textinputObject != 0); + + textinputObject->setCursorPosition(cursorPosition); + textinputObject->moveCursorSelection(movePosition, mode); + + QCOMPARE(textinputObject->selectionStart(), selectionStart); + QCOMPARE(textinputObject->selectionEnd(), selectionEnd); + + if (reversible) { + textinputObject->setCursorPosition(movePosition); + textinputObject->moveCursorSelection(cursorPosition, mode); + + QCOMPARE(textinputObject->selectionStart(), selectionStart); + QCOMPARE(textinputObject->selectionEnd(), selectionEnd); + } +} + void tst_qdeclarativetextinput::horizontalAlignment_data() { QTest::addColumn<int>("hAlign"); -- cgit v0.12 From 77cba04c244c47c77af04777de3b3172c309b541 Mon Sep 17 00:00:00 2001 From: Alan Alpert <alan.alpert@nokia.com> Date: Mon, 10 Jan 2011 15:01:11 +1000 Subject: Fix word selection in QLineControl Word selection occasionally selected the word beforehand as well, in both QLineEdit and TextInput. Visual Test included to verify behavior. Task-number: QTBUG-15818 Reviewed-by: Martin Jones --- src/gui/widgets/qlinecontrol.cpp | 4 +- .../data-X11/qtbug-15818.0.png | Bin 0 -> 573 bytes .../data-X11/qtbug-15818.1.png | Bin 0 -> 573 bytes .../data-X11/qtbug-15818.2.png | Bin 0 -> 573 bytes .../data-X11/qtbug-15818.3.png | Bin 0 -> 647 bytes .../data-X11/qtbug-15818.4.png | Bin 0 -> 647 bytes .../data-X11/qtbug-15818.5.png | Bin 0 -> 625 bytes .../qdeclarativetextinput/data-X11/qtbug-15818.qml | 1039 ++++++++++++++++++++ .../qdeclarativetextinput/qtbug-15818.qml | 13 + 9 files changed, 1054 insertions(+), 2 deletions(-) create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.0.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.1.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.2.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.3.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.4.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.5.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.qml create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativetextinput/qtbug-15818.qml diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 5ea9dc4..12607c1 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -541,10 +541,10 @@ void QLineControl::draw(QPainter *painter, const QPoint &offset, const QRect &cl */ void QLineControl::selectWordAtPos(int cursor) { - int c = m_textLayout.previousCursorPosition(cursor, QTextLayout::SkipWords); + int c = m_textLayout.previousCursorPosition(cursor+1, QTextLayout::SkipWords); moveCursor(c, false); // ## text layout should support end of words. - int end = m_textLayout.nextCursorPosition(cursor, QTextLayout::SkipWords); + int end = m_textLayout.nextCursorPosition(c, QTextLayout::SkipWords); while (end > cursor && m_text[end-1].isSpace()) --end; moveCursor(end, true); diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.0.png new file mode 100644 index 0000000..fc34b1a Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.0.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.1.png new file mode 100644 index 0000000..fc34b1a Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.1.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.2.png new file mode 100644 index 0000000..fc34b1a Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.2.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.3.png new file mode 100644 index 0000000..fb2c90b Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.3.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.4.png new file mode 100644 index 0000000..fb2c90b Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.4.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.5.png new file mode 100644 index 0000000..e2231ff Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.5.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.qml new file mode 100644 index 0000000..790dffa --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.qml @@ -0,0 +1,1039 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + image: "qtbug-15818.0.png" + } + Frame { + msec: 32 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 48 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 64 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 80 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 96 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 112 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 128 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 144 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 160 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 176 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 192 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 208 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 224 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 240 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 256 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 272 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 288 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 304 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 320 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 336 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 352 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 368 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 384 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 400 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 416 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 432 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 448 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 464 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 480 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 496 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 512 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 528 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 544 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 560 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 576 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 592 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 608 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 624 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 640 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 656 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 672 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 688 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 704 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 720 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 736 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 752 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 768 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 784 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 800 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 816 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 832 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 848 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 864 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 880 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 26; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 896 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 912 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 928 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 27; y: 9 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 27; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 944 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 960 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 976 + image: "qtbug-15818.1.png" + } + Frame { + msec: 992 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Mouse { + type: 4 + button: 1 + buttons: 1 + x: 27; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1008 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1024 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1040 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1056 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1072 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1088 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1104 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 27; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1120 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1136 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1152 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1168 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1184 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1200 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1216 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1232 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1248 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1264 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1280 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1296 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1312 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1328 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1344 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1360 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1376 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1392 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1408 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1424 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1440 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1456 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1472 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1488 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1504 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1520 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1536 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1552 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1568 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1584 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1600 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1616 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1632 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1648 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1664 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1680 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1696 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1712 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1728 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1744 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1760 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1776 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Frame { + msec: 1792 + hash: "8833dfac6aae78ce1309222cc4438e6f" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 43; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1808 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 1824 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 1840 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 1856 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 1872 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 1888 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 43; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1904 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 1920 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 1936 + image: "qtbug-15818.2.png" + } + Frame { + msec: 1952 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Mouse { + type: 4 + button: 1 + buttons: 1 + x: 43; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1968 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 1984 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2000 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2016 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2032 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2048 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2064 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 43; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2080 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2096 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2112 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2128 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2144 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2160 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2176 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2192 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2208 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2224 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2240 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2256 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2272 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2288 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2304 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2320 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2336 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2352 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2368 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2384 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2400 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2416 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2432 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2448 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2464 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2480 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2496 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2512 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2528 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2544 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2560 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2576 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2592 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2608 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2624 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2640 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2656 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2672 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2688 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 54; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2704 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 2720 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 2736 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 2752 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 2768 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 2784 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 55; y: 9 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 55; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2800 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 2816 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 2832 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Frame { + msec: 2848 + hash: "0a63463fc1004efffd15f9524bcf3a29" + } + Mouse { + type: 4 + button: 1 + buttons: 1 + x: 55; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2864 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2880 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2896 + image: "qtbug-15818.3.png" + } + Frame { + msec: 2912 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2928 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2944 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2960 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 2976 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 55; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2992 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3008 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3024 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3040 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3056 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3072 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3088 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3104 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3120 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3136 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3152 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3168 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3184 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3200 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3216 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3232 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3248 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3264 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3280 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3296 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3312 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3328 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3344 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3360 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3376 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3392 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3408 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3424 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3440 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3456 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3472 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3488 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3504 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3520 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3536 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3552 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3568 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3584 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3600 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3616 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3632 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3648 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3664 + hash: "270462ec02bce658757e0ea4fb2136b1" + } + Frame { + msec: 3680 + hash: "270462ec02bce658757e0ea4fb2136b1" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/qtbug-15818.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/qtbug-15818.qml new file mode 100644 index 0000000..59710a4 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/qtbug-15818.qml @@ -0,0 +1,13 @@ +import QtQuick 1.1 +//Test that doubleclicking on the front of a word only selects that word, and not the word in front + +Item{ + width: 200 + height: 100 + TextInput{ + anchors.fill: parent + readOnly: true + selectByMouse: true + text: "abc a cba test" + } +} -- cgit v0.12 From 7aae8a569809208318ad06017eda39c860c1b2a9 Mon Sep 17 00:00:00 2001 From: Joona Petrell <joona.t.petrell@nokia.com> Date: Mon, 10 Jan 2011 15:29:03 +1000 Subject: Add no warnings label to qmlviewer warnings window Small developer usability improvement Task-number: Reviewed-by: Bea Lam --- tools/qml/loggerwidget.cpp | 15 +++++++++++++++ tools/qml/loggerwidget.h | 4 +++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp index f601d95..fb4fedc 100644 --- a/tools/qml/loggerwidget.cpp +++ b/tools/qml/loggerwidget.cpp @@ -45,6 +45,8 @@ #include <QActionGroup> #include <QMenu> #include <QPlainTextEdit> +#include <QLabel> +#include <QVBoxLayout> #ifdef Q_WS_MAEMO_5 # include <QScrollArea> # include <QVBoxLayout> @@ -83,6 +85,14 @@ LoggerWidget::LoggerWidget(QWidget *parent) : setCentralWidget(m_plainTextEdit); #endif + m_noWarningsLabel = new QLabel(m_plainTextEdit); + m_noWarningsLabel->setText(tr("(No warnings)")); + m_noWarningsLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter); + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(m_noWarningsLabel); + m_plainTextEdit->setLayout(layout); + connect(m_plainTextEdit, SIGNAL(textChanged()), this, SLOT(updateNoWarningsLabel())); + readSettings(); setupPreferencesMenu(); } @@ -207,4 +217,9 @@ void LoggerWidget::setupPreferencesMenu() } } +void LoggerWidget::updateNoWarningsLabel() +{ + m_noWarningsLabel->setVisible(m_plainTextEdit->toPlainText().length() == 0); +} + QT_END_NAMESPACE diff --git a/tools/qml/loggerwidget.h b/tools/qml/loggerwidget.h index 13c319f..27d4d0b 100644 --- a/tools/qml/loggerwidget.h +++ b/tools/qml/loggerwidget.h @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE class QPlainTextEdit; +class QLabel; class QMenu; class QAction; @@ -66,6 +67,7 @@ public: public slots: void append(const QString &msg); + void updateNoWarningsLabel(); private slots: void warningsPreferenceChanged(QAction *action); @@ -86,7 +88,7 @@ private: QMenu *m_preferencesMenu; QAction *m_showWidgetAction; QPlainTextEdit *m_plainTextEdit; - + QLabel *m_noWarningsLabel; enum ConfigOrigin { CommandLineOrigin, SettingsOrigin }; ConfigOrigin m_visibilityOrigin; Visibility m_visibility; -- cgit v0.12 From 6a36f1f6299980cd0338009cb31e2a36cd40e44f Mon Sep 17 00:00:00 2001 From: Joona Petrell <joona.t.petrell@nokia.com> Date: Mon, 10 Jan 2011 15:40:11 +1000 Subject: Add property versioning checks for QtQuick 1.1 deselect() function Task-number: QTBUG-16059 Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp | 5 ++++- src/declarative/graphicsitems/qdeclarativetextedit_p.h | 2 +- src/declarative/graphicsitems/qdeclarativetextinput_p.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 7db4d85..0d386c6 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -179,8 +179,11 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType<QDeclarativePinchArea>("QtQuick",1,1,"PinchArea"); qmlRegisterType<QDeclarativePinch>("QtQuick",1,1,"Pinch"); qmlRegisterType<QDeclarativePinchEvent>(); - qmlRegisterType<QDeclarativeRepeater, 1>("QtQuick",1,1,"Repeater"); + qmlRegisterType<QDeclarativeRepeater,1>("QtQuick",1,1,"Repeater"); qmlRegisterType<QDeclarativeTextEdit,1>("QtQuick",1,1,"TextEdit"); +#ifndef QT_NO_LINEEDIT + qmlRegisterType<QDeclarativeTextInput,1>("QtQuick",1,1,"TextInput"); +#endif #ifndef QT_NO_IMPORT_QT47_QML #ifdef QT_NO_MOVIE diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h index 6a05aa8..3e86a05 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h @@ -231,10 +231,10 @@ Q_SIGNALS: Q_REVISION(1) void linkActivated(const QString &link); public Q_SLOTS: - void deselect(); void selectAll(); void selectWord(); void select(int start, int end); + Q_REVISION(1) void deselect(); #ifndef QT_NO_CLIPBOARD void cut(); void copy(); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h index 25b8e66..5bff2ea 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h @@ -238,10 +238,10 @@ protected: void focusInEvent(QFocusEvent *event); public Q_SLOTS: - void deselect(); void selectAll(); void selectWord(); void select(int start, int end); + Q_REVISION(1) void deselect(); #ifndef QT_NO_CLIPBOARD void cut(); void copy(); -- cgit v0.12 From d281cea3a445aa244901decceffd7d653ed829c8 Mon Sep 17 00:00:00 2001 From: Sami Merila <sami.merila@nokia.com> Date: Mon, 10 Jan 2011 10:36:41 +0200 Subject: QWidgets support for VGA screen Add pixelmetrics data for QS60Style to support VGA screensizes. Task-number: QT-4079 Reviewed-by: Miikka Heikkinen --- src/gui/styles/qs60style.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 040ca4f..3ba8887 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -96,7 +96,8 @@ const layoutHeader QS60StylePrivate::m_layoutHeaders[] = { {320,240,1,19,"QVGA Portrait"}, {360,640,1,19,"NHD Landscape"}, {640,360,1,19,"NHD Portrait"}, -{352,800,1,12,"E90 Landscape"} +{352,800,1,12,"E90 Landscape"}, +{480,640,1,19,"VGA Landscape"} // *** End of generated data *** }; const int QS60StylePrivate::m_numberOfLayouts = @@ -109,6 +110,7 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { {7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, {7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, {7,0,-909,0,0,2,0,2,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106} +{9,0,-909,0,0,2,0,5,-1,34,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,19,19,9,1,25,-909,9,101,24,9,0,7,7,7,16,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184} // *** End of generated data *** }; -- cgit v0.12 From 19b6e2b944a0d1eeef0fb707a00f567e4ee870e6 Mon Sep 17 00:00:00 2001 From: Sami Merila <sami.merila@nokia.com> Date: Mon, 10 Jan 2011 11:32:15 +0200 Subject: Build failure fix (related to QT-4079) Change d281cea3a445aa244901decceffd7d653ed829c8 caused build failure, due to missing comma (one line missing from commit). Fixed by adding the missing change. Task-number: QT-4079 Reviewed-by: Miikka Heikkinen --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 3ba8887..4a4095d 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -109,7 +109,7 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { {5,0,-909,0,0,1,0,2,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106}, {7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, {7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, -{7,0,-909,0,0,2,0,2,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106} +{7,0,-909,0,0,2,0,2,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106}, {9,0,-909,0,0,2,0,5,-1,34,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,19,19,9,1,25,-909,9,101,24,9,0,7,7,7,16,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184} // *** End of generated data *** }; -- cgit v0.12 From d95b1dd15f7aed243d7177a2096eb58080359d55 Mon Sep 17 00:00:00 2001 From: David Boddie <david.boddie@nokia.com> Date: Mon, 10 Jan 2011 13:40:21 +0100 Subject: Doc: Changed description to prevent confusion about managed widgets. --- src/gui/kernel/qlayout.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qlayout.cpp b/src/gui/kernel/qlayout.cpp index 5b526d4..fbede11 100644 --- a/src/gui/kernel/qlayout.cpp +++ b/src/gui/kernel/qlayout.cpp @@ -980,10 +980,10 @@ void QLayoutPrivate::reparentChildWidgets(QWidget *mw) /*! This function is called from \c addWidget() functions in - subclasses to add \a w as a child widget. + subclasses to add \a w as a managed widget of a layout. - If \a w is already in a layout, this function will give a warning - and remove \a w from the layout. This function must therefore be + If \a w is already managed by a layout, this function will give a warning + and remove \a w from that layout. This function must therefore be called before adding \a w to the layout's data structure. */ void QLayout::addChildWidget(QWidget *w) -- cgit v0.12 From fbc2c44d1382e223a9a6e13fab66731fc6d54b18 Mon Sep 17 00:00:00 2001 From: Jason McDonald <jason.mcdonald@nokia.com> Date: Tue, 11 Jan 2011 01:15:00 +1000 Subject: Update copyright year to 2011. Reviewed-by: Trust Me --- LICENSE.LGPL | 2 +- bin/createpackage.bat | 2 +- bin/createpackage.pl | 2 +- bin/patch_capabilities.pl | 2 +- bin/setcepaths.bat | 2 +- bin/syncqt | 2 +- bin/syncqt.bat | 2 +- config.tests/mac/crc/main.cpp | 2 +- config.tests/mac/xcodeversion.cpp | 2 +- config.tests/qws/ahi/ahi.cpp | 2 +- config.tests/qws/directfb/directfb.cpp | 2 +- config.tests/qws/sound/sound.cpp | 2 +- config.tests/qws/svgalib/svgalib.cpp | 2 +- config.tests/unix/3dnow/3dnow.cpp | 2 +- config.tests/unix/alsa/alsatest.cpp | 2 +- config.tests/unix/clock-gettime/clock-gettime.cpp | 2 +- config.tests/unix/clock-monotonic/clock-monotonic.cpp | 2 +- config.tests/unix/cups/cups.cpp | 2 +- config.tests/unix/db2/db2.cpp | 2 +- config.tests/unix/dbus/dbus.cpp | 2 +- config.tests/unix/doubleformat/doubleformattest.cpp | 2 +- config.tests/unix/egl/egl.cpp | 2 +- config.tests/unix/egl4gles1/egl4gles1.cpp | 2 +- config.tests/unix/endian/endiantest.cpp | 2 +- config.tests/unix/floatmath/floatmath.cpp | 2 +- config.tests/unix/freetype/freetype.cpp | 2 +- config.tests/unix/getaddrinfo/getaddrinfotest.cpp | 2 +- config.tests/unix/getifaddrs/getifaddrs.cpp | 2 +- config.tests/unix/glib/glib.cpp | 2 +- config.tests/unix/gnu-libiconv/gnu-libiconv.cpp | 2 +- config.tests/unix/gstreamer/gstreamer.cpp | 2 +- config.tests/unix/ibase/ibase.cpp | 2 +- config.tests/unix/iconv/iconv.cpp | 2 +- config.tests/unix/inotify/inotifytest.cpp | 2 +- config.tests/unix/iodbc/iodbc.cpp | 2 +- config.tests/unix/ipv6/ipv6test.cpp | 2 +- config.tests/unix/ipv6ifname/ipv6ifname.cpp | 2 +- config.tests/unix/iwmmxt/iwmmxt.cpp | 2 +- config.tests/unix/javascriptcore-jit/hwcap_test.cpp | 2 +- config.tests/unix/largefile/largefiletest.cpp | 2 +- config.tests/unix/libjpeg/libjpeg.cpp | 2 +- config.tests/unix/libmng/libmng.cpp | 2 +- config.tests/unix/libpng/libpng.cpp | 2 +- config.tests/unix/libtiff/libtiff.cpp | 2 +- config.tests/unix/mmx/mmx.cpp | 2 +- config.tests/unix/mremap/mremap.cpp | 2 +- config.tests/unix/mysql/mysql.cpp | 2 +- config.tests/unix/neon/neon.cpp | 2 +- config.tests/unix/nis/nis.cpp | 2 +- config.tests/unix/oci/oci.cpp | 2 +- config.tests/unix/odbc/odbc.cpp | 2 +- config.tests/unix/opengles1/opengles1.cpp | 2 +- config.tests/unix/opengles1cl/opengles1cl.cpp | 2 +- config.tests/unix/opengles2/opengles2.cpp | 2 +- config.tests/unix/openssl/openssl.cpp | 2 +- config.tests/unix/openvg/openvg.cpp | 2 +- config.tests/unix/psql/psql.cpp | 2 +- config.tests/unix/ptrsize/ptrsizetest.cpp | 2 +- config.tests/unix/shivavg/shivavg.cpp | 2 +- config.tests/unix/sqlite/sqlite.cpp | 2 +- config.tests/unix/sqlite2/sqlite2.cpp | 2 +- config.tests/unix/sse/sse.cpp | 2 +- config.tests/unix/sse2/sse2.cpp | 2 +- config.tests/unix/stdint/main.cpp | 2 +- config.tests/unix/stl/stltest.cpp | 2 +- config.tests/unix/tds/tds.cpp | 2 +- config.tests/unix/tslib/tslib.cpp | 2 +- config.tests/unix/zlib/zlib.cpp | 2 +- config.tests/x11/fontconfig/fontconfig.cpp | 2 +- config.tests/x11/glxfbconfig/glxfbconfig.cpp | 2 +- config.tests/x11/mitshm/mitshm.cpp | 2 +- config.tests/x11/notype/notypetest.cpp | 2 +- config.tests/x11/opengl/opengl.cpp | 2 +- config.tests/x11/sm/sm.cpp | 2 +- config.tests/x11/xcursor/xcursor.cpp | 2 +- config.tests/x11/xfixes/xfixes.cpp | 2 +- config.tests/x11/xinerama/xinerama.cpp | 2 +- config.tests/x11/xinput/xinput.cpp | 2 +- config.tests/x11/xkb/xkb.cpp | 2 +- config.tests/x11/xlib/xlib.cpp | 2 +- config.tests/x11/xrandr/xrandr.cpp | 2 +- config.tests/x11/xrender/xrender.cpp | 2 +- config.tests/x11/xshape/xshape.cpp | 2 +- config.tests/x11/xsync/xsync.cpp | 2 +- configure | 2 +- demos/affine/main.cpp | 2 +- demos/affine/xform.cpp | 2 +- demos/affine/xform.h | 2 +- demos/arthurplugin/plugin.cpp | 2 +- demos/books/bookdelegate.cpp | 2 +- demos/books/bookdelegate.h | 2 +- demos/books/bookwindow.cpp | 2 +- demos/books/bookwindow.h | 2 +- demos/books/initdb.h | 2 +- demos/books/main.cpp | 2 +- demos/boxes/basic.fsh | 2 +- demos/boxes/basic.vsh | 2 +- demos/boxes/dotted.fsh | 2 +- demos/boxes/fresnel.fsh | 2 +- demos/boxes/glass.fsh | 2 +- demos/boxes/glbuffers.cpp | 2 +- demos/boxes/glbuffers.h | 2 +- demos/boxes/glextensions.cpp | 2 +- demos/boxes/glextensions.h | 2 +- demos/boxes/gltrianglemesh.h | 2 +- demos/boxes/granite.fsh | 2 +- demos/boxes/main.cpp | 2 +- demos/boxes/marble.fsh | 2 +- demos/boxes/qtbox.cpp | 2 +- demos/boxes/qtbox.h | 2 +- demos/boxes/reflection.fsh | 2 +- demos/boxes/refraction.fsh | 2 +- demos/boxes/roundedbox.cpp | 2 +- demos/boxes/roundedbox.h | 2 +- demos/boxes/scene.cpp | 2 +- demos/boxes/scene.h | 2 +- demos/boxes/trackball.cpp | 2 +- demos/boxes/trackball.h | 2 +- demos/boxes/wood.fsh | 2 +- demos/browser/autosaver.cpp | 2 +- demos/browser/autosaver.h | 2 +- demos/browser/bookmarks.cpp | 2 +- demos/browser/bookmarks.h | 2 +- demos/browser/browserapplication.cpp | 2 +- demos/browser/browserapplication.h | 2 +- demos/browser/browsermainwindow.cpp | 2 +- demos/browser/browsermainwindow.h | 2 +- demos/browser/chasewidget.cpp | 2 +- demos/browser/chasewidget.h | 2 +- demos/browser/cookiejar.cpp | 2 +- demos/browser/cookiejar.h | 2 +- demos/browser/data/browser.svg | 2 +- demos/browser/downloadmanager.cpp | 2 +- demos/browser/downloadmanager.h | 2 +- demos/browser/edittableview.cpp | 2 +- demos/browser/edittableview.h | 2 +- demos/browser/edittreeview.cpp | 2 +- demos/browser/edittreeview.h | 2 +- demos/browser/history.cpp | 2 +- demos/browser/history.h | 2 +- demos/browser/main.cpp | 2 +- demos/browser/modelmenu.cpp | 2 +- demos/browser/modelmenu.h | 2 +- demos/browser/networkaccessmanager.cpp | 2 +- demos/browser/networkaccessmanager.h | 2 +- demos/browser/searchlineedit.cpp | 2 +- demos/browser/searchlineedit.h | 2 +- demos/browser/settings.cpp | 2 +- demos/browser/settings.h | 2 +- demos/browser/squeezelabel.cpp | 2 +- demos/browser/squeezelabel.h | 2 +- demos/browser/tabwidget.cpp | 2 +- demos/browser/tabwidget.h | 2 +- demos/browser/toolbarsearch.cpp | 2 +- demos/browser/toolbarsearch.h | 2 +- demos/browser/urllineedit.cpp | 2 +- demos/browser/urllineedit.h | 2 +- demos/browser/webview.cpp | 2 +- demos/browser/webview.h | 2 +- demos/browser/xbel.cpp | 2 +- demos/browser/xbel.h | 2 +- demos/chip/chip.cpp | 2 +- demos/chip/chip.h | 2 +- demos/chip/main.cpp | 2 +- demos/chip/mainwindow.cpp | 2 +- demos/chip/mainwindow.h | 2 +- demos/chip/view.cpp | 2 +- demos/chip/view.h | 2 +- demos/composition/composition.cpp | 2 +- demos/composition/composition.h | 2 +- demos/composition/main.cpp | 2 +- demos/deform/main.cpp | 2 +- demos/deform/pathdeform.cpp | 2 +- demos/deform/pathdeform.h | 2 +- demos/embedded/anomaly/src/AddressBar.cpp | 2 +- demos/embedded/anomaly/src/AddressBar.h | 2 +- demos/embedded/anomaly/src/BookmarksView.cpp | 2 +- demos/embedded/anomaly/src/BookmarksView.h | 2 +- demos/embedded/anomaly/src/BrowserView.cpp | 2 +- demos/embedded/anomaly/src/BrowserView.h | 2 +- demos/embedded/anomaly/src/BrowserWindow.cpp | 2 +- demos/embedded/anomaly/src/BrowserWindow.h | 2 +- demos/embedded/anomaly/src/ControlStrip.cpp | 2 +- demos/embedded/anomaly/src/ControlStrip.h | 2 +- demos/embedded/anomaly/src/HomeView.cpp | 2 +- demos/embedded/anomaly/src/HomeView.h | 2 +- demos/embedded/anomaly/src/Main.cpp | 2 +- demos/embedded/anomaly/src/TitleBar.cpp | 2 +- demos/embedded/anomaly/src/TitleBar.h | 2 +- demos/embedded/anomaly/src/ZoomStrip.cpp | 2 +- demos/embedded/anomaly/src/ZoomStrip.h | 2 +- demos/embedded/anomaly/src/flickcharm.cpp | 2 +- demos/embedded/anomaly/src/flickcharm.h | 2 +- demos/embedded/anomaly/src/webview.cpp | 2 +- demos/embedded/anomaly/src/webview.h | 2 +- demos/embedded/desktopservices/contenttab.cpp | 2 +- demos/embedded/desktopservices/contenttab.h | 2 +- demos/embedded/desktopservices/desktopwidget.cpp | 2 +- demos/embedded/desktopservices/desktopwidget.h | 2 +- demos/embedded/desktopservices/linktab.cpp | 2 +- demos/embedded/desktopservices/linktab.h | 2 +- demos/embedded/desktopservices/main.cpp | 2 +- demos/embedded/digiflip/digiflip.cpp | 2 +- demos/embedded/embeddedsvgviewer/embeddedsvgviewer.cpp | 2 +- demos/embedded/embeddedsvgviewer/embeddedsvgviewer.h | 2 +- demos/embedded/embeddedsvgviewer/main.cpp | 2 +- demos/embedded/flickable/flickable.cpp | 2 +- demos/embedded/flickable/flickable.h | 2 +- demos/embedded/flickable/main.cpp | 2 +- demos/embedded/flightinfo/flightinfo.cpp | 2 +- demos/embedded/fluidlauncher/demoapplication.cpp | 2 +- demos/embedded/fluidlauncher/demoapplication.h | 2 +- demos/embedded/fluidlauncher/fluidlauncher.cpp | 2 +- demos/embedded/fluidlauncher/fluidlauncher.h | 2 +- demos/embedded/fluidlauncher/main.cpp | 2 +- demos/embedded/fluidlauncher/pictureflow.cpp | 2 +- demos/embedded/fluidlauncher/pictureflow.h | 2 +- demos/embedded/fluidlauncher/slideshow.cpp | 2 +- demos/embedded/fluidlauncher/slideshow.h | 2 +- demos/embedded/lightmaps/lightmaps.cpp | 2 +- demos/embedded/raycasting/raycasting.cpp | 2 +- demos/embedded/styledemo/main.cpp | 2 +- demos/embedded/styledemo/stylewidget.cpp | 2 +- demos/embedded/styledemo/stylewidget.h | 2 +- demos/embedded/weatherinfo/weatherinfo.cpp | 2 +- demos/embeddeddialogs/customproxy.cpp | 2 +- demos/embeddeddialogs/customproxy.h | 2 +- demos/embeddeddialogs/embeddeddialog.cpp | 2 +- demos/embeddeddialogs/embeddeddialog.h | 2 +- demos/embeddeddialogs/main.cpp | 2 +- demos/gradients/gradients.cpp | 2 +- demos/gradients/gradients.h | 2 +- demos/gradients/main.cpp | 2 +- demos/interview/main.cpp | 2 +- demos/interview/model.cpp | 2 +- demos/interview/model.h | 2 +- demos/macmainwindow/macmainwindow.h | 2 +- demos/macmainwindow/macmainwindow.mm | 2 +- demos/macmainwindow/main.cpp | 2 +- demos/mainwindow/colorswatch.cpp | 2 +- demos/mainwindow/colorswatch.h | 2 +- demos/mainwindow/main.cpp | 2 +- demos/mainwindow/mainwindow.cpp | 2 +- demos/mainwindow/mainwindow.h | 2 +- demos/mainwindow/toolbar.cpp | 2 +- demos/mainwindow/toolbar.h | 2 +- demos/pathstroke/main.cpp | 2 +- demos/pathstroke/pathstroke.cpp | 2 +- demos/pathstroke/pathstroke.h | 2 +- demos/qmediaplayer/main.cpp | 2 +- demos/qmediaplayer/mediaplayer.cpp | 2 +- demos/qmediaplayer/mediaplayer.h | 2 +- demos/qtdemo/colors.cpp | 2 +- demos/qtdemo/colors.h | 2 +- demos/qtdemo/demoitem.cpp | 2 +- demos/qtdemo/demoitem.h | 2 +- demos/qtdemo/demoitemanimation.cpp | 2 +- demos/qtdemo/demoitemanimation.h | 2 +- demos/qtdemo/demoscene.cpp | 2 +- demos/qtdemo/demoscene.h | 2 +- demos/qtdemo/demotextitem.cpp | 2 +- demos/qtdemo/demotextitem.h | 2 +- demos/qtdemo/dockitem.cpp | 2 +- demos/qtdemo/dockitem.h | 2 +- demos/qtdemo/examplecontent.cpp | 2 +- demos/qtdemo/examplecontent.h | 2 +- demos/qtdemo/guide.cpp | 2 +- demos/qtdemo/guide.h | 2 +- demos/qtdemo/guidecircle.cpp | 2 +- demos/qtdemo/guidecircle.h | 2 +- demos/qtdemo/guideline.cpp | 2 +- demos/qtdemo/guideline.h | 2 +- demos/qtdemo/headingitem.cpp | 2 +- demos/qtdemo/headingitem.h | 2 +- demos/qtdemo/imageitem.cpp | 2 +- demos/qtdemo/imageitem.h | 2 +- demos/qtdemo/itemcircleanimation.cpp | 2 +- demos/qtdemo/itemcircleanimation.h | 2 +- demos/qtdemo/letteritem.cpp | 2 +- demos/qtdemo/letteritem.h | 2 +- demos/qtdemo/main.cpp | 2 +- demos/qtdemo/mainwindow.cpp | 2 +- demos/qtdemo/mainwindow.h | 2 +- demos/qtdemo/menucontent.cpp | 2 +- demos/qtdemo/menucontent.h | 2 +- demos/qtdemo/menumanager.cpp | 2 +- demos/qtdemo/menumanager.h | 2 +- demos/qtdemo/qtdemo.rc | 2 +- demos/qtdemo/scanitem.cpp | 2 +- demos/qtdemo/scanitem.h | 2 +- demos/qtdemo/score.cpp | 2 +- demos/qtdemo/score.h | 2 +- demos/qtdemo/textbutton.cpp | 2 +- demos/qtdemo/textbutton.h | 2 +- demos/shared/arthurstyle.cpp | 2 +- demos/shared/arthurstyle.h | 2 +- demos/shared/arthurwidgets.cpp | 2 +- demos/shared/arthurwidgets.h | 2 +- demos/shared/hoverpoints.cpp | 2 +- demos/shared/hoverpoints.h | 2 +- demos/spectrum/3rdparty/fftreal/fftreal_wrapper.cpp | 2 +- demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h | 2 +- demos/spectrum/app/engine.cpp | 2 +- demos/spectrum/app/engine.h | 2 +- demos/spectrum/app/frequencyspectrum.cpp | 2 +- demos/spectrum/app/frequencyspectrum.h | 2 +- demos/spectrum/app/levelmeter.cpp | 2 +- demos/spectrum/app/levelmeter.h | 2 +- demos/spectrum/app/main.cpp | 2 +- demos/spectrum/app/mainwidget.cpp | 2 +- demos/spectrum/app/mainwidget.h | 2 +- demos/spectrum/app/progressbar.cpp | 2 +- demos/spectrum/app/progressbar.h | 2 +- demos/spectrum/app/settingsdialog.cpp | 2 +- demos/spectrum/app/settingsdialog.h | 2 +- demos/spectrum/app/spectrograph.cpp | 2 +- demos/spectrum/app/spectrograph.h | 2 +- demos/spectrum/app/spectrum.h | 2 +- demos/spectrum/app/spectrumanalyser.cpp | 2 +- demos/spectrum/app/spectrumanalyser.h | 2 +- demos/spectrum/app/tonegenerator.cpp | 2 +- demos/spectrum/app/tonegenerator.h | 2 +- demos/spectrum/app/tonegeneratordialog.cpp | 2 +- demos/spectrum/app/tonegeneratordialog.h | 2 +- demos/spectrum/app/utils.cpp | 2 +- demos/spectrum/app/utils.h | 2 +- demos/spectrum/app/waveform.cpp | 2 +- demos/spectrum/app/waveform.h | 2 +- demos/spectrum/app/wavfile.cpp | 2 +- demos/spectrum/app/wavfile.h | 2 +- demos/spreadsheet/main.cpp | 2 +- demos/spreadsheet/printview.cpp | 2 +- demos/spreadsheet/printview.h | 2 +- demos/spreadsheet/spreadsheet.cpp | 2 +- demos/spreadsheet/spreadsheet.h | 2 +- demos/spreadsheet/spreadsheetdelegate.cpp | 2 +- demos/spreadsheet/spreadsheetdelegate.h | 2 +- demos/spreadsheet/spreadsheetitem.cpp | 2 +- demos/spreadsheet/spreadsheetitem.h | 2 +- demos/sqlbrowser/browser.cpp | 2 +- demos/sqlbrowser/browser.h | 2 +- demos/sqlbrowser/connectionwidget.cpp | 2 +- demos/sqlbrowser/connectionwidget.h | 2 +- demos/sqlbrowser/main.cpp | 2 +- demos/sqlbrowser/qsqlconnectiondialog.cpp | 2 +- demos/sqlbrowser/qsqlconnectiondialog.h | 2 +- demos/sub-attaq/animationmanager.cpp | 2 +- demos/sub-attaq/animationmanager.h | 2 +- demos/sub-attaq/boat.cpp | 2 +- demos/sub-attaq/boat.h | 2 +- demos/sub-attaq/boat_p.h | 2 +- demos/sub-attaq/bomb.cpp | 2 +- demos/sub-attaq/bomb.h | 2 +- demos/sub-attaq/graphicsscene.cpp | 2 +- demos/sub-attaq/graphicsscene.h | 2 +- demos/sub-attaq/main.cpp | 2 +- demos/sub-attaq/mainwindow.cpp | 2 +- demos/sub-attaq/mainwindow.h | 2 +- demos/sub-attaq/pixmapitem.cpp | 2 +- demos/sub-attaq/pixmapitem.h | 2 +- demos/sub-attaq/progressitem.cpp | 2 +- demos/sub-attaq/progressitem.h | 2 +- demos/sub-attaq/qanimationstate.cpp | 2 +- demos/sub-attaq/qanimationstate.h | 2 +- demos/sub-attaq/states.cpp | 2 +- demos/sub-attaq/states.h | 2 +- demos/sub-attaq/submarine.cpp | 2 +- demos/sub-attaq/submarine.h | 2 +- demos/sub-attaq/submarine_p.h | 2 +- demos/sub-attaq/textinformationitem.cpp | 2 +- demos/sub-attaq/textinformationitem.h | 2 +- demos/sub-attaq/torpedo.cpp | 2 +- demos/sub-attaq/torpedo.h | 2 +- demos/textedit/main.cpp | 2 +- demos/textedit/textedit.cpp | 2 +- demos/textedit/textedit.h | 2 +- demos/textedit/textedit.qdoc | 2 +- demos/undo/commands.cpp | 2 +- demos/undo/commands.h | 2 +- demos/undo/document.cpp | 2 +- demos/undo/document.h | 2 +- demos/undo/main.cpp | 2 +- demos/undo/mainwindow.cpp | 2 +- demos/undo/mainwindow.h | 2 +- doc/src/bughowto.qdoc | 2 +- doc/src/classes.qdoc | 2 +- doc/src/classes/exportedfunctions.qdoc | 2 +- doc/src/classes/phonon-api.qdoc | 2 +- doc/src/classes/phonon-namespace.qdoc | 2 +- doc/src/classes/qpatternistdummy.cpp | 2 +- doc/src/credits.qdoc | 2 +- doc/src/demos/affine.qdoc | 2 +- doc/src/demos/anomaly.qdoc | 2 +- doc/src/demos/arthurplugin.qdoc | 2 +- doc/src/demos/books.qdoc | 2 +- doc/src/demos/boxes.qdoc | 2 +- doc/src/demos/browser.qdoc | 2 +- doc/src/demos/chip.qdoc | 2 +- doc/src/demos/composition.qdoc | 2 +- doc/src/demos/deform.qdoc | 2 +- doc/src/demos/desktopservices.qdoc | 2 +- doc/src/demos/digiflip.qdoc | 2 +- doc/src/demos/embeddeddialogs.qdoc | 2 +- doc/src/demos/embeddedsvgviewer.qdoc | 2 +- doc/src/demos/flickable.qdoc | 2 +- doc/src/demos/flightinfo.qdoc | 2 +- doc/src/demos/fluidlauncher.qdoc | 2 +- doc/src/demos/gradients.qdoc | 2 +- doc/src/demos/interview.qdoc | 2 +- doc/src/demos/lightmaps.qdoc | 2 +- doc/src/demos/macmainwindow.qdoc | 2 +- doc/src/demos/mainwindow.qdoc | 2 +- doc/src/demos/mediaplayer.qdoc | 2 +- doc/src/demos/pathstroke.qdoc | 2 +- doc/src/demos/qtdemo.qdoc | 2 +- doc/src/demos/raycasting.qdoc | 2 +- doc/src/demos/spreadsheet.qdoc | 2 +- doc/src/demos/sqlbrowser.qdoc | 2 +- doc/src/demos/styledemo.qdoc | 2 +- doc/src/demos/sub-attaq.qdoc | 2 +- doc/src/demos/textedit.qdoc | 2 +- doc/src/demos/undo.qdoc | 2 +- doc/src/demos/weatherinfo.qdoc | 2 +- doc/src/deployment/deployment-plugins.qdoc | 2 +- doc/src/deployment/deployment.qdoc | 2 +- doc/src/deployment/qt-conf.qdoc | 2 +- doc/src/deployment/qtconfig.qdoc | 2 +- doc/src/development/activeqt-dumpcpp.qdoc | 2 +- doc/src/development/activeqt-dumpdoc.qdoc | 2 +- doc/src/development/activeqt-idc.qdoc | 2 +- doc/src/development/activeqt-testcon.qdoc | 2 +- doc/src/development/assistant-manual.qdoc | 2 +- doc/src/development/debug.qdoc | 2 +- doc/src/development/designer-manual.qdoc | 4 ++-- doc/src/development/developing-on-mac.qdoc | 2 +- doc/src/development/developing-with-qt.qdoc | 2 +- doc/src/development/moc.qdoc | 2 +- doc/src/development/qmake-manual.qdoc | 2 +- doc/src/development/qmsdev.qdoc | 2 +- doc/src/development/qtestlib.qdoc | 2 +- doc/src/development/rcc.qdoc | 2 +- doc/src/development/tools-list.qdoc | 2 +- doc/src/development/uic.qdoc | 2 +- doc/src/diagrams/contentspropagation/customwidget.py | 2 +- doc/src/diagrams/contentspropagation/standardwidgets.py | 2 +- doc/src/diagrams/programs/easingcurve/main.cpp | 2 +- doc/src/diagrams/programs/mdiarea.py | 2 +- doc/src/diagrams/programs/qpen-dashpattern.py | 2 +- doc/src/diagrams/programs/standard_views.py | 2 +- doc/src/examples/2dpainting.qdoc | 2 +- doc/src/examples/activeqt/comapp.qdoc | 2 +- doc/src/examples/activeqt/dotnet.qdoc | 2 +- doc/src/examples/activeqt/hierarchy.qdoc | 2 +- doc/src/examples/activeqt/menus.qdoc | 2 +- doc/src/examples/activeqt/multiple.qdoc | 2 +- doc/src/examples/activeqt/opengl.qdoc | 2 +- doc/src/examples/activeqt/qutlook.qdoc | 2 +- doc/src/examples/activeqt/simple.qdoc | 2 +- doc/src/examples/activeqt/webbrowser.qdoc | 2 +- doc/src/examples/activeqt/wrapper.qdoc | 2 +- doc/src/examples/addressbook.qdoc | 2 +- doc/src/examples/analogclock.qdoc | 2 +- doc/src/examples/animatedtiles.qdoc | 2 +- doc/src/examples/appchooser.qdoc | 2 +- doc/src/examples/application.qdoc | 2 +- doc/src/examples/arrowpad.qdoc | 2 +- doc/src/examples/audiodevices.qdoc | 2 +- doc/src/examples/audioinput.qdoc | 2 +- doc/src/examples/audiooutput.qdoc | 2 +- doc/src/examples/basicdrawing.qdoc | 2 +- doc/src/examples/basicgraphicslayouts.qdoc | 2 +- doc/src/examples/basiclayouts.qdoc | 2 +- doc/src/examples/basicsortfiltermodel.qdoc | 2 +- doc/src/examples/blockingfortuneclient.qdoc | 2 +- doc/src/examples/blurpicker.qdoc | 2 +- doc/src/examples/borderlayout.qdoc | 2 +- doc/src/examples/broadcastreceiver.qdoc | 2 +- doc/src/examples/broadcastsender.qdoc | 2 +- doc/src/examples/cachedtable.qdoc | 2 +- doc/src/examples/calculator.qdoc | 2 +- doc/src/examples/calculatorbuilder.qdoc | 2 +- doc/src/examples/calculatorform.qdoc | 2 +- doc/src/examples/calendar.qdoc | 2 +- doc/src/examples/calendarwidget.qdoc | 2 +- doc/src/examples/capabilitiesexample.qdoc | 2 +- doc/src/examples/charactermap.qdoc | 2 +- doc/src/examples/chart.qdoc | 2 +- doc/src/examples/classwizard.qdoc | 2 +- doc/src/examples/codecs.qdoc | 2 +- doc/src/examples/codeeditor.qdoc | 2 +- doc/src/examples/collidingmice-example.qdoc | 2 +- doc/src/examples/coloreditorfactory.qdoc | 2 +- doc/src/examples/combowidgetmapper.qdoc | 2 +- doc/src/examples/completer.qdoc | 2 +- doc/src/examples/complexpingpong.qdoc | 2 +- doc/src/examples/concentriccircles.qdoc | 2 +- doc/src/examples/configdialog.qdoc | 2 +- doc/src/examples/containerextension.qdoc | 2 +- doc/src/examples/context2d.qdoc | 2 +- doc/src/examples/contiguouscache.qdoc | 2 +- doc/src/examples/customcompleter.qdoc | 2 +- doc/src/examples/customsortfiltermodel.qdoc | 2 +- doc/src/examples/customtype.qdoc | 2 +- doc/src/examples/customtypesending.qdoc | 2 +- doc/src/examples/customwidgetplugin.qdoc | 2 +- doc/src/examples/dbscreen.qdoc | 2 +- doc/src/examples/dbus-chat.qdoc | 2 +- doc/src/examples/dbus-listnames.qdoc | 2 +- doc/src/examples/dbus-pingpong.qdoc | 2 +- doc/src/examples/dbus-remotecontrolledcar.qdoc | 2 +- doc/src/examples/defaultprototypes.qdoc | 2 +- doc/src/examples/delayedencoding.qdoc | 2 +- doc/src/examples/diagramscene.qdoc | 2 +- doc/src/examples/digitalclock.qdoc | 2 +- doc/src/examples/dirview.qdoc | 2 +- doc/src/examples/dockwidgets.qdoc | 2 +- doc/src/examples/dombookmarks.qdoc | 2 +- doc/src/examples/domtraversal.qdoc | 2 +- doc/src/examples/draganddroppuzzle.qdoc | 2 +- doc/src/examples/dragdroprobot.qdoc | 2 +- doc/src/examples/draggableicons.qdoc | 2 +- doc/src/examples/draggabletext.qdoc | 2 +- doc/src/examples/drilldown.qdoc | 2 +- doc/src/examples/dropsite.qdoc | 2 +- doc/src/examples/dynamiclayouts.qdoc | 2 +- doc/src/examples/easing.qdoc | 2 +- doc/src/examples/echoplugin.qdoc | 2 +- doc/src/examples/editabletreemodel.qdoc | 2 +- doc/src/examples/elasticnodes.qdoc | 2 +- doc/src/examples/eventtransitions.qdoc | 2 +- doc/src/examples/extension.qdoc | 2 +- doc/src/examples/factorial.qdoc | 2 +- doc/src/examples/fademessage.qdoc | 2 +- doc/src/examples/fancybrowser.qdoc | 2 +- doc/src/examples/fetchmore.qdoc | 2 +- doc/src/examples/filetree.qdoc | 2 +- doc/src/examples/findfiles.qdoc | 2 +- doc/src/examples/fingerpaint.qdoc | 2 +- doc/src/examples/flowlayout.qdoc | 2 +- doc/src/examples/fontsampler.qdoc | 2 +- doc/src/examples/formextractor.qdoc | 2 +- doc/src/examples/fortuneclient.qdoc | 2 +- doc/src/examples/fortuneserver.qdoc | 2 +- doc/src/examples/framebufferobject.qdoc | 2 +- doc/src/examples/framebufferobject2.qdoc | 2 +- doc/src/examples/fridgemagnets.qdoc | 2 +- doc/src/examples/frozencolumn.qdoc | 2 +- doc/src/examples/ftp.qdoc | 2 +- doc/src/examples/globalVariables.qdoc | 2 +- doc/src/examples/googlechat.qdoc | 2 +- doc/src/examples/googlesuggest.qdoc | 2 +- doc/src/examples/grabber.qdoc | 2 +- doc/src/examples/graphicsview-anchorlayout.qdoc | 2 +- doc/src/examples/graphicsview-flowlayout.qdoc | 2 +- doc/src/examples/graphicsview-simpleanchorlayout.qdoc | 2 +- doc/src/examples/graphicsview-weatheranchorlayout.qdoc | 2 +- doc/src/examples/groupbox.qdoc | 2 +- doc/src/examples/hellogl.qdoc | 2 +- doc/src/examples/hellogl_es.qdoc | 2 +- doc/src/examples/helloscript.qdoc | 2 +- doc/src/examples/hellotr.qdoc | 2 +- doc/src/examples/htmlinfo.qdoc | 2 +- doc/src/examples/http.qdoc | 2 +- doc/src/examples/i18n.qdoc | 2 +- doc/src/examples/icons.qdoc | 2 +- doc/src/examples/imagecomposition.qdoc | 2 +- doc/src/examples/imagegestures.qdoc | 2 +- doc/src/examples/imageviewer.qdoc | 2 +- doc/src/examples/inputpanel.qdoc | 2 +- doc/src/examples/itemviewspuzzle.qdoc | 2 +- doc/src/examples/licensewizard.qdoc | 2 +- doc/src/examples/lighting.qdoc | 2 +- doc/src/examples/lineedits.qdoc | 2 +- doc/src/examples/localfortuneclient.qdoc | 2 +- doc/src/examples/localfortuneserver.qdoc | 2 +- doc/src/examples/loopback.qdoc | 2 +- doc/src/examples/mandelbrot.qdoc | 2 +- doc/src/examples/masterdetail.qdoc | 2 +- doc/src/examples/mdi.qdoc | 2 +- doc/src/examples/menus.qdoc | 2 +- doc/src/examples/mousecalibration.qdoc | 2 +- doc/src/examples/moveblocks.qdoc | 2 +- doc/src/examples/movie.qdoc | 2 +- doc/src/examples/multipleinheritance.qdoc | 2 +- doc/src/examples/multitouch-dials.qdoc | 2 +- doc/src/examples/multitouch-knobs.qdoc | 2 +- doc/src/examples/musicplayerexample.qdoc | 2 +- doc/src/examples/network-chat.qdoc | 2 +- doc/src/examples/network-download.qdoc | 2 +- doc/src/examples/network-downloadmanager.qdoc | 2 +- doc/src/examples/openvg-star.qdoc | 2 +- doc/src/examples/orderform.qdoc | 2 +- doc/src/examples/overpainting.qdoc | 2 +- doc/src/examples/padnavigator.qdoc | 2 +- doc/src/examples/painterpaths.qdoc | 2 +- doc/src/examples/pbuffers.qdoc | 2 +- doc/src/examples/pbuffers2.qdoc | 2 +- doc/src/examples/pinchzoom.qdoc | 2 +- doc/src/examples/pingpong.qdoc | 2 +- doc/src/examples/pixelator.qdoc | 2 +- doc/src/examples/plugandpaint.qdoc | 2 +- doc/src/examples/portedasteroids.qdoc | 2 +- doc/src/examples/portedcanvas.qdoc | 2 +- doc/src/examples/previewer.qdoc | 2 +- doc/src/examples/qobjectxmlmodel.qdoc | 2 +- doc/src/examples/qtconcurrent-imagescaling.qdoc | 2 +- doc/src/examples/qtconcurrent-map.qdoc | 2 +- doc/src/examples/qtconcurrent-progressdialog.qdoc | 2 +- doc/src/examples/qtconcurrent-runfunction.qdoc | 2 +- doc/src/examples/qtconcurrent-wordcount.qdoc | 2 +- doc/src/examples/qtscriptcalculator.qdoc | 2 +- doc/src/examples/qtscriptcustomclass.qdoc | 2 +- doc/src/examples/qtscripttetrix.qdoc | 2 +- doc/src/examples/querymodel.qdoc | 2 +- doc/src/examples/queuedcustomtype.qdoc | 2 +- doc/src/examples/qxmlstreambookmarks.qdoc | 2 +- doc/src/examples/recentfiles.qdoc | 2 +- doc/src/examples/recipes.qdoc | 2 +- doc/src/examples/regexp.qdoc | 2 +- doc/src/examples/relationaltablemodel.qdoc | 2 +- doc/src/examples/remotecontrol.qdoc | 2 +- doc/src/examples/rogue.qdoc | 2 +- doc/src/examples/rsslisting.qdoc | 2 +- doc/src/examples/samplebuffers.qdoc | 2 +- doc/src/examples/saxbookmarks.qdoc | 2 +- doc/src/examples/schema.qdoc | 2 +- doc/src/examples/screenshot.qdoc | 2 +- doc/src/examples/scribble.qdoc | 2 +- doc/src/examples/script-marshal.qdoc | 2 +- doc/src/examples/script-qscript.qdoc | 2 +- doc/src/examples/script-qsdbg.qdoc | 2 +- doc/src/examples/sdi.qdoc | 2 +- doc/src/examples/securesocketclient.qdoc | 2 +- doc/src/examples/semaphores.qdoc | 2 +- doc/src/examples/settingseditor.qdoc | 2 +- doc/src/examples/shapedclock.qdoc | 2 +- doc/src/examples/sharedmemory.qdoc | 2 +- doc/src/examples/simpledecoration.qdoc | 2 +- doc/src/examples/simpledommodel.qdoc | 2 +- doc/src/examples/simpleselector.qdoc | 2 +- doc/src/examples/simpletextviewer.qdoc | 2 +- doc/src/examples/simpletreemodel.qdoc | 2 +- doc/src/examples/simplewidgetmapper.qdoc | 2 +- doc/src/examples/sipdialog.qdoc | 2 +- doc/src/examples/sliders.qdoc | 2 +- doc/src/examples/spinboxdelegate.qdoc | 2 +- doc/src/examples/spinboxes.qdoc | 2 +- doc/src/examples/sqlwidgetmapper.qdoc | 2 +- doc/src/examples/standarddialogs.qdoc | 2 +- doc/src/examples/stardelegate.qdoc | 2 +- doc/src/examples/states.qdoc | 2 +- doc/src/examples/stickman.qdoc | 2 +- doc/src/examples/styleplugin.qdoc | 2 +- doc/src/examples/styles.qdoc | 2 +- doc/src/examples/stylesheet.qdoc | 2 +- doc/src/examples/svgalib.qdoc | 2 +- doc/src/examples/svggenerator.qdoc | 2 +- doc/src/examples/svgviewer.qdoc | 2 +- doc/src/examples/syntaxhighlighter.qdoc | 2 +- doc/src/examples/systray.qdoc | 2 +- doc/src/examples/tabdialog.qdoc | 2 +- doc/src/examples/tablemodel.qdoc | 2 +- doc/src/examples/tablet.qdoc | 2 +- doc/src/examples/taskmenuextension.qdoc | 2 +- doc/src/examples/tetrix.qdoc | 2 +- doc/src/examples/textfinder.qdoc | 2 +- doc/src/examples/textobject.qdoc | 2 +- doc/src/examples/textures.qdoc | 2 +- doc/src/examples/threadedfortuneserver.qdoc | 2 +- doc/src/examples/tooltips.qdoc | 2 +- doc/src/examples/torrent.qdoc | 2 +- doc/src/examples/trafficinfo.qdoc | 2 +- doc/src/examples/trafficlight.qdoc | 2 +- doc/src/examples/transformations.qdoc | 2 +- doc/src/examples/treemodelcompleter.qdoc | 2 +- doc/src/examples/trivialwizard.qdoc | 2 +- doc/src/examples/trollprint.qdoc | 2 +- doc/src/examples/twowaybutton.qdoc | 2 +- doc/src/examples/undoframework.qdoc | 2 +- doc/src/examples/videographicsitem.qdoc | 2 +- doc/src/examples/videowidget.qdoc | 2 +- doc/src/examples/waitconditions.qdoc | 2 +- doc/src/examples/webkit-framecapture.qdoc | 2 +- doc/src/examples/widgets-softkeys.qdoc | 2 +- doc/src/examples/widgets-validators.qdoc | 2 +- doc/src/examples/wiggly.qdoc | 2 +- doc/src/examples/windowflags.qdoc | 2 +- doc/src/examples/worldtimeclockbuilder.qdoc | 2 +- doc/src/examples/worldtimeclockplugin.qdoc | 2 +- doc/src/examples/xmlstreamlint.qdoc | 2 +- doc/src/external-resources.qdoc | 2 +- doc/src/files-and-resources/datastreamformat.qdoc | 2 +- doc/src/files-and-resources/resources.qdoc | 2 +- doc/src/frameworks-technologies/accessible.qdoc | 2 +- doc/src/frameworks-technologies/activeqt-container.qdoc | 2 +- doc/src/frameworks-technologies/activeqt-server.qdoc | 2 +- doc/src/frameworks-technologies/activeqt.qdoc | 2 +- doc/src/frameworks-technologies/animation.qdoc | 2 +- doc/src/frameworks-technologies/containers.qdoc | 2 +- doc/src/frameworks-technologies/dbus-adaptors.qdoc | 2 +- doc/src/frameworks-technologies/dbus-intro.qdoc | 2 +- doc/src/frameworks-technologies/desktop-integration.qdoc | 2 +- doc/src/frameworks-technologies/dnd.qdoc | 2 +- doc/src/frameworks-technologies/eventsandfilters.qdoc | 2 +- doc/src/frameworks-technologies/gestures.qdoc | 2 +- doc/src/frameworks-technologies/graphicsview.qdoc | 2 +- doc/src/frameworks-technologies/implicit-sharing.qdoc | 2 +- doc/src/frameworks-technologies/ipc.qdoc | 2 +- .../frameworks-technologies/model-view-programming.qdoc | 2 +- doc/src/frameworks-technologies/phonon.qdoc | 2 +- doc/src/frameworks-technologies/plugins-howto.qdoc | 2 +- doc/src/frameworks-technologies/qthelp.qdoc | 2 +- doc/src/frameworks-technologies/qundo.qdoc | 2 +- doc/src/frameworks-technologies/richtext.qdoc | 2 +- doc/src/frameworks-technologies/statemachine.qdoc | 2 +- doc/src/frameworks-technologies/templates.qdoc | 2 +- doc/src/frameworks-technologies/threads.qdoc | 2 +- doc/src/frameworks-technologies/unicode.qdoc | 2 +- doc/src/getting-started/demos.qdoc | 2 +- doc/src/getting-started/examples.qdoc | 2 +- doc/src/getting-started/how-to-learn-qt.qdoc | 2 +- doc/src/getting-started/installation.qdoc | 2 +- doc/src/getting-started/known-issues.qdoc | 2 +- doc/src/getting-started/tutorials.qdoc | 2 +- doc/src/howtos/HWacceleration.qdoc | 2 +- doc/src/howtos/accelerators.qdoc | 2 +- doc/src/howtos/appicon.qdoc | 2 +- doc/src/howtos/custom-types.qdoc | 2 +- doc/src/howtos/exceptionsafety.qdoc | 2 +- doc/src/howtos/guibooks.qdoc | 2 +- doc/src/howtos/openvg.qdoc | 2 +- doc/src/howtos/qtdesigner.qdoc | 2 +- doc/src/howtos/restoring-geometry.qdoc | 2 +- doc/src/howtos/session.qdoc | 2 +- doc/src/howtos/sharedlibrary.qdoc | 2 +- doc/src/howtos/timers.qdoc | 2 +- doc/src/howtos/unix-signal-handlers.qdoc | 2 +- doc/src/index.qdoc | 2 +- doc/src/internationalization/i18n.qdoc | 2 +- doc/src/internationalization/linguist-manual.qdoc | 2 +- doc/src/legal/3rdparty.qdoc | 2 +- doc/src/legal/commercialeditions.qdoc | 2 +- doc/src/legal/editions.qdoc | 2 +- doc/src/legal/gpl.qdoc | 6 +++--- doc/src/legal/licenses.qdoc | 2 +- doc/src/legal/opensourceedition.qdoc | 2 +- doc/src/legal/trademarks.qdoc | 2 +- doc/src/modules.qdoc | 14 +++++++------- doc/src/network-programming/qtnetwork.qdoc | 2 +- doc/src/network-programming/ssl.qdoc | 2 +- doc/src/objectmodel/metaobjects.qdoc | 2 +- doc/src/objectmodel/object.qdoc | 2 +- doc/src/objectmodel/objecttrees.qdoc | 2 +- doc/src/objectmodel/properties.qdoc | 2 +- doc/src/objectmodel/signalsandslots.qdoc | 2 +- doc/src/overviews.qdoc | 2 +- doc/src/painting-and-printing/coordsys.qdoc | 2 +- doc/src/painting-and-printing/paintsystem.qdoc | 2 +- doc/src/painting-and-printing/printing.qdoc | 2 +- doc/src/platforms/atomic-operations.qdoc | 2 +- doc/src/platforms/compiler-notes.qdoc | 2 +- doc/src/platforms/emb-HwAcc-LinuxEmbedded.qdoc | 2 +- doc/src/platforms/emb-HwAcc-WinCE.qdoc | 2 +- doc/src/platforms/emb-accel.qdoc | 2 +- doc/src/platforms/emb-architecture.qdoc | 2 +- doc/src/platforms/emb-charinput.qdoc | 2 +- doc/src/platforms/emb-crosscompiling.qdoc | 2 +- doc/src/platforms/emb-deployment.qdoc | 2 +- doc/src/platforms/emb-differences.qdoc | 2 +- doc/src/platforms/emb-directfb-EmbLinux.qdoc | 2 +- doc/src/platforms/emb-displaymanagement.qdoc | 2 +- doc/src/platforms/emb-envvars.qdoc | 2 +- doc/src/platforms/emb-features.qdoc | 2 +- doc/src/platforms/emb-fonts.qdoc | 2 +- doc/src/platforms/emb-framebuffer-howto.qdoc | 2 +- doc/src/platforms/emb-install.qdoc | 2 +- doc/src/platforms/emb-kmap2qmap.qdoc | 2 +- doc/src/platforms/emb-makeqpf.qdoc | 2 +- doc/src/platforms/emb-opengl-EmbLinux.qdoc | 2 +- doc/src/platforms/emb-openvg-EmbLinux.qdoc | 2 +- doc/src/platforms/emb-performance.qdoc | 2 +- doc/src/platforms/emb-pointer.qdoc | 2 +- doc/src/platforms/emb-porting.qdoc | 2 +- doc/src/platforms/emb-qvfb.qdoc | 2 +- doc/src/platforms/emb-running.qdoc | 2 +- doc/src/platforms/emb-vnc.qdoc | 2 +- doc/src/platforms/mac-differences.qdoc | 2 +- doc/src/platforms/platform-notes-rtos.qdoc | 2 +- doc/src/platforms/platform-notes.qdoc | 2 +- doc/src/platforms/qt-embedded-linux.qdoc | 2 +- doc/src/platforms/qt-embedded.qdoc | 2 +- doc/src/platforms/qtmac-as-native.qdoc | 2 +- doc/src/platforms/supported-platforms.qdoc | 2 +- doc/src/platforms/symbian-exceptionsafety.qdoc | 2 +- doc/src/platforms/symbian-introduction.qdoc | 2 +- doc/src/platforms/wince-customization.qdoc | 2 +- doc/src/platforms/wince-introduction.qdoc | 2 +- doc/src/platforms/wince-opengl.qdoc | 2 +- doc/src/platforms/wince-openvg.qdoc | 2 +- doc/src/platforms/wince-signing.qdoc | 2 +- doc/src/platforms/winsystem.qdoc | 2 +- doc/src/platforms/x11overlays.qdoc | 2 +- doc/src/porting/porting-qsa.qdoc | 2 +- doc/src/porting/porting4-canvas.qdoc | 2 +- doc/src/porting/porting4-designer.qdoc | 2 +- doc/src/porting/porting4-dnd.qdoc | 2 +- doc/src/porting/porting4-overview.qdoc | 2 +- doc/src/porting/porting4.qdoc | 2 +- doc/src/porting/qt3to4.qdoc | 4 ++-- doc/src/porting/qt4-accessibility.qdoc | 2 +- doc/src/porting/qt4-arthur.qdoc | 2 +- doc/src/porting/qt4-designer.qdoc | 2 +- doc/src/porting/qt4-interview.qdoc | 2 +- doc/src/porting/qt4-mainwindow.qdoc | 2 +- doc/src/porting/qt4-network.qdoc | 2 +- doc/src/porting/qt4-scribe.qdoc | 2 +- doc/src/porting/qt4-sql.qdoc | 2 +- doc/src/porting/qt4-styles.qdoc | 2 +- doc/src/porting/qt4-threads.qdoc | 2 +- doc/src/porting/qt4-tulip.qdoc | 2 +- doc/src/qt-resources.qdoc | 2 +- doc/src/qt-webpages.qdoc | 2 +- doc/src/qt4-intro.qdoc | 2 +- doc/src/scripting/ecmascript.qdoc | 2 +- doc/src/scripting/qtscriptdebugger-manual.qdoc | 2 +- doc/src/scripting/qtscriptextensions.qdoc | 2 +- doc/src/scripting/scripting.qdoc | 2 +- doc/src/snippets/accessibilityfactorysnippet.cpp | 2 +- doc/src/snippets/accessibilitypluginsnippet.cpp | 2 +- doc/src/snippets/accessibilityslidersnippet.cpp | 2 +- doc/src/snippets/alphachannel.cpp | 2 +- doc/src/snippets/animation/sequential/main.cpp | 2 +- doc/src/snippets/animation/sequential/tracer.cpp | 2 +- doc/src/snippets/animation/sequential/tracer.h | 2 +- doc/src/snippets/audio/main.cpp | 2 +- doc/src/snippets/audioeffects.cpp | 2 +- doc/src/snippets/brush/brush.cpp | 2 +- doc/src/snippets/brush/gradientcreationsnippet.cpp | 2 +- doc/src/snippets/brushstyles/main.cpp | 2 +- doc/src/snippets/brushstyles/renderarea.cpp | 2 +- doc/src/snippets/brushstyles/renderarea.h | 2 +- doc/src/snippets/brushstyles/stylewidget.cpp | 2 +- doc/src/snippets/brushstyles/stylewidget.h | 2 +- doc/src/snippets/buffer/buffer.cpp | 2 +- doc/src/snippets/clipboard/clipwindow.cpp | 2 +- doc/src/snippets/clipboard/clipwindow.h | 2 +- doc/src/snippets/clipboard/main.cpp | 2 +- doc/src/snippets/code/doc.src.qtscripttools.qdoc | 2 +- doc/src/snippets/code/doc_src_activeqt-dumpcpp.qdoc | 2 +- doc/src/snippets/code/doc_src_appicon.qdoc | 2 +- doc/src/snippets/code/doc_src_assistant-manual.qdoc | 2 +- doc/src/snippets/code/doc_src_atomic-operations.qdoc | 2 +- doc/src/snippets/code/doc_src_compiler-notes.qdoc | 2 +- doc/src/snippets/code/doc_src_containers.qdoc | 2 +- doc/src/snippets/code/doc_src_coordsys.qdoc | 2 +- doc/src/snippets/code/doc_src_debug.qdoc | 2 +- doc/src/snippets/code/doc_src_deployment.qdoc | 2 +- doc/src/snippets/code/doc_src_designer-manual.qdoc | 2 +- doc/src/snippets/code/doc_src_dnd.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-charinput.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-crosscompiling.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-envvars.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-features.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-fonts.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-install.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-performance.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-pointer.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-qvfb.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-running.qdoc | 2 +- doc/src/snippets/code/doc_src_emb-vnc.qdoc | 2 +- .../snippets/code/doc_src_examples_activeqt_comapp.qdoc | 2 +- .../snippets/code/doc_src_examples_activeqt_dotnet.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_activeqt_menus.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_application.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_arrowpad.qdoc | 2 +- .../snippets/code/doc_src_examples_containerextension.qdoc | 2 +- .../snippets/code/doc_src_examples_customwidgetplugin.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_dropsite.qdoc | 2 +- .../snippets/code/doc_src_examples_editabletreemodel.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_hellotr.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_icons.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_imageviewer.qdoc | 2 +- .../code/doc_src_examples_qtscriptcustomclass.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_simpledommodel.qdoc | 2 +- .../snippets/code/doc_src_examples_simpletreemodel.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_svgalib.qdoc | 2 +- .../snippets/code/doc_src_examples_taskmenuextension.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_textfinder.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_trollprint.qdoc | 2 +- doc/src/snippets/code/doc_src_examples_tutorial.qdoc | 2 +- .../code/doc_src_examples_worldtimeclockplugin.qdoc | 2 +- doc/src/snippets/code/doc_src_exportedfunctions.qdoc | 2 +- doc/src/snippets/code/doc_src_gpl.qdoc | 2 +- doc/src/snippets/code/doc_src_graphicsview.qdoc | 2 +- doc/src/snippets/code/doc_src_groups.qdoc | 2 +- doc/src/snippets/code/doc_src_i18n.qdoc | 2 +- doc/src/snippets/code/doc_src_installation.qdoc | 2 +- doc/src/snippets/code/doc_src_introtodbus.qdoc | 2 +- doc/src/snippets/code/doc_src_layout.qdoc | 2 +- doc/src/snippets/code/doc_src_lgpl.qdoc | 2 +- doc/src/snippets/code/doc_src_licenses.qdoc | 2 +- doc/src/snippets/code/doc_src_linguist-manual.qdoc | 2 +- doc/src/snippets/code/doc_src_mac-differences.qdoc | 2 +- doc/src/snippets/code/doc_src_moc.qdoc | 2 +- doc/src/snippets/code/doc_src_model-view-programming.qdoc | 2 +- doc/src/snippets/code/doc_src_modules.qdoc | 2 +- doc/src/snippets/code/doc_src_objecttrees.qdoc | 2 +- doc/src/snippets/code/doc_src_phonon-api.qdoc | 2 +- doc/src/snippets/code/doc_src_phonon.qdoc | 2 +- doc/src/snippets/code/doc_src_platform-notes.qdoc | 2 +- doc/src/snippets/code/doc_src_plugins-howto.qdoc | 2 +- doc/src/snippets/code/doc_src_porting-qsa.qdoc | 2 +- doc/src/snippets/code/doc_src_porting4-canvas.qdoc | 2 +- doc/src/snippets/code/doc_src_porting4-designer.qdoc | 2 +- doc/src/snippets/code/doc_src_porting4.qdoc | 2 +- doc/src/snippets/code/doc_src_properties.qdoc | 2 +- doc/src/snippets/code/doc_src_q3asciidict.qdoc | 2 +- doc/src/snippets/code/doc_src_q3dict.qdoc | 2 +- doc/src/snippets/code/doc_src_q3intdict.qdoc | 2 +- doc/src/snippets/code/doc_src_q3memarray.qdoc | 2 +- doc/src/snippets/code/doc_src_q3ptrdict.qdoc | 2 +- doc/src/snippets/code/doc_src_q3ptrlist.qdoc | 2 +- doc/src/snippets/code/doc_src_q3valuelist.qdoc | 2 +- doc/src/snippets/code/doc_src_q3valuestack.qdoc | 2 +- doc/src/snippets/code/doc_src_q3valuevector.qdoc | 2 +- doc/src/snippets/code/doc_src_qalgorithms.qdoc | 2 +- doc/src/snippets/code/doc_src_qaxcontainer.qdoc | 2 +- doc/src/snippets/code/doc_src_qaxserver.qdoc | 2 +- doc/src/snippets/code/doc_src_qcache.qdoc | 2 +- doc/src/snippets/code/doc_src_qdbusadaptors.qdoc | 2 +- doc/src/snippets/code/doc_src_qiterator.qdoc | 2 +- doc/src/snippets/code/doc_src_qmake-manual.qdoc | 2 +- doc/src/snippets/code/doc_src_qnamespace.qdoc | 2 +- doc/src/snippets/code/doc_src_qpair.qdoc | 2 +- doc/src/snippets/code/doc_src_qplugin.qdoc | 2 +- doc/src/snippets/code/doc_src_qset.qdoc | 2 +- doc/src/snippets/code/doc_src_qsignalspy.qdoc | 2 +- doc/src/snippets/code/doc_src_qt-conf.qdoc | 2 +- .../code/doc_src_qt-embedded-displaymanagement.qdoc | 2 +- doc/src/snippets/code/doc_src_qt3support.qdoc | 2 +- doc/src/snippets/code/doc_src_qt3to4.qdoc | 2 +- doc/src/snippets/code/doc_src_qt4-accessibility.qdoc | 2 +- doc/src/snippets/code/doc_src_qt4-arthur.qdoc | 2 +- doc/src/snippets/code/doc_src_qt4-intro.qdoc | 2 +- doc/src/snippets/code/doc_src_qt4-mainwindow.qdoc | 2 +- doc/src/snippets/code/doc_src_qt4-sql.qdoc | 2 +- doc/src/snippets/code/doc_src_qt4-styles.qdoc | 2 +- doc/src/snippets/code/doc_src_qt4-tulip.qdoc | 2 +- doc/src/snippets/code/doc_src_qtcore.qdoc | 2 +- doc/src/snippets/code/doc_src_qtdbus.qdoc | 2 +- doc/src/snippets/code/doc_src_qtdesigner.qdoc | 2 +- doc/src/snippets/code/doc_src_qtestevent.qdoc | 2 +- doc/src/snippets/code/doc_src_qtestlib.qdoc | 2 +- doc/src/snippets/code/doc_src_qtgui.qdoc | 2 +- doc/src/snippets/code/doc_src_qthelp.qdoc | 2 +- doc/src/snippets/code/doc_src_qtmac-as-native.qdoc | 2 +- doc/src/snippets/code/doc_src_qtmultimedia.qdoc | 2 +- doc/src/snippets/code/doc_src_qtnetwork.qdoc | 2 +- doc/src/snippets/code/doc_src_qtopengl.qdoc | 2 +- doc/src/snippets/code/doc_src_qtscript.qdoc | 2 +- doc/src/snippets/code/doc_src_qtscriptextensions.qdoc | 2 +- doc/src/snippets/code/doc_src_qtsql.qdoc | 2 +- doc/src/snippets/code/doc_src_qtsvg.qdoc | 2 +- doc/src/snippets/code/doc_src_qttest.qdoc | 2 +- doc/src/snippets/code/doc_src_qtuiloader.qdoc | 2 +- doc/src/snippets/code/doc_src_qtxml.qdoc | 2 +- doc/src/snippets/code/doc_src_qtxmlpatterns.qdoc | 2 +- doc/src/snippets/code/doc_src_qvarlengtharray.qdoc | 2 +- doc/src/snippets/code/doc_src_rcc.qdoc | 2 +- doc/src/snippets/code/doc_src_resources.qdoc | 2 +- doc/src/snippets/code/doc_src_richtext.qdoc | 2 +- doc/src/snippets/code/doc_src_session.qdoc | 2 +- doc/src/snippets/code/doc_src_sql-driver.qdoc | 2 +- doc/src/snippets/code/doc_src_styles.qdoc | 2 +- doc/src/snippets/code/doc_src_stylesheet.qdoc | 2 +- doc/src/snippets/code/doc_src_symbian-introduction.qdoc | 2 +- doc/src/snippets/code/doc_src_uic.qdoc | 2 +- doc/src/snippets/code/doc_src_unicode.qdoc | 2 +- doc/src/snippets/code/doc_src_unix-signal-handlers.qdoc | 2 +- doc/src/snippets/code/doc_src_wince-customization.qdoc | 2 +- doc/src/snippets/code/doc_src_wince-introduction.qdoc | 2 +- doc/src/snippets/code/doc_src_wince-opengl.qdoc | 2 +- doc/src/snippets/code/src.gui.text.qtextdocumentwriter.cpp | 2 +- doc/src/snippets/code/src.qdbus.qdbuspendingcall.cpp | 2 +- doc/src/snippets/code/src.qdbus.qdbuspendingreply.cpp | 2 +- .../code/src.scripttools.qscriptenginedebugger.cpp | 2 +- doc/src/snippets/code/src_activeqt_container_qaxbase.cpp | 2 +- doc/src/snippets/code/src_activeqt_container_qaxscript.cpp | 2 +- doc/src/snippets/code/src_activeqt_control_qaxbindable.cpp | 2 +- doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp | 2 +- doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp | 2 +- .../snippets/code/src_corelib_codecs_qtextcodecplugin.cpp | 2 +- doc/src/snippets/code/src_corelib_concurrent_qfuture.cpp | 2 +- .../code/src_corelib_concurrent_qfuturesynchronizer.cpp | 2 +- .../code/src_corelib_concurrent_qfuturewatcher.cpp | 2 +- .../code/src_corelib_concurrent_qtconcurrentexception.cpp | 2 +- .../code/src_corelib_concurrent_qtconcurrentfilter.cpp | 2 +- .../code/src_corelib_concurrent_qtconcurrentmap.cpp | 2 +- .../code/src_corelib_concurrent_qtconcurrentrun.cpp | 2 +- .../snippets/code/src_corelib_concurrent_qthreadpool.cpp | 2 +- doc/src/snippets/code/src_corelib_global_qglobal.cpp | 2 +- .../snippets/code/src_corelib_io_qabstractfileengine.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qdatastream.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qdir.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qdiriterator.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qfile.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qfileinfo.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qiodevice.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qprocess.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qsettings.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qtextstream.cpp | 2 +- doc/src/snippets/code/src_corelib_io_qurl.cpp | 2 +- .../code/src_corelib_kernel_qabstracteventdispatcher.cpp | 2 +- .../code/src_corelib_kernel_qabstractitemmodel.cpp | 2 +- .../snippets/code/src_corelib_kernel_qcoreapplication.cpp | 2 +- doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp | 2 +- doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp | 2 +- doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp | 2 +- doc/src/snippets/code/src_corelib_kernel_qobject.cpp | 2 +- .../snippets/code/src_corelib_kernel_qsystemsemaphore.cpp | 2 +- doc/src/snippets/code/src_corelib_kernel_qtimer.cpp | 2 +- doc/src/snippets/code/src_corelib_kernel_qvariant.cpp | 2 +- doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp | 2 +- doc/src/snippets/code/src_corelib_plugin_quuid.cpp | 2 +- .../code/src_corelib_statemachine_qstatemachine.cpp | 2 +- doc/src/snippets/code/src_corelib_thread_qatomic.cpp | 2 +- doc/src/snippets/code/src_corelib_thread_qmutex.cpp | 2 +- doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp | 2 +- .../snippets/code/src_corelib_thread_qreadwritelock.cpp | 2 +- doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp | 2 +- doc/src/snippets/code/src_corelib_thread_qthread.cpp | 2 +- .../code/src_corelib_thread_qwaitcondition_unix.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qbitarray.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qbytearray.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qdatetime.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qeasingcurve.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qhash.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qlistdata.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qlocale.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qmap.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qpoint.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qqueue.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qrect.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qregexp.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qsize.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qstring.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qtimeline.cpp | 2 +- doc/src/snippets/code/src_corelib_tools_qvector.cpp | 2 +- doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp | 2 +- doc/src/snippets/code/src_gui_accessible_qaccessible.cpp | 2 +- .../snippets/code/src_gui_dialogs_qabstractprintdialog.cpp | 2 +- doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp | 2 +- doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp | 2 +- doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp | 2 +- doc/src/snippets/code/src_gui_dialogs_qwizard.cpp | 2 +- doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp | 2 +- doc/src/snippets/code/src_gui_embedded_qcopchannel_qws.cpp | 2 +- doc/src/snippets/code/src_gui_embedded_qmouse_qws.cpp | 2 +- doc/src/snippets/code/src_gui_embedded_qmousetslib_qws.cpp | 2 +- doc/src/snippets/code/src_gui_embedded_qscreen_qws.cpp | 2 +- .../snippets/code/src_gui_embedded_qtransportauth_qws.cpp | 2 +- .../snippets/code/src_gui_embedded_qwindowsystem_qws.cpp | 2 +- .../code/src_gui_graphicsview_qgraphicsgridlayout.cpp | 2 +- .../snippets/code/src_gui_graphicsview_qgraphicsitem.cpp | 2 +- .../code/src_gui_graphicsview_qgraphicslinearlayout.cpp | 2 +- .../code/src_gui_graphicsview_qgraphicsproxywidget.cpp | 2 +- .../snippets/code/src_gui_graphicsview_qgraphicsscene.cpp | 2 +- .../code/src_gui_graphicsview_qgraphicssceneevent.cpp | 2 +- .../snippets/code/src_gui_graphicsview_qgraphicsview.cpp | 2 +- .../snippets/code/src_gui_graphicsview_qgraphicswidget.cpp | 2 +- doc/src/snippets/code/src_gui_image_qbitmap.cpp | 2 +- doc/src/snippets/code/src_gui_image_qicon.cpp | 2 +- doc/src/snippets/code/src_gui_image_qimage.cpp | 2 +- doc/src/snippets/code/src_gui_image_qimagereader.cpp | 2 +- doc/src/snippets/code/src_gui_image_qimagewriter.cpp | 2 +- doc/src/snippets/code/src_gui_image_qmovie.cpp | 2 +- doc/src/snippets/code/src_gui_image_qpixmap.cpp | 2 +- doc/src/snippets/code/src_gui_image_qpixmapcache.cpp | 2 +- doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp | 2 +- .../snippets/code/src_gui_itemviews_qabstractitemview.cpp | 2 +- .../snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp | 2 +- .../snippets/code/src_gui_itemviews_qitemeditorfactory.cpp | 2 +- .../code/src_gui_itemviews_qitemselectionmodel.cpp | 2 +- .../snippets/code/src_gui_itemviews_qstandarditemmodel.cpp | 2 +- doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp | 2 +- doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qaction.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qapplication.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qapplication_x11.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qclipboard.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qevent.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qformlayout.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qkeysequence.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qlayout.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qshortcut.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qshortcutmap.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qsound.cpp | 2 +- doc/src/snippets/code/src_gui_kernel_qwidget.cpp | 2 +- doc/src/snippets/code/src_gui_painting_qbrush.cpp | 2 +- doc/src/snippets/code/src_gui_painting_qcolor.cpp | 2 +- doc/src/snippets/code/src_gui_painting_qdrawutil.cpp | 2 +- doc/src/snippets/code/src_gui_painting_qmatrix.cpp | 2 +- doc/src/snippets/code/src_gui_painting_qpainter.cpp | 2 +- doc/src/snippets/code/src_gui_painting_qpainterpath.cpp | 2 +- doc/src/snippets/code/src_gui_painting_qpen.cpp | 2 +- doc/src/snippets/code/src_gui_painting_qregion.cpp | 2 +- doc/src/snippets/code/src_gui_painting_qregion_unix.cpp | 2 +- doc/src/snippets/code/src_gui_painting_qtransform.cpp | 2 +- doc/src/snippets/code/src_gui_qproxystyle.cpp | 2 +- doc/src/snippets/code/src_gui_styles_qstyle.cpp | 2 +- doc/src/snippets/code/src_gui_styles_qstyleoption.cpp | 2 +- doc/src/snippets/code/src_gui_text_qfont.cpp | 2 +- doc/src/snippets/code/src_gui_text_qfontmetrics.cpp | 2 +- doc/src/snippets/code/src_gui_text_qsyntaxhighlighter.cpp | 2 +- doc/src/snippets/code/src_gui_text_qtextcursor.cpp | 2 +- doc/src/snippets/code/src_gui_text_qtextdocument.cpp | 2 +- doc/src/snippets/code/src_gui_text_qtextlayout.cpp | 2 +- doc/src/snippets/code/src_gui_util_qcompleter.cpp | 2 +- doc/src/snippets/code/src_gui_util_qdesktopservices.cpp | 2 +- doc/src/snippets/code/src_gui_util_qundostack.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qframe.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qlabel.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qlineedit.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qmenu.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qmenubar.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qrubberband.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qspinbox.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qsplitter.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qtextedit.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qvalidator.cpp | 2 +- doc/src/snippets/code/src_gui_widgets_qworkspace.cpp | 2 +- doc/src/snippets/code/src_network_access_qftp.cpp | 2 +- doc/src/snippets/code/src_network_access_qhttp.cpp | 2 +- .../code/src_network_access_qnetworkaccessmanager.cpp | 2 +- .../snippets/code/src_network_access_qnetworkdiskcache.cpp | 2 +- doc/src/snippets/code/src_network_access_qnetworkreply.cpp | 2 +- .../snippets/code/src_network_access_qnetworkrequest.cpp | 2 +- doc/src/snippets/code/src_network_kernel_qhostaddress.cpp | 2 +- doc/src/snippets/code/src_network_kernel_qhostinfo.cpp | 2 +- doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp | 2 +- .../snippets/code/src_network_socket_qabstractsocket.cpp | 2 +- .../snippets/code/src_network_socket_qlocalsocket_unix.cpp | 2 +- .../code/src_network_socket_qnativesocketengine.cpp | 2 +- doc/src/snippets/code/src_network_socket_qtcpserver.cpp | 2 +- doc/src/snippets/code/src_network_socket_qudpsocket.cpp | 2 +- doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp | 2 +- .../snippets/code/src_network_ssl_qsslconfiguration.cpp | 2 +- doc/src/snippets/code/src_network_ssl_qsslsocket.cpp | 2 +- doc/src/snippets/code/src_opengl_qgl.cpp | 2 +- doc/src/snippets/code/src_opengl_qglcolormap.cpp | 2 +- doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp | 2 +- doc/src/snippets/code/src_opengl_qglshaderprogram.cpp | 2 +- doc/src/snippets/code/src_qdbus_qdbusabstractinterface.cpp | 2 +- doc/src/snippets/code/src_qdbus_qdbusargument.cpp | 2 +- doc/src/snippets/code/src_qdbus_qdbuscontext.cpp | 2 +- doc/src/snippets/code/src_qdbus_qdbusinterface.cpp | 2 +- doc/src/snippets/code/src_qdbus_qdbusmetatype.cpp | 2 +- doc/src/snippets/code/src_qdbus_qdbusreply.cpp | 2 +- doc/src/snippets/code/src_qt3support_canvas_q3canvas.cpp | 2 +- .../snippets/code/src_qt3support_dialogs_q3filedialog.cpp | 2 +- .../code/src_qt3support_dialogs_q3progressdialog.cpp | 2 +- .../snippets/code/src_qt3support_itemviews_q3iconview.cpp | 2 +- .../snippets/code/src_qt3support_itemviews_q3listview.cpp | 2 +- doc/src/snippets/code/src_qt3support_itemviews_q3table.cpp | 2 +- doc/src/snippets/code/src_qt3support_network_q3dns.cpp | 2 +- doc/src/snippets/code/src_qt3support_network_q3ftp.cpp | 2 +- doc/src/snippets/code/src_qt3support_network_q3http.cpp | 2 +- doc/src/snippets/code/src_qt3support_network_q3localfs.cpp | 2 +- .../code/src_qt3support_network_q3networkprotocol.cpp | 2 +- doc/src/snippets/code/src_qt3support_network_q3socket.cpp | 2 +- .../code/src_qt3support_network_q3socketdevice.cpp | 2 +- doc/src/snippets/code/src_qt3support_network_q3url.cpp | 2 +- .../snippets/code/src_qt3support_network_q3urloperator.cpp | 2 +- doc/src/snippets/code/src_qt3support_other_q3accel.cpp | 2 +- .../snippets/code/src_qt3support_other_q3mimefactory.cpp | 2 +- doc/src/snippets/code/src_qt3support_other_q3process.cpp | 2 +- .../snippets/code/src_qt3support_other_q3process_unix.cpp | 2 +- .../code/src_qt3support_painting_q3paintdevicemetrics.cpp | 2 +- .../snippets/code/src_qt3support_painting_q3painter.cpp | 2 +- .../snippets/code/src_qt3support_painting_q3picture.cpp | 2 +- doc/src/snippets/code/src_qt3support_sql_q3databrowser.cpp | 2 +- doc/src/snippets/code/src_qt3support_sql_q3datatable.cpp | 2 +- doc/src/snippets/code/src_qt3support_sql_q3dataview.cpp | 2 +- doc/src/snippets/code/src_qt3support_sql_q3sqlcursor.cpp | 2 +- doc/src/snippets/code/src_qt3support_sql_q3sqlform.cpp | 2 +- .../snippets/code/src_qt3support_sql_q3sqlmanager_p.cpp | 2 +- .../snippets/code/src_qt3support_sql_q3sqlpropertymap.cpp | 2 +- .../snippets/code/src_qt3support_sql_q3sqlselectcursor.cpp | 2 +- .../snippets/code/src_qt3support_text_q3simplerichtext.cpp | 2 +- .../snippets/code/src_qt3support_text_q3textbrowser.cpp | 2 +- doc/src/snippets/code/src_qt3support_text_q3textedit.cpp | 2 +- doc/src/snippets/code/src_qt3support_text_q3textstream.cpp | 2 +- doc/src/snippets/code/src_qt3support_tools_q3cstring.cpp | 2 +- doc/src/snippets/code/src_qt3support_tools_q3deepcopy.cpp | 2 +- doc/src/snippets/code/src_qt3support_tools_q3garray.cpp | 2 +- doc/src/snippets/code/src_qt3support_tools_q3signal.cpp | 2 +- .../snippets/code/src_qt3support_widgets_q3combobox.cpp | 2 +- .../code/src_qt3support_widgets_q3datetimeedit.cpp | 2 +- .../snippets/code/src_qt3support_widgets_q3dockarea.cpp | 2 +- .../snippets/code/src_qt3support_widgets_q3dockwindow.cpp | 2 +- .../snippets/code/src_qt3support_widgets_q3gridview.cpp | 2 +- doc/src/snippets/code/src_qt3support_widgets_q3header.cpp | 2 +- .../snippets/code/src_qt3support_widgets_q3mainwindow.cpp | 2 +- .../snippets/code/src_qt3support_widgets_q3scrollview.cpp | 2 +- .../snippets/code/src_qt3support_widgets_q3whatsthis.cpp | 2 +- doc/src/snippets/code/src_qtestlib_qtestcase.cpp | 2 +- doc/src/snippets/code/src_script_qscriptable.cpp | 2 +- doc/src/snippets/code/src_script_qscriptclass.cpp | 2 +- doc/src/snippets/code/src_script_qscriptcontext.cpp | 2 +- doc/src/snippets/code/src_script_qscriptengine.cpp | 2 +- doc/src/snippets/code/src_script_qscriptengineagent.cpp | 2 +- doc/src/snippets/code/src_script_qscriptvalue.cpp | 2 +- doc/src/snippets/code/src_script_qscriptvalueiterator.cpp | 2 +- doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp | 2 +- doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp | 2 +- doc/src/snippets/code/src_sql_kernel_qsqlerror.cpp | 2 +- doc/src/snippets/code/src_sql_kernel_qsqlindex.cpp | 2 +- doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp | 2 +- doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp | 2 +- doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp | 2 +- doc/src/snippets/code/src_svg_qgraphicssvgitem.cpp | 2 +- doc/src/snippets/code/src_xml_dom_qdom.cpp | 2 +- doc/src/snippets/code/src_xml_sax_qxml.cpp | 2 +- .../code/src_xmlpatterns_api_qabstracturiresolver.cpp | 2 +- .../src_xmlpatterns_api_qabstractxmlforwarditerator.cpp | 2 +- .../code/src_xmlpatterns_api_qabstractxmlnodemodel.cpp | 2 +- .../code/src_xmlpatterns_api_qabstractxmlreceiver.cpp | 2 +- .../code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp | 2 +- .../snippets/code/src_xmlpatterns_api_qxmlformatter.cpp | 2 +- doc/src/snippets/code/src_xmlpatterns_api_qxmlname.cpp | 2 +- doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp | 2 +- .../snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp | 2 +- .../snippets/code/src_xmlpatterns_api_qxmlserializer.cpp | 2 +- .../code/tools_assistant_compat_lib_qassistantclient.cpp | 2 +- ...designer_src_lib_extension_default_extensionfactory.cpp | 2 +- .../code/tools_designer_src_lib_extension_extension.cpp | 2 +- .../tools_designer_src_lib_extension_qextensionmanager.cpp | 2 +- .../code/tools_designer_src_lib_sdk_abstractformeditor.cpp | 2 +- .../code/tools_designer_src_lib_sdk_abstractformwindow.cpp | 2 +- ...tools_designer_src_lib_sdk_abstractformwindowcursor.cpp | 2 +- ...ools_designer_src_lib_sdk_abstractformwindowmanager.cpp | 2 +- .../tools_designer_src_lib_sdk_abstractobjectinspector.cpp | 2 +- .../tools_designer_src_lib_sdk_abstractpropertyeditor.cpp | 2 +- .../code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp | 2 +- .../tools_designer_src_lib_uilib_abstractformbuilder.cpp | 2 +- .../code/tools_designer_src_lib_uilib_formbuilder.cpp | 2 +- .../code/tools_patternist_qapplicationargumentparser.cpp | 2 +- .../tools_shared_qtgradienteditor_qtgradientdialog.cpp | 2 +- .../tools_shared_qtpropertybrowser_qtpropertybrowser.cpp | 2 +- .../tools_shared_qtpropertybrowser_qtvariantproperty.cpp | 2 +- .../code/tools_shared_qttoolbardialog_qttoolbardialog.cpp | 2 +- doc/src/snippets/colors/main.cpp | 2 +- doc/src/snippets/colors/window.cpp | 2 +- doc/src/snippets/colors/window.h | 2 +- doc/src/snippets/coordsys/coordsys.cpp | 2 +- doc/src/snippets/customstyle/customstyle.cpp | 2 +- doc/src/snippets/customstyle/customstyle.h | 2 +- doc/src/snippets/customstyle/main.cpp | 2 +- doc/src/snippets/customviewstyle.cpp | 2 +- doc/src/snippets/designer/autoconnection/imagedialog.cpp | 2 +- doc/src/snippets/designer/autoconnection/imagedialog.h | 2 +- doc/src/snippets/designer/autoconnection/main.cpp | 2 +- doc/src/snippets/designer/imagedialog/main.cpp | 2 +- .../snippets/designer/multipleinheritance/imagedialog.cpp | 2 +- .../snippets/designer/multipleinheritance/imagedialog.h | 2 +- doc/src/snippets/designer/multipleinheritance/main.cpp | 2 +- doc/src/snippets/designer/noautoconnection/imagedialog.cpp | 2 +- doc/src/snippets/designer/noautoconnection/imagedialog.h | 2 +- doc/src/snippets/designer/noautoconnection/main.cpp | 2 +- .../snippets/designer/singleinheritance/imagedialog.cpp | 2 +- doc/src/snippets/designer/singleinheritance/imagedialog.h | 2 +- doc/src/snippets/designer/singleinheritance/main.cpp | 2 +- doc/src/snippets/dialogs/dialogs.cpp | 2 +- doc/src/snippets/dockwidgets/main.cpp | 2 +- doc/src/snippets/dockwidgets/mainwindow.cpp | 2 +- doc/src/snippets/dockwidgets/mainwindow.h | 2 +- doc/src/snippets/draganddrop/dragwidget.cpp | 2 +- doc/src/snippets/draganddrop/dragwidget.h | 2 +- doc/src/snippets/draganddrop/main.cpp | 2 +- doc/src/snippets/draganddrop/mainwindow.cpp | 2 +- doc/src/snippets/draganddrop/mainwindow.h | 2 +- doc/src/snippets/dragging/main.cpp | 2 +- doc/src/snippets/dragging/mainwindow.cpp | 2 +- doc/src/snippets/dragging/mainwindow.h | 2 +- doc/src/snippets/dropactions/main.cpp | 2 +- doc/src/snippets/dropactions/window.cpp | 2 +- doc/src/snippets/dropactions/window.h | 2 +- doc/src/snippets/droparea.cpp | 2 +- doc/src/snippets/dropevents/main.cpp | 2 +- doc/src/snippets/dropevents/window.cpp | 2 +- doc/src/snippets/dropevents/window.h | 2 +- doc/src/snippets/droprectangle/main.cpp | 2 +- doc/src/snippets/droprectangle/window.cpp | 2 +- doc/src/snippets/droprectangle/window.h | 2 +- doc/src/snippets/eventfilters/filterobject.cpp | 2 +- doc/src/snippets/eventfilters/filterobject.h | 2 +- doc/src/snippets/eventfilters/main.cpp | 2 +- doc/src/snippets/events/events.cpp | 2 +- doc/src/snippets/explicitlysharedemployee/employee.cpp | 2 +- doc/src/snippets/explicitlysharedemployee/employee.h | 2 +- doc/src/snippets/explicitlysharedemployee/main.cpp | 2 +- doc/src/snippets/file/file.cpp | 2 +- doc/src/snippets/filedialogurls.cpp | 2 +- doc/src/snippets/fileinfo/main.cpp | 2 +- doc/src/snippets/graphicssceneadditemsnippet.cpp | 2 +- doc/src/snippets/i18n-non-qt-class/main.cpp | 2 +- doc/src/snippets/i18n-non-qt-class/myclass.cpp | 2 +- doc/src/snippets/i18n-non-qt-class/myclass.h | 2 +- doc/src/snippets/image/image.cpp | 2 +- doc/src/snippets/image/supportedformat.cpp | 2 +- doc/src/snippets/inherited-slot/button.cpp | 2 +- doc/src/snippets/inherited-slot/button.h | 2 +- doc/src/snippets/inherited-slot/main.cpp | 2 +- doc/src/snippets/itemselection/main.cpp | 2 +- doc/src/snippets/itemselection/model.cpp | 2 +- doc/src/snippets/itemselection/model.h | 2 +- doc/src/snippets/javastyle.cpp | 2 +- doc/src/snippets/layouts/layouts.cpp | 2 +- doc/src/snippets/mainwindowsnippet.cpp | 2 +- doc/src/snippets/matrix/matrix.cpp | 2 +- doc/src/snippets/mdiareasnippets.cpp | 2 +- doc/src/snippets/medianodesnippet.cpp | 2 +- doc/src/snippets/moc/main.cpp | 2 +- doc/src/snippets/moc/myclass1.h | 2 +- doc/src/snippets/moc/myclass2.h | 2 +- doc/src/snippets/moc/myclass3.h | 2 +- doc/src/snippets/modelview-subclasses/main.cpp | 2 +- doc/src/snippets/modelview-subclasses/model.cpp | 2 +- doc/src/snippets/modelview-subclasses/model.h | 2 +- doc/src/snippets/modelview-subclasses/view.cpp | 2 +- doc/src/snippets/modelview-subclasses/view.h | 2 +- doc/src/snippets/modelview-subclasses/window.cpp | 2 +- doc/src/snippets/modelview-subclasses/window.h | 2 +- doc/src/snippets/myscrollarea.cpp | 2 +- doc/src/snippets/network/tcpwait.cpp | 2 +- doc/src/snippets/ntfsp.cpp | 2 +- doc/src/snippets/painterpath/painterpath.cpp | 2 +- doc/src/snippets/persistentindexes/main.cpp | 2 +- doc/src/snippets/persistentindexes/mainwindow.cpp | 2 +- doc/src/snippets/persistentindexes/mainwindow.h | 2 +- doc/src/snippets/persistentindexes/model.cpp | 2 +- doc/src/snippets/persistentindexes/model.h | 2 +- doc/src/snippets/phonon.cpp | 2 +- doc/src/snippets/phonon/samplebackend/main.cpp | 2 +- doc/src/snippets/phononeffectparameter.cpp | 2 +- doc/src/snippets/phononobjectdescription.cpp | 2 +- doc/src/snippets/picture/picture.cpp | 2 +- doc/src/snippets/plaintextlayout/main.cpp | 2 +- doc/src/snippets/plaintextlayout/window.cpp | 2 +- doc/src/snippets/plaintextlayout/window.h | 2 +- doc/src/snippets/pointer/pointer.cpp | 2 +- doc/src/snippets/polygon/polygon.cpp | 2 +- doc/src/snippets/porting4-dropevents/main.cpp | 2 +- doc/src/snippets/porting4-dropevents/window.cpp | 2 +- doc/src/snippets/porting4-dropevents/window.h | 2 +- doc/src/snippets/printing-qprinter/errors.cpp | 2 +- doc/src/snippets/printing-qprinter/main.cpp | 2 +- doc/src/snippets/printing-qprinter/object.cpp | 2 +- doc/src/snippets/printing-qprinter/object.h | 2 +- doc/src/snippets/process/process.cpp | 2 +- doc/src/snippets/qabstractsliderisnippet.cpp | 2 +- doc/src/snippets/qcalendarwidget/main.cpp | 2 +- doc/src/snippets/qcolumnview/main.cpp | 2 +- doc/src/snippets/qdbusextratypes/qdbusextratypes.cpp | 2 +- doc/src/snippets/qdebug/qdebugsnippet.cpp | 2 +- doc/src/snippets/qdir-filepaths/main.cpp | 2 +- doc/src/snippets/qdir-listfiles/main.cpp | 2 +- doc/src/snippets/qdir-namefilters/main.cpp | 2 +- doc/src/snippets/qfontdatabase/main.cpp | 2 +- doc/src/snippets/qgl-namespace/main.cpp | 2 +- doc/src/snippets/qlabel/main.cpp | 2 +- doc/src/snippets/qlineargradient/main.cpp | 2 +- doc/src/snippets/qlineargradient/paintwidget.cpp | 2 +- doc/src/snippets/qlineargradient/paintwidget.h | 2 +- doc/src/snippets/qlistview-dnd/main.cpp | 2 +- doc/src/snippets/qlistview-dnd/mainwindow.cpp | 2 +- doc/src/snippets/qlistview-dnd/mainwindow.h | 2 +- doc/src/snippets/qlistview-dnd/model.cpp | 4 ++-- doc/src/snippets/qlistview-dnd/model.h | 4 ++-- doc/src/snippets/qlistview-using/main.cpp | 2 +- doc/src/snippets/qlistview-using/mainwindow.cpp | 2 +- doc/src/snippets/qlistview-using/mainwindow.h | 2 +- doc/src/snippets/qlistview-using/model.cpp | 4 ++-- doc/src/snippets/qlistview-using/model.h | 4 ++-- doc/src/snippets/qlistwidget-dnd/main.cpp | 2 +- doc/src/snippets/qlistwidget-dnd/mainwindow.cpp | 2 +- doc/src/snippets/qlistwidget-dnd/mainwindow.h | 2 +- doc/src/snippets/qlistwidget-using/main.cpp | 2 +- doc/src/snippets/qlistwidget-using/mainwindow.cpp | 2 +- doc/src/snippets/qlistwidget-using/mainwindow.h | 2 +- doc/src/snippets/qmacnativewidget/main.mm | 2 +- doc/src/snippets/qmake/delegate.h | 2 +- doc/src/snippets/qmake/main.cpp | 2 +- doc/src/snippets/qmake/model.cpp | 2 +- doc/src/snippets/qmake/model.h | 2 +- doc/src/snippets/qmake/paintwidget_mac.cpp | 2 +- doc/src/snippets/qmake/paintwidget_unix.cpp | 2 +- doc/src/snippets/qmake/paintwidget_win.cpp | 2 +- doc/src/snippets/qmake/view.h | 2 +- doc/src/snippets/qmetaobject-invokable/main.cpp | 2 +- doc/src/snippets/qmetaobject-invokable/window.cpp | 2 +- doc/src/snippets/qmetaobject-invokable/window.h | 2 +- doc/src/snippets/qprocess-environment/main.cpp | 2 +- doc/src/snippets/qprocess/qprocess-simpleexecution.cpp | 2 +- doc/src/snippets/qsignalmapper/buttonwidget.cpp | 2 +- doc/src/snippets/qsignalmapper/buttonwidget.h | 2 +- doc/src/snippets/qsignalmapper/main.cpp | 2 +- doc/src/snippets/qsignalmapper/mainwindow.h | 2 +- doc/src/snippets/qsortfilterproxymodel-details/main.cpp | 2 +- doc/src/snippets/qsortfilterproxymodel/main.cpp | 2 +- doc/src/snippets/qsplashscreen/main.cpp | 2 +- doc/src/snippets/qsplashscreen/mainwindow.cpp | 2 +- doc/src/snippets/qsplashscreen/mainwindow.h | 2 +- doc/src/snippets/qsql-namespace/main.cpp | 2 +- doc/src/snippets/qstack/main.cpp | 2 +- doc/src/snippets/qstackedlayout/main.cpp | 2 +- doc/src/snippets/qstackedwidget/main.cpp | 2 +- doc/src/snippets/qstandarditemmodel/main.cpp | 2 +- doc/src/snippets/qstatustipevent/main.cpp | 2 +- doc/src/snippets/qstring/main.cpp | 2 +- doc/src/snippets/qstring/stringbuilder.cpp | 2 +- doc/src/snippets/qstringlist/main.cpp | 2 +- doc/src/snippets/qstringlistmodel/main.cpp | 2 +- doc/src/snippets/qstyleoption/main.cpp | 2 +- doc/src/snippets/qstyleplugin/main.cpp | 2 +- doc/src/snippets/qsvgwidget/main.cpp | 2 +- doc/src/snippets/qt-namespace/main.cpp | 2 +- doc/src/snippets/qtablewidget-dnd/main.cpp | 2 +- doc/src/snippets/qtablewidget-dnd/mainwindow.cpp | 2 +- doc/src/snippets/qtablewidget-dnd/mainwindow.h | 2 +- doc/src/snippets/qtablewidget-resizing/main.cpp | 2 +- doc/src/snippets/qtablewidget-resizing/mainwindow.cpp | 2 +- doc/src/snippets/qtablewidget-resizing/mainwindow.h | 2 +- doc/src/snippets/qtablewidget-using/main.cpp | 2 +- doc/src/snippets/qtablewidget-using/mainwindow.cpp | 2 +- doc/src/snippets/qtablewidget-using/mainwindow.h | 2 +- doc/src/snippets/qtcast/qtcast.cpp | 2 +- doc/src/snippets/qtcast/qtcast.h | 2 +- doc/src/snippets/qtest-namespace/main.cpp | 2 +- doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp | 4 ++-- doc/src/snippets/qtreeview-dnd/dragdropmodel.h | 4 ++-- doc/src/snippets/qtreeview-dnd/main.cpp | 2 +- doc/src/snippets/qtreeview-dnd/mainwindow.cpp | 2 +- doc/src/snippets/qtreeview-dnd/mainwindow.h | 2 +- doc/src/snippets/qtreeview-dnd/treeitem.cpp | 2 +- doc/src/snippets/qtreeview-dnd/treeitem.h | 2 +- doc/src/snippets/qtreeview-dnd/treemodel.cpp | 2 +- doc/src/snippets/qtreeview-dnd/treemodel.h | 2 +- doc/src/snippets/qtreewidget-using/main.cpp | 2 +- doc/src/snippets/qtreewidget-using/mainwindow.cpp | 2 +- doc/src/snippets/qtreewidget-using/mainwindow.h | 2 +- doc/src/snippets/qtreewidgetitemiterator-using/main.cpp | 2 +- .../snippets/qtreewidgetitemiterator-using/mainwindow.cpp | 2 +- .../snippets/qtreewidgetitemiterator-using/mainwindow.h | 2 +- doc/src/snippets/qtscript/evaluation/main.cpp | 2 +- doc/src/snippets/qtscript/registeringobjects/main.cpp | 2 +- doc/src/snippets/qtscript/registeringobjects/myobject.cpp | 2 +- doc/src/snippets/qtscript/registeringobjects/myobject.h | 2 +- doc/src/snippets/qtscript/registeringvalues/main.cpp | 2 +- doc/src/snippets/qtscript/scriptedslot/main.cpp | 2 +- doc/src/snippets/quiloader/main.cpp | 2 +- doc/src/snippets/quiloader/mywidget.cpp | 2 +- doc/src/snippets/quiloader/mywidget.h | 2 +- doc/src/snippets/qx11embedcontainer/main.cpp | 2 +- doc/src/snippets/qx11embedwidget/embedwidget.cpp | 2 +- doc/src/snippets/qx11embedwidget/embedwidget.h | 2 +- doc/src/snippets/qx11embedwidget/main.cpp | 2 +- doc/src/snippets/qxmlquery/bindingExample.cpp | 2 +- doc/src/snippets/qxmlschema/main.cpp | 2 +- doc/src/snippets/qxmlschemavalidator/main.cpp | 2 +- doc/src/snippets/qxmlstreamwriter/main.cpp | 2 +- doc/src/snippets/reading-selections/main.cpp | 2 +- doc/src/snippets/reading-selections/model.cpp | 2 +- doc/src/snippets/reading-selections/model.h | 2 +- doc/src/snippets/reading-selections/window.cpp | 2 +- doc/src/snippets/reading-selections/window.h | 2 +- doc/src/snippets/scribe-overview/main.cpp | 2 +- doc/src/snippets/scriptdebugger.cpp | 2 +- doc/src/snippets/seekslider.cpp | 2 +- doc/src/snippets/separations/finalwidget.cpp | 2 +- doc/src/snippets/separations/finalwidget.h | 2 +- doc/src/snippets/separations/main.cpp | 2 +- doc/src/snippets/separations/screenwidget.cpp | 2 +- doc/src/snippets/separations/screenwidget.h | 2 +- doc/src/snippets/separations/separations.qdoc | 2 +- doc/src/snippets/separations/viewer.cpp | 2 +- doc/src/snippets/separations/viewer.h | 2 +- doc/src/snippets/settings/settings.cpp | 2 +- doc/src/snippets/shareddirmodel/main.cpp | 2 +- doc/src/snippets/sharedemployee/employee.cpp | 2 +- doc/src/snippets/sharedemployee/employee.h | 2 +- doc/src/snippets/sharedemployee/main.cpp | 2 +- doc/src/snippets/sharedtablemodel/main.cpp | 2 +- doc/src/snippets/sharedtablemodel/model.cpp | 2 +- doc/src/snippets/sharedtablemodel/model.h | 2 +- doc/src/snippets/signalmapper/filereader.cpp | 2 +- doc/src/snippets/signalmapper/filereader.h | 2 +- doc/src/snippets/signalmapper/main.cpp | 2 +- doc/src/snippets/signalsandslots/lcdnumber.cpp | 2 +- doc/src/snippets/signalsandslots/lcdnumber.h | 2 +- doc/src/snippets/signalsandslots/signalsandslots.cpp | 2 +- doc/src/snippets/signalsandslots/signalsandslots.h | 2 +- doc/src/snippets/simplemodel-use/main.cpp | 2 +- doc/src/snippets/splitter/splitter.cpp | 2 +- doc/src/snippets/splitterhandle/main.cpp | 2 +- doc/src/snippets/splitterhandle/splitter.cpp | 2 +- doc/src/snippets/splitterhandle/splitter.h | 2 +- doc/src/snippets/sqldatabase/sqldatabase.cpp | 2 +- doc/src/snippets/statemachine/eventtest.cpp | 2 +- doc/src/snippets/statemachine/main.cpp | 2 +- doc/src/snippets/statemachine/main2.cpp | 2 +- doc/src/snippets/statemachine/main3.cpp | 2 +- doc/src/snippets/statemachine/main4.cpp | 2 +- doc/src/snippets/statemachine/main5.cpp | 2 +- doc/src/snippets/streaming/main.cpp | 2 +- doc/src/snippets/stringlistmodel/main.cpp | 2 +- doc/src/snippets/stringlistmodel/model.cpp | 2 +- doc/src/snippets/stringlistmodel/model.h | 2 +- doc/src/snippets/styles/styles.cpp | 2 +- doc/src/snippets/stylesheet/common-mistakes.cpp | 2 +- doc/src/snippets/textblock-formats/main.cpp | 2 +- doc/src/snippets/textblock-fragments/main.cpp | 2 +- doc/src/snippets/textblock-fragments/mainwindow.cpp | 2 +- doc/src/snippets/textblock-fragments/mainwindow.h | 2 +- doc/src/snippets/textblock-fragments/xmlwriter.cpp | 2 +- doc/src/snippets/textblock-fragments/xmlwriter.h | 2 +- doc/src/snippets/textdocument-blocks/main.cpp | 2 +- doc/src/snippets/textdocument-blocks/mainwindow.cpp | 2 +- doc/src/snippets/textdocument-blocks/mainwindow.h | 2 +- doc/src/snippets/textdocument-blocks/xmlwriter.cpp | 2 +- doc/src/snippets/textdocument-blocks/xmlwriter.h | 2 +- doc/src/snippets/textdocument-charformats/main.cpp | 2 +- doc/src/snippets/textdocument-css/main.cpp | 2 +- doc/src/snippets/textdocument-cursors/main.cpp | 2 +- doc/src/snippets/textdocument-find/main.cpp | 2 +- doc/src/snippets/textdocument-frames/main.cpp | 2 +- doc/src/snippets/textdocument-frames/mainwindow.cpp | 2 +- doc/src/snippets/textdocument-frames/mainwindow.h | 2 +- doc/src/snippets/textdocument-frames/xmlwriter.cpp | 2 +- doc/src/snippets/textdocument-frames/xmlwriter.h | 2 +- doc/src/snippets/textdocument-imagedrop/main.cpp | 2 +- doc/src/snippets/textdocument-imagedrop/textedit.cpp | 2 +- doc/src/snippets/textdocument-imagedrop/textedit.h | 2 +- doc/src/snippets/textdocument-imageformat/main.cpp | 2 +- doc/src/snippets/textdocument-images/main.cpp | 2 +- doc/src/snippets/textdocument-listitems/main.cpp | 2 +- doc/src/snippets/textdocument-listitems/mainwindow.cpp | 2 +- doc/src/snippets/textdocument-listitems/mainwindow.h | 2 +- doc/src/snippets/textdocument-lists/main.cpp | 2 +- doc/src/snippets/textdocument-lists/mainwindow.cpp | 2 +- doc/src/snippets/textdocument-lists/mainwindow.h | 2 +- doc/src/snippets/textdocument-printing/main.cpp | 2 +- doc/src/snippets/textdocument-printing/mainwindow.cpp | 2 +- doc/src/snippets/textdocument-printing/mainwindow.h | 2 +- doc/src/snippets/textdocument-resources/main.cpp | 2 +- doc/src/snippets/textdocument-selections/main.cpp | 2 +- doc/src/snippets/textdocument-selections/mainwindow.cpp | 2 +- doc/src/snippets/textdocument-selections/mainwindow.h | 2 +- doc/src/snippets/textdocument-tables/main.cpp | 2 +- doc/src/snippets/textdocument-tables/mainwindow.cpp | 2 +- doc/src/snippets/textdocument-tables/mainwindow.h | 2 +- doc/src/snippets/textdocument-tables/xmlwriter.cpp | 2 +- doc/src/snippets/textdocument-tables/xmlwriter.h | 2 +- doc/src/snippets/textdocument-texttable/main.cpp | 2 +- doc/src/snippets/textdocumentendsnippet.cpp | 2 +- doc/src/snippets/threads/threads.cpp | 2 +- doc/src/snippets/threads/threads.h | 2 +- doc/src/snippets/timeline/main.cpp | 2 +- doc/src/snippets/timers/timers.cpp | 2 +- doc/src/snippets/transform/main.cpp | 2 +- doc/src/snippets/uitools/calculatorform/main.cpp | 2 +- doc/src/snippets/updating-selections/main.cpp | 2 +- doc/src/snippets/updating-selections/model.cpp | 2 +- doc/src/snippets/updating-selections/model.h | 2 +- doc/src/snippets/updating-selections/window.cpp | 2 +- doc/src/snippets/updating-selections/window.h | 2 +- doc/src/snippets/videomedia.cpp | 2 +- doc/src/snippets/volumeslider.cpp | 2 +- doc/src/snippets/whatsthis/whatsthis.cpp | 2 +- doc/src/snippets/widget-mask/main.cpp | 2 +- doc/src/snippets/widgetdelegate.cpp | 2 +- doc/src/snippets/widgets-tutorial/childwidget/main.cpp | 2 +- doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp | 2 +- doc/src/snippets/widgets-tutorial/template.cpp | 2 +- doc/src/snippets/widgets-tutorial/toplevel/main.cpp | 2 +- doc/src/snippets/widgets-tutorial/windowlayout/main.cpp | 2 +- doc/src/snippets/xml/prettyprint/main.cpp | 2 +- doc/src/snippets/xml/rsslisting/handler.cpp | 2 +- doc/src/snippets/xml/rsslisting/handler.h | 2 +- doc/src/snippets/xml/rsslisting/main.cpp | 2 +- doc/src/snippets/xml/rsslisting/rsslisting.cpp | 2 +- doc/src/snippets/xml/rsslisting/rsslisting.h | 2 +- doc/src/snippets/xml/simpleparse/handler.cpp | 2 +- doc/src/snippets/xml/simpleparse/handler.h | 2 +- doc/src/snippets/xml/simpleparse/main.cpp | 2 +- doc/src/sql-programming/qsqldatatype-table.qdoc | 2 +- doc/src/sql-programming/sql-driver.qdoc | 2 +- doc/src/sql-programming/sql-programming.qdoc | 2 +- doc/src/tutorials/addressbook-fr.qdoc | 2 +- doc/src/tutorials/addressbook.qdoc | 2 +- doc/src/tutorials/widgets-tutorial.qdoc | 2 +- doc/src/widgets-and-layouts/focus.qdoc | 2 +- doc/src/widgets-and-layouts/gallery-cde.qdoc | 2 +- doc/src/widgets-and-layouts/gallery-cleanlooks.qdoc | 2 +- doc/src/widgets-and-layouts/gallery-gtk.qdoc | 2 +- doc/src/widgets-and-layouts/gallery-macintosh.qdoc | 2 +- doc/src/widgets-and-layouts/gallery-motif.qdoc | 2 +- doc/src/widgets-and-layouts/gallery-plastique.qdoc | 2 +- doc/src/widgets-and-layouts/gallery-windows.qdoc | 2 +- doc/src/widgets-and-layouts/gallery-windowsvista.qdoc | 2 +- doc/src/widgets-and-layouts/gallery-windowsxp.qdoc | 2 +- doc/src/widgets-and-layouts/gallery.qdoc | 2 +- doc/src/widgets-and-layouts/layout.qdoc | 2 +- doc/src/widgets-and-layouts/styles.qdoc | 2 +- doc/src/widgets-and-layouts/stylesheet.qdoc | 2 +- doc/src/widgets-and-layouts/widgets.qdoc | 2 +- doc/src/windows-and-dialogs/dialogs.qdoc | 2 +- doc/src/windows-and-dialogs/mainwindow.qdoc | 2 +- doc/src/xml-processing/xml-patterns.qdoc | 2 +- doc/src/xml-processing/xml-processing.qdoc | 2 +- doc/src/xml-processing/xquery-introduction.qdoc | 2 +- examples/activeqt/comapp/main.cpp | 2 +- examples/activeqt/dotnet/wrapper/lib/networker.cpp | 2 +- examples/activeqt/dotnet/wrapper/lib/networker.h | 2 +- examples/activeqt/dotnet/wrapper/lib/tools.cpp | 2 +- examples/activeqt/dotnet/wrapper/lib/tools.h | 2 +- examples/activeqt/dotnet/wrapper/lib/worker.cpp | 2 +- examples/activeqt/dotnet/wrapper/lib/worker.h | 2 +- examples/activeqt/hierarchy/main.cpp | 2 +- examples/activeqt/hierarchy/objects.cpp | 2 +- examples/activeqt/hierarchy/objects.h | 2 +- examples/activeqt/menus/main.cpp | 2 +- examples/activeqt/menus/menus.cpp | 2 +- examples/activeqt/menus/menus.h | 2 +- examples/activeqt/multiple/ax1.h | 2 +- examples/activeqt/multiple/ax2.h | 2 +- examples/activeqt/multiple/main.cpp | 2 +- examples/activeqt/multiple/multipleax.rc | 2 +- examples/activeqt/opengl/glbox.cpp | 2 +- examples/activeqt/opengl/glbox.h | 2 +- examples/activeqt/opengl/globjwin.cpp | 2 +- examples/activeqt/opengl/globjwin.h | 2 +- examples/activeqt/opengl/main.cpp | 2 +- examples/activeqt/qutlook/addressview.cpp | 2 +- examples/activeqt/qutlook/addressview.h | 2 +- examples/activeqt/qutlook/main.cpp | 2 +- examples/activeqt/simple/main.cpp | 2 +- examples/activeqt/webbrowser/main.cpp | 2 +- examples/activeqt/webbrowser/webaxwidget.h | 2 +- examples/activeqt/wrapper/main.cpp | 2 +- examples/activeqt/wrapper/wrapperax.rc | 2 +- examples/animation/animatedtiles/main.cpp | 2 +- examples/animation/appchooser/main.cpp | 2 +- examples/animation/easing/animation.h | 2 +- examples/animation/easing/main.cpp | 2 +- examples/animation/easing/window.cpp | 2 +- examples/animation/easing/window.h | 2 +- examples/animation/moveblocks/main.cpp | 2 +- examples/animation/states/main.cpp | 2 +- examples/animation/stickman/animation.cpp | 2 +- examples/animation/stickman/animation.h | 2 +- examples/animation/stickman/graphicsview.cpp | 2 +- examples/animation/stickman/graphicsview.h | 2 +- examples/animation/stickman/lifecycle.cpp | 2 +- examples/animation/stickman/lifecycle.h | 2 +- examples/animation/stickman/main.cpp | 2 +- examples/animation/stickman/node.cpp | 2 +- examples/animation/stickman/node.h | 2 +- examples/animation/stickman/stickman.cpp | 2 +- examples/animation/stickman/stickman.h | 2 +- examples/assistant/simpletextviewer/findfiledialog.cpp | 2 +- examples/assistant/simpletextviewer/findfiledialog.h | 2 +- examples/assistant/simpletextviewer/main.cpp | 2 +- examples/assistant/simpletextviewer/mainwindow.cpp | 2 +- examples/assistant/simpletextviewer/mainwindow.h | 2 +- examples/dbus/complexpingpong/complexping.cpp | 2 +- examples/dbus/complexpingpong/complexping.h | 2 +- examples/dbus/complexpingpong/complexpong.cpp | 2 +- examples/dbus/complexpingpong/complexpong.h | 2 +- examples/dbus/complexpingpong/ping-common.h | 2 +- examples/dbus/dbus-chat/chat.cpp | 2 +- examples/dbus/dbus-chat/chat.h | 2 +- examples/dbus/dbus-chat/chat_adaptor.cpp | 4 ++-- examples/dbus/dbus-chat/chat_adaptor.h | 4 ++-- examples/dbus/dbus-chat/chat_interface.cpp | 4 ++-- examples/dbus/dbus-chat/chat_interface.h | 4 ++-- examples/dbus/listnames/listnames.cpp | 2 +- examples/dbus/pingpong/ping-common.h | 2 +- examples/dbus/pingpong/ping.cpp | 2 +- examples/dbus/pingpong/pong.cpp | 2 +- examples/dbus/pingpong/pong.h | 2 +- examples/dbus/remotecontrolledcar/car/car.cpp | 2 +- examples/dbus/remotecontrolledcar/car/car.h | 2 +- examples/dbus/remotecontrolledcar/car/car_adaptor.cpp | 4 ++-- examples/dbus/remotecontrolledcar/car/car_adaptor_p.h | 4 ++-- examples/dbus/remotecontrolledcar/car/main.cpp | 2 +- .../dbus/remotecontrolledcar/controller/car_interface.cpp | 4 ++-- .../dbus/remotecontrolledcar/controller/car_interface_p.h | 4 ++-- .../dbus/remotecontrolledcar/controller/controller.cpp | 2 +- examples/dbus/remotecontrolledcar/controller/controller.h | 2 +- examples/dbus/remotecontrolledcar/controller/main.cpp | 2 +- examples/designer/calculatorbuilder/calculatorform.cpp | 2 +- examples/designer/calculatorbuilder/calculatorform.h | 2 +- examples/designer/calculatorbuilder/main.cpp | 2 +- examples/designer/calculatorform/calculatorform.cpp | 2 +- examples/designer/calculatorform/calculatorform.h | 2 +- examples/designer/calculatorform/main.cpp | 2 +- examples/designer/containerextension/multipagewidget.cpp | 2 +- examples/designer/containerextension/multipagewidget.h | 2 +- .../multipagewidgetcontainerextension.cpp | 2 +- .../containerextension/multipagewidgetcontainerextension.h | 2 +- .../containerextension/multipagewidgetextensionfactory.cpp | 2 +- .../containerextension/multipagewidgetextensionfactory.h | 2 +- .../designer/containerextension/multipagewidgetplugin.cpp | 2 +- .../designer/containerextension/multipagewidgetplugin.h | 2 +- examples/designer/customwidgetplugin/analogclock.cpp | 2 +- examples/designer/customwidgetplugin/analogclock.h | 2 +- .../designer/customwidgetplugin/customwidgetplugin.cpp | 2 +- examples/designer/customwidgetplugin/customwidgetplugin.h | 2 +- examples/designer/taskmenuextension/tictactoe.cpp | 2 +- examples/designer/taskmenuextension/tictactoe.h | 2 +- examples/designer/taskmenuextension/tictactoedialog.cpp | 2 +- examples/designer/taskmenuextension/tictactoedialog.h | 2 +- examples/designer/taskmenuextension/tictactoeplugin.cpp | 2 +- examples/designer/taskmenuextension/tictactoeplugin.h | 2 +- examples/designer/taskmenuextension/tictactoetaskmenu.cpp | 2 +- examples/designer/taskmenuextension/tictactoetaskmenu.h | 2 +- examples/designer/worldtimeclockbuilder/main.cpp | 2 +- examples/designer/worldtimeclockplugin/worldtimeclock.cpp | 2 +- examples/designer/worldtimeclockplugin/worldtimeclock.h | 2 +- .../designer/worldtimeclockplugin/worldtimeclockplugin.cpp | 2 +- .../designer/worldtimeclockplugin/worldtimeclockplugin.h | 2 +- examples/desktop/screenshot/main.cpp | 2 +- examples/desktop/screenshot/screenshot.cpp | 2 +- examples/desktop/screenshot/screenshot.h | 2 +- examples/desktop/systray/main.cpp | 2 +- examples/desktop/systray/window.cpp | 2 +- examples/desktop/systray/window.h | 2 +- examples/dialogs/classwizard/classwizard.cpp | 2 +- examples/dialogs/classwizard/classwizard.h | 2 +- examples/dialogs/classwizard/main.cpp | 2 +- examples/dialogs/configdialog/configdialog.cpp | 2 +- examples/dialogs/configdialog/configdialog.h | 2 +- examples/dialogs/configdialog/main.cpp | 2 +- examples/dialogs/configdialog/pages.cpp | 2 +- examples/dialogs/configdialog/pages.h | 2 +- examples/dialogs/extension/finddialog.cpp | 2 +- examples/dialogs/extension/finddialog.h | 2 +- examples/dialogs/extension/main.cpp | 2 +- examples/dialogs/findfiles/main.cpp | 2 +- examples/dialogs/findfiles/window.cpp | 2 +- examples/dialogs/findfiles/window.h | 2 +- examples/dialogs/licensewizard/licensewizard.cpp | 2 +- examples/dialogs/licensewizard/licensewizard.h | 2 +- examples/dialogs/licensewizard/main.cpp | 2 +- examples/dialogs/sipdialog/dialog.cpp | 2 +- examples/dialogs/sipdialog/dialog.h | 2 +- examples/dialogs/sipdialog/main.cpp | 2 +- examples/dialogs/standarddialogs/dialog.cpp | 2 +- examples/dialogs/standarddialogs/dialog.h | 2 +- examples/dialogs/standarddialogs/main.cpp | 2 +- examples/dialogs/tabdialog/main.cpp | 2 +- examples/dialogs/tabdialog/tabdialog.cpp | 2 +- examples/dialogs/tabdialog/tabdialog.h | 2 +- examples/dialogs/trivialwizard/trivialwizard.cpp | 2 +- examples/draganddrop/delayedencoding/images/example.svg | 2 +- examples/draganddrop/delayedencoding/main.cpp | 2 +- examples/draganddrop/delayedencoding/mimedata.cpp | 2 +- examples/draganddrop/delayedencoding/mimedata.h | 2 +- examples/draganddrop/delayedencoding/sourcewidget.cpp | 2 +- examples/draganddrop/delayedencoding/sourcewidget.h | 2 +- examples/draganddrop/draggableicons/dragwidget.cpp | 2 +- examples/draganddrop/draggableicons/dragwidget.h | 2 +- examples/draganddrop/draggableicons/main.cpp | 2 +- examples/draganddrop/draggabletext/draglabel.cpp | 2 +- examples/draganddrop/draggabletext/draglabel.h | 2 +- examples/draganddrop/draggabletext/dragwidget.cpp | 2 +- examples/draganddrop/draggabletext/dragwidget.h | 2 +- examples/draganddrop/draggabletext/main.cpp | 2 +- examples/draganddrop/dropsite/droparea.cpp | 2 +- examples/draganddrop/dropsite/droparea.h | 2 +- examples/draganddrop/dropsite/dropsitewindow.cpp | 2 +- examples/draganddrop/dropsite/dropsitewindow.h | 2 +- examples/draganddrop/dropsite/main.cpp | 2 +- examples/draganddrop/fridgemagnets/draglabel.cpp | 2 +- examples/draganddrop/fridgemagnets/draglabel.h | 2 +- examples/draganddrop/fridgemagnets/dragwidget.cpp | 2 +- examples/draganddrop/fridgemagnets/dragwidget.h | 2 +- examples/draganddrop/fridgemagnets/main.cpp | 2 +- examples/draganddrop/puzzle/main.cpp | 2 +- examples/draganddrop/puzzle/mainwindow.cpp | 2 +- examples/draganddrop/puzzle/mainwindow.h | 2 +- examples/draganddrop/puzzle/pieceslist.cpp | 2 +- examples/draganddrop/puzzle/pieceslist.h | 2 +- examples/draganddrop/puzzle/puzzlewidget.cpp | 2 +- examples/draganddrop/puzzle/puzzlewidget.h | 2 +- examples/effects/blurpicker/blureffect.cpp | 2 +- examples/effects/blurpicker/blureffect.h | 2 +- examples/effects/blurpicker/blurpicker.cpp | 2 +- examples/effects/blurpicker/blurpicker.h | 2 +- examples/effects/blurpicker/main.cpp | 2 +- examples/effects/fademessage/fademessage.cpp | 2 +- examples/effects/fademessage/fademessage.h | 2 +- examples/effects/fademessage/main.cpp | 2 +- examples/effects/lighting/lighting.cpp | 2 +- examples/effects/lighting/lighting.h | 2 +- examples/effects/lighting/main.cpp | 2 +- examples/gestures/imagegestures/imagewidget.cpp | 2 +- examples/gestures/imagegestures/imagewidget.h | 2 +- examples/gestures/imagegestures/main.cpp | 2 +- examples/gestures/imagegestures/mainwidget.cpp | 2 +- examples/gestures/imagegestures/mainwidget.h | 2 +- examples/graphicsview/anchorlayout/main.cpp | 2 +- examples/graphicsview/basicgraphicslayouts/layoutitem.cpp | 2 +- examples/graphicsview/basicgraphicslayouts/layoutitem.h | 2 +- examples/graphicsview/basicgraphicslayouts/main.cpp | 2 +- examples/graphicsview/basicgraphicslayouts/window.cpp | 2 +- examples/graphicsview/basicgraphicslayouts/window.h | 2 +- examples/graphicsview/collidingmice/main.cpp | 2 +- examples/graphicsview/collidingmice/mouse.cpp | 2 +- examples/graphicsview/collidingmice/mouse.h | 2 +- examples/graphicsview/diagramscene/arrow.cpp | 2 +- examples/graphicsview/diagramscene/arrow.h | 2 +- examples/graphicsview/diagramscene/diagramitem.cpp | 2 +- examples/graphicsview/diagramscene/diagramitem.h | 2 +- examples/graphicsview/diagramscene/diagramscene.cpp | 2 +- examples/graphicsview/diagramscene/diagramscene.h | 2 +- examples/graphicsview/diagramscene/diagramtextitem.cpp | 2 +- examples/graphicsview/diagramscene/diagramtextitem.h | 2 +- examples/graphicsview/diagramscene/main.cpp | 2 +- examples/graphicsview/diagramscene/mainwindow.cpp | 2 +- examples/graphicsview/diagramscene/mainwindow.h | 2 +- examples/graphicsview/dragdroprobot/coloritem.cpp | 2 +- examples/graphicsview/dragdroprobot/coloritem.h | 2 +- examples/graphicsview/dragdroprobot/main.cpp | 2 +- examples/graphicsview/dragdroprobot/robot.cpp | 2 +- examples/graphicsview/dragdroprobot/robot.h | 2 +- examples/graphicsview/elasticnodes/edge.cpp | 2 +- examples/graphicsview/elasticnodes/edge.h | 2 +- examples/graphicsview/elasticnodes/graphwidget.cpp | 2 +- examples/graphicsview/elasticnodes/graphwidget.h | 2 +- examples/graphicsview/elasticnodes/main.cpp | 2 +- examples/graphicsview/elasticnodes/node.cpp | 2 +- examples/graphicsview/elasticnodes/node.h | 2 +- examples/graphicsview/flowlayout/flowlayout.cpp | 2 +- examples/graphicsview/flowlayout/flowlayout.h | 2 +- examples/graphicsview/flowlayout/main.cpp | 2 +- examples/graphicsview/flowlayout/window.cpp | 2 +- examples/graphicsview/flowlayout/window.h | 2 +- examples/graphicsview/padnavigator/main.cpp | 2 +- examples/graphicsview/padnavigator/panel.cpp | 2 +- examples/graphicsview/padnavigator/panel.h | 2 +- examples/graphicsview/padnavigator/roundrectitem.cpp | 2 +- examples/graphicsview/padnavigator/roundrectitem.h | 2 +- examples/graphicsview/padnavigator/splashitem.cpp | 2 +- examples/graphicsview/padnavigator/splashitem.h | 2 +- examples/graphicsview/portedasteroids/animateditem.cpp | 2 +- examples/graphicsview/portedasteroids/animateditem.h | 2 +- examples/graphicsview/portedasteroids/ledmeter.cpp | 2 +- examples/graphicsview/portedasteroids/ledmeter.h | 2 +- examples/graphicsview/portedasteroids/main.cpp | 2 +- examples/graphicsview/portedasteroids/sprites.h | 2 +- examples/graphicsview/portedasteroids/toplevel.cpp | 2 +- examples/graphicsview/portedasteroids/toplevel.h | 2 +- examples/graphicsview/portedasteroids/view.cpp | 2 +- examples/graphicsview/portedasteroids/view.h | 2 +- examples/graphicsview/portedcanvas/blendshadow.cpp | 2 +- examples/graphicsview/portedcanvas/canvas.cpp | 2 +- examples/graphicsview/portedcanvas/canvas.h | 2 +- examples/graphicsview/portedcanvas/main.cpp | 2 +- examples/graphicsview/portedcanvas/makeimg.cpp | 2 +- examples/graphicsview/simpleanchorlayout/main.cpp | 2 +- examples/graphicsview/weatheranchorlayout/main.cpp | 2 +- examples/help/contextsensitivehelp/helpbrowser.cpp | 2 +- examples/help/contextsensitivehelp/helpbrowser.h | 2 +- examples/help/contextsensitivehelp/main.cpp | 2 +- .../help/contextsensitivehelp/wateringconfigdialog.cpp | 2 +- examples/help/contextsensitivehelp/wateringconfigdialog.h | 2 +- examples/help/remotecontrol/main.cpp | 2 +- examples/help/remotecontrol/remotecontrol.cpp | 2 +- examples/help/remotecontrol/remotecontrol.h | 2 +- examples/help/simpletextviewer/assistant.cpp | 2 +- examples/help/simpletextviewer/assistant.h | 2 +- examples/help/simpletextviewer/findfiledialog.cpp | 2 +- examples/help/simpletextviewer/findfiledialog.h | 2 +- examples/help/simpletextviewer/main.cpp | 2 +- examples/help/simpletextviewer/mainwindow.cpp | 2 +- examples/help/simpletextviewer/mainwindow.h | 2 +- examples/help/simpletextviewer/textedit.cpp | 2 +- examples/help/simpletextviewer/textedit.h | 2 +- examples/ipc/localfortuneclient/client.cpp | 2 +- examples/ipc/localfortuneclient/client.h | 2 +- examples/ipc/localfortuneclient/main.cpp | 2 +- examples/ipc/localfortuneserver/main.cpp | 2 +- examples/ipc/localfortuneserver/server.cpp | 2 +- examples/ipc/localfortuneserver/server.h | 2 +- examples/ipc/sharedmemory/dialog.cpp | 2 +- examples/ipc/sharedmemory/dialog.h | 2 +- examples/ipc/sharedmemory/main.cpp | 2 +- examples/itemviews/addressbook/adddialog.cpp | 2 +- examples/itemviews/addressbook/adddialog.h | 2 +- examples/itemviews/addressbook/addresswidget.cpp | 2 +- examples/itemviews/addressbook/addresswidget.h | 2 +- examples/itemviews/addressbook/main.cpp | 2 +- examples/itemviews/addressbook/mainwindow.cpp | 2 +- examples/itemviews/addressbook/mainwindow.h | 2 +- examples/itemviews/addressbook/newaddresstab.cpp | 2 +- examples/itemviews/addressbook/newaddresstab.h | 2 +- examples/itemviews/addressbook/tablemodel.cpp | 2 +- examples/itemviews/addressbook/tablemodel.h | 2 +- examples/itemviews/basicsortfiltermodel/main.cpp | 2 +- examples/itemviews/basicsortfiltermodel/window.cpp | 2 +- examples/itemviews/basicsortfiltermodel/window.h | 2 +- examples/itemviews/chart/main.cpp | 2 +- examples/itemviews/chart/mainwindow.cpp | 2 +- examples/itemviews/chart/mainwindow.h | 2 +- examples/itemviews/chart/pieview.cpp | 2 +- examples/itemviews/chart/pieview.h | 2 +- examples/itemviews/coloreditorfactory/colorlisteditor.cpp | 2 +- examples/itemviews/coloreditorfactory/colorlisteditor.h | 2 +- examples/itemviews/coloreditorfactory/main.cpp | 2 +- examples/itemviews/coloreditorfactory/window.cpp | 2 +- examples/itemviews/coloreditorfactory/window.h | 2 +- examples/itemviews/combowidgetmapper/main.cpp | 2 +- examples/itemviews/combowidgetmapper/window.cpp | 2 +- examples/itemviews/combowidgetmapper/window.h | 2 +- examples/itemviews/customsortfiltermodel/main.cpp | 2 +- .../customsortfiltermodel/mysortfilterproxymodel.cpp | 2 +- .../customsortfiltermodel/mysortfilterproxymodel.h | 2 +- examples/itemviews/customsortfiltermodel/window.cpp | 2 +- examples/itemviews/customsortfiltermodel/window.h | 2 +- examples/itemviews/dirview/main.cpp | 2 +- examples/itemviews/editabletreemodel/main.cpp | 2 +- examples/itemviews/editabletreemodel/mainwindow.cpp | 2 +- examples/itemviews/editabletreemodel/mainwindow.h | 2 +- examples/itemviews/editabletreemodel/treeitem.cpp | 2 +- examples/itemviews/editabletreemodel/treeitem.h | 2 +- examples/itemviews/editabletreemodel/treemodel.cpp | 2 +- examples/itemviews/editabletreemodel/treemodel.h | 2 +- examples/itemviews/fetchmore/filelistmodel.cpp | 2 +- examples/itemviews/fetchmore/filelistmodel.h | 2 +- examples/itemviews/fetchmore/main.cpp | 2 +- examples/itemviews/fetchmore/window.cpp | 2 +- examples/itemviews/fetchmore/window.h | 2 +- examples/itemviews/frozencolumn/freezetablewidget.cpp | 2 +- examples/itemviews/frozencolumn/freezetablewidget.h | 2 +- examples/itemviews/frozencolumn/main.cpp | 2 +- examples/itemviews/pixelator/imagemodel.cpp | 2 +- examples/itemviews/pixelator/imagemodel.h | 2 +- examples/itemviews/pixelator/main.cpp | 2 +- examples/itemviews/pixelator/mainwindow.cpp | 2 +- examples/itemviews/pixelator/mainwindow.h | 2 +- examples/itemviews/pixelator/pixeldelegate.cpp | 2 +- examples/itemviews/pixelator/pixeldelegate.h | 2 +- examples/itemviews/puzzle/main.cpp | 2 +- examples/itemviews/puzzle/mainwindow.cpp | 2 +- examples/itemviews/puzzle/mainwindow.h | 2 +- examples/itemviews/puzzle/piecesmodel.cpp | 2 +- examples/itemviews/puzzle/piecesmodel.h | 2 +- examples/itemviews/puzzle/puzzlewidget.cpp | 2 +- examples/itemviews/puzzle/puzzlewidget.h | 2 +- examples/itemviews/simpledommodel/domitem.cpp | 2 +- examples/itemviews/simpledommodel/domitem.h | 2 +- examples/itemviews/simpledommodel/dommodel.cpp | 2 +- examples/itemviews/simpledommodel/dommodel.h | 2 +- examples/itemviews/simpledommodel/main.cpp | 2 +- examples/itemviews/simpledommodel/mainwindow.cpp | 2 +- examples/itemviews/simpledommodel/mainwindow.h | 2 +- examples/itemviews/simpletreemodel/main.cpp | 2 +- examples/itemviews/simpletreemodel/treeitem.cpp | 2 +- examples/itemviews/simpletreemodel/treeitem.h | 2 +- examples/itemviews/simpletreemodel/treemodel.cpp | 2 +- examples/itemviews/simpletreemodel/treemodel.h | 2 +- examples/itemviews/simplewidgetmapper/main.cpp | 2 +- examples/itemviews/simplewidgetmapper/window.cpp | 2 +- examples/itemviews/simplewidgetmapper/window.h | 2 +- examples/itemviews/spinboxdelegate/delegate.cpp | 2 +- examples/itemviews/spinboxdelegate/delegate.h | 2 +- examples/itemviews/spinboxdelegate/main.cpp | 2 +- examples/itemviews/stardelegate/main.cpp | 2 +- examples/itemviews/stardelegate/stardelegate.cpp | 2 +- examples/itemviews/stardelegate/stardelegate.h | 2 +- examples/itemviews/stardelegate/stareditor.cpp | 2 +- examples/itemviews/stardelegate/stareditor.h | 2 +- examples/itemviews/stardelegate/starrating.cpp | 2 +- examples/itemviews/stardelegate/starrating.h | 2 +- examples/layouts/basiclayouts/dialog.cpp | 2 +- examples/layouts/basiclayouts/dialog.h | 2 +- examples/layouts/basiclayouts/main.cpp | 2 +- examples/layouts/borderlayout/borderlayout.cpp | 2 +- examples/layouts/borderlayout/borderlayout.h | 2 +- examples/layouts/borderlayout/main.cpp | 2 +- examples/layouts/borderlayout/window.cpp | 2 +- examples/layouts/borderlayout/window.h | 2 +- examples/layouts/dynamiclayouts/dialog.cpp | 2 +- examples/layouts/dynamiclayouts/dialog.h | 2 +- examples/layouts/dynamiclayouts/main.cpp | 2 +- examples/layouts/flowlayout/flowlayout.cpp | 2 +- examples/layouts/flowlayout/flowlayout.h | 2 +- examples/layouts/flowlayout/main.cpp | 2 +- examples/layouts/flowlayout/window.cpp | 2 +- examples/layouts/flowlayout/window.h | 2 +- examples/linguist/arrowpad/arrowpad.cpp | 2 +- examples/linguist/arrowpad/arrowpad.h | 2 +- examples/linguist/arrowpad/main.cpp | 2 +- examples/linguist/arrowpad/mainwindow.cpp | 2 +- examples/linguist/arrowpad/mainwindow.h | 2 +- examples/linguist/hellotr/main.cpp | 2 +- examples/linguist/trollprint/main.cpp | 2 +- examples/linguist/trollprint/mainwindow.cpp | 2 +- examples/linguist/trollprint/mainwindow.h | 2 +- examples/linguist/trollprint/printpanel.cpp | 2 +- examples/linguist/trollprint/printpanel.h | 2 +- examples/mainwindows/application/main.cpp | 2 +- examples/mainwindows/application/mainwindow.cpp | 2 +- examples/mainwindows/application/mainwindow.h | 2 +- examples/mainwindows/dockwidgets/main.cpp | 2 +- examples/mainwindows/dockwidgets/mainwindow.cpp | 2 +- examples/mainwindows/dockwidgets/mainwindow.h | 2 +- examples/mainwindows/mdi/main.cpp | 2 +- examples/mainwindows/mdi/mainwindow.cpp | 2 +- examples/mainwindows/mdi/mainwindow.h | 2 +- examples/mainwindows/mdi/mdichild.cpp | 2 +- examples/mainwindows/mdi/mdichild.h | 2 +- examples/mainwindows/menus/main.cpp | 2 +- examples/mainwindows/menus/mainwindow.cpp | 2 +- examples/mainwindows/menus/mainwindow.h | 2 +- examples/mainwindows/recentfiles/main.cpp | 2 +- examples/mainwindows/recentfiles/mainwindow.cpp | 2 +- examples/mainwindows/recentfiles/mainwindow.h | 2 +- examples/mainwindows/sdi/main.cpp | 2 +- examples/mainwindows/sdi/mainwindow.cpp | 2 +- examples/mainwindows/sdi/mainwindow.h | 2 +- examples/multimedia/audiodevices/audiodevices.cpp | 2 +- examples/multimedia/audiodevices/audiodevices.h | 2 +- examples/multimedia/audiodevices/main.cpp | 2 +- examples/multimedia/audioinput/audioinput.cpp | 2 +- examples/multimedia/audioinput/audioinput.h | 2 +- examples/multimedia/audioinput/main.cpp | 2 +- examples/multimedia/audiooutput/audiooutput.cpp | 2 +- examples/multimedia/audiooutput/audiooutput.h | 2 +- examples/multimedia/audiooutput/main.cpp | 2 +- examples/multimedia/videographicsitem/main.cpp | 2 +- examples/multimedia/videographicsitem/videoitem.cpp | 2 +- examples/multimedia/videographicsitem/videoitem.h | 2 +- examples/multimedia/videographicsitem/videoplayer.cpp | 2 +- examples/multimedia/videographicsitem/videoplayer.h | 2 +- examples/multimedia/videowidget/main.cpp | 2 +- examples/multimedia/videowidget/videoplayer.cpp | 2 +- examples/multimedia/videowidget/videoplayer.h | 2 +- examples/multimedia/videowidget/videowidget.cpp | 2 +- examples/multimedia/videowidget/videowidget.h | 2 +- examples/multimedia/videowidget/videowidgetsurface.cpp | 2 +- examples/multimedia/videowidget/videowidgetsurface.h | 2 +- examples/multitouch/dials/main.cpp | 2 +- examples/multitouch/fingerpaint/main.cpp | 2 +- examples/multitouch/fingerpaint/mainwindow.cpp | 2 +- examples/multitouch/fingerpaint/mainwindow.h | 2 +- examples/multitouch/fingerpaint/scribblearea.cpp | 2 +- examples/multitouch/fingerpaint/scribblearea.h | 2 +- examples/multitouch/knobs/knob.cpp | 2 +- examples/multitouch/knobs/knob.h | 2 +- examples/multitouch/knobs/main.cpp | 2 +- examples/multitouch/pinchzoom/graphicsview.cpp | 2 +- examples/multitouch/pinchzoom/graphicsview.h | 2 +- examples/multitouch/pinchzoom/main.cpp | 2 +- examples/multitouch/pinchzoom/mouse.cpp | 2 +- examples/multitouch/pinchzoom/mouse.h | 2 +- examples/network/blockingfortuneclient/blockingclient.cpp | 2 +- examples/network/blockingfortuneclient/blockingclient.h | 2 +- examples/network/blockingfortuneclient/fortunethread.cpp | 2 +- examples/network/blockingfortuneclient/fortunethread.h | 2 +- examples/network/blockingfortuneclient/main.cpp | 2 +- examples/network/broadcastreceiver/main.cpp | 2 +- examples/network/broadcastreceiver/receiver.cpp | 2 +- examples/network/broadcastreceiver/receiver.h | 2 +- examples/network/broadcastsender/main.cpp | 2 +- examples/network/broadcastsender/sender.cpp | 2 +- examples/network/broadcastsender/sender.h | 2 +- examples/network/download/main.cpp | 2 +- examples/network/downloadmanager/downloadmanager.cpp | 2 +- examples/network/downloadmanager/downloadmanager.h | 2 +- examples/network/downloadmanager/main.cpp | 2 +- examples/network/downloadmanager/textprogressbar.cpp | 2 +- examples/network/downloadmanager/textprogressbar.h | 2 +- examples/network/fortuneclient/client.cpp | 2 +- examples/network/fortuneclient/client.h | 2 +- examples/network/fortuneclient/main.cpp | 2 +- examples/network/fortuneserver/main.cpp | 2 +- examples/network/fortuneserver/server.cpp | 2 +- examples/network/fortuneserver/server.h | 2 +- examples/network/googlesuggest/googlesuggest.cpp | 2 +- examples/network/googlesuggest/googlesuggest.h | 2 +- examples/network/googlesuggest/main.cpp | 2 +- examples/network/googlesuggest/searchbox.cpp | 2 +- examples/network/googlesuggest/searchbox.h | 2 +- examples/network/http/httpwindow.cpp | 2 +- examples/network/http/httpwindow.h | 2 +- examples/network/http/main.cpp | 2 +- examples/network/loopback/dialog.cpp | 2 +- examples/network/loopback/dialog.h | 2 +- examples/network/loopback/main.cpp | 2 +- examples/network/network-chat/chatdialog.cpp | 2 +- examples/network/network-chat/chatdialog.h | 2 +- examples/network/network-chat/client.cpp | 2 +- examples/network/network-chat/client.h | 2 +- examples/network/network-chat/connection.cpp | 2 +- examples/network/network-chat/connection.h | 2 +- examples/network/network-chat/main.cpp | 2 +- examples/network/network-chat/peermanager.cpp | 2 +- examples/network/network-chat/peermanager.h | 2 +- examples/network/network-chat/server.cpp | 2 +- examples/network/network-chat/server.h | 2 +- examples/network/qftp/ftpwindow.cpp | 2 +- examples/network/qftp/ftpwindow.h | 2 +- examples/network/qftp/main.cpp | 2 +- examples/network/qftp/sym_iap_util.h | 2 +- examples/network/securesocketclient/certificateinfo.cpp | 2 +- examples/network/securesocketclient/certificateinfo.h | 2 +- examples/network/securesocketclient/main.cpp | 2 +- examples/network/securesocketclient/sslclient.cpp | 2 +- examples/network/securesocketclient/sslclient.h | 2 +- examples/network/threadedfortuneserver/dialog.cpp | 2 +- examples/network/threadedfortuneserver/dialog.h | 2 +- examples/network/threadedfortuneserver/fortuneserver.cpp | 2 +- examples/network/threadedfortuneserver/fortuneserver.h | 2 +- examples/network/threadedfortuneserver/fortunethread.cpp | 2 +- examples/network/threadedfortuneserver/fortunethread.h | 2 +- examples/network/threadedfortuneserver/main.cpp | 2 +- examples/network/torrent/addtorrentdialog.cpp | 2 +- examples/network/torrent/addtorrentdialog.h | 2 +- examples/network/torrent/bencodeparser.cpp | 2 +- examples/network/torrent/bencodeparser.h | 2 +- examples/network/torrent/connectionmanager.cpp | 2 +- examples/network/torrent/connectionmanager.h | 2 +- examples/network/torrent/filemanager.cpp | 2 +- examples/network/torrent/filemanager.h | 2 +- examples/network/torrent/main.cpp | 2 +- examples/network/torrent/mainwindow.cpp | 2 +- examples/network/torrent/mainwindow.h | 2 +- examples/network/torrent/metainfo.cpp | 2 +- examples/network/torrent/metainfo.h | 2 +- examples/network/torrent/peerwireclient.cpp | 2 +- examples/network/torrent/peerwireclient.h | 2 +- examples/network/torrent/ratecontroller.cpp | 2 +- examples/network/torrent/ratecontroller.h | 2 +- examples/network/torrent/torrentclient.cpp | 2 +- examples/network/torrent/torrentclient.h | 2 +- examples/network/torrent/torrentserver.cpp | 2 +- examples/network/torrent/torrentserver.h | 2 +- examples/network/torrent/trackerclient.cpp | 2 +- examples/network/torrent/trackerclient.h | 2 +- examples/opengl/2dpainting/glwidget.cpp | 2 +- examples/opengl/2dpainting/glwidget.h | 2 +- examples/opengl/2dpainting/helper.cpp | 2 +- examples/opengl/2dpainting/helper.h | 2 +- examples/opengl/2dpainting/main.cpp | 2 +- examples/opengl/2dpainting/widget.cpp | 2 +- examples/opengl/2dpainting/widget.h | 2 +- examples/opengl/2dpainting/window.cpp | 2 +- examples/opengl/2dpainting/window.h | 2 +- examples/opengl/framebufferobject/glwidget.cpp | 2 +- examples/opengl/framebufferobject/glwidget.h | 2 +- examples/opengl/framebufferobject/main.cpp | 2 +- examples/opengl/framebufferobject2/glwidget.cpp | 2 +- examples/opengl/framebufferobject2/glwidget.h | 2 +- examples/opengl/framebufferobject2/main.cpp | 2 +- examples/opengl/grabber/glwidget.cpp | 2 +- examples/opengl/grabber/glwidget.h | 2 +- examples/opengl/grabber/main.cpp | 2 +- examples/opengl/grabber/mainwindow.cpp | 2 +- examples/opengl/grabber/mainwindow.h | 2 +- examples/opengl/hellogl/glwidget.cpp | 2 +- examples/opengl/hellogl/glwidget.h | 2 +- examples/opengl/hellogl/main.cpp | 2 +- examples/opengl/hellogl/window.cpp | 2 +- examples/opengl/hellogl/window.h | 2 +- examples/opengl/hellogl_es/bubble.cpp | 2 +- examples/opengl/hellogl_es/bubble.h | 2 +- examples/opengl/hellogl_es/cl_helper.h | 2 +- examples/opengl/hellogl_es/glwidget.cpp | 2 +- examples/opengl/hellogl_es/glwidget.h | 2 +- examples/opengl/hellogl_es/main.cpp | 2 +- examples/opengl/hellogl_es/mainwindow.cpp | 2 +- examples/opengl/hellogl_es/mainwindow.h | 2 +- examples/opengl/hellogl_es2/bubble.cpp | 2 +- examples/opengl/hellogl_es2/bubble.h | 2 +- examples/opengl/hellogl_es2/glwidget.cpp | 2 +- examples/opengl/hellogl_es2/glwidget.h | 2 +- examples/opengl/hellogl_es2/main.cpp | 2 +- examples/opengl/hellogl_es2/mainwindow.cpp | 2 +- examples/opengl/hellogl_es2/mainwindow.h | 2 +- examples/opengl/overpainting/bubble.cpp | 2 +- examples/opengl/overpainting/bubble.h | 2 +- examples/opengl/overpainting/glwidget.cpp | 2 +- examples/opengl/overpainting/glwidget.h | 2 +- examples/opengl/overpainting/main.cpp | 2 +- examples/opengl/pbuffers/cube.cpp | 2 +- examples/opengl/pbuffers/cube.h | 2 +- examples/opengl/pbuffers/glwidget.cpp | 2 +- examples/opengl/pbuffers/glwidget.h | 2 +- examples/opengl/pbuffers/main.cpp | 2 +- examples/opengl/pbuffers2/glwidget.cpp | 2 +- examples/opengl/pbuffers2/glwidget.h | 2 +- examples/opengl/pbuffers2/main.cpp | 2 +- examples/opengl/samplebuffers/glwidget.cpp | 2 +- examples/opengl/samplebuffers/glwidget.h | 2 +- examples/opengl/samplebuffers/main.cpp | 2 +- examples/opengl/shared/qtlogo.cpp | 2 +- examples/opengl/shared/qtlogo.h | 2 +- examples/opengl/textures/glwidget.cpp | 2 +- examples/opengl/textures/glwidget.h | 2 +- examples/opengl/textures/main.cpp | 2 +- examples/opengl/textures/window.cpp | 2 +- examples/opengl/textures/window.h | 2 +- examples/openvg/star/main.cpp | 2 +- examples/openvg/star/starwidget.cpp | 2 +- examples/openvg/star/starwidget.h | 2 +- examples/painting/basicdrawing/main.cpp | 2 +- examples/painting/basicdrawing/renderarea.cpp | 2 +- examples/painting/basicdrawing/renderarea.h | 2 +- examples/painting/basicdrawing/window.cpp | 2 +- examples/painting/basicdrawing/window.h | 2 +- examples/painting/concentriccircles/circlewidget.cpp | 2 +- examples/painting/concentriccircles/circlewidget.h | 2 +- examples/painting/concentriccircles/main.cpp | 2 +- examples/painting/concentriccircles/window.cpp | 2 +- examples/painting/concentriccircles/window.h | 2 +- examples/painting/fontsampler/main.cpp | 2 +- examples/painting/fontsampler/mainwindow.cpp | 2 +- examples/painting/fontsampler/mainwindow.h | 2 +- examples/painting/imagecomposition/imagecomposer.cpp | 2 +- examples/painting/imagecomposition/imagecomposer.h | 2 +- examples/painting/imagecomposition/main.cpp | 2 +- examples/painting/painterpaths/main.cpp | 2 +- examples/painting/painterpaths/renderarea.cpp | 2 +- examples/painting/painterpaths/renderarea.h | 2 +- examples/painting/painterpaths/window.cpp | 2 +- examples/painting/painterpaths/window.h | 2 +- examples/painting/svggenerator/displaywidget.cpp | 2 +- examples/painting/svggenerator/displaywidget.h | 2 +- examples/painting/svggenerator/main.cpp | 2 +- examples/painting/svggenerator/window.cpp | 2 +- examples/painting/svggenerator/window.h | 2 +- examples/painting/svgviewer/main.cpp | 2 +- examples/painting/svgviewer/mainwindow.cpp | 2 +- examples/painting/svgviewer/mainwindow.h | 2 +- examples/painting/svgviewer/svgview.cpp | 2 +- examples/painting/svgviewer/svgview.h | 2 +- examples/painting/transformations/main.cpp | 2 +- examples/painting/transformations/renderarea.cpp | 2 +- examples/painting/transformations/renderarea.h | 2 +- examples/painting/transformations/window.cpp | 2 +- examples/painting/transformations/window.h | 2 +- examples/phonon/capabilities/main.cpp | 2 +- examples/phonon/capabilities/window.cpp | 2 +- examples/phonon/capabilities/window.h | 2 +- examples/phonon/qmusicplayer/main.cpp | 2 +- examples/phonon/qmusicplayer/mainwindow.cpp | 2 +- examples/phonon/qmusicplayer/mainwindow.h | 2 +- examples/qmake/precompile/main.cpp | 2 +- examples/qmake/precompile/mydialog.cpp | 2 +- examples/qmake/precompile/mydialog.h | 2 +- examples/qmake/precompile/myobject.cpp | 2 +- examples/qmake/precompile/myobject.h | 2 +- examples/qmake/precompile/stable.h | 2 +- examples/qmake/precompile/util.cpp | 2 +- examples/qmake/tutorial/hello.cpp | 2 +- examples/qmake/tutorial/hello.h | 2 +- examples/qmake/tutorial/hellounix.cpp | 2 +- examples/qmake/tutorial/hellowin.cpp | 2 +- examples/qmake/tutorial/main.cpp | 2 +- examples/qtconcurrent/imagescaling/imagescaling.cpp | 2 +- examples/qtconcurrent/imagescaling/imagescaling.h | 2 +- examples/qtconcurrent/imagescaling/main.cpp | 2 +- examples/qtconcurrent/map/main.cpp | 2 +- examples/qtconcurrent/progressdialog/main.cpp | 2 +- examples/qtconcurrent/runfunction/main.cpp | 2 +- examples/qtconcurrent/wordcount/main.cpp | 2 +- examples/qtestlib/tutorial1/testqstring.cpp | 2 +- examples/qtestlib/tutorial2/testqstring.cpp | 2 +- examples/qtestlib/tutorial3/testgui.cpp | 2 +- examples/qtestlib/tutorial4/testgui.cpp | 2 +- examples/qtestlib/tutorial5/benchmarking.cpp | 2 +- examples/qws/dbscreen/dbscreen.cpp | 2 +- examples/qws/dbscreen/dbscreen.h | 2 +- examples/qws/dbscreen/dbscreendriverplugin.cpp | 2 +- examples/qws/framebuffer/main.c | 2 +- examples/qws/mousecalibration/calibration.cpp | 2 +- examples/qws/mousecalibration/calibration.h | 2 +- examples/qws/mousecalibration/main.cpp | 2 +- examples/qws/mousecalibration/scribblewidget.cpp | 2 +- examples/qws/mousecalibration/scribblewidget.h | 2 +- examples/qws/simpledecoration/analogclock.cpp | 2 +- examples/qws/simpledecoration/analogclock.h | 2 +- examples/qws/simpledecoration/main.cpp | 2 +- examples/qws/simpledecoration/mydecoration.cpp | 2 +- examples/qws/simpledecoration/mydecoration.h | 2 +- examples/qws/svgalib/svgalibpaintdevice.cpp | 2 +- examples/qws/svgalib/svgalibpaintdevice.h | 2 +- examples/qws/svgalib/svgalibpaintengine.cpp | 2 +- examples/qws/svgalib/svgalibpaintengine.h | 2 +- examples/qws/svgalib/svgalibplugin.cpp | 2 +- examples/qws/svgalib/svgalibscreen.cpp | 2 +- examples/qws/svgalib/svgalibscreen.h | 2 +- examples/qws/svgalib/svgalibsurface.cpp | 2 +- examples/qws/svgalib/svgalibsurface.h | 2 +- examples/richtext/calendar/main.cpp | 2 +- examples/richtext/calendar/mainwindow.cpp | 2 +- examples/richtext/calendar/mainwindow.h | 2 +- examples/richtext/orderform/detailsdialog.cpp | 2 +- examples/richtext/orderform/detailsdialog.h | 2 +- examples/richtext/orderform/main.cpp | 2 +- examples/richtext/orderform/mainwindow.cpp | 2 +- examples/richtext/orderform/mainwindow.h | 2 +- examples/richtext/syntaxhighlighter/highlighter.cpp | 2 +- examples/richtext/syntaxhighlighter/highlighter.h | 2 +- examples/richtext/syntaxhighlighter/main.cpp | 2 +- examples/richtext/syntaxhighlighter/mainwindow.cpp | 2 +- examples/richtext/syntaxhighlighter/mainwindow.h | 2 +- examples/richtext/textobject/main.cpp | 2 +- examples/richtext/textobject/svgtextobject.cpp | 2 +- examples/richtext/textobject/svgtextobject.h | 2 +- examples/richtext/textobject/window.cpp | 2 +- examples/richtext/textobject/window.h | 2 +- examples/script/calculator/main.cpp | 2 +- examples/script/context2d/context2d.cpp | 2 +- examples/script/context2d/context2d.h | 2 +- examples/script/context2d/domimage.cpp | 2 +- examples/script/context2d/domimage.h | 2 +- examples/script/context2d/environment.cpp | 2 +- examples/script/context2d/environment.h | 2 +- examples/script/context2d/main.cpp | 2 +- examples/script/context2d/qcontext2dcanvas.cpp | 2 +- examples/script/context2d/qcontext2dcanvas.h | 2 +- examples/script/context2d/window.cpp | 2 +- examples/script/context2d/window.h | 2 +- examples/script/customclass/bytearrayclass.cpp | 2 +- examples/script/customclass/bytearrayclass.h | 2 +- examples/script/customclass/bytearrayprototype.cpp | 2 +- examples/script/customclass/bytearrayprototype.h | 2 +- examples/script/customclass/main.cpp | 2 +- examples/script/defaultprototypes/main.cpp | 2 +- examples/script/defaultprototypes/prototypes.cpp | 2 +- examples/script/defaultprototypes/prototypes.h | 2 +- examples/script/helloscript/main.cpp | 2 +- examples/script/marshal/main.cpp | 2 +- examples/script/qscript/main.cpp | 2 +- examples/script/qsdbg/main.cpp | 2 +- examples/script/qsdbg/scriptbreakpointmanager.cpp | 2 +- examples/script/qsdbg/scriptbreakpointmanager.h | 2 +- examples/script/qsdbg/scriptdebugger.cpp | 2 +- examples/script/qsdbg/scriptdebugger.h | 2 +- examples/script/qstetrix/main.cpp | 2 +- examples/script/qstetrix/tetrixboard.cpp | 2 +- examples/script/qstetrix/tetrixboard.h | 2 +- examples/sql/cachedtable/main.cpp | 2 +- examples/sql/cachedtable/tableeditor.cpp | 2 +- examples/sql/cachedtable/tableeditor.h | 2 +- examples/sql/connection.h | 2 +- examples/sql/drilldown/imageitem.cpp | 2 +- examples/sql/drilldown/imageitem.h | 2 +- examples/sql/drilldown/informationwindow.cpp | 2 +- examples/sql/drilldown/informationwindow.h | 2 +- examples/sql/drilldown/main.cpp | 2 +- examples/sql/drilldown/view.cpp | 2 +- examples/sql/drilldown/view.h | 2 +- examples/sql/masterdetail/database.h | 2 +- examples/sql/masterdetail/dialog.cpp | 2 +- examples/sql/masterdetail/dialog.h | 2 +- examples/sql/masterdetail/main.cpp | 2 +- examples/sql/masterdetail/mainwindow.cpp | 2 +- examples/sql/masterdetail/mainwindow.h | 2 +- examples/sql/querymodel/customsqlmodel.cpp | 2 +- examples/sql/querymodel/customsqlmodel.h | 2 +- examples/sql/querymodel/editablesqlmodel.cpp | 2 +- examples/sql/querymodel/editablesqlmodel.h | 2 +- examples/sql/querymodel/main.cpp | 2 +- examples/sql/relationaltablemodel/relationaltablemodel.cpp | 2 +- examples/sql/sqlwidgetmapper/main.cpp | 2 +- examples/sql/sqlwidgetmapper/window.cpp | 2 +- examples/sql/sqlwidgetmapper/window.h | 2 +- examples/sql/tablemodel/tablemodel.cpp | 2 +- examples/statemachine/eventtransitions/main.cpp | 2 +- examples/statemachine/factorial/main.cpp | 2 +- examples/statemachine/pingpong/main.cpp | 2 +- examples/statemachine/rogue/main.cpp | 2 +- examples/statemachine/rogue/movementtransition.h | 2 +- examples/statemachine/rogue/window.cpp | 2 +- examples/statemachine/rogue/window.h | 2 +- examples/statemachine/trafficlight/main.cpp | 2 +- examples/statemachine/twowaybutton/main.cpp | 2 +- examples/threads/mandelbrot/main.cpp | 2 +- examples/threads/mandelbrot/mandelbrotwidget.cpp | 2 +- examples/threads/mandelbrot/mandelbrotwidget.h | 2 +- examples/threads/mandelbrot/renderthread.cpp | 2 +- examples/threads/mandelbrot/renderthread.h | 2 +- examples/threads/queuedcustomtype/block.cpp | 2 +- examples/threads/queuedcustomtype/block.h | 2 +- examples/threads/queuedcustomtype/main.cpp | 2 +- examples/threads/queuedcustomtype/renderthread.cpp | 2 +- examples/threads/queuedcustomtype/renderthread.h | 2 +- examples/threads/queuedcustomtype/window.cpp | 2 +- examples/threads/queuedcustomtype/window.h | 2 +- examples/threads/semaphores/semaphores.cpp | 2 +- examples/threads/waitconditions/waitconditions.cpp | 2 +- examples/tools/codecs/main.cpp | 2 +- examples/tools/codecs/mainwindow.cpp | 2 +- examples/tools/codecs/mainwindow.h | 2 +- examples/tools/codecs/previewform.cpp | 2 +- examples/tools/codecs/previewform.h | 2 +- examples/tools/completer/dirmodel.cpp | 2 +- examples/tools/completer/dirmodel.h | 2 +- examples/tools/completer/main.cpp | 2 +- examples/tools/completer/mainwindow.cpp | 2 +- examples/tools/completer/mainwindow.h | 2 +- examples/tools/contiguouscache/main.cpp | 2 +- examples/tools/contiguouscache/randomlistmodel.cpp | 2 +- examples/tools/contiguouscache/randomlistmodel.h | 2 +- examples/tools/customcompleter/main.cpp | 2 +- examples/tools/customcompleter/mainwindow.cpp | 2 +- examples/tools/customcompleter/mainwindow.h | 2 +- examples/tools/customcompleter/textedit.cpp | 2 +- examples/tools/customcompleter/textedit.h | 2 +- examples/tools/customtype/main.cpp | 2 +- examples/tools/customtype/message.cpp | 2 +- examples/tools/customtype/message.h | 2 +- examples/tools/customtypesending/main.cpp | 2 +- examples/tools/customtypesending/message.cpp | 2 +- examples/tools/customtypesending/message.h | 2 +- examples/tools/customtypesending/window.cpp | 2 +- examples/tools/customtypesending/window.h | 2 +- examples/tools/echoplugin/echowindow/echointerface.h | 2 +- examples/tools/echoplugin/echowindow/echowindow.cpp | 2 +- examples/tools/echoplugin/echowindow/echowindow.h | 2 +- examples/tools/echoplugin/echowindow/main.cpp | 2 +- examples/tools/echoplugin/plugin/echoplugin.cpp | 2 +- examples/tools/echoplugin/plugin/echoplugin.h | 2 +- examples/tools/i18n/languagechooser.cpp | 2 +- examples/tools/i18n/languagechooser.h | 2 +- examples/tools/i18n/main.cpp | 2 +- examples/tools/i18n/mainwindow.cpp | 2 +- examples/tools/i18n/mainwindow.h | 2 +- examples/tools/inputpanel/main.cpp | 2 +- examples/tools/inputpanel/myinputpanel.cpp | 2 +- examples/tools/inputpanel/myinputpanel.h | 2 +- examples/tools/inputpanel/myinputpanelcontext.cpp | 2 +- examples/tools/inputpanel/myinputpanelcontext.h | 2 +- examples/tools/plugandpaint/interfaces.h | 2 +- examples/tools/plugandpaint/main.cpp | 2 +- examples/tools/plugandpaint/mainwindow.cpp | 2 +- examples/tools/plugandpaint/mainwindow.h | 2 +- examples/tools/plugandpaint/paintarea.cpp | 2 +- examples/tools/plugandpaint/paintarea.h | 2 +- examples/tools/plugandpaint/plugindialog.cpp | 2 +- examples/tools/plugandpaint/plugindialog.h | 2 +- .../plugandpaintplugins/basictools/basictoolsplugin.cpp | 2 +- .../plugandpaintplugins/basictools/basictoolsplugin.h | 2 +- .../extrafilters/extrafiltersplugin.cpp | 2 +- .../plugandpaintplugins/extrafilters/extrafiltersplugin.h | 2 +- examples/tools/regexp/main.cpp | 2 +- examples/tools/regexp/regexpdialog.cpp | 2 +- examples/tools/regexp/regexpdialog.h | 2 +- examples/tools/settingseditor/locationdialog.cpp | 2 +- examples/tools/settingseditor/locationdialog.h | 2 +- examples/tools/settingseditor/main.cpp | 2 +- examples/tools/settingseditor/mainwindow.cpp | 2 +- examples/tools/settingseditor/mainwindow.h | 2 +- examples/tools/settingseditor/settingstree.cpp | 2 +- examples/tools/settingseditor/settingstree.h | 2 +- examples/tools/settingseditor/variantdelegate.cpp | 2 +- examples/tools/settingseditor/variantdelegate.h | 2 +- examples/tools/styleplugin/plugin/simplestyle.cpp | 2 +- examples/tools/styleplugin/plugin/simplestyle.h | 2 +- examples/tools/styleplugin/plugin/simplestyleplugin.cpp | 2 +- examples/tools/styleplugin/plugin/simplestyleplugin.h | 2 +- examples/tools/styleplugin/stylewindow/main.cpp | 2 +- examples/tools/styleplugin/stylewindow/stylewindow.cpp | 2 +- examples/tools/styleplugin/stylewindow/stylewindow.h | 2 +- examples/tools/treemodelcompleter/main.cpp | 2 +- examples/tools/treemodelcompleter/mainwindow.cpp | 2 +- examples/tools/treemodelcompleter/mainwindow.h | 2 +- examples/tools/treemodelcompleter/treemodelcompleter.cpp | 2 +- examples/tools/treemodelcompleter/treemodelcompleter.h | 2 +- examples/tools/undoframework/commands.cpp | 2 +- examples/tools/undoframework/commands.h | 2 +- examples/tools/undoframework/diagramitem.cpp | 2 +- examples/tools/undoframework/diagramitem.h | 2 +- examples/tools/undoframework/diagramscene.cpp | 2 +- examples/tools/undoframework/diagramscene.h | 2 +- examples/tools/undoframework/main.cpp | 2 +- examples/tools/undoframework/mainwindow.cpp | 2 +- examples/tools/undoframework/mainwindow.h | 2 +- examples/tutorials/addressbook-fr/part1/addressbook.cpp | 2 +- examples/tutorials/addressbook-fr/part1/addressbook.h | 2 +- examples/tutorials/addressbook-fr/part1/main.cpp | 2 +- examples/tutorials/addressbook-fr/part2/addressbook.cpp | 2 +- examples/tutorials/addressbook-fr/part2/addressbook.h | 2 +- examples/tutorials/addressbook-fr/part2/main.cpp | 2 +- examples/tutorials/addressbook-fr/part3/addressbook.cpp | 2 +- examples/tutorials/addressbook-fr/part3/addressbook.h | 2 +- examples/tutorials/addressbook-fr/part3/main.cpp | 2 +- examples/tutorials/addressbook-fr/part4/addressbook.cpp | 2 +- examples/tutorials/addressbook-fr/part4/addressbook.h | 2 +- examples/tutorials/addressbook-fr/part4/main.cpp | 2 +- examples/tutorials/addressbook-fr/part5/addressbook.cpp | 2 +- examples/tutorials/addressbook-fr/part5/addressbook.h | 2 +- examples/tutorials/addressbook-fr/part5/finddialog.cpp | 2 +- examples/tutorials/addressbook-fr/part5/finddialog.h | 2 +- examples/tutorials/addressbook-fr/part5/main.cpp | 2 +- examples/tutorials/addressbook-fr/part6/addressbook.cpp | 2 +- examples/tutorials/addressbook-fr/part6/addressbook.h | 2 +- examples/tutorials/addressbook-fr/part6/finddialog.cpp | 2 +- examples/tutorials/addressbook-fr/part6/finddialog.h | 2 +- examples/tutorials/addressbook-fr/part6/main.cpp | 2 +- examples/tutorials/addressbook-fr/part7/addressbook.cpp | 2 +- examples/tutorials/addressbook-fr/part7/addressbook.h | 2 +- examples/tutorials/addressbook-fr/part7/finddialog.cpp | 2 +- examples/tutorials/addressbook-fr/part7/finddialog.h | 2 +- examples/tutorials/addressbook-fr/part7/main.cpp | 2 +- examples/tutorials/addressbook/part1/addressbook.cpp | 2 +- examples/tutorials/addressbook/part1/addressbook.h | 2 +- examples/tutorials/addressbook/part1/main.cpp | 2 +- examples/tutorials/addressbook/part2/addressbook.cpp | 2 +- examples/tutorials/addressbook/part2/addressbook.h | 2 +- examples/tutorials/addressbook/part2/main.cpp | 2 +- examples/tutorials/addressbook/part3/addressbook.cpp | 2 +- examples/tutorials/addressbook/part3/addressbook.h | 2 +- examples/tutorials/addressbook/part3/main.cpp | 2 +- examples/tutorials/addressbook/part4/addressbook.cpp | 2 +- examples/tutorials/addressbook/part4/addressbook.h | 2 +- examples/tutorials/addressbook/part4/main.cpp | 2 +- examples/tutorials/addressbook/part5/addressbook.cpp | 2 +- examples/tutorials/addressbook/part5/addressbook.h | 2 +- examples/tutorials/addressbook/part5/finddialog.cpp | 2 +- examples/tutorials/addressbook/part5/finddialog.h | 2 +- examples/tutorials/addressbook/part5/main.cpp | 2 +- examples/tutorials/addressbook/part6/addressbook.cpp | 2 +- examples/tutorials/addressbook/part6/addressbook.h | 2 +- examples/tutorials/addressbook/part6/finddialog.cpp | 2 +- examples/tutorials/addressbook/part6/finddialog.h | 2 +- examples/tutorials/addressbook/part6/main.cpp | 2 +- examples/tutorials/addressbook/part7/addressbook.cpp | 2 +- examples/tutorials/addressbook/part7/addressbook.h | 2 +- examples/tutorials/addressbook/part7/finddialog.cpp | 2 +- examples/tutorials/addressbook/part7/finddialog.h | 2 +- examples/tutorials/addressbook/part7/main.cpp | 2 +- examples/tutorials/widgets/childwidget/main.cpp | 2 +- examples/tutorials/widgets/nestedlayouts/main.cpp | 2 +- examples/tutorials/widgets/toplevel/main.cpp | 2 +- examples/tutorials/widgets/windowlayout/main.cpp | 2 +- examples/uitools/multipleinheritance/calculatorform.cpp | 2 +- examples/uitools/multipleinheritance/calculatorform.h | 2 +- examples/uitools/multipleinheritance/main.cpp | 2 +- examples/uitools/textfinder/main.cpp | 2 +- examples/uitools/textfinder/textfinder.cpp | 2 +- examples/uitools/textfinder/textfinder.h | 2 +- examples/webkit/domtraversal/main.cpp | 2 +- examples/webkit/domtraversal/window.cpp | 2 +- examples/webkit/domtraversal/window.h | 2 +- examples/webkit/fancybrowser/main.cpp | 2 +- examples/webkit/fancybrowser/mainwindow.cpp | 2 +- examples/webkit/fancybrowser/mainwindow.h | 2 +- examples/webkit/formextractor/formextractor.cpp | 2 +- examples/webkit/formextractor/formextractor.h | 2 +- examples/webkit/formextractor/main.cpp | 2 +- examples/webkit/formextractor/mainwindow.cpp | 2 +- examples/webkit/formextractor/mainwindow.h | 2 +- examples/webkit/framecapture/framecapture.cpp | 2 +- examples/webkit/framecapture/framecapture.h | 2 +- examples/webkit/framecapture/main.cpp | 2 +- examples/webkit/googlechat/googlechat.cpp | 2 +- examples/webkit/googlechat/googlechat.h | 2 +- examples/webkit/googlechat/main.cpp | 2 +- examples/webkit/previewer/main.cpp | 2 +- examples/webkit/previewer/mainwindow.cpp | 2 +- examples/webkit/previewer/mainwindow.h | 2 +- examples/webkit/previewer/previewer.cpp | 2 +- examples/webkit/previewer/previewer.h | 2 +- examples/webkit/simpleselector/main.cpp | 2 +- examples/webkit/simpleselector/window.cpp | 2 +- examples/webkit/simpleselector/window.h | 2 +- examples/widgets/analogclock/analogclock.cpp | 2 +- examples/widgets/analogclock/analogclock.h | 2 +- examples/widgets/analogclock/main.cpp | 2 +- examples/widgets/calculator/button.cpp | 2 +- examples/widgets/calculator/button.h | 2 +- examples/widgets/calculator/calculator.cpp | 2 +- examples/widgets/calculator/calculator.h | 2 +- examples/widgets/calculator/main.cpp | 2 +- examples/widgets/calendarwidget/main.cpp | 2 +- examples/widgets/calendarwidget/window.cpp | 2 +- examples/widgets/calendarwidget/window.h | 2 +- examples/widgets/charactermap/characterwidget.cpp | 2 +- examples/widgets/charactermap/characterwidget.h | 2 +- examples/widgets/charactermap/main.cpp | 2 +- examples/widgets/charactermap/mainwindow.cpp | 2 +- examples/widgets/charactermap/mainwindow.h | 2 +- examples/widgets/codeeditor/codeeditor.cpp | 2 +- examples/widgets/codeeditor/codeeditor.h | 2 +- examples/widgets/codeeditor/main.cpp | 2 +- examples/widgets/digitalclock/digitalclock.cpp | 2 +- examples/widgets/digitalclock/digitalclock.h | 2 +- examples/widgets/digitalclock/main.cpp | 2 +- examples/widgets/groupbox/main.cpp | 2 +- examples/widgets/groupbox/window.cpp | 2 +- examples/widgets/groupbox/window.h | 2 +- examples/widgets/icons/iconpreviewarea.cpp | 2 +- examples/widgets/icons/iconpreviewarea.h | 2 +- examples/widgets/icons/iconsizespinbox.cpp | 2 +- examples/widgets/icons/iconsizespinbox.h | 2 +- examples/widgets/icons/imagedelegate.cpp | 2 +- examples/widgets/icons/imagedelegate.h | 2 +- examples/widgets/icons/main.cpp | 2 +- examples/widgets/icons/mainwindow.cpp | 2 +- examples/widgets/icons/mainwindow.h | 2 +- examples/widgets/imageviewer/imageviewer.cpp | 2 +- examples/widgets/imageviewer/imageviewer.h | 2 +- examples/widgets/imageviewer/main.cpp | 2 +- examples/widgets/lineedits/main.cpp | 2 +- examples/widgets/lineedits/window.cpp | 2 +- examples/widgets/lineedits/window.h | 2 +- examples/widgets/movie/main.cpp | 2 +- examples/widgets/movie/movieplayer.cpp | 2 +- examples/widgets/movie/movieplayer.h | 2 +- examples/widgets/scribble/main.cpp | 2 +- examples/widgets/scribble/mainwindow.cpp | 2 +- examples/widgets/scribble/mainwindow.h | 2 +- examples/widgets/scribble/scribblearea.cpp | 2 +- examples/widgets/scribble/scribblearea.h | 2 +- examples/widgets/shapedclock/main.cpp | 2 +- examples/widgets/shapedclock/shapedclock.cpp | 2 +- examples/widgets/shapedclock/shapedclock.h | 2 +- examples/widgets/sliders/main.cpp | 2 +- examples/widgets/sliders/slidersgroup.cpp | 2 +- examples/widgets/sliders/slidersgroup.h | 2 +- examples/widgets/sliders/window.cpp | 2 +- examples/widgets/sliders/window.h | 2 +- examples/widgets/softkeys/main.cpp | 2 +- examples/widgets/softkeys/softkeys.cpp | 2 +- examples/widgets/softkeys/softkeys.h | 2 +- examples/widgets/spinboxes/main.cpp | 2 +- examples/widgets/spinboxes/window.cpp | 2 +- examples/widgets/spinboxes/window.h | 2 +- examples/widgets/styles/main.cpp | 2 +- examples/widgets/styles/norwegianwoodstyle.cpp | 2 +- examples/widgets/styles/norwegianwoodstyle.h | 2 +- examples/widgets/styles/widgetgallery.cpp | 2 +- examples/widgets/styles/widgetgallery.h | 2 +- examples/widgets/stylesheet/main.cpp | 2 +- examples/widgets/stylesheet/mainwindow.cpp | 2 +- examples/widgets/stylesheet/mainwindow.h | 2 +- examples/widgets/stylesheet/stylesheeteditor.cpp | 2 +- examples/widgets/stylesheet/stylesheeteditor.h | 2 +- examples/widgets/tablet/main.cpp | 2 +- examples/widgets/tablet/mainwindow.cpp | 2 +- examples/widgets/tablet/mainwindow.h | 2 +- examples/widgets/tablet/tabletapplication.cpp | 2 +- examples/widgets/tablet/tabletapplication.h | 2 +- examples/widgets/tablet/tabletcanvas.cpp | 2 +- examples/widgets/tablet/tabletcanvas.h | 2 +- examples/widgets/tetrix/main.cpp | 2 +- examples/widgets/tetrix/tetrixboard.cpp | 2 +- examples/widgets/tetrix/tetrixboard.h | 2 +- examples/widgets/tetrix/tetrixpiece.cpp | 2 +- examples/widgets/tetrix/tetrixpiece.h | 2 +- examples/widgets/tetrix/tetrixwindow.cpp | 2 +- examples/widgets/tetrix/tetrixwindow.h | 2 +- examples/widgets/tooltips/main.cpp | 2 +- examples/widgets/tooltips/shapeitem.cpp | 2 +- examples/widgets/tooltips/shapeitem.h | 2 +- examples/widgets/tooltips/sortingbox.cpp | 2 +- examples/widgets/tooltips/sortingbox.h | 2 +- examples/widgets/validators/ledwidget.cpp | 2 +- examples/widgets/validators/ledwidget.h | 2 +- examples/widgets/validators/localeselector.cpp | 2 +- examples/widgets/validators/localeselector.h | 2 +- examples/widgets/validators/main.cpp | 2 +- examples/widgets/wiggly/dialog.cpp | 2 +- examples/widgets/wiggly/dialog.h | 2 +- examples/widgets/wiggly/main.cpp | 2 +- examples/widgets/wiggly/wigglywidget.cpp | 2 +- examples/widgets/wiggly/wigglywidget.h | 2 +- examples/widgets/windowflags/controllerwindow.cpp | 2 +- examples/widgets/windowflags/controllerwindow.h | 2 +- examples/widgets/windowflags/main.cpp | 2 +- examples/widgets/windowflags/previewwindow.cpp | 2 +- examples/widgets/windowflags/previewwindow.h | 2 +- examples/xml/dombookmarks/main.cpp | 2 +- examples/xml/dombookmarks/mainwindow.cpp | 2 +- examples/xml/dombookmarks/mainwindow.h | 2 +- examples/xml/dombookmarks/xbeltree.cpp | 2 +- examples/xml/dombookmarks/xbeltree.h | 2 +- examples/xml/htmlinfo/main.cpp | 2 +- examples/xml/rsslisting/main.cpp | 2 +- examples/xml/rsslisting/rsslisting.cpp | 2 +- examples/xml/rsslisting/rsslisting.h | 2 +- examples/xml/saxbookmarks/main.cpp | 2 +- examples/xml/saxbookmarks/mainwindow.cpp | 2 +- examples/xml/saxbookmarks/mainwindow.h | 2 +- examples/xml/saxbookmarks/xbelgenerator.cpp | 2 +- examples/xml/saxbookmarks/xbelgenerator.h | 2 +- examples/xml/saxbookmarks/xbelhandler.cpp | 2 +- examples/xml/saxbookmarks/xbelhandler.h | 2 +- examples/xml/streambookmarks/main.cpp | 2 +- examples/xml/streambookmarks/mainwindow.cpp | 2 +- examples/xml/streambookmarks/mainwindow.h | 2 +- examples/xml/streambookmarks/xbelreader.cpp | 2 +- examples/xml/streambookmarks/xbelreader.h | 2 +- examples/xml/streambookmarks/xbelwriter.cpp | 2 +- examples/xml/streambookmarks/xbelwriter.h | 2 +- examples/xml/xmlstreamlint/main.cpp | 2 +- examples/xmlpatterns/filetree/filetree.cpp | 2 +- examples/xmlpatterns/filetree/filetree.h | 2 +- examples/xmlpatterns/filetree/main.cpp | 2 +- examples/xmlpatterns/filetree/mainwindow.cpp | 2 +- examples/xmlpatterns/filetree/mainwindow.h | 2 +- examples/xmlpatterns/qobjectxmlmodel/main.cpp | 2 +- examples/xmlpatterns/qobjectxmlmodel/mainwindow.cpp | 2 +- examples/xmlpatterns/qobjectxmlmodel/mainwindow.h | 2 +- examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp | 2 +- examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h | 2 +- examples/xmlpatterns/recipes/main.cpp | 2 +- examples/xmlpatterns/recipes/querymainwindow.cpp | 2 +- examples/xmlpatterns/recipes/querymainwindow.h | 2 +- examples/xmlpatterns/schema/main.cpp | 2 +- examples/xmlpatterns/schema/mainwindow.cpp | 2 +- examples/xmlpatterns/schema/mainwindow.h | 2 +- examples/xmlpatterns/shared/xmlsyntaxhighlighter.cpp | 2 +- examples/xmlpatterns/shared/xmlsyntaxhighlighter.h | 2 +- examples/xmlpatterns/trafficinfo/main.cpp | 2 +- examples/xmlpatterns/trafficinfo/mainwindow.cpp | 2 +- examples/xmlpatterns/trafficinfo/mainwindow.h | 2 +- examples/xmlpatterns/trafficinfo/stationdialog.cpp | 2 +- examples/xmlpatterns/trafficinfo/stationdialog.h | 2 +- examples/xmlpatterns/trafficinfo/stationquery.cpp | 2 +- examples/xmlpatterns/trafficinfo/stationquery.h | 2 +- examples/xmlpatterns/trafficinfo/timequery.cpp | 2 +- examples/xmlpatterns/trafficinfo/timequery.h | 2 +- examples/xmlpatterns/xquery/globalVariables/globals.cpp | 2 +- header.BSD | 2 +- header.LGPL | 2 +- header.LGPL-ONLY | 2 +- mkspecs/aix-g++-64/qplatformdefs.h | 2 +- mkspecs/aix-g++/qplatformdefs.h | 2 +- mkspecs/aix-xlc-64/qplatformdefs.h | 2 +- mkspecs/aix-xlc/qplatformdefs.h | 2 +- mkspecs/common/symbian/qplatformdefs.h | 2 +- mkspecs/common/wince/qplatformdefs.h | 2 +- mkspecs/cygwin-g++/qplatformdefs.h | 2 +- mkspecs/darwin-g++/qplatformdefs.h | 2 +- mkspecs/freebsd-g++/qplatformdefs.h | 2 +- mkspecs/freebsd-g++34/qplatformdefs.h | 2 +- mkspecs/freebsd-g++40/qplatformdefs.h | 2 +- mkspecs/freebsd-icc/qplatformdefs.h | 2 +- mkspecs/hpux-acc-64/qplatformdefs.h | 2 +- mkspecs/hpux-acc-o64/qplatformdefs.h | 2 +- mkspecs/hpux-acc/qplatformdefs.h | 2 +- mkspecs/hpux-g++-64/qplatformdefs.h | 2 +- mkspecs/hpux-g++/qplatformdefs.h | 2 +- mkspecs/hpuxi-acc-32/qplatformdefs.h | 2 +- mkspecs/hpuxi-acc-64/qplatformdefs.h | 2 +- mkspecs/hpuxi-g++-64/qplatformdefs.h | 2 +- mkspecs/hurd-g++/qplatformdefs.h | 2 +- mkspecs/irix-cc-64/qplatformdefs.h | 2 +- mkspecs/irix-cc/qplatformdefs.h | 2 +- mkspecs/irix-g++-64/qplatformdefs.h | 2 +- mkspecs/irix-g++/qplatformdefs.h | 2 +- mkspecs/linux-cxx/qplatformdefs.h | 2 +- mkspecs/linux-ecc-64/qplatformdefs.h | 2 +- mkspecs/linux-g++-32/qplatformdefs.h | 2 +- mkspecs/linux-g++-64/qplatformdefs.h | 2 +- mkspecs/linux-g++-maemo/qplatformdefs.h | 2 +- mkspecs/linux-g++/qplatformdefs.h | 2 +- mkspecs/linux-icc-32/qplatformdefs.h | 2 +- mkspecs/linux-icc-64/qplatformdefs.h | 2 +- mkspecs/linux-icc/qplatformdefs.h | 2 +- mkspecs/linux-kcc/qplatformdefs.h | 2 +- mkspecs/linux-llvm/qplatformdefs.h | 2 +- mkspecs/linux-lsb-g++/qplatformdefs.h | 2 +- mkspecs/linux-pgcc/qplatformdefs.h | 2 +- mkspecs/lynxos-g++/qplatformdefs.h | 2 +- mkspecs/macx-g++/qplatformdefs.h | 2 +- mkspecs/macx-g++40/qplatformdefs.h | 2 +- mkspecs/macx-g++42/qplatformdefs.h | 2 +- mkspecs/macx-icc/qplatformdefs.h | 2 +- mkspecs/macx-llvm/qplatformdefs.h | 2 +- mkspecs/macx-pbuilder/qplatformdefs.h | 2 +- mkspecs/macx-xcode/qplatformdefs.h | 2 +- mkspecs/macx-xlc/qplatformdefs.h | 2 +- mkspecs/netbsd-g++/qplatformdefs.h | 2 +- mkspecs/openbsd-g++/qplatformdefs.h | 2 +- mkspecs/qws/freebsd-generic-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-arm-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-armv6-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-avr32-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-cellon-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-dm7000-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-dm800-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-generic-g++-32/qplatformdefs.h | 2 +- mkspecs/qws/linux-generic-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-ipaq-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-lsb-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-mips-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-powerpc-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-sh-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-sh4al-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-sharp-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-x86-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-x86_64-g++/qplatformdefs.h | 2 +- mkspecs/qws/linux-zylonite-g++/qplatformdefs.h | 2 +- mkspecs/qws/macx-generic-g++/qplatformdefs.h | 2 +- mkspecs/qws/solaris-generic-g++/qplatformdefs.h | 2 +- mkspecs/sco-cc/qplatformdefs.h | 2 +- mkspecs/sco-g++/qplatformdefs.h | 2 +- mkspecs/solaris-cc-64-stlport/qplatformdefs.h | 2 +- mkspecs/solaris-cc-64/qplatformdefs.h | 2 +- mkspecs/solaris-cc-stlport/qplatformdefs.h | 2 +- mkspecs/solaris-cc/qplatformdefs.h | 2 +- mkspecs/solaris-g++-64/qplatformdefs.h | 2 +- mkspecs/solaris-g++/qplatformdefs.h | 2 +- mkspecs/symbian-abld/qplatformdefs.h | 2 +- mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm | 2 +- mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm | 2 +- mkspecs/symbian-sbsv2/flm/qt/qmake_post_link.flm | 2 +- mkspecs/symbian-sbsv2/flm/qt/qmake_store_build.flm | 2 +- mkspecs/symbian-sbsv2/flm/qt/qt.xml | 2 +- mkspecs/symbian-sbsv2/qplatformdefs.h | 2 +- mkspecs/tru64-cxx/qplatformdefs.h | 2 +- mkspecs/tru64-g++/qplatformdefs.h | 2 +- mkspecs/unixware-cc/qplatformdefs.h | 2 +- mkspecs/unixware-g++/qplatformdefs.h | 2 +- mkspecs/unsupported/linux-host-g++/qplatformdefs.h | 2 +- mkspecs/unsupported/linux-scratchbox2-g++/qplatformdefs.h | 2 +- mkspecs/unsupported/qnx-g++/qplatformdefs.h | 2 +- mkspecs/unsupported/qws/qnx-generic-g++/qplatformdefs.h | 2 +- mkspecs/unsupported/qws/qnx-i386-g++/qplatformdefs.h | 2 +- mkspecs/unsupported/qws/qnx-ppc-g++/qplatformdefs.h | 2 +- mkspecs/unsupported/vxworks-ppc-dcc/qplatformdefs.h | 2 +- mkspecs/unsupported/vxworks-ppc-g++/qplatformdefs.h | 2 +- mkspecs/unsupported/vxworks-simpentium-dcc/qplatformdefs.h | 2 +- mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h | 2 +- mkspecs/win32-borland/qplatformdefs.h | 2 +- mkspecs/win32-g++/qplatformdefs.h | 2 +- mkspecs/win32-icc/qplatformdefs.h | 2 +- mkspecs/win32-msvc.net/qplatformdefs.h | 2 +- mkspecs/win32-msvc/qplatformdefs.h | 2 +- mkspecs/win32-msvc2002/qplatformdefs.h | 2 +- mkspecs/win32-msvc2003/qplatformdefs.h | 2 +- mkspecs/win32-msvc2005/qplatformdefs.h | 2 +- mkspecs/win32-msvc2008/qplatformdefs.h | 2 +- mkspecs/wince50standard-armv4i-msvc2005/qplatformdefs.h | 2 +- mkspecs/wince50standard-armv4i-msvc2008/qplatformdefs.h | 2 +- mkspecs/wince50standard-mipsii-msvc2005/qplatformdefs.h | 2 +- mkspecs/wince50standard-mipsii-msvc2008/qplatformdefs.h | 2 +- mkspecs/wince50standard-mipsiv-msvc2005/qplatformdefs.h | 2 +- mkspecs/wince50standard-mipsiv-msvc2008/qplatformdefs.h | 2 +- mkspecs/wince50standard-sh4-msvc2005/qplatformdefs.h | 2 +- mkspecs/wince50standard-sh4-msvc2008/qplatformdefs.h | 2 +- mkspecs/wince50standard-x86-msvc2005/qplatformdefs.h | 2 +- mkspecs/wince50standard-x86-msvc2008/qplatformdefs.h | 2 +- mkspecs/wince60standard-armv4i-msvc2005/qplatformdefs.h | 2 +- mkspecs/wince60standard-x86-msvc2005/qplatformdefs.h | 2 +- mkspecs/wincewm50pocket-msvc2005/qplatformdefs.h | 2 +- mkspecs/wincewm50pocket-msvc2008/qplatformdefs.h | 2 +- mkspecs/wincewm50smart-msvc2005/qplatformdefs.h | 2 +- mkspecs/wincewm50smart-msvc2008/qplatformdefs.h | 2 +- mkspecs/wincewm60professional-msvc2005/qplatformdefs.h | 2 +- mkspecs/wincewm60professional-msvc2008/qplatformdefs.h | 2 +- mkspecs/wincewm60standard-msvc2005/qplatformdefs.h | 2 +- mkspecs/wincewm60standard-msvc2008/qplatformdefs.h | 2 +- mkspecs/wincewm65professional-msvc2005/qplatformdefs.h | 2 +- mkspecs/wincewm65professional-msvc2008/qplatformdefs.h | 2 +- qmake/cachekeys.h | 2 +- qmake/generators/mac/pbuilder_pbx.cpp | 2 +- qmake/generators/mac/pbuilder_pbx.h | 2 +- qmake/generators/makefile.cpp | 2 +- qmake/generators/makefile.h | 2 +- qmake/generators/makefiledeps.cpp | 2 +- qmake/generators/makefiledeps.h | 2 +- qmake/generators/metamakefile.cpp | 2 +- qmake/generators/metamakefile.h | 2 +- qmake/generators/projectgenerator.cpp | 2 +- qmake/generators/projectgenerator.h | 2 +- qmake/generators/symbian/initprojectdeploy_symbian.cpp | 2 +- qmake/generators/symbian/initprojectdeploy_symbian.h | 2 +- qmake/generators/symbian/symmake.cpp | 2 +- qmake/generators/symbian/symmake.h | 2 +- qmake/generators/symbian/symmake_abld.cpp | 2 +- qmake/generators/symbian/symmake_abld.h | 2 +- qmake/generators/symbian/symmake_sbsv2.cpp | 2 +- qmake/generators/symbian/symmake_sbsv2.h | 2 +- qmake/generators/unix/unixmake.cpp | 2 +- qmake/generators/unix/unixmake.h | 2 +- qmake/generators/unix/unixmake2.cpp | 2 +- qmake/generators/win32/borland_bmake.cpp | 2 +- qmake/generators/win32/borland_bmake.h | 2 +- qmake/generators/win32/mingw_make.cpp | 2 +- qmake/generators/win32/mingw_make.h | 2 +- qmake/generators/win32/msvc_dsp.cpp | 2 +- qmake/generators/win32/msvc_dsp.h | 2 +- qmake/generators/win32/msvc_nmake.cpp | 2 +- qmake/generators/win32/msvc_nmake.h | 2 +- qmake/generators/win32/msvc_objectmodel.cpp | 2 +- qmake/generators/win32/msvc_objectmodel.h | 2 +- qmake/generators/win32/msvc_vcproj.cpp | 2 +- qmake/generators/win32/msvc_vcproj.h | 2 +- qmake/generators/win32/winmakefile.cpp | 2 +- qmake/generators/win32/winmakefile.h | 2 +- qmake/generators/xmloutput.cpp | 2 +- qmake/generators/xmloutput.h | 2 +- qmake/main.cpp | 2 +- qmake/meta.cpp | 2 +- qmake/meta.h | 2 +- qmake/option.cpp | 2 +- qmake/option.h | 2 +- qmake/project.cpp | 2 +- qmake/project.h | 2 +- qmake/property.cpp | 2 +- qmake/property.h | 2 +- qmake/qmake_pch.h | 2 +- src/3rdparty/harfbuzz/src/harfbuzz-greek.c | 2 +- src/3rdparty/s60/eiksoftkeyimage.h | 2 +- .../JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.cpp | 2 +- .../JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.h | 2 +- src/activeqt/container/qaxbase.cpp | 2 +- src/activeqt/container/qaxbase.h | 2 +- src/activeqt/container/qaxdump.cpp | 2 +- src/activeqt/container/qaxobject.cpp | 2 +- src/activeqt/container/qaxobject.h | 2 +- src/activeqt/container/qaxscript.cpp | 2 +- src/activeqt/container/qaxscript.h | 2 +- src/activeqt/container/qaxscriptwrapper.cpp | 2 +- src/activeqt/container/qaxselect.cpp | 2 +- src/activeqt/container/qaxselect.h | 2 +- src/activeqt/container/qaxselect.ui | 2 +- src/activeqt/container/qaxwidget.cpp | 2 +- src/activeqt/container/qaxwidget.h | 2 +- src/activeqt/control/qaxaggregated.h | 2 +- src/activeqt/control/qaxbindable.cpp | 2 +- src/activeqt/control/qaxbindable.h | 2 +- src/activeqt/control/qaxfactory.cpp | 2 +- src/activeqt/control/qaxfactory.h | 2 +- src/activeqt/control/qaxmain.cpp | 2 +- src/activeqt/control/qaxserver.cpp | 2 +- src/activeqt/control/qaxserverbase.cpp | 2 +- src/activeqt/control/qaxserverdll.cpp | 2 +- src/activeqt/control/qaxservermain.cpp | 2 +- src/activeqt/shared/qaxtypes.cpp | 2 +- src/activeqt/shared/qaxtypes.h | 2 +- src/corelib/animation/qabstractanimation.cpp | 2 +- src/corelib/animation/qabstractanimation.h | 2 +- src/corelib/animation/qabstractanimation_p.h | 2 +- src/corelib/animation/qanimationgroup.cpp | 2 +- src/corelib/animation/qanimationgroup.h | 2 +- src/corelib/animation/qanimationgroup_p.h | 2 +- src/corelib/animation/qparallelanimationgroup.cpp | 2 +- src/corelib/animation/qparallelanimationgroup.h | 2 +- src/corelib/animation/qparallelanimationgroup_p.h | 2 +- src/corelib/animation/qpauseanimation.cpp | 2 +- src/corelib/animation/qpauseanimation.h | 2 +- src/corelib/animation/qpropertyanimation.cpp | 2 +- src/corelib/animation/qpropertyanimation.h | 2 +- src/corelib/animation/qpropertyanimation_p.h | 2 +- src/corelib/animation/qsequentialanimationgroup.cpp | 2 +- src/corelib/animation/qsequentialanimationgroup.h | 2 +- src/corelib/animation/qsequentialanimationgroup_p.h | 2 +- src/corelib/animation/qvariantanimation.cpp | 2 +- src/corelib/animation/qvariantanimation.h | 2 +- src/corelib/animation/qvariantanimation_p.h | 2 +- src/corelib/arch/alpha/qatomic_alpha.s | 2 +- src/corelib/arch/arm/qatomic_arm.cpp | 2 +- src/corelib/arch/armv6/qatomic_generic_armv6.cpp | 2 +- src/corelib/arch/generic/qatomic_generic_unix.cpp | 2 +- src/corelib/arch/generic/qatomic_generic_windows.cpp | 2 +- src/corelib/arch/ia64/qatomic_ia64.s | 2 +- src/corelib/arch/macosx/qatomic32_ppc.s | 2 +- src/corelib/arch/mips/qatomic_mips32.s | 2 +- src/corelib/arch/mips/qatomic_mips64.s | 2 +- src/corelib/arch/parisc/q_ldcw.s | 2 +- src/corelib/arch/parisc/qatomic_parisc.cpp | 2 +- src/corelib/arch/powerpc/qatomic32.s | 2 +- src/corelib/arch/powerpc/qatomic64.s | 2 +- src/corelib/arch/qatomic_alpha.h | 2 +- src/corelib/arch/qatomic_arch.h | 2 +- src/corelib/arch/qatomic_arm.h | 2 +- src/corelib/arch/qatomic_armv6.h | 2 +- src/corelib/arch/qatomic_avr32.h | 2 +- src/corelib/arch/qatomic_bfin.h | 2 +- src/corelib/arch/qatomic_bootstrap.h | 2 +- src/corelib/arch/qatomic_generic.h | 2 +- src/corelib/arch/qatomic_i386.h | 2 +- src/corelib/arch/qatomic_ia64.h | 2 +- src/corelib/arch/qatomic_macosx.h | 2 +- src/corelib/arch/qatomic_mips.h | 2 +- src/corelib/arch/qatomic_parisc.h | 2 +- src/corelib/arch/qatomic_powerpc.h | 2 +- src/corelib/arch/qatomic_s390.h | 2 +- src/corelib/arch/qatomic_sh.h | 2 +- src/corelib/arch/qatomic_sh4a.h | 2 +- src/corelib/arch/qatomic_sparc.h | 2 +- src/corelib/arch/qatomic_symbian.h | 2 +- src/corelib/arch/qatomic_vxworks.h | 2 +- src/corelib/arch/qatomic_windows.h | 2 +- src/corelib/arch/qatomic_windowsce.h | 2 +- src/corelib/arch/qatomic_x86_64.h | 2 +- src/corelib/arch/sh/qatomic_sh.cpp | 2 +- src/corelib/arch/sparc/qatomic32.s | 2 +- src/corelib/arch/sparc/qatomic64.s | 2 +- src/corelib/arch/sparc/qatomic_sparc.cpp | 2 +- src/corelib/arch/symbian/qatomic_symbian.cpp | 2 +- src/corelib/codecs/codecs.qdoc | 2 +- src/corelib/codecs/qfontlaocodec.cpp | 2 +- src/corelib/codecs/qfontlaocodec_p.h | 2 +- src/corelib/codecs/qiconvcodec.cpp | 2 +- src/corelib/codecs/qiconvcodec_p.h | 2 +- src/corelib/codecs/qisciicodec.cpp | 2 +- src/corelib/codecs/qisciicodec_p.h | 2 +- src/corelib/codecs/qlatincodec.cpp | 2 +- src/corelib/codecs/qlatincodec_p.h | 2 +- src/corelib/codecs/qsimplecodec.cpp | 2 +- src/corelib/codecs/qsimplecodec_p.h | 2 +- src/corelib/codecs/qtextcodec.cpp | 2 +- src/corelib/codecs/qtextcodec.h | 2 +- src/corelib/codecs/qtextcodec_p.h | 2 +- src/corelib/codecs/qtextcodecplugin.cpp | 2 +- src/corelib/codecs/qtextcodecplugin.h | 2 +- src/corelib/codecs/qtsciicodec.cpp | 2 +- src/corelib/codecs/qtsciicodec_p.h | 2 +- src/corelib/codecs/qutfcodec.cpp | 2 +- src/corelib/codecs/qutfcodec_p.h | 2 +- src/corelib/concurrent/qfuture.cpp | 2 +- src/corelib/concurrent/qfuture.h | 2 +- src/corelib/concurrent/qfutureinterface.cpp | 2 +- src/corelib/concurrent/qfutureinterface.h | 2 +- src/corelib/concurrent/qfutureinterface_p.h | 2 +- src/corelib/concurrent/qfuturesynchronizer.cpp | 2 +- src/corelib/concurrent/qfuturesynchronizer.h | 2 +- src/corelib/concurrent/qfuturewatcher.cpp | 2 +- src/corelib/concurrent/qfuturewatcher.h | 2 +- src/corelib/concurrent/qfuturewatcher_p.h | 2 +- src/corelib/concurrent/qrunnable.cpp | 2 +- src/corelib/concurrent/qrunnable.h | 2 +- src/corelib/concurrent/qtconcurrentcompilertest.h | 2 +- src/corelib/concurrent/qtconcurrentexception.cpp | 2 +- src/corelib/concurrent/qtconcurrentexception.h | 2 +- src/corelib/concurrent/qtconcurrentfilter.cpp | 2 +- src/corelib/concurrent/qtconcurrentfilter.h | 2 +- src/corelib/concurrent/qtconcurrentfilterkernel.h | 2 +- src/corelib/concurrent/qtconcurrentfunctionwrappers.h | 2 +- src/corelib/concurrent/qtconcurrentiteratekernel.cpp | 2 +- src/corelib/concurrent/qtconcurrentiteratekernel.h | 2 +- src/corelib/concurrent/qtconcurrentmap.cpp | 2 +- src/corelib/concurrent/qtconcurrentmap.h | 2 +- src/corelib/concurrent/qtconcurrentmapkernel.h | 2 +- src/corelib/concurrent/qtconcurrentmedian.h | 2 +- src/corelib/concurrent/qtconcurrentreducekernel.h | 2 +- src/corelib/concurrent/qtconcurrentresultstore.cpp | 2 +- src/corelib/concurrent/qtconcurrentresultstore.h | 2 +- src/corelib/concurrent/qtconcurrentrun.cpp | 2 +- src/corelib/concurrent/qtconcurrentrun.h | 2 +- src/corelib/concurrent/qtconcurrentrunbase.h | 2 +- src/corelib/concurrent/qtconcurrentstoredfunctioncall.h | 2 +- src/corelib/concurrent/qtconcurrentthreadengine.cpp | 2 +- src/corelib/concurrent/qtconcurrentthreadengine.h | 2 +- src/corelib/concurrent/qthreadpool.cpp | 2 +- src/corelib/concurrent/qthreadpool.h | 2 +- src/corelib/concurrent/qthreadpool_p.h | 2 +- src/corelib/global/qconfig-dist.h | 2 +- src/corelib/global/qconfig-large.h | 2 +- src/corelib/global/qconfig-medium.h | 2 +- src/corelib/global/qconfig-minimal.h | 2 +- src/corelib/global/qconfig-small.h | 2 +- src/corelib/global/qendian.h | 2 +- src/corelib/global/qendian.qdoc | 2 +- src/corelib/global/qfeatures.h | 2 +- src/corelib/global/qglobal.cpp | 2 +- src/corelib/global/qglobal.h | 2 +- src/corelib/global/qlibraryinfo.cpp | 4 ++-- src/corelib/global/qlibraryinfo.h | 2 +- src/corelib/global/qmalloc.cpp | 2 +- src/corelib/global/qnamespace.h | 2 +- src/corelib/global/qnamespace.qdoc | 2 +- src/corelib/global/qnumeric.cpp | 2 +- src/corelib/global/qnumeric.h | 2 +- src/corelib/global/qnumeric_p.h | 2 +- src/corelib/global/qt_pch.h | 2 +- src/corelib/global/qt_windows.h | 2 +- src/corelib/io/qabstractfileengine.cpp | 2 +- src/corelib/io/qabstractfileengine.h | 2 +- src/corelib/io/qabstractfileengine_p.h | 2 +- src/corelib/io/qbuffer.cpp | 2 +- src/corelib/io/qbuffer.h | 2 +- src/corelib/io/qdatastream.cpp | 2 +- src/corelib/io/qdatastream.h | 2 +- src/corelib/io/qdatastream_p.h | 2 +- src/corelib/io/qdebug.cpp | 2 +- src/corelib/io/qdebug.h | 2 +- src/corelib/io/qdir.cpp | 2 +- src/corelib/io/qdir.h | 2 +- src/corelib/io/qdiriterator.cpp | 2 +- src/corelib/io/qdiriterator.h | 2 +- src/corelib/io/qfile.cpp | 2 +- src/corelib/io/qfile.h | 2 +- src/corelib/io/qfile_p.h | 2 +- src/corelib/io/qfileinfo.cpp | 2 +- src/corelib/io/qfileinfo.h | 2 +- src/corelib/io/qfileinfo_p.h | 2 +- src/corelib/io/qfilesystemwatcher.cpp | 2 +- src/corelib/io/qfilesystemwatcher.h | 2 +- src/corelib/io/qfilesystemwatcher_dnotify.cpp | 2 +- src/corelib/io/qfilesystemwatcher_dnotify_p.h | 2 +- src/corelib/io/qfilesystemwatcher_fsevents.cpp | 2 +- src/corelib/io/qfilesystemwatcher_fsevents_p.h | 2 +- src/corelib/io/qfilesystemwatcher_inotify.cpp | 2 +- src/corelib/io/qfilesystemwatcher_inotify_p.h | 2 +- src/corelib/io/qfilesystemwatcher_kqueue.cpp | 2 +- src/corelib/io/qfilesystemwatcher_kqueue_p.h | 2 +- src/corelib/io/qfilesystemwatcher_p.h | 2 +- src/corelib/io/qfilesystemwatcher_symbian.cpp | 2 +- src/corelib/io/qfilesystemwatcher_symbian_p.h | 2 +- src/corelib/io/qfilesystemwatcher_win.cpp | 2 +- src/corelib/io/qfilesystemwatcher_win_p.h | 2 +- src/corelib/io/qfsfileengine.cpp | 2 +- src/corelib/io/qfsfileengine.h | 2 +- src/corelib/io/qfsfileengine_iterator.cpp | 2 +- src/corelib/io/qfsfileengine_iterator_p.h | 2 +- src/corelib/io/qfsfileengine_iterator_unix.cpp | 2 +- src/corelib/io/qfsfileengine_iterator_win.cpp | 2 +- src/corelib/io/qfsfileengine_p.h | 2 +- src/corelib/io/qfsfileengine_unix.cpp | 2 +- src/corelib/io/qfsfileengine_win.cpp | 2 +- src/corelib/io/qiodevice.cpp | 2 +- src/corelib/io/qiodevice.h | 2 +- src/corelib/io/qiodevice_p.h | 2 +- src/corelib/io/qnoncontiguousbytedevice.cpp | 2 +- src/corelib/io/qnoncontiguousbytedevice_p.h | 2 +- src/corelib/io/qprocess.cpp | 2 +- src/corelib/io/qprocess.h | 2 +- src/corelib/io/qprocess_p.h | 2 +- src/corelib/io/qprocess_symbian.cpp | 2 +- src/corelib/io/qprocess_unix.cpp | 2 +- src/corelib/io/qprocess_win.cpp | 2 +- src/corelib/io/qresource.cpp | 2 +- src/corelib/io/qresource.h | 2 +- src/corelib/io/qresource_iterator.cpp | 2 +- src/corelib/io/qresource_iterator_p.h | 2 +- src/corelib/io/qresource_p.h | 2 +- src/corelib/io/qsettings.cpp | 2 +- src/corelib/io/qsettings.h | 2 +- src/corelib/io/qsettings_mac.cpp | 2 +- src/corelib/io/qsettings_p.h | 2 +- src/corelib/io/qsettings_win.cpp | 2 +- src/corelib/io/qtemporaryfile.cpp | 2 +- src/corelib/io/qtemporaryfile.h | 2 +- src/corelib/io/qtextstream.cpp | 2 +- src/corelib/io/qtextstream.h | 2 +- src/corelib/io/qurl.cpp | 2 +- src/corelib/io/qurl.h | 2 +- src/corelib/io/qwindowspipewriter.cpp | 2 +- src/corelib/io/qwindowspipewriter_p.h | 2 +- src/corelib/kernel/qabstracteventdispatcher.cpp | 2 +- src/corelib/kernel/qabstracteventdispatcher.h | 2 +- src/corelib/kernel/qabstracteventdispatcher_p.h | 2 +- src/corelib/kernel/qabstractitemmodel.cpp | 2 +- src/corelib/kernel/qabstractitemmodel.h | 2 +- src/corelib/kernel/qabstractitemmodel_p.h | 2 +- src/corelib/kernel/qbasictimer.cpp | 2 +- src/corelib/kernel/qbasictimer.h | 2 +- src/corelib/kernel/qcore_mac.cpp | 2 +- src/corelib/kernel/qcore_mac_p.h | 2 +- src/corelib/kernel/qcore_symbian_p.cpp | 2 +- src/corelib/kernel/qcore_symbian_p.h | 2 +- src/corelib/kernel/qcore_unix.cpp | 2 +- src/corelib/kernel/qcore_unix_p.h | 2 +- src/corelib/kernel/qcoreapplication.cpp | 2 +- src/corelib/kernel/qcoreapplication.h | 2 +- src/corelib/kernel/qcoreapplication_mac.cpp | 2 +- src/corelib/kernel/qcoreapplication_p.h | 2 +- src/corelib/kernel/qcoreapplication_win.cpp | 2 +- src/corelib/kernel/qcorecmdlineargs_p.h | 2 +- src/corelib/kernel/qcoreevent.cpp | 2 +- src/corelib/kernel/qcoreevent.h | 2 +- src/corelib/kernel/qcoreglobaldata.cpp | 2 +- src/corelib/kernel/qcoreglobaldata_p.h | 2 +- src/corelib/kernel/qcrashhandler.cpp | 2 +- src/corelib/kernel/qcrashhandler_p.h | 2 +- src/corelib/kernel/qeventdispatcher_glib.cpp | 2 +- src/corelib/kernel/qeventdispatcher_glib_p.h | 2 +- src/corelib/kernel/qeventdispatcher_symbian.cpp | 2 +- src/corelib/kernel/qeventdispatcher_symbian_p.h | 2 +- src/corelib/kernel/qeventdispatcher_unix.cpp | 2 +- src/corelib/kernel/qeventdispatcher_unix_p.h | 2 +- src/corelib/kernel/qeventdispatcher_win.cpp | 2 +- src/corelib/kernel/qeventdispatcher_win_p.h | 2 +- src/corelib/kernel/qeventloop.cpp | 2 +- src/corelib/kernel/qeventloop.h | 2 +- src/corelib/kernel/qfunctions_p.h | 2 +- src/corelib/kernel/qfunctions_vxworks.cpp | 2 +- src/corelib/kernel/qfunctions_vxworks.h | 2 +- src/corelib/kernel/qfunctions_wince.cpp | 2 +- src/corelib/kernel/qfunctions_wince.h | 2 +- src/corelib/kernel/qguard_p.h | 2 +- src/corelib/kernel/qmath.cpp | 2 +- src/corelib/kernel/qmath.h | 2 +- src/corelib/kernel/qmetaobject.cpp | 2 +- src/corelib/kernel/qmetaobject.h | 2 +- src/corelib/kernel/qmetaobject_p.h | 2 +- src/corelib/kernel/qmetatype.cpp | 2 +- src/corelib/kernel/qmetatype.h | 2 +- src/corelib/kernel/qmimedata.cpp | 2 +- src/corelib/kernel/qmimedata.h | 2 +- src/corelib/kernel/qobject.cpp | 2 +- src/corelib/kernel/qobject.h | 2 +- src/corelib/kernel/qobject_p.h | 2 +- src/corelib/kernel/qobjectcleanuphandler.cpp | 2 +- src/corelib/kernel/qobjectcleanuphandler.h | 2 +- src/corelib/kernel/qobjectdefs.h | 2 +- src/corelib/kernel/qpointer.cpp | 2 +- src/corelib/kernel/qpointer.h | 2 +- src/corelib/kernel/qsharedmemory.cpp | 2 +- src/corelib/kernel/qsharedmemory.h | 2 +- src/corelib/kernel/qsharedmemory_p.h | 2 +- src/corelib/kernel/qsharedmemory_symbian.cpp | 2 +- src/corelib/kernel/qsharedmemory_unix.cpp | 2 +- src/corelib/kernel/qsharedmemory_win.cpp | 2 +- src/corelib/kernel/qsignalmapper.cpp | 2 +- src/corelib/kernel/qsignalmapper.h | 2 +- src/corelib/kernel/qsocketnotifier.cpp | 2 +- src/corelib/kernel/qsocketnotifier.h | 2 +- src/corelib/kernel/qsystemsemaphore.cpp | 2 +- src/corelib/kernel/qsystemsemaphore.h | 2 +- src/corelib/kernel/qsystemsemaphore_p.h | 2 +- src/corelib/kernel/qsystemsemaphore_symbian.cpp | 2 +- src/corelib/kernel/qsystemsemaphore_unix.cpp | 2 +- src/corelib/kernel/qsystemsemaphore_win.cpp | 2 +- src/corelib/kernel/qtcore_eval.cpp | 6 +++--- src/corelib/kernel/qtimer.cpp | 2 +- src/corelib/kernel/qtimer.h | 2 +- src/corelib/kernel/qtranslator.cpp | 2 +- src/corelib/kernel/qtranslator.h | 2 +- src/corelib/kernel/qtranslator_p.h | 2 +- src/corelib/kernel/qvariant.cpp | 2 +- src/corelib/kernel/qvariant.h | 2 +- src/corelib/kernel/qvariant_p.h | 2 +- src/corelib/kernel/qwineventnotifier_p.cpp | 2 +- src/corelib/kernel/qwineventnotifier_p.h | 2 +- src/corelib/plugin/qfactoryinterface.h | 2 +- src/corelib/plugin/qfactoryloader.cpp | 2 +- src/corelib/plugin/qfactoryloader_p.h | 2 +- src/corelib/plugin/qlibrary.cpp | 2 +- src/corelib/plugin/qlibrary.h | 2 +- src/corelib/plugin/qlibrary_p.h | 2 +- src/corelib/plugin/qlibrary_unix.cpp | 2 +- src/corelib/plugin/qlibrary_win.cpp | 2 +- src/corelib/plugin/qplugin.h | 2 +- src/corelib/plugin/qplugin.qdoc | 2 +- src/corelib/plugin/qpluginloader.cpp | 2 +- src/corelib/plugin/qpluginloader.h | 2 +- src/corelib/plugin/qsystemlibrary.cpp | 2 +- src/corelib/plugin/qsystemlibrary_p.h | 2 +- src/corelib/plugin/quuid.cpp | 2 +- src/corelib/plugin/quuid.h | 2 +- src/corelib/statemachine/qabstractstate.cpp | 2 +- src/corelib/statemachine/qabstractstate.h | 2 +- src/corelib/statemachine/qabstractstate_p.h | 2 +- src/corelib/statemachine/qabstracttransition.cpp | 2 +- src/corelib/statemachine/qabstracttransition.h | 2 +- src/corelib/statemachine/qabstracttransition_p.h | 2 +- src/corelib/statemachine/qeventtransition.cpp | 2 +- src/corelib/statemachine/qeventtransition.h | 2 +- src/corelib/statemachine/qeventtransition_p.h | 2 +- src/corelib/statemachine/qfinalstate.cpp | 2 +- src/corelib/statemachine/qfinalstate.h | 2 +- src/corelib/statemachine/qhistorystate.cpp | 2 +- src/corelib/statemachine/qhistorystate.h | 2 +- src/corelib/statemachine/qhistorystate_p.h | 2 +- src/corelib/statemachine/qsignaleventgenerator_p.h | 2 +- src/corelib/statemachine/qsignaltransition.cpp | 2 +- src/corelib/statemachine/qsignaltransition.h | 2 +- src/corelib/statemachine/qsignaltransition_p.h | 2 +- src/corelib/statemachine/qstate.cpp | 2 +- src/corelib/statemachine/qstate.h | 2 +- src/corelib/statemachine/qstate_p.h | 2 +- src/corelib/statemachine/qstatemachine.cpp | 2 +- src/corelib/statemachine/qstatemachine.h | 2 +- src/corelib/statemachine/qstatemachine_p.h | 2 +- src/corelib/thread/qatomic.cpp | 2 +- src/corelib/thread/qatomic.h | 2 +- src/corelib/thread/qbasicatomic.h | 2 +- src/corelib/thread/qmutex.cpp | 2 +- src/corelib/thread/qmutex.h | 2 +- src/corelib/thread/qmutex_p.h | 2 +- src/corelib/thread/qmutex_unix.cpp | 2 +- src/corelib/thread/qmutex_win.cpp | 2 +- src/corelib/thread/qmutexpool.cpp | 2 +- src/corelib/thread/qmutexpool_p.h | 2 +- src/corelib/thread/qorderedmutexlocker_p.h | 2 +- src/corelib/thread/qreadwritelock.cpp | 2 +- src/corelib/thread/qreadwritelock.h | 2 +- src/corelib/thread/qreadwritelock_p.h | 2 +- src/corelib/thread/qsemaphore.cpp | 2 +- src/corelib/thread/qsemaphore.h | 2 +- src/corelib/thread/qthread.cpp | 2 +- src/corelib/thread/qthread.h | 2 +- src/corelib/thread/qthread_p.h | 2 +- src/corelib/thread/qthread_unix.cpp | 2 +- src/corelib/thread/qthread_win.cpp | 2 +- src/corelib/thread/qthreadstorage.cpp | 2 +- src/corelib/thread/qthreadstorage.h | 2 +- src/corelib/thread/qwaitcondition.h | 2 +- src/corelib/thread/qwaitcondition.qdoc | 2 +- src/corelib/thread/qwaitcondition_unix.cpp | 2 +- src/corelib/thread/qwaitcondition_win.cpp | 2 +- src/corelib/tools/qalgorithms.h | 2 +- src/corelib/tools/qalgorithms.qdoc | 2 +- src/corelib/tools/qbitarray.cpp | 2 +- src/corelib/tools/qbitarray.h | 2 +- src/corelib/tools/qbytearray.cpp | 2 +- src/corelib/tools/qbytearray.h | 2 +- src/corelib/tools/qbytearraymatcher.cpp | 2 +- src/corelib/tools/qbytearraymatcher.h | 2 +- src/corelib/tools/qbytedata_p.h | 2 +- src/corelib/tools/qcache.h | 2 +- src/corelib/tools/qcache.qdoc | 2 +- src/corelib/tools/qchar.cpp | 2 +- src/corelib/tools/qchar.h | 2 +- src/corelib/tools/qcontainerfwd.h | 2 +- src/corelib/tools/qcontiguouscache.cpp | 2 +- src/corelib/tools/qcontiguouscache.h | 2 +- src/corelib/tools/qcryptographichash.cpp | 2 +- src/corelib/tools/qcryptographichash.h | 2 +- src/corelib/tools/qdatetime.cpp | 2 +- src/corelib/tools/qdatetime.h | 2 +- src/corelib/tools/qdatetime_p.h | 2 +- src/corelib/tools/qeasingcurve.cpp | 2 +- src/corelib/tools/qeasingcurve.h | 2 +- src/corelib/tools/qharfbuzz.cpp | 2 +- src/corelib/tools/qharfbuzz_p.h | 2 +- src/corelib/tools/qhash.cpp | 2 +- src/corelib/tools/qhash.h | 2 +- src/corelib/tools/qiterator.h | 2 +- src/corelib/tools/qiterator.qdoc | 2 +- src/corelib/tools/qline.cpp | 2 +- src/corelib/tools/qline.h | 2 +- src/corelib/tools/qlinkedlist.cpp | 2 +- src/corelib/tools/qlinkedlist.h | 2 +- src/corelib/tools/qlist.cpp | 2 +- src/corelib/tools/qlist.h | 2 +- src/corelib/tools/qlocale.cpp | 2 +- src/corelib/tools/qlocale.h | 2 +- src/corelib/tools/qlocale_data_p.h | 2 +- src/corelib/tools/qlocale_p.h | 2 +- src/corelib/tools/qlocale_symbian.cpp | 2 +- src/corelib/tools/qmap.cpp | 2 +- src/corelib/tools/qmap.h | 2 +- src/corelib/tools/qmargins.cpp | 2 +- src/corelib/tools/qmargins.h | 2 +- src/corelib/tools/qpair.h | 2 +- src/corelib/tools/qpair.qdoc | 2 +- src/corelib/tools/qpodlist_p.h | 2 +- src/corelib/tools/qpoint.cpp | 2 +- src/corelib/tools/qpoint.h | 2 +- src/corelib/tools/qqueue.cpp | 2 +- src/corelib/tools/qqueue.h | 2 +- src/corelib/tools/qrect.cpp | 2 +- src/corelib/tools/qrect.h | 2 +- src/corelib/tools/qregexp.cpp | 2 +- src/corelib/tools/qregexp.h | 2 +- src/corelib/tools/qringbuffer_p.h | 2 +- src/corelib/tools/qscopedpointer.cpp | 2 +- src/corelib/tools/qscopedpointer.h | 2 +- src/corelib/tools/qscopedpointer_p.h | 2 +- src/corelib/tools/qset.h | 2 +- src/corelib/tools/qset.qdoc | 2 +- src/corelib/tools/qshareddata.cpp | 2 +- src/corelib/tools/qshareddata.h | 2 +- src/corelib/tools/qsharedpointer.cpp | 2 +- src/corelib/tools/qsharedpointer.h | 2 +- src/corelib/tools/qsharedpointer_impl.h | 2 +- src/corelib/tools/qsize.cpp | 2 +- src/corelib/tools/qsize.h | 2 +- src/corelib/tools/qstack.cpp | 2 +- src/corelib/tools/qstack.h | 2 +- src/corelib/tools/qstring.cpp | 2 +- src/corelib/tools/qstring.h | 2 +- src/corelib/tools/qstringbuilder.cpp | 2 +- src/corelib/tools/qstringbuilder.h | 2 +- src/corelib/tools/qstringlist.cpp | 2 +- src/corelib/tools/qstringlist.h | 2 +- src/corelib/tools/qstringmatcher.cpp | 2 +- src/corelib/tools/qstringmatcher.h | 2 +- src/corelib/tools/qtextboundaryfinder.cpp | 2 +- src/corelib/tools/qtextboundaryfinder.h | 2 +- src/corelib/tools/qtimeline.cpp | 2 +- src/corelib/tools/qtimeline.h | 2 +- src/corelib/tools/qtools_p.h | 2 +- src/corelib/tools/qunicodetables.cpp | 2 +- src/corelib/tools/qunicodetables_p.h | 2 +- src/corelib/tools/qvarlengtharray.h | 2 +- src/corelib/tools/qvarlengtharray.qdoc | 2 +- src/corelib/tools/qvector.cpp | 2 +- src/corelib/tools/qvector.h | 2 +- src/corelib/tools/qvsnprintf.cpp | 2 +- src/corelib/xml/make-parser.sh | 2 +- src/corelib/xml/qxmlstream.cpp | 2 +- src/corelib/xml/qxmlstream.g | 2 +- src/corelib/xml/qxmlstream.h | 2 +- src/corelib/xml/qxmlstream_p.h | 2 +- src/corelib/xml/qxmlutils.cpp | 2 +- src/corelib/xml/qxmlutils_p.h | 2 +- src/dbus/qdbus_symbols.cpp | 2 +- src/dbus/qdbus_symbols_p.h | 2 +- src/dbus/qdbusabstractadaptor.cpp | 2 +- src/dbus/qdbusabstractadaptor.h | 2 +- src/dbus/qdbusabstractadaptor_p.h | 2 +- src/dbus/qdbusabstractinterface.cpp | 2 +- src/dbus/qdbusabstractinterface.h | 2 +- src/dbus/qdbusabstractinterface_p.h | 2 +- src/dbus/qdbusargument.cpp | 2 +- src/dbus/qdbusargument.h | 2 +- src/dbus/qdbusargument_p.h | 2 +- src/dbus/qdbusconnection.cpp | 2 +- src/dbus/qdbusconnection.h | 2 +- src/dbus/qdbusconnection_p.h | 2 +- src/dbus/qdbusconnectioninterface.cpp | 2 +- src/dbus/qdbusconnectioninterface.h | 2 +- src/dbus/qdbuscontext.cpp | 2 +- src/dbus/qdbuscontext.h | 2 +- src/dbus/qdbuscontext_p.h | 2 +- src/dbus/qdbusdemarshaller.cpp | 2 +- src/dbus/qdbuserror.cpp | 2 +- src/dbus/qdbuserror.h | 2 +- src/dbus/qdbusextratypes.cpp | 2 +- src/dbus/qdbusextratypes.h | 2 +- src/dbus/qdbusintegrator.cpp | 2 +- src/dbus/qdbusintegrator_p.h | 2 +- src/dbus/qdbusinterface.cpp | 2 +- src/dbus/qdbusinterface.h | 2 +- src/dbus/qdbusinterface_p.h | 2 +- src/dbus/qdbusinternalfilters.cpp | 2 +- src/dbus/qdbusintrospection.cpp | 2 +- src/dbus/qdbusintrospection_p.h | 2 +- src/dbus/qdbusmacros.h | 2 +- src/dbus/qdbusmarshaller.cpp | 2 +- src/dbus/qdbusmessage.cpp | 2 +- src/dbus/qdbusmessage.h | 2 +- src/dbus/qdbusmessage_p.h | 2 +- src/dbus/qdbusmetaobject.cpp | 2 +- src/dbus/qdbusmetaobject_p.h | 2 +- src/dbus/qdbusmetatype.cpp | 2 +- src/dbus/qdbusmetatype.h | 2 +- src/dbus/qdbusmetatype_p.h | 2 +- src/dbus/qdbusmisc.cpp | 2 +- src/dbus/qdbuspendingcall.cpp | 2 +- src/dbus/qdbuspendingcall.h | 2 +- src/dbus/qdbuspendingcall_p.h | 2 +- src/dbus/qdbuspendingreply.cpp | 2 +- src/dbus/qdbuspendingreply.h | 2 +- src/dbus/qdbusreply.cpp | 2 +- src/dbus/qdbusreply.h | 2 +- src/dbus/qdbusserver.cpp | 2 +- src/dbus/qdbusserver.h | 2 +- src/dbus/qdbusservicewatcher.cpp | 2 +- src/dbus/qdbusservicewatcher.h | 2 +- src/dbus/qdbusthreaddebug_p.h | 2 +- src/dbus/qdbusutil.cpp | 2 +- src/dbus/qdbusutil_p.h | 2 +- src/dbus/qdbusxmlgenerator.cpp | 2 +- src/dbus/qdbusxmlparser.cpp | 2 +- src/dbus/qdbusxmlparser_p.h | 2 +- src/gui/accessible/qaccessible.cpp | 2 +- src/gui/accessible/qaccessible.h | 2 +- src/gui/accessible/qaccessible2.cpp | 2 +- src/gui/accessible/qaccessible2.h | 2 +- src/gui/accessible/qaccessible_mac.mm | 2 +- src/gui/accessible/qaccessible_mac_carbon.cpp | 2 +- src/gui/accessible/qaccessible_mac_cocoa.mm | 2 +- src/gui/accessible/qaccessible_mac_p.h | 2 +- src/gui/accessible/qaccessible_unix.cpp | 2 +- src/gui/accessible/qaccessible_win.cpp | 2 +- src/gui/accessible/qaccessiblebridge.cpp | 2 +- src/gui/accessible/qaccessiblebridge.h | 2 +- src/gui/accessible/qaccessibleobject.cpp | 2 +- src/gui/accessible/qaccessibleobject.h | 2 +- src/gui/accessible/qaccessibleplugin.cpp | 2 +- src/gui/accessible/qaccessibleplugin.h | 2 +- src/gui/accessible/qaccessiblewidget.cpp | 2 +- src/gui/accessible/qaccessiblewidget.h | 2 +- src/gui/animation/qguivariantanimation.cpp | 2 +- src/gui/dialogs/qabstractpagesetupdialog.cpp | 2 +- src/gui/dialogs/qabstractpagesetupdialog.h | 2 +- src/gui/dialogs/qabstractpagesetupdialog_p.h | 2 +- src/gui/dialogs/qabstractprintdialog.cpp | 2 +- src/gui/dialogs/qabstractprintdialog.h | 2 +- src/gui/dialogs/qabstractprintdialog_p.h | 2 +- src/gui/dialogs/qcolordialog.cpp | 2 +- src/gui/dialogs/qcolordialog.h | 2 +- src/gui/dialogs/qcolordialog_mac.mm | 2 +- src/gui/dialogs/qcolordialog_p.h | 2 +- src/gui/dialogs/qdialog.cpp | 2 +- src/gui/dialogs/qdialog.h | 2 +- src/gui/dialogs/qdialog_p.h | 2 +- src/gui/dialogs/qdialogsbinarycompat_win.cpp | 2 +- src/gui/dialogs/qerrormessage.cpp | 2 +- src/gui/dialogs/qerrormessage.h | 2 +- src/gui/dialogs/qfiledialog.cpp | 2 +- src/gui/dialogs/qfiledialog.h | 2 +- src/gui/dialogs/qfiledialog.ui | 2 +- src/gui/dialogs/qfiledialog_embedded.ui | 2 +- src/gui/dialogs/qfiledialog_mac.mm | 2 +- src/gui/dialogs/qfiledialog_p.h | 2 +- src/gui/dialogs/qfiledialog_win.cpp | 2 +- src/gui/dialogs/qfileinfogatherer.cpp | 2 +- src/gui/dialogs/qfileinfogatherer_p.h | 2 +- src/gui/dialogs/qfilesystemmodel.cpp | 2 +- src/gui/dialogs/qfilesystemmodel.h | 2 +- src/gui/dialogs/qfilesystemmodel_p.h | 2 +- src/gui/dialogs/qfontdialog.cpp | 2 +- src/gui/dialogs/qfontdialog.h | 2 +- src/gui/dialogs/qfontdialog_mac.mm | 2 +- src/gui/dialogs/qfontdialog_p.h | 2 +- src/gui/dialogs/qfscompleter_p.h | 2 +- src/gui/dialogs/qinputdialog.cpp | 2 +- src/gui/dialogs/qinputdialog.h | 2 +- src/gui/dialogs/qmessagebox.cpp | 4 ++-- src/gui/dialogs/qmessagebox.h | 2 +- src/gui/dialogs/qnspanelproxy_mac.mm | 2 +- src/gui/dialogs/qpagesetupdialog.cpp | 2 +- src/gui/dialogs/qpagesetupdialog.h | 2 +- src/gui/dialogs/qpagesetupdialog_mac.mm | 2 +- src/gui/dialogs/qpagesetupdialog_unix.cpp | 2 +- src/gui/dialogs/qpagesetupdialog_unix_p.h | 2 +- src/gui/dialogs/qpagesetupdialog_win.cpp | 2 +- src/gui/dialogs/qprintdialog.h | 2 +- src/gui/dialogs/qprintdialog.qdoc | 2 +- src/gui/dialogs/qprintdialog_mac.mm | 2 +- src/gui/dialogs/qprintdialog_qws.cpp | 2 +- src/gui/dialogs/qprintdialog_unix.cpp | 2 +- src/gui/dialogs/qprintdialog_win.cpp | 2 +- src/gui/dialogs/qprintpreviewdialog.cpp | 2 +- src/gui/dialogs/qprintpreviewdialog.h | 2 +- src/gui/dialogs/qprogressdialog.cpp | 2 +- src/gui/dialogs/qprogressdialog.h | 2 +- src/gui/dialogs/qsidebar.cpp | 2 +- src/gui/dialogs/qsidebar_p.h | 2 +- src/gui/dialogs/qwizard.cpp | 2 +- src/gui/dialogs/qwizard.h | 2 +- src/gui/dialogs/qwizard_win.cpp | 2 +- src/gui/dialogs/qwizard_win_p.h | 2 +- src/gui/effects/qgraphicseffect.cpp | 2 +- src/gui/effects/qgraphicseffect.h | 2 +- src/gui/effects/qgraphicseffect_p.h | 2 +- src/gui/egl/qegl.cpp | 2 +- src/gui/egl/qegl_p.h | 2 +- src/gui/egl/qegl_qws.cpp | 2 +- src/gui/egl/qegl_stub.cpp | 2 +- src/gui/egl/qegl_symbian.cpp | 2 +- src/gui/egl/qegl_wince.cpp | 2 +- src/gui/egl/qegl_x11.cpp | 2 +- src/gui/egl/qeglproperties.cpp | 2 +- src/gui/egl/qeglproperties_p.h | 2 +- src/gui/egl/qeglproperties_stub.cpp | 2 +- src/gui/embedded/qcopchannel_qws.cpp | 2 +- src/gui/embedded/qcopchannel_qws.h | 2 +- src/gui/embedded/qdecoration_qws.cpp | 2 +- src/gui/embedded/qdecoration_qws.h | 2 +- src/gui/embedded/qdecorationdefault_qws.cpp | 2 +- src/gui/embedded/qdecorationdefault_qws.h | 2 +- src/gui/embedded/qdecorationfactory_qws.cpp | 2 +- src/gui/embedded/qdecorationfactory_qws.h | 2 +- src/gui/embedded/qdecorationplugin_qws.cpp | 2 +- src/gui/embedded/qdecorationplugin_qws.h | 2 +- src/gui/embedded/qdecorationstyled_qws.cpp | 2 +- src/gui/embedded/qdecorationstyled_qws.h | 2 +- src/gui/embedded/qdecorationwindows_qws.cpp | 2 +- src/gui/embedded/qdecorationwindows_qws.h | 2 +- src/gui/embedded/qdirectpainter_qws.cpp | 2 +- src/gui/embedded/qdirectpainter_qws.h | 2 +- src/gui/embedded/qkbd_defaultmap_qws_p.h | 2 +- src/gui/embedded/qkbd_qws.cpp | 2 +- src/gui/embedded/qkbd_qws.h | 2 +- src/gui/embedded/qkbd_qws_p.h | 2 +- src/gui/embedded/qkbddriverfactory_qws.cpp | 2 +- src/gui/embedded/qkbddriverfactory_qws.h | 2 +- src/gui/embedded/qkbddriverplugin_qws.cpp | 2 +- src/gui/embedded/qkbddriverplugin_qws.h | 2 +- src/gui/embedded/qkbdlinuxinput_qws.cpp | 2 +- src/gui/embedded/qkbdlinuxinput_qws.h | 2 +- src/gui/embedded/qkbdqnx_qws.cpp | 2 +- src/gui/embedded/qkbdqnx_qws.h | 2 +- src/gui/embedded/qkbdtty_qws.cpp | 2 +- src/gui/embedded/qkbdtty_qws.h | 2 +- src/gui/embedded/qkbdum_qws.cpp | 2 +- src/gui/embedded/qkbdum_qws.h | 2 +- src/gui/embedded/qkbdvfb_qws.cpp | 2 +- src/gui/embedded/qkbdvfb_qws.h | 2 +- src/gui/embedded/qlock.cpp | 2 +- src/gui/embedded/qlock_p.h | 2 +- src/gui/embedded/qmouse_qws.cpp | 2 +- src/gui/embedded/qmouse_qws.h | 2 +- src/gui/embedded/qmousedriverfactory_qws.cpp | 2 +- src/gui/embedded/qmousedriverfactory_qws.h | 2 +- src/gui/embedded/qmousedriverplugin_qws.cpp | 2 +- src/gui/embedded/qmousedriverplugin_qws.h | 2 +- src/gui/embedded/qmouselinuxinput_qws.cpp | 2 +- src/gui/embedded/qmouselinuxinput_qws.h | 2 +- src/gui/embedded/qmouselinuxtp_qws.cpp | 2 +- src/gui/embedded/qmouselinuxtp_qws.h | 2 +- src/gui/embedded/qmousepc_qws.cpp | 2 +- src/gui/embedded/qmousepc_qws.h | 2 +- src/gui/embedded/qmouseqnx_qws.cpp | 2 +- src/gui/embedded/qmouseqnx_qws.h | 2 +- src/gui/embedded/qmousetslib_qws.cpp | 2 +- src/gui/embedded/qmousetslib_qws.h | 2 +- src/gui/embedded/qmousevfb_qws.cpp | 2 +- src/gui/embedded/qmousevfb_qws.h | 2 +- src/gui/embedded/qscreen_qws.cpp | 2 +- src/gui/embedded/qscreen_qws.h | 2 +- src/gui/embedded/qscreendriverfactory_qws.cpp | 2 +- src/gui/embedded/qscreendriverfactory_qws.h | 2 +- src/gui/embedded/qscreendriverplugin_qws.cpp | 2 +- src/gui/embedded/qscreendriverplugin_qws.h | 2 +- src/gui/embedded/qscreenlinuxfb_qws.cpp | 2 +- src/gui/embedded/qscreenlinuxfb_qws.h | 2 +- src/gui/embedded/qscreenmulti_qws.cpp | 2 +- src/gui/embedded/qscreenmulti_qws_p.h | 2 +- src/gui/embedded/qscreenproxy_qws.cpp | 2 +- src/gui/embedded/qscreenproxy_qws.h | 2 +- src/gui/embedded/qscreenqnx_qws.cpp | 2 +- src/gui/embedded/qscreenqnx_qws.h | 2 +- src/gui/embedded/qscreentransformed_qws.cpp | 2 +- src/gui/embedded/qscreentransformed_qws.h | 2 +- src/gui/embedded/qscreenvfb_qws.cpp | 2 +- src/gui/embedded/qscreenvfb_qws.h | 2 +- src/gui/embedded/qsoundqss_qws.cpp | 2 +- src/gui/embedded/qsoundqss_qws.h | 2 +- src/gui/embedded/qtransportauth_qws.cpp | 2 +- src/gui/embedded/qtransportauth_qws.h | 2 +- src/gui/embedded/qtransportauth_qws_p.h | 2 +- src/gui/embedded/qtransportauthdefs_qws.h | 2 +- src/gui/embedded/qunixsocket.cpp | 2 +- src/gui/embedded/qunixsocket_p.h | 2 +- src/gui/embedded/qunixsocketserver.cpp | 2 +- src/gui/embedded/qunixsocketserver_p.h | 2 +- src/gui/embedded/qvfbhdr.h | 2 +- src/gui/embedded/qwindowsystem_p.h | 2 +- src/gui/embedded/qwindowsystem_qws.cpp | 2 +- src/gui/embedded/qwindowsystem_qws.h | 2 +- src/gui/embedded/qwscommand_qws.cpp | 2 +- src/gui/embedded/qwscommand_qws_p.h | 2 +- src/gui/embedded/qwscursor_qws.cpp | 2 +- src/gui/embedded/qwscursor_qws.h | 2 +- src/gui/embedded/qwsdisplay_qws.h | 2 +- src/gui/embedded/qwsdisplay_qws_p.h | 2 +- src/gui/embedded/qwsembedwidget.cpp | 2 +- src/gui/embedded/qwsembedwidget.h | 2 +- src/gui/embedded/qwsevent_qws.cpp | 2 +- src/gui/embedded/qwsevent_qws.h | 2 +- src/gui/embedded/qwslock.cpp | 2 +- src/gui/embedded/qwslock_p.h | 2 +- src/gui/embedded/qwsmanager_p.h | 2 +- src/gui/embedded/qwsmanager_qws.cpp | 2 +- src/gui/embedded/qwsmanager_qws.h | 2 +- src/gui/embedded/qwsproperty_qws.cpp | 2 +- src/gui/embedded/qwsproperty_qws.h | 2 +- src/gui/embedded/qwsprotocolitem_qws.h | 2 +- src/gui/embedded/qwssharedmemory.cpp | 2 +- src/gui/embedded/qwssharedmemory_p.h | 2 +- src/gui/embedded/qwssignalhandler.cpp | 2 +- src/gui/embedded/qwssignalhandler_p.h | 2 +- src/gui/embedded/qwssocket_qws.cpp | 2 +- src/gui/embedded/qwssocket_qws.h | 2 +- src/gui/embedded/qwsutils_qws.h | 2 +- src/gui/graphicsview/qgraph_p.h | 2 +- src/gui/graphicsview/qgraphicsanchorlayout.cpp | 2 +- src/gui/graphicsview/qgraphicsanchorlayout.h | 2 +- src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 2 +- src/gui/graphicsview/qgraphicsanchorlayout_p.h | 2 +- src/gui/graphicsview/qgraphicsgridlayout.cpp | 2 +- src/gui/graphicsview/qgraphicsgridlayout.h | 2 +- src/gui/graphicsview/qgraphicsitem.cpp | 2 +- src/gui/graphicsview/qgraphicsitem.h | 2 +- src/gui/graphicsview/qgraphicsitem_p.h | 2 +- src/gui/graphicsview/qgraphicsitemanimation.cpp | 2 +- src/gui/graphicsview/qgraphicsitemanimation.h | 2 +- src/gui/graphicsview/qgraphicslayout.cpp | 2 +- src/gui/graphicsview/qgraphicslayout.h | 2 +- src/gui/graphicsview/qgraphicslayout_p.cpp | 2 +- src/gui/graphicsview/qgraphicslayout_p.h | 2 +- src/gui/graphicsview/qgraphicslayoutitem.cpp | 2 +- src/gui/graphicsview/qgraphicslayoutitem.h | 2 +- src/gui/graphicsview/qgraphicslayoutitem_p.h | 2 +- src/gui/graphicsview/qgraphicslinearlayout.cpp | 2 +- src/gui/graphicsview/qgraphicslinearlayout.h | 2 +- src/gui/graphicsview/qgraphicsproxywidget.cpp | 2 +- src/gui/graphicsview/qgraphicsproxywidget.h | 2 +- src/gui/graphicsview/qgraphicsproxywidget_p.h | 2 +- src/gui/graphicsview/qgraphicsscene.cpp | 2 +- src/gui/graphicsview/qgraphicsscene.h | 2 +- src/gui/graphicsview/qgraphicsscene_bsp.cpp | 2 +- src/gui/graphicsview/qgraphicsscene_bsp_p.h | 2 +- src/gui/graphicsview/qgraphicsscene_p.h | 2 +- src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp | 2 +- src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h | 2 +- src/gui/graphicsview/qgraphicssceneevent.cpp | 2 +- src/gui/graphicsview/qgraphicssceneevent.h | 2 +- src/gui/graphicsview/qgraphicssceneindex.cpp | 2 +- src/gui/graphicsview/qgraphicssceneindex_p.h | 2 +- src/gui/graphicsview/qgraphicsscenelinearindex.cpp | 2 +- src/gui/graphicsview/qgraphicsscenelinearindex_p.h | 2 +- src/gui/graphicsview/qgraphicstransform.cpp | 2 +- src/gui/graphicsview/qgraphicstransform.h | 2 +- src/gui/graphicsview/qgraphicstransform_p.h | 2 +- src/gui/graphicsview/qgraphicsview.cpp | 2 +- src/gui/graphicsview/qgraphicsview.h | 2 +- src/gui/graphicsview/qgraphicsview_p.h | 2 +- src/gui/graphicsview/qgraphicswidget.cpp | 2 +- src/gui/graphicsview/qgraphicswidget.h | 2 +- src/gui/graphicsview/qgraphicswidget_p.cpp | 2 +- src/gui/graphicsview/qgraphicswidget_p.h | 2 +- src/gui/graphicsview/qgridlayoutengine.cpp | 2 +- src/gui/graphicsview/qgridlayoutengine_p.h | 2 +- src/gui/graphicsview/qsimplex_p.cpp | 2 +- src/gui/graphicsview/qsimplex_p.h | 2 +- src/gui/image/qbitmap.cpp | 2 +- src/gui/image/qbitmap.h | 2 +- src/gui/image/qbmphandler.cpp | 2 +- src/gui/image/qbmphandler_p.h | 2 +- src/gui/image/qicon.cpp | 2 +- src/gui/image/qicon.h | 2 +- src/gui/image/qicon_p.h | 2 +- src/gui/image/qiconengine.cpp | 2 +- src/gui/image/qiconengine.h | 2 +- src/gui/image/qiconengineplugin.cpp | 2 +- src/gui/image/qiconengineplugin.h | 2 +- src/gui/image/qiconloader.cpp | 2 +- src/gui/image/qiconloader_p.h | 2 +- src/gui/image/qimage.cpp | 2 +- src/gui/image/qimage.h | 2 +- src/gui/image/qimage_p.h | 2 +- src/gui/image/qimageiohandler.cpp | 2 +- src/gui/image/qimageiohandler.h | 2 +- src/gui/image/qimagepixmapcleanuphooks.cpp | 2 +- src/gui/image/qimagepixmapcleanuphooks_p.h | 2 +- src/gui/image/qimagereader.cpp | 2 +- src/gui/image/qimagereader.h | 2 +- src/gui/image/qimagewriter.cpp | 2 +- src/gui/image/qimagewriter.h | 2 +- src/gui/image/qmovie.cpp | 2 +- src/gui/image/qmovie.h | 2 +- src/gui/image/qnativeimage.cpp | 2 +- src/gui/image/qnativeimage_p.h | 2 +- src/gui/image/qpaintengine_pic.cpp | 2 +- src/gui/image/qpaintengine_pic_p.h | 2 +- src/gui/image/qpicture.cpp | 2 +- src/gui/image/qpicture.h | 2 +- src/gui/image/qpicture_p.h | 2 +- src/gui/image/qpictureformatplugin.cpp | 2 +- src/gui/image/qpictureformatplugin.h | 2 +- src/gui/image/qpixmap.cpp | 2 +- src/gui/image/qpixmap.h | 2 +- src/gui/image/qpixmap_mac.cpp | 2 +- src/gui/image/qpixmap_mac_p.h | 2 +- src/gui/image/qpixmap_qws.cpp | 2 +- src/gui/image/qpixmap_raster.cpp | 2 +- src/gui/image/qpixmap_raster_p.h | 2 +- src/gui/image/qpixmap_s60.cpp | 2 +- src/gui/image/qpixmap_s60_p.h | 2 +- src/gui/image/qpixmap_win.cpp | 2 +- src/gui/image/qpixmap_x11.cpp | 2 +- src/gui/image/qpixmap_x11_p.h | 2 +- src/gui/image/qpixmapcache.cpp | 2 +- src/gui/image/qpixmapcache.h | 2 +- src/gui/image/qpixmapcache_p.h | 2 +- src/gui/image/qpixmapdata.cpp | 2 +- src/gui/image/qpixmapdata_p.h | 2 +- src/gui/image/qpixmapdatafactory.cpp | 2 +- src/gui/image/qpixmapdatafactory_p.h | 2 +- src/gui/image/qpixmapfilter.cpp | 2 +- src/gui/image/qpixmapfilter_p.h | 2 +- src/gui/image/qpnghandler.cpp | 2 +- src/gui/image/qpnghandler_p.h | 2 +- src/gui/image/qppmhandler.cpp | 2 +- src/gui/image/qppmhandler_p.h | 2 +- src/gui/image/qxbmhandler.cpp | 2 +- src/gui/image/qxbmhandler_p.h | 2 +- src/gui/image/qxpmhandler.cpp | 2 +- src/gui/image/qxpmhandler_p.h | 2 +- src/gui/inputmethod/qcoefepinputcontext_p.h | 2 +- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 2 +- src/gui/inputmethod/qinputcontext.cpp | 2 +- src/gui/inputmethod/qinputcontext.h | 2 +- src/gui/inputmethod/qinputcontext_p.h | 2 +- src/gui/inputmethod/qinputcontextfactory.cpp | 2 +- src/gui/inputmethod/qinputcontextfactory.h | 2 +- src/gui/inputmethod/qinputcontextplugin.cpp | 2 +- src/gui/inputmethod/qinputcontextplugin.h | 2 +- src/gui/inputmethod/qmacinputcontext_mac.cpp | 2 +- src/gui/inputmethod/qmacinputcontext_p.h | 2 +- src/gui/inputmethod/qwininputcontext_p.h | 2 +- src/gui/inputmethod/qwininputcontext_win.cpp | 2 +- src/gui/inputmethod/qwsinputcontext_p.h | 2 +- src/gui/inputmethod/qwsinputcontext_qws.cpp | 2 +- src/gui/inputmethod/qximinputcontext_p.h | 2 +- src/gui/inputmethod/qximinputcontext_x11.cpp | 2 +- src/gui/itemviews/qabstractitemdelegate.cpp | 2 +- src/gui/itemviews/qabstractitemdelegate.h | 2 +- src/gui/itemviews/qabstractitemview.cpp | 2 +- src/gui/itemviews/qabstractitemview.h | 2 +- src/gui/itemviews/qabstractitemview_p.h | 2 +- src/gui/itemviews/qabstractproxymodel.cpp | 2 +- src/gui/itemviews/qabstractproxymodel.h | 2 +- src/gui/itemviews/qabstractproxymodel_p.h | 2 +- src/gui/itemviews/qbsptree.cpp | 2 +- src/gui/itemviews/qbsptree_p.h | 2 +- src/gui/itemviews/qcolumnview.cpp | 2 +- src/gui/itemviews/qcolumnview.h | 2 +- src/gui/itemviews/qcolumnview_p.h | 2 +- src/gui/itemviews/qcolumnviewgrip.cpp | 2 +- src/gui/itemviews/qcolumnviewgrip_p.h | 2 +- src/gui/itemviews/qdatawidgetmapper.cpp | 2 +- src/gui/itemviews/qdatawidgetmapper.h | 2 +- src/gui/itemviews/qdirmodel.cpp | 2 +- src/gui/itemviews/qdirmodel.h | 2 +- src/gui/itemviews/qfileiconprovider.cpp | 2 +- src/gui/itemviews/qfileiconprovider.h | 2 +- src/gui/itemviews/qheaderview.cpp | 2 +- src/gui/itemviews/qheaderview.h | 2 +- src/gui/itemviews/qheaderview_p.h | 2 +- src/gui/itemviews/qitemdelegate.cpp | 2 +- src/gui/itemviews/qitemdelegate.h | 2 +- src/gui/itemviews/qitemeditorfactory.cpp | 2 +- src/gui/itemviews/qitemeditorfactory.h | 2 +- src/gui/itemviews/qitemeditorfactory_p.h | 2 +- src/gui/itemviews/qitemselectionmodel.cpp | 2 +- src/gui/itemviews/qitemselectionmodel.h | 2 +- src/gui/itemviews/qitemselectionmodel_p.h | 2 +- src/gui/itemviews/qlistview.cpp | 2 +- src/gui/itemviews/qlistview.h | 2 +- src/gui/itemviews/qlistview_p.h | 2 +- src/gui/itemviews/qlistwidget.cpp | 2 +- src/gui/itemviews/qlistwidget.h | 2 +- src/gui/itemviews/qlistwidget_p.h | 2 +- src/gui/itemviews/qproxymodel.cpp | 2 +- src/gui/itemviews/qproxymodel.h | 2 +- src/gui/itemviews/qproxymodel_p.h | 2 +- src/gui/itemviews/qsortfilterproxymodel.cpp | 2 +- src/gui/itemviews/qsortfilterproxymodel.h | 2 +- src/gui/itemviews/qstandarditemmodel.cpp | 2 +- src/gui/itemviews/qstandarditemmodel.h | 2 +- src/gui/itemviews/qstandarditemmodel_p.h | 2 +- src/gui/itemviews/qstringlistmodel.cpp | 2 +- src/gui/itemviews/qstringlistmodel.h | 2 +- src/gui/itemviews/qstyleditemdelegate.cpp | 2 +- src/gui/itemviews/qstyleditemdelegate.h | 2 +- src/gui/itemviews/qtableview.cpp | 2 +- src/gui/itemviews/qtableview.h | 2 +- src/gui/itemviews/qtableview_p.h | 2 +- src/gui/itemviews/qtablewidget.cpp | 2 +- src/gui/itemviews/qtablewidget.h | 2 +- src/gui/itemviews/qtablewidget_p.h | 2 +- src/gui/itemviews/qtreeview.cpp | 2 +- src/gui/itemviews/qtreeview.h | 2 +- src/gui/itemviews/qtreeview_p.h | 2 +- src/gui/itemviews/qtreewidget.cpp | 2 +- src/gui/itemviews/qtreewidget.h | 2 +- src/gui/itemviews/qtreewidget_p.h | 2 +- src/gui/itemviews/qtreewidgetitemiterator.cpp | 2 +- src/gui/itemviews/qtreewidgetitemiterator.h | 2 +- src/gui/itemviews/qtreewidgetitemiterator_p.h | 2 +- src/gui/itemviews/qwidgetitemdata_p.h | 2 +- src/gui/kernel/qaction.cpp | 2 +- src/gui/kernel/qaction.h | 2 +- src/gui/kernel/qaction_p.h | 2 +- src/gui/kernel/qactiongroup.cpp | 2 +- src/gui/kernel/qactiongroup.h | 2 +- src/gui/kernel/qapplication.cpp | 2 +- src/gui/kernel/qapplication.h | 2 +- src/gui/kernel/qapplication_mac.mm | 2 +- src/gui/kernel/qapplication_p.h | 2 +- src/gui/kernel/qapplication_qws.cpp | 2 +- src/gui/kernel/qapplication_s60.cpp | 2 +- src/gui/kernel/qapplication_win.cpp | 2 +- src/gui/kernel/qapplication_x11.cpp | 2 +- src/gui/kernel/qboxlayout.cpp | 2 +- src/gui/kernel/qboxlayout.h | 2 +- src/gui/kernel/qclipboard.cpp | 2 +- src/gui/kernel/qclipboard.h | 2 +- src/gui/kernel/qclipboard_mac.cpp | 2 +- src/gui/kernel/qclipboard_p.h | 2 +- src/gui/kernel/qclipboard_qws.cpp | 2 +- src/gui/kernel/qclipboard_s60.cpp | 2 +- src/gui/kernel/qclipboard_win.cpp | 2 +- src/gui/kernel/qclipboard_x11.cpp | 2 +- src/gui/kernel/qcocoaapplication_mac.mm | 2 +- src/gui/kernel/qcocoaapplication_mac_p.h | 2 +- src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 2 +- src/gui/kernel/qcocoaapplicationdelegate_mac_p.h | 2 +- src/gui/kernel/qcocoamenuloader_mac.mm | 2 +- src/gui/kernel/qcocoamenuloader_mac_p.h | 2 +- src/gui/kernel/qcocoapanel_mac.mm | 2 +- src/gui/kernel/qcocoapanel_mac_p.h | 2 +- src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 2 +- src/gui/kernel/qcocoaview_mac.mm | 2 +- src/gui/kernel/qcocoaview_mac_p.h | 2 +- src/gui/kernel/qcocoawindow_mac.mm | 2 +- src/gui/kernel/qcocoawindow_mac_p.h | 2 +- src/gui/kernel/qcocoawindowcustomthemeframe_mac.mm | 2 +- src/gui/kernel/qcocoawindowcustomthemeframe_mac_p.h | 2 +- src/gui/kernel/qcocoawindowdelegate_mac.mm | 2 +- src/gui/kernel/qcocoawindowdelegate_mac_p.h | 2 +- src/gui/kernel/qcursor.cpp | 2 +- src/gui/kernel/qcursor.h | 2 +- src/gui/kernel/qcursor_mac.mm | 2 +- src/gui/kernel/qcursor_p.h | 2 +- src/gui/kernel/qcursor_qws.cpp | 2 +- src/gui/kernel/qcursor_s60.cpp | 2 +- src/gui/kernel/qcursor_win.cpp | 2 +- src/gui/kernel/qcursor_x11.cpp | 2 +- src/gui/kernel/qdesktopwidget.cpp | 2 +- src/gui/kernel/qdesktopwidget.h | 2 +- src/gui/kernel/qdesktopwidget.qdoc | 2 +- src/gui/kernel/qdesktopwidget_mac.mm | 2 +- src/gui/kernel/qdesktopwidget_mac_p.h | 2 +- src/gui/kernel/qdesktopwidget_qws.cpp | 2 +- src/gui/kernel/qdesktopwidget_s60.cpp | 2 +- src/gui/kernel/qdesktopwidget_win.cpp | 2 +- src/gui/kernel/qdesktopwidget_x11.cpp | 2 +- src/gui/kernel/qdnd.cpp | 2 +- src/gui/kernel/qdnd_mac.mm | 2 +- src/gui/kernel/qdnd_p.h | 2 +- src/gui/kernel/qdnd_qws.cpp | 2 +- src/gui/kernel/qdnd_s60.cpp | 2 +- src/gui/kernel/qdnd_win.cpp | 2 +- src/gui/kernel/qdnd_x11.cpp | 2 +- src/gui/kernel/qdrag.cpp | 2 +- src/gui/kernel/qdrag.h | 2 +- src/gui/kernel/qevent.cpp | 2 +- src/gui/kernel/qevent.h | 2 +- src/gui/kernel/qevent_p.h | 2 +- src/gui/kernel/qeventdispatcher_glib_qws.cpp | 2 +- src/gui/kernel/qeventdispatcher_glib_qws_p.h | 2 +- src/gui/kernel/qeventdispatcher_mac.mm | 2 +- src/gui/kernel/qeventdispatcher_mac_p.h | 2 +- src/gui/kernel/qeventdispatcher_qws.cpp | 2 +- src/gui/kernel/qeventdispatcher_qws_p.h | 2 +- src/gui/kernel/qeventdispatcher_s60.cpp | 2 +- src/gui/kernel/qeventdispatcher_s60_p.h | 2 +- src/gui/kernel/qeventdispatcher_x11.cpp | 2 +- src/gui/kernel/qeventdispatcher_x11_p.h | 2 +- src/gui/kernel/qformlayout.cpp | 2 +- src/gui/kernel/qformlayout.h | 2 +- src/gui/kernel/qgesture.cpp | 2 +- src/gui/kernel/qgesture.h | 2 +- src/gui/kernel/qgesture_p.h | 2 +- src/gui/kernel/qgesturemanager.cpp | 2 +- src/gui/kernel/qgesturemanager_p.h | 2 +- src/gui/kernel/qgesturerecognizer.cpp | 2 +- src/gui/kernel/qgesturerecognizer.h | 2 +- src/gui/kernel/qgridlayout.cpp | 2 +- src/gui/kernel/qgridlayout.h | 2 +- src/gui/kernel/qguieventdispatcher_glib.cpp | 2 +- src/gui/kernel/qguieventdispatcher_glib_p.h | 2 +- src/gui/kernel/qguifunctions_wince.cpp | 2 +- src/gui/kernel/qguifunctions_wince.h | 2 +- src/gui/kernel/qguiplatformplugin.cpp | 2 +- src/gui/kernel/qguiplatformplugin_p.h | 2 +- src/gui/kernel/qguivariant.cpp | 2 +- src/gui/kernel/qkde.cpp | 2 +- src/gui/kernel/qkde_p.h | 2 +- src/gui/kernel/qkeymapper.cpp | 2 +- src/gui/kernel/qkeymapper_mac.cpp | 2 +- src/gui/kernel/qkeymapper_p.h | 2 +- src/gui/kernel/qkeymapper_qws.cpp | 2 +- src/gui/kernel/qkeymapper_s60.cpp | 2 +- src/gui/kernel/qkeymapper_win.cpp | 2 +- src/gui/kernel/qkeymapper_x11.cpp | 2 +- src/gui/kernel/qkeymapper_x11_p.cpp | 2 +- src/gui/kernel/qkeysequence.cpp | 2 +- src/gui/kernel/qkeysequence.h | 2 +- src/gui/kernel/qkeysequence_p.h | 2 +- src/gui/kernel/qlayout.cpp | 2 +- src/gui/kernel/qlayout.h | 2 +- src/gui/kernel/qlayout_p.h | 2 +- src/gui/kernel/qlayoutengine.cpp | 2 +- src/gui/kernel/qlayoutengine_p.h | 2 +- src/gui/kernel/qlayoutitem.cpp | 2 +- src/gui/kernel/qlayoutitem.h | 2 +- src/gui/kernel/qmacdefines_mac.h | 2 +- src/gui/kernel/qmacgesturerecognizer_mac.mm | 2 +- src/gui/kernel/qmacgesturerecognizer_mac_p.h | 2 +- src/gui/kernel/qmime.cpp | 2 +- src/gui/kernel/qmime.h | 2 +- src/gui/kernel/qmime_mac.cpp | 2 +- src/gui/kernel/qmime_win.cpp | 2 +- src/gui/kernel/qmotifdnd_x11.cpp | 2 +- src/gui/kernel/qmultitouch_mac.mm | 2 +- src/gui/kernel/qmultitouch_mac_p.h | 2 +- src/gui/kernel/qnsframeview_mac_p.h | 2 +- src/gui/kernel/qnsthemeframe_mac_p.h | 2 +- src/gui/kernel/qnstitledframe_mac_p.h | 2 +- src/gui/kernel/qole_win.cpp | 2 +- src/gui/kernel/qpalette.cpp | 2 +- src/gui/kernel/qpalette.h | 2 +- src/gui/kernel/qsessionmanager.h | 2 +- src/gui/kernel/qsessionmanager_qws.cpp | 2 +- src/gui/kernel/qshortcut.cpp | 2 +- src/gui/kernel/qshortcut.h | 2 +- src/gui/kernel/qshortcutmap.cpp | 2 +- src/gui/kernel/qshortcutmap_p.h | 2 +- src/gui/kernel/qsizepolicy.h | 2 +- src/gui/kernel/qsizepolicy.qdoc | 2 +- src/gui/kernel/qsoftkeymanager.cpp | 2 +- src/gui/kernel/qsoftkeymanager_common_p.h | 2 +- src/gui/kernel/qsoftkeymanager_p.h | 2 +- src/gui/kernel/qsoftkeymanager_s60.cpp | 2 +- src/gui/kernel/qsoftkeymanager_s60_p.h | 2 +- src/gui/kernel/qsound.cpp | 2 +- src/gui/kernel/qsound.h | 2 +- src/gui/kernel/qsound_mac.mm | 2 +- src/gui/kernel/qsound_p.h | 2 +- src/gui/kernel/qsound_qws.cpp | 2 +- src/gui/kernel/qsound_s60.cpp | 2 +- src/gui/kernel/qsound_win.cpp | 2 +- src/gui/kernel/qsound_x11.cpp | 2 +- src/gui/kernel/qstackedlayout.cpp | 2 +- src/gui/kernel/qstackedlayout.h | 2 +- src/gui/kernel/qstandardgestures.cpp | 2 +- src/gui/kernel/qstandardgestures_p.h | 2 +- src/gui/kernel/qt_cocoa_helpers_mac.mm | 2 +- src/gui/kernel/qt_cocoa_helpers_mac_p.h | 2 +- src/gui/kernel/qt_gui_pch.h | 2 +- src/gui/kernel/qt_mac.cpp | 2 +- src/gui/kernel/qt_mac_p.h | 2 +- src/gui/kernel/qt_s60_p.h | 2 +- src/gui/kernel/qt_x11_p.h | 2 +- src/gui/kernel/qtooltip.cpp | 2 +- src/gui/kernel/qtooltip.h | 2 +- src/gui/kernel/qwhatsthis.cpp | 2 +- src/gui/kernel/qwhatsthis.h | 2 +- src/gui/kernel/qwidget.cpp | 2 +- src/gui/kernel/qwidget.h | 2 +- src/gui/kernel/qwidget_mac.mm | 2 +- src/gui/kernel/qwidget_p.h | 2 +- src/gui/kernel/qwidget_qws.cpp | 2 +- src/gui/kernel/qwidget_s60.cpp | 2 +- src/gui/kernel/qwidget_win.cpp | 2 +- src/gui/kernel/qwidget_wince.cpp | 2 +- src/gui/kernel/qwidget_x11.cpp | 2 +- src/gui/kernel/qwidgetaction.cpp | 2 +- src/gui/kernel/qwidgetaction.h | 2 +- src/gui/kernel/qwidgetaction_p.h | 2 +- src/gui/kernel/qwidgetcreate_x11.cpp | 2 +- src/gui/kernel/qwindowdefs.h | 2 +- src/gui/kernel/qwindowdefs_win.h | 2 +- src/gui/kernel/qwinnativepangesturerecognizer_win.cpp | 2 +- src/gui/kernel/qwinnativepangesturerecognizer_win_p.h | 2 +- src/gui/kernel/qx11embed_x11.cpp | 2 +- src/gui/kernel/qx11embed_x11.h | 2 +- src/gui/kernel/qx11info_x11.cpp | 2 +- src/gui/kernel/qx11info_x11.h | 2 +- src/gui/math3d/qgenericmatrix.cpp | 2 +- src/gui/math3d/qgenericmatrix.h | 2 +- src/gui/math3d/qmatrix4x4.cpp | 2 +- src/gui/math3d/qmatrix4x4.h | 2 +- src/gui/math3d/qquaternion.cpp | 2 +- src/gui/math3d/qquaternion.h | 2 +- src/gui/math3d/qvector2d.cpp | 2 +- src/gui/math3d/qvector2d.h | 2 +- src/gui/math3d/qvector3d.cpp | 2 +- src/gui/math3d/qvector3d.h | 2 +- src/gui/math3d/qvector4d.cpp | 2 +- src/gui/math3d/qvector4d.h | 2 +- src/gui/painting/makepsheader.pl | 2 +- src/gui/painting/qbackingstore.cpp | 2 +- src/gui/painting/qbackingstore_p.h | 2 +- src/gui/painting/qbezier.cpp | 2 +- src/gui/painting/qbezier_p.h | 2 +- src/gui/painting/qblendfunctions.cpp | 2 +- src/gui/painting/qblendfunctions_armv6_rvct.s | 2 +- src/gui/painting/qbrush.cpp | 2 +- src/gui/painting/qbrush.h | 2 +- src/gui/painting/qcolor.cpp | 2 +- src/gui/painting/qcolor.h | 2 +- src/gui/painting/qcolor_p.cpp | 2 +- src/gui/painting/qcolor_p.h | 2 +- src/gui/painting/qcolormap.h | 2 +- src/gui/painting/qcolormap.qdoc | 2 +- src/gui/painting/qcolormap_mac.cpp | 2 +- src/gui/painting/qcolormap_qws.cpp | 2 +- src/gui/painting/qcolormap_s60.cpp | 2 +- src/gui/painting/qcolormap_win.cpp | 2 +- src/gui/painting/qcolormap_x11.cpp | 2 +- src/gui/painting/qcssutil.cpp | 2 +- src/gui/painting/qcssutil_p.h | 2 +- src/gui/painting/qcups.cpp | 2 +- src/gui/painting/qcups_p.h | 2 +- src/gui/painting/qdatabuffer_p.h | 2 +- src/gui/painting/qdrawhelper.cpp | 2 +- src/gui/painting/qdrawhelper_armv6_p.h | 2 +- src/gui/painting/qdrawhelper_armv6_rvct.inc | 2 +- src/gui/painting/qdrawhelper_armv6_rvct.s | 2 +- src/gui/painting/qdrawhelper_iwmmxt.cpp | 2 +- src/gui/painting/qdrawhelper_mmx.cpp | 2 +- src/gui/painting/qdrawhelper_mmx3dnow.cpp | 2 +- src/gui/painting/qdrawhelper_mmx_p.h | 2 +- src/gui/painting/qdrawhelper_neon.cpp | 2 +- src/gui/painting/qdrawhelper_neon_p.h | 2 +- src/gui/painting/qdrawhelper_p.h | 2 +- src/gui/painting/qdrawhelper_sse.cpp | 2 +- src/gui/painting/qdrawhelper_sse2.cpp | 2 +- src/gui/painting/qdrawhelper_sse3dnow.cpp | 2 +- src/gui/painting/qdrawhelper_sse_p.h | 2 +- src/gui/painting/qdrawhelper_x86_p.h | 2 +- src/gui/painting/qdrawutil.cpp | 2 +- src/gui/painting/qdrawutil.h | 2 +- src/gui/painting/qemulationpaintengine.cpp | 2 +- src/gui/painting/qemulationpaintengine_p.h | 2 +- src/gui/painting/qfixed_p.h | 2 +- src/gui/painting/qgraphicssystem.cpp | 2 +- src/gui/painting/qgraphicssystem_mac.cpp | 2 +- src/gui/painting/qgraphicssystem_mac_p.h | 2 +- src/gui/painting/qgraphicssystem_p.h | 2 +- src/gui/painting/qgraphicssystem_qws.cpp | 2 +- src/gui/painting/qgraphicssystem_qws_p.h | 2 +- src/gui/painting/qgraphicssystem_raster.cpp | 2 +- src/gui/painting/qgraphicssystem_raster_p.h | 2 +- src/gui/painting/qgraphicssystemfactory.cpp | 2 +- src/gui/painting/qgraphicssystemfactory_p.h | 2 +- src/gui/painting/qgraphicssystemplugin.cpp | 2 +- src/gui/painting/qgraphicssystemplugin_p.h | 2 +- src/gui/painting/qgrayraster.c | 2 +- src/gui/painting/qgrayraster_p.h | 2 +- src/gui/painting/qimagescale.cpp | 2 +- src/gui/painting/qimagescale_p.h | 2 +- src/gui/painting/qmath_p.h | 2 +- src/gui/painting/qmatrix.cpp | 2 +- src/gui/painting/qmatrix.h | 2 +- src/gui/painting/qmemrotate.cpp | 2 +- src/gui/painting/qmemrotate_p.h | 2 +- src/gui/painting/qoutlinemapper.cpp | 2 +- src/gui/painting/qoutlinemapper_p.h | 2 +- src/gui/painting/qpaintbuffer.cpp | 2 +- src/gui/painting/qpaintbuffer_p.h | 2 +- src/gui/painting/qpaintdevice.cpp | 2 +- src/gui/painting/qpaintdevice.h | 2 +- src/gui/painting/qpaintdevice.qdoc | 2 +- src/gui/painting/qpaintdevice_mac.cpp | 2 +- src/gui/painting/qpaintdevice_qws.cpp | 2 +- src/gui/painting/qpaintdevice_win.cpp | 2 +- src/gui/painting/qpaintdevice_x11.cpp | 2 +- src/gui/painting/qpaintengine.cpp | 2 +- src/gui/painting/qpaintengine.h | 2 +- src/gui/painting/qpaintengine_alpha.cpp | 2 +- src/gui/painting/qpaintengine_alpha_p.h | 2 +- src/gui/painting/qpaintengine_mac.cpp | 2 +- src/gui/painting/qpaintengine_mac_p.h | 2 +- src/gui/painting/qpaintengine_p.h | 2 +- src/gui/painting/qpaintengine_preview.cpp | 2 +- src/gui/painting/qpaintengine_preview_p.h | 2 +- src/gui/painting/qpaintengine_raster.cpp | 2 +- src/gui/painting/qpaintengine_raster_p.h | 2 +- src/gui/painting/qpaintengine_s60.cpp | 2 +- src/gui/painting/qpaintengine_s60_p.h | 2 +- src/gui/painting/qpaintengine_x11.cpp | 2 +- src/gui/painting/qpaintengine_x11_p.h | 2 +- src/gui/painting/qpaintengineex.cpp | 2 +- src/gui/painting/qpaintengineex_p.h | 2 +- src/gui/painting/qpainter.cpp | 2 +- src/gui/painting/qpainter.h | 2 +- src/gui/painting/qpainter_p.h | 2 +- src/gui/painting/qpainterpath.cpp | 2 +- src/gui/painting/qpainterpath.h | 2 +- src/gui/painting/qpainterpath_p.h | 2 +- src/gui/painting/qpathclipper.cpp | 2 +- src/gui/painting/qpathclipper_p.h | 2 +- src/gui/painting/qpdf.cpp | 2 +- src/gui/painting/qpdf_p.h | 2 +- src/gui/painting/qpen.cpp | 2 +- src/gui/painting/qpen.h | 2 +- src/gui/painting/qpen_p.h | 2 +- src/gui/painting/qpolygon.cpp | 2 +- src/gui/painting/qpolygon.h | 2 +- src/gui/painting/qpolygonclipper_p.h | 2 +- src/gui/painting/qprintengine.h | 2 +- src/gui/painting/qprintengine_mac.mm | 2 +- src/gui/painting/qprintengine_mac_p.h | 2 +- src/gui/painting/qprintengine_pdf.cpp | 2 +- src/gui/painting/qprintengine_pdf_p.h | 2 +- src/gui/painting/qprintengine_ps.cpp | 2 +- src/gui/painting/qprintengine_ps_p.h | 2 +- src/gui/painting/qprintengine_qws.cpp | 2 +- src/gui/painting/qprintengine_qws_p.h | 2 +- src/gui/painting/qprintengine_win.cpp | 2 +- src/gui/painting/qprintengine_win_p.h | 2 +- src/gui/painting/qprinter.cpp | 2 +- src/gui/painting/qprinter.h | 2 +- src/gui/painting/qprinter_p.h | 2 +- src/gui/painting/qprinterinfo.h | 2 +- src/gui/painting/qprinterinfo.qdoc | 2 +- src/gui/painting/qprinterinfo_mac.cpp | 2 +- src/gui/painting/qprinterinfo_unix.cpp | 2 +- src/gui/painting/qprinterinfo_unix_p.h | 2 +- src/gui/painting/qprinterinfo_win.cpp | 2 +- src/gui/painting/qrasterdefs_p.h | 2 +- src/gui/painting/qrasterizer.cpp | 2 +- src/gui/painting/qrasterizer_p.h | 2 +- src/gui/painting/qregion.cpp | 2 +- src/gui/painting/qregion.h | 2 +- src/gui/painting/qregion_mac.cpp | 2 +- src/gui/painting/qregion_qws.cpp | 2 +- src/gui/painting/qregion_s60.cpp | 2 +- src/gui/painting/qregion_win.cpp | 2 +- src/gui/painting/qregion_x11.cpp | 2 +- src/gui/painting/qrgb.h | 2 +- src/gui/painting/qstroker.cpp | 2 +- src/gui/painting/qstroker_p.h | 2 +- src/gui/painting/qstylepainter.cpp | 2 +- src/gui/painting/qstylepainter.h | 2 +- src/gui/painting/qtessellator.cpp | 2 +- src/gui/painting/qtessellator_p.h | 2 +- src/gui/painting/qtextureglyphcache.cpp | 2 +- src/gui/painting/qtextureglyphcache_p.h | 2 +- src/gui/painting/qtransform.cpp | 2 +- src/gui/painting/qtransform.h | 2 +- src/gui/painting/qvectorpath_p.h | 2 +- src/gui/painting/qwindowsurface.cpp | 2 +- src/gui/painting/qwindowsurface_mac.cpp | 2 +- src/gui/painting/qwindowsurface_mac_p.h | 2 +- src/gui/painting/qwindowsurface_p.h | 2 +- src/gui/painting/qwindowsurface_qws.cpp | 2 +- src/gui/painting/qwindowsurface_qws_p.h | 2 +- src/gui/painting/qwindowsurface_raster.cpp | 2 +- src/gui/painting/qwindowsurface_raster_p.h | 2 +- src/gui/painting/qwindowsurface_s60.cpp | 2 +- src/gui/painting/qwindowsurface_s60_p.h | 2 +- src/gui/painting/qwindowsurface_x11.cpp | 2 +- src/gui/painting/qwindowsurface_x11_p.h | 2 +- src/gui/painting/qwmatrix.h | 2 +- src/gui/s60framework/qs60mainapplication.cpp | 2 +- src/gui/s60framework/qs60mainapplication.h | 2 +- src/gui/s60framework/qs60mainapplication_p.h | 2 +- src/gui/s60framework/qs60mainappui.cpp | 2 +- src/gui/s60framework/qs60mainappui.h | 2 +- src/gui/s60framework/qs60maindocument.cpp | 2 +- src/gui/s60framework/qs60maindocument.h | 2 +- src/gui/s60framework/s60main.rss | 2 +- src/gui/statemachine/qbasickeyeventtransition.cpp | 2 +- src/gui/statemachine/qbasickeyeventtransition_p.h | 2 +- src/gui/statemachine/qbasicmouseeventtransition.cpp | 2 +- src/gui/statemachine/qbasicmouseeventtransition_p.h | 2 +- src/gui/statemachine/qguistatemachine.cpp | 2 +- src/gui/statemachine/qkeyeventtransition.cpp | 2 +- src/gui/statemachine/qkeyeventtransition.h | 2 +- src/gui/statemachine/qmouseeventtransition.cpp | 2 +- src/gui/statemachine/qmouseeventtransition.h | 2 +- src/gui/styles/qcdestyle.cpp | 2 +- src/gui/styles/qcdestyle.h | 2 +- src/gui/styles/qcleanlooksstyle.cpp | 2 +- src/gui/styles/qcleanlooksstyle.h | 2 +- src/gui/styles/qcleanlooksstyle_p.h | 2 +- src/gui/styles/qcommonstyle.cpp | 2 +- src/gui/styles/qcommonstyle.h | 2 +- src/gui/styles/qcommonstyle_p.h | 2 +- src/gui/styles/qcommonstylepixmaps_p.h | 2 +- src/gui/styles/qgtkpainter.cpp | 2 +- src/gui/styles/qgtkpainter_p.h | 2 +- src/gui/styles/qgtkstyle.cpp | 2 +- src/gui/styles/qgtkstyle.h | 2 +- src/gui/styles/qgtkstyle_p.cpp | 2 +- src/gui/styles/qgtkstyle_p.h | 2 +- src/gui/styles/qmacstyle.qdoc | 2 +- src/gui/styles/qmacstyle_mac.h | 2 +- src/gui/styles/qmacstyle_mac.mm | 2 +- src/gui/styles/qmacstylepixmaps_mac_p.h | 2 +- src/gui/styles/qmotifstyle.cpp | 2 +- src/gui/styles/qmotifstyle.h | 2 +- src/gui/styles/qmotifstyle_p.h | 2 +- src/gui/styles/qplastiquestyle.cpp | 2 +- src/gui/styles/qplastiquestyle.h | 2 +- src/gui/styles/qproxystyle.cpp | 2 +- src/gui/styles/qproxystyle.h | 2 +- src/gui/styles/qproxystyle_p.h | 2 +- src/gui/styles/qs60style.cpp | 2 +- src/gui/styles/qs60style.h | 2 +- src/gui/styles/qs60style_p.h | 2 +- src/gui/styles/qs60style_s60.cpp | 2 +- src/gui/styles/qs60style_simulated.cpp | 2 +- src/gui/styles/qstyle.cpp | 2 +- src/gui/styles/qstyle.h | 2 +- src/gui/styles/qstyle_p.h | 2 +- src/gui/styles/qstylefactory.cpp | 2 +- src/gui/styles/qstylefactory.h | 2 +- src/gui/styles/qstylehelper.cpp | 2 +- src/gui/styles/qstylehelper_p.h | 2 +- src/gui/styles/qstyleoption.cpp | 2 +- src/gui/styles/qstyleoption.h | 2 +- src/gui/styles/qstyleplugin.cpp | 2 +- src/gui/styles/qstyleplugin.h | 2 +- src/gui/styles/qstylesheetstyle.cpp | 2 +- src/gui/styles/qstylesheetstyle_default.cpp | 2 +- src/gui/styles/qstylesheetstyle_p.h | 2 +- src/gui/styles/qwindowscestyle.cpp | 2 +- src/gui/styles/qwindowscestyle.h | 2 +- src/gui/styles/qwindowscestyle_p.h | 2 +- src/gui/styles/qwindowsmobilestyle.cpp | 2 +- src/gui/styles/qwindowsmobilestyle.h | 2 +- src/gui/styles/qwindowsmobilestyle_p.h | 2 +- src/gui/styles/qwindowsstyle.cpp | 2 +- src/gui/styles/qwindowsstyle.h | 2 +- src/gui/styles/qwindowsstyle_p.h | 2 +- src/gui/styles/qwindowsvistastyle.cpp | 2 +- src/gui/styles/qwindowsvistastyle.h | 2 +- src/gui/styles/qwindowsvistastyle_p.h | 2 +- src/gui/styles/qwindowsxpstyle.cpp | 2 +- src/gui/styles/qwindowsxpstyle.h | 2 +- src/gui/styles/qwindowsxpstyle_p.h | 2 +- src/gui/symbian/qsymbianevent.cpp | 2 +- src/gui/symbian/qsymbianevent.h | 2 +- src/gui/text/qabstractfontengine_p.h | 2 +- src/gui/text/qabstractfontengine_qws.cpp | 2 +- src/gui/text/qabstractfontengine_qws.h | 2 +- src/gui/text/qabstracttextdocumentlayout.cpp | 2 +- src/gui/text/qabstracttextdocumentlayout.h | 2 +- src/gui/text/qabstracttextdocumentlayout_p.h | 2 +- src/gui/text/qcssparser.cpp | 2 +- src/gui/text/qcssparser_p.h | 2 +- src/gui/text/qcssscanner.cpp | 2 +- src/gui/text/qfont.cpp | 2 +- src/gui/text/qfont.h | 2 +- src/gui/text/qfont_mac.cpp | 2 +- src/gui/text/qfont_p.h | 2 +- src/gui/text/qfont_qws.cpp | 2 +- src/gui/text/qfont_s60.cpp | 2 +- src/gui/text/qfont_win.cpp | 2 +- src/gui/text/qfont_x11.cpp | 2 +- src/gui/text/qfontdatabase.cpp | 2 +- src/gui/text/qfontdatabase.h | 2 +- src/gui/text/qfontdatabase_mac.cpp | 2 +- src/gui/text/qfontdatabase_qws.cpp | 2 +- src/gui/text/qfontdatabase_s60.cpp | 2 +- src/gui/text/qfontdatabase_win.cpp | 2 +- src/gui/text/qfontdatabase_x11.cpp | 2 +- src/gui/text/qfontengine.cpp | 2 +- src/gui/text/qfontengine_ft.cpp | 2 +- src/gui/text/qfontengine_ft_p.h | 2 +- src/gui/text/qfontengine_mac.mm | 2 +- src/gui/text/qfontengine_p.h | 2 +- src/gui/text/qfontengine_qpf.cpp | 2 +- src/gui/text/qfontengine_qpf_p.h | 2 +- src/gui/text/qfontengine_qws.cpp | 2 +- src/gui/text/qfontengine_s60.cpp | 2 +- src/gui/text/qfontengine_s60_p.h | 2 +- src/gui/text/qfontengine_win.cpp | 2 +- src/gui/text/qfontengine_win_p.h | 2 +- src/gui/text/qfontengine_x11.cpp | 2 +- src/gui/text/qfontengine_x11_p.h | 2 +- src/gui/text/qfontengineglyphcache_p.h | 2 +- src/gui/text/qfontinfo.h | 2 +- src/gui/text/qfontmetrics.cpp | 2 +- src/gui/text/qfontmetrics.h | 2 +- src/gui/text/qfontsubset.cpp | 2 +- src/gui/text/qfontsubset_p.h | 2 +- src/gui/text/qfragmentmap.cpp | 2 +- src/gui/text/qfragmentmap_p.h | 2 +- src/gui/text/qpfutil.cpp | 2 +- src/gui/text/qsyntaxhighlighter.cpp | 2 +- src/gui/text/qsyntaxhighlighter.h | 2 +- src/gui/text/qtextcontrol.cpp | 2 +- src/gui/text/qtextcontrol_p.h | 2 +- src/gui/text/qtextcontrol_p_p.h | 2 +- src/gui/text/qtextcursor.cpp | 2 +- src/gui/text/qtextcursor.h | 2 +- src/gui/text/qtextcursor_p.h | 2 +- src/gui/text/qtextdocument.cpp | 2 +- src/gui/text/qtextdocument.h | 2 +- src/gui/text/qtextdocument_p.cpp | 2 +- src/gui/text/qtextdocument_p.h | 2 +- src/gui/text/qtextdocumentfragment.cpp | 2 +- src/gui/text/qtextdocumentfragment.h | 2 +- src/gui/text/qtextdocumentfragment_p.h | 2 +- src/gui/text/qtextdocumentlayout.cpp | 2 +- src/gui/text/qtextdocumentlayout_p.h | 2 +- src/gui/text/qtextdocumentwriter.cpp | 2 +- src/gui/text/qtextdocumentwriter.h | 2 +- src/gui/text/qtextengine.cpp | 2 +- src/gui/text/qtextengine_mac.cpp | 2 +- src/gui/text/qtextengine_p.h | 2 +- src/gui/text/qtextformat.cpp | 2 +- src/gui/text/qtextformat.h | 2 +- src/gui/text/qtextformat_p.h | 2 +- src/gui/text/qtexthtmlparser.cpp | 2 +- src/gui/text/qtexthtmlparser_p.h | 2 +- src/gui/text/qtextimagehandler.cpp | 2 +- src/gui/text/qtextimagehandler_p.h | 2 +- src/gui/text/qtextlayout.cpp | 2 +- src/gui/text/qtextlayout.h | 2 +- src/gui/text/qtextlist.cpp | 2 +- src/gui/text/qtextlist.h | 2 +- src/gui/text/qtextobject.cpp | 2 +- src/gui/text/qtextobject.h | 2 +- src/gui/text/qtextobject_p.h | 2 +- src/gui/text/qtextodfwriter.cpp | 2 +- src/gui/text/qtextodfwriter_p.h | 2 +- src/gui/text/qtextoption.cpp | 2 +- src/gui/text/qtextoption.h | 2 +- src/gui/text/qtexttable.cpp | 2 +- src/gui/text/qtexttable.h | 2 +- src/gui/text/qtexttable_p.h | 2 +- src/gui/text/qzip.cpp | 2 +- src/gui/text/qzipreader_p.h | 2 +- src/gui/text/qzipwriter_p.h | 2 +- src/gui/util/qcompleter.cpp | 2 +- src/gui/util/qcompleter.h | 2 +- src/gui/util/qcompleter_p.h | 2 +- src/gui/util/qdesktopservices.cpp | 2 +- src/gui/util/qdesktopservices.h | 2 +- src/gui/util/qdesktopservices_mac.cpp | 2 +- src/gui/util/qdesktopservices_qws.cpp | 2 +- src/gui/util/qdesktopservices_s60.cpp | 2 +- src/gui/util/qdesktopservices_win.cpp | 2 +- src/gui/util/qdesktopservices_x11.cpp | 2 +- src/gui/util/qsystemtrayicon.cpp | 2 +- src/gui/util/qsystemtrayicon.h | 2 +- src/gui/util/qsystemtrayicon_mac.mm | 2 +- src/gui/util/qsystemtrayicon_p.h | 2 +- src/gui/util/qsystemtrayicon_qws.cpp | 2 +- src/gui/util/qsystemtrayicon_win.cpp | 2 +- src/gui/util/qsystemtrayicon_wince.cpp | 2 +- src/gui/util/qsystemtrayicon_x11.cpp | 2 +- src/gui/util/qundogroup.cpp | 2 +- src/gui/util/qundogroup.h | 2 +- src/gui/util/qundostack.cpp | 2 +- src/gui/util/qundostack.h | 2 +- src/gui/util/qundostack_p.h | 2 +- src/gui/util/qundoview.cpp | 2 +- src/gui/util/qundoview.h | 2 +- src/gui/widgets/qabstractbutton.cpp | 2 +- src/gui/widgets/qabstractbutton.h | 2 +- src/gui/widgets/qabstractbutton_p.h | 2 +- src/gui/widgets/qabstractscrollarea.cpp | 2 +- src/gui/widgets/qabstractscrollarea.h | 2 +- src/gui/widgets/qabstractscrollarea_p.h | 2 +- src/gui/widgets/qabstractslider.cpp | 2 +- src/gui/widgets/qabstractslider.h | 2 +- src/gui/widgets/qabstractslider_p.h | 2 +- src/gui/widgets/qabstractspinbox.cpp | 2 +- src/gui/widgets/qabstractspinbox.h | 2 +- src/gui/widgets/qabstractspinbox_p.h | 2 +- src/gui/widgets/qbuttongroup.cpp | 2 +- src/gui/widgets/qbuttongroup.h | 2 +- src/gui/widgets/qcalendartextnavigator_p.h | 2 +- src/gui/widgets/qcalendarwidget.cpp | 2 +- src/gui/widgets/qcalendarwidget.h | 2 +- src/gui/widgets/qcheckbox.cpp | 2 +- src/gui/widgets/qcheckbox.h | 2 +- src/gui/widgets/qcocoamenu_mac.mm | 2 +- src/gui/widgets/qcocoamenu_mac_p.h | 2 +- src/gui/widgets/qcocoatoolbardelegate_mac.mm | 2 +- src/gui/widgets/qcocoatoolbardelegate_mac_p.h | 2 +- src/gui/widgets/qcombobox.cpp | 2 +- src/gui/widgets/qcombobox.h | 2 +- src/gui/widgets/qcombobox_p.h | 2 +- src/gui/widgets/qcommandlinkbutton.cpp | 2 +- src/gui/widgets/qcommandlinkbutton.h | 2 +- src/gui/widgets/qdatetimeedit.cpp | 2 +- src/gui/widgets/qdatetimeedit.h | 2 +- src/gui/widgets/qdatetimeedit_p.h | 2 +- src/gui/widgets/qdial.cpp | 2 +- src/gui/widgets/qdial.h | 2 +- src/gui/widgets/qdialogbuttonbox.cpp | 2 +- src/gui/widgets/qdialogbuttonbox.h | 2 +- src/gui/widgets/qdockarealayout.cpp | 2 +- src/gui/widgets/qdockarealayout_p.h | 2 +- src/gui/widgets/qdockwidget.cpp | 2 +- src/gui/widgets/qdockwidget.h | 2 +- src/gui/widgets/qdockwidget_p.h | 2 +- src/gui/widgets/qeffects.cpp | 2 +- src/gui/widgets/qeffects_p.h | 2 +- src/gui/widgets/qfocusframe.cpp | 2 +- src/gui/widgets/qfocusframe.h | 2 +- src/gui/widgets/qfontcombobox.cpp | 2 +- src/gui/widgets/qfontcombobox.h | 2 +- src/gui/widgets/qframe.cpp | 2 +- src/gui/widgets/qframe.h | 2 +- src/gui/widgets/qframe_p.h | 2 +- src/gui/widgets/qgroupbox.cpp | 2 +- src/gui/widgets/qgroupbox.h | 2 +- src/gui/widgets/qlabel.cpp | 2 +- src/gui/widgets/qlabel.h | 2 +- src/gui/widgets/qlabel_p.h | 2 +- src/gui/widgets/qlcdnumber.cpp | 2 +- src/gui/widgets/qlcdnumber.h | 2 +- src/gui/widgets/qlinecontrol.cpp | 2 +- src/gui/widgets/qlinecontrol_p.h | 2 +- src/gui/widgets/qlineedit.cpp | 2 +- src/gui/widgets/qlineedit.h | 2 +- src/gui/widgets/qlineedit_p.cpp | 2 +- src/gui/widgets/qlineedit_p.h | 2 +- src/gui/widgets/qmaccocoaviewcontainer_mac.h | 2 +- src/gui/widgets/qmaccocoaviewcontainer_mac.mm | 2 +- src/gui/widgets/qmacnativewidget_mac.h | 2 +- src/gui/widgets/qmacnativewidget_mac.mm | 2 +- src/gui/widgets/qmainwindow.cpp | 2 +- src/gui/widgets/qmainwindow.h | 2 +- src/gui/widgets/qmainwindowlayout.cpp | 2 +- src/gui/widgets/qmainwindowlayout_mac.mm | 2 +- src/gui/widgets/qmainwindowlayout_p.h | 2 +- src/gui/widgets/qmdiarea.cpp | 2 +- src/gui/widgets/qmdiarea.h | 2 +- src/gui/widgets/qmdiarea_p.h | 2 +- src/gui/widgets/qmdisubwindow.cpp | 2 +- src/gui/widgets/qmdisubwindow.h | 2 +- src/gui/widgets/qmdisubwindow_p.h | 2 +- src/gui/widgets/qmenu.cpp | 2 +- src/gui/widgets/qmenu.h | 2 +- src/gui/widgets/qmenu_mac.mm | 2 +- src/gui/widgets/qmenu_p.h | 2 +- src/gui/widgets/qmenu_symbian.cpp | 2 +- src/gui/widgets/qmenu_wince.cpp | 2 +- src/gui/widgets/qmenu_wince_resource_p.h | 2 +- src/gui/widgets/qmenubar.cpp | 2 +- src/gui/widgets/qmenubar.h | 2 +- src/gui/widgets/qmenubar_p.h | 2 +- src/gui/widgets/qmenudata.cpp | 2 +- src/gui/widgets/qmenudata.h | 2 +- src/gui/widgets/qplaintextedit.cpp | 2 +- src/gui/widgets/qplaintextedit.h | 2 +- src/gui/widgets/qplaintextedit_p.h | 2 +- src/gui/widgets/qprintpreviewwidget.cpp | 2 +- src/gui/widgets/qprintpreviewwidget.h | 2 +- src/gui/widgets/qprogressbar.cpp | 2 +- src/gui/widgets/qprogressbar.h | 2 +- src/gui/widgets/qpushbutton.cpp | 2 +- src/gui/widgets/qpushbutton.h | 2 +- src/gui/widgets/qpushbutton_p.h | 2 +- src/gui/widgets/qradiobutton.cpp | 2 +- src/gui/widgets/qradiobutton.h | 2 +- src/gui/widgets/qrubberband.cpp | 2 +- src/gui/widgets/qrubberband.h | 2 +- src/gui/widgets/qscrollarea.cpp | 2 +- src/gui/widgets/qscrollarea.h | 2 +- src/gui/widgets/qscrollarea_p.h | 2 +- src/gui/widgets/qscrollbar.cpp | 2 +- src/gui/widgets/qscrollbar.h | 2 +- src/gui/widgets/qsizegrip.cpp | 2 +- src/gui/widgets/qsizegrip.h | 2 +- src/gui/widgets/qslider.cpp | 2 +- src/gui/widgets/qslider.h | 2 +- src/gui/widgets/qspinbox.cpp | 2 +- src/gui/widgets/qspinbox.h | 2 +- src/gui/widgets/qsplashscreen.cpp | 2 +- src/gui/widgets/qsplashscreen.h | 2 +- src/gui/widgets/qsplitter.cpp | 2 +- src/gui/widgets/qsplitter.h | 2 +- src/gui/widgets/qsplitter_p.h | 2 +- src/gui/widgets/qstackedwidget.cpp | 2 +- src/gui/widgets/qstackedwidget.h | 2 +- src/gui/widgets/qstatusbar.cpp | 2 +- src/gui/widgets/qstatusbar.h | 2 +- src/gui/widgets/qtabbar.cpp | 2 +- src/gui/widgets/qtabbar.h | 2 +- src/gui/widgets/qtabbar_p.h | 2 +- src/gui/widgets/qtabwidget.cpp | 2 +- src/gui/widgets/qtabwidget.h | 2 +- src/gui/widgets/qtextbrowser.cpp | 2 +- src/gui/widgets/qtextbrowser.h | 2 +- src/gui/widgets/qtextedit.cpp | 2 +- src/gui/widgets/qtextedit.h | 2 +- src/gui/widgets/qtextedit_p.h | 2 +- src/gui/widgets/qtoolbar.cpp | 2 +- src/gui/widgets/qtoolbar.h | 2 +- src/gui/widgets/qtoolbar_p.h | 2 +- src/gui/widgets/qtoolbararealayout.cpp | 2 +- src/gui/widgets/qtoolbararealayout_p.h | 2 +- src/gui/widgets/qtoolbarextension.cpp | 2 +- src/gui/widgets/qtoolbarextension_p.h | 2 +- src/gui/widgets/qtoolbarlayout.cpp | 2 +- src/gui/widgets/qtoolbarlayout_p.h | 2 +- src/gui/widgets/qtoolbarseparator.cpp | 2 +- src/gui/widgets/qtoolbarseparator_p.h | 2 +- src/gui/widgets/qtoolbox.cpp | 2 +- src/gui/widgets/qtoolbox.h | 2 +- src/gui/widgets/qtoolbutton.cpp | 2 +- src/gui/widgets/qtoolbutton.h | 2 +- src/gui/widgets/qvalidator.cpp | 2 +- src/gui/widgets/qvalidator.h | 2 +- src/gui/widgets/qwidgetanimator.cpp | 2 +- src/gui/widgets/qwidgetanimator_p.h | 2 +- src/gui/widgets/qwidgetresizehandler.cpp | 2 +- src/gui/widgets/qwidgetresizehandler_p.h | 2 +- src/gui/widgets/qworkspace.cpp | 2 +- src/gui/widgets/qworkspace.h | 2 +- src/multimedia/audio/qaudio.cpp | 2 +- src/multimedia/audio/qaudio.h | 2 +- src/multimedia/audio/qaudio_mac.cpp | 2 +- src/multimedia/audio/qaudio_mac_p.h | 2 +- src/multimedia/audio/qaudio_symbian_p.cpp | 2 +- src/multimedia/audio/qaudio_symbian_p.h | 2 +- src/multimedia/audio/qaudiodevicefactory.cpp | 2 +- src/multimedia/audio/qaudiodevicefactory_p.h | 2 +- src/multimedia/audio/qaudiodeviceinfo.cpp | 2 +- src/multimedia/audio/qaudiodeviceinfo.h | 2 +- src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | 2 +- src/multimedia/audio/qaudiodeviceinfo_alsa_p.h | 2 +- src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp | 2 +- src/multimedia/audio/qaudiodeviceinfo_mac_p.h | 2 +- src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp | 2 +- src/multimedia/audio/qaudiodeviceinfo_symbian_p.h | 2 +- src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp | 2 +- src/multimedia/audio/qaudiodeviceinfo_win32_p.h | 2 +- src/multimedia/audio/qaudioengine.cpp | 2 +- src/multimedia/audio/qaudioengine.h | 2 +- src/multimedia/audio/qaudioengineplugin.cpp | 2 +- src/multimedia/audio/qaudioengineplugin.h | 2 +- src/multimedia/audio/qaudioformat.cpp | 2 +- src/multimedia/audio/qaudioformat.h | 2 +- src/multimedia/audio/qaudioinput.cpp | 2 +- src/multimedia/audio/qaudioinput.h | 2 +- src/multimedia/audio/qaudioinput_alsa_p.cpp | 2 +- src/multimedia/audio/qaudioinput_alsa_p.h | 2 +- src/multimedia/audio/qaudioinput_mac_p.cpp | 2 +- src/multimedia/audio/qaudioinput_mac_p.h | 2 +- src/multimedia/audio/qaudioinput_symbian_p.cpp | 2 +- src/multimedia/audio/qaudioinput_symbian_p.h | 2 +- src/multimedia/audio/qaudioinput_win32_p.cpp | 2 +- src/multimedia/audio/qaudioinput_win32_p.h | 2 +- src/multimedia/audio/qaudiooutput.cpp | 2 +- src/multimedia/audio/qaudiooutput.h | 2 +- src/multimedia/audio/qaudiooutput_alsa_p.cpp | 2 +- src/multimedia/audio/qaudiooutput_alsa_p.h | 2 +- src/multimedia/audio/qaudiooutput_mac_p.cpp | 2 +- src/multimedia/audio/qaudiooutput_mac_p.h | 2 +- src/multimedia/audio/qaudiooutput_symbian_p.cpp | 2 +- src/multimedia/audio/qaudiooutput_symbian_p.h | 2 +- src/multimedia/audio/qaudiooutput_win32_p.cpp | 2 +- src/multimedia/audio/qaudiooutput_win32_p.h | 2 +- src/multimedia/video/qabstractvideobuffer.cpp | 2 +- src/multimedia/video/qabstractvideobuffer.h | 2 +- src/multimedia/video/qabstractvideobuffer_p.h | 2 +- src/multimedia/video/qabstractvideosurface.cpp | 2 +- src/multimedia/video/qabstractvideosurface.h | 2 +- src/multimedia/video/qabstractvideosurface_p.h | 2 +- src/multimedia/video/qimagevideobuffer.cpp | 2 +- src/multimedia/video/qimagevideobuffer_p.h | 2 +- src/multimedia/video/qmemoryvideobuffer.cpp | 2 +- src/multimedia/video/qmemoryvideobuffer_p.h | 2 +- src/multimedia/video/qvideoframe.cpp | 2 +- src/multimedia/video/qvideoframe.h | 2 +- src/multimedia/video/qvideosurfaceformat.cpp | 2 +- src/multimedia/video/qvideosurfaceformat.h | 2 +- src/network/access/qabstractnetworkcache.cpp | 2 +- src/network/access/qabstractnetworkcache.h | 2 +- src/network/access/qabstractnetworkcache_p.h | 2 +- src/network/access/qfilenetworkreply.cpp | 2 +- src/network/access/qfilenetworkreply_p.h | 2 +- src/network/access/qftp.cpp | 2 +- src/network/access/qftp.h | 2 +- src/network/access/qhttp.cpp | 2 +- src/network/access/qhttp.h | 2 +- src/network/access/qhttpnetworkconnection.cpp | 2 +- src/network/access/qhttpnetworkconnection_p.h | 2 +- src/network/access/qhttpnetworkconnectionchannel.cpp | 2 +- src/network/access/qhttpnetworkconnectionchannel_p.h | 2 +- src/network/access/qhttpnetworkheader.cpp | 2 +- src/network/access/qhttpnetworkheader_p.h | 2 +- src/network/access/qhttpnetworkreply.cpp | 2 +- src/network/access/qhttpnetworkreply_p.h | 2 +- src/network/access/qhttpnetworkrequest.cpp | 2 +- src/network/access/qhttpnetworkrequest_p.h | 2 +- src/network/access/qnetworkaccessbackend.cpp | 2 +- src/network/access/qnetworkaccessbackend_p.h | 2 +- src/network/access/qnetworkaccesscache.cpp | 2 +- src/network/access/qnetworkaccesscache_p.h | 2 +- src/network/access/qnetworkaccesscachebackend.cpp | 2 +- src/network/access/qnetworkaccesscachebackend_p.h | 2 +- src/network/access/qnetworkaccessdatabackend.cpp | 2 +- src/network/access/qnetworkaccessdatabackend_p.h | 2 +- src/network/access/qnetworkaccessdebugpipebackend.cpp | 2 +- src/network/access/qnetworkaccessdebugpipebackend_p.h | 2 +- src/network/access/qnetworkaccessfilebackend.cpp | 2 +- src/network/access/qnetworkaccessfilebackend_p.h | 2 +- src/network/access/qnetworkaccessftpbackend.cpp | 2 +- src/network/access/qnetworkaccessftpbackend_p.h | 2 +- src/network/access/qnetworkaccesshttpbackend.cpp | 2 +- src/network/access/qnetworkaccesshttpbackend_p.h | 2 +- src/network/access/qnetworkaccessmanager.cpp | 2 +- src/network/access/qnetworkaccessmanager.h | 2 +- src/network/access/qnetworkaccessmanager_p.h | 2 +- src/network/access/qnetworkcookie.cpp | 2 +- src/network/access/qnetworkcookie.h | 2 +- src/network/access/qnetworkcookie_p.h | 2 +- src/network/access/qnetworkcookiejar.cpp | 2 +- src/network/access/qnetworkcookiejar.h | 2 +- src/network/access/qnetworkcookiejar_p.h | 2 +- src/network/access/qnetworkdiskcache.cpp | 2 +- src/network/access/qnetworkdiskcache.h | 2 +- src/network/access/qnetworkdiskcache_p.h | 2 +- src/network/access/qnetworkreply.cpp | 2 +- src/network/access/qnetworkreply.h | 2 +- src/network/access/qnetworkreply_p.h | 2 +- src/network/access/qnetworkreplyimpl.cpp | 2 +- src/network/access/qnetworkreplyimpl_p.h | 2 +- src/network/access/qnetworkrequest.cpp | 2 +- src/network/access/qnetworkrequest.h | 2 +- src/network/access/qnetworkrequest_p.h | 2 +- src/network/kernel/qauthenticator.cpp | 2 +- src/network/kernel/qauthenticator.h | 2 +- src/network/kernel/qauthenticator_p.h | 2 +- src/network/kernel/qhostaddress.cpp | 2 +- src/network/kernel/qhostaddress.h | 2 +- src/network/kernel/qhostaddress_p.h | 2 +- src/network/kernel/qhostinfo.cpp | 2 +- src/network/kernel/qhostinfo.h | 2 +- src/network/kernel/qhostinfo_p.h | 2 +- src/network/kernel/qhostinfo_unix.cpp | 2 +- src/network/kernel/qhostinfo_win.cpp | 2 +- src/network/kernel/qnetworkinterface.cpp | 2 +- src/network/kernel/qnetworkinterface.h | 2 +- src/network/kernel/qnetworkinterface_p.h | 2 +- src/network/kernel/qnetworkinterface_symbian.cpp | 2 +- src/network/kernel/qnetworkinterface_unix.cpp | 2 +- src/network/kernel/qnetworkinterface_win.cpp | 2 +- src/network/kernel/qnetworkinterface_win_p.h | 2 +- src/network/kernel/qnetworkproxy.cpp | 2 +- src/network/kernel/qnetworkproxy.h | 2 +- src/network/kernel/qnetworkproxy_generic.cpp | 2 +- src/network/kernel/qnetworkproxy_mac.cpp | 2 +- src/network/kernel/qnetworkproxy_win.cpp | 2 +- src/network/kernel/qurlinfo.cpp | 2 +- src/network/kernel/qurlinfo.h | 2 +- src/network/socket/qabstractsocket.cpp | 2 +- src/network/socket/qabstractsocket.h | 2 +- src/network/socket/qabstractsocket_p.h | 2 +- src/network/socket/qabstractsocketengine.cpp | 2 +- src/network/socket/qabstractsocketengine_p.h | 2 +- src/network/socket/qhttpsocketengine.cpp | 2 +- src/network/socket/qhttpsocketengine_p.h | 2 +- src/network/socket/qlocalserver.cpp | 2 +- src/network/socket/qlocalserver.h | 2 +- src/network/socket/qlocalserver_p.h | 2 +- src/network/socket/qlocalserver_tcp.cpp | 2 +- src/network/socket/qlocalserver_unix.cpp | 2 +- src/network/socket/qlocalserver_win.cpp | 2 +- src/network/socket/qlocalsocket.cpp | 2 +- src/network/socket/qlocalsocket.h | 2 +- src/network/socket/qlocalsocket_p.h | 2 +- src/network/socket/qlocalsocket_tcp.cpp | 2 +- src/network/socket/qlocalsocket_unix.cpp | 2 +- src/network/socket/qlocalsocket_win.cpp | 2 +- src/network/socket/qnativesocketengine.cpp | 2 +- src/network/socket/qnativesocketengine_p.h | 2 +- src/network/socket/qnativesocketengine_unix.cpp | 2 +- src/network/socket/qnativesocketengine_win.cpp | 2 +- src/network/socket/qnet_unix_p.h | 2 +- src/network/socket/qsocks5socketengine.cpp | 2 +- src/network/socket/qsocks5socketengine_p.h | 2 +- src/network/socket/qtcpserver.cpp | 2 +- src/network/socket/qtcpserver.h | 2 +- src/network/socket/qtcpsocket.cpp | 2 +- src/network/socket/qtcpsocket.h | 2 +- src/network/socket/qtcpsocket_p.h | 2 +- src/network/socket/qudpsocket.cpp | 2 +- src/network/socket/qudpsocket.h | 2 +- src/network/ssl/qssl.cpp | 2 +- src/network/ssl/qssl.h | 2 +- src/network/ssl/qsslcertificate.cpp | 2 +- src/network/ssl/qsslcertificate.h | 2 +- src/network/ssl/qsslcertificate_p.h | 2 +- src/network/ssl/qsslcipher.cpp | 2 +- src/network/ssl/qsslcipher.h | 2 +- src/network/ssl/qsslcipher_p.h | 2 +- src/network/ssl/qsslconfiguration.cpp | 2 +- src/network/ssl/qsslconfiguration.h | 2 +- src/network/ssl/qsslconfiguration_p.h | 2 +- src/network/ssl/qsslerror.cpp | 2 +- src/network/ssl/qsslerror.h | 2 +- src/network/ssl/qsslkey.cpp | 2 +- src/network/ssl/qsslkey.h | 2 +- src/network/ssl/qsslkey_p.h | 2 +- src/network/ssl/qsslsocket.cpp | 2 +- src/network/ssl/qsslsocket.h | 2 +- src/network/ssl/qsslsocket_openssl.cpp | 2 +- src/network/ssl/qsslsocket_openssl_p.h | 2 +- src/network/ssl/qsslsocket_openssl_symbols.cpp | 2 +- src/network/ssl/qsslsocket_openssl_symbols_p.h | 2 +- src/network/ssl/qsslsocket_p.h | 2 +- src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp | 2 +- src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h | 2 +- src/opengl/gl2paintengineex/qglcustomshaderstage.cpp | 2 +- src/opengl/gl2paintengineex/qglcustomshaderstage_p.h | 2 +- src/opengl/gl2paintengineex/qglengineshadermanager.cpp | 2 +- src/opengl/gl2paintengineex/qglengineshadermanager_p.h | 2 +- src/opengl/gl2paintengineex/qglengineshadersource_p.h | 2 +- src/opengl/gl2paintengineex/qglgradientcache.cpp | 2 +- src/opengl/gl2paintengineex/qglgradientcache_p.h | 2 +- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 2 +- src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 2 +- src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 2 +- src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h | 2 +- src/opengl/gl2paintengineex/qtriangulatingstroker.cpp | 2 +- src/opengl/gl2paintengineex/qtriangulatingstroker_p.h | 2 +- src/opengl/qgl.cpp | 2 +- src/opengl/qgl.h | 2 +- src/opengl/qgl_cl_p.h | 2 +- src/opengl/qgl_egl.cpp | 2 +- src/opengl/qgl_egl_p.h | 2 +- src/opengl/qgl_mac.mm | 2 +- src/opengl/qgl_p.h | 2 +- src/opengl/qgl_qws.cpp | 2 +- src/opengl/qgl_win.cpp | 2 +- src/opengl/qgl_wince.cpp | 2 +- src/opengl/qgl_x11.cpp | 2 +- src/opengl/qgl_x11egl.cpp | 2 +- src/opengl/qglcolormap.cpp | 2 +- src/opengl/qglcolormap.h | 2 +- src/opengl/qglextensions.cpp | 2 +- src/opengl/qglextensions_p.h | 2 +- src/opengl/qglframebufferobject.cpp | 2 +- src/opengl/qglframebufferobject.h | 2 +- src/opengl/qglframebufferobject_p.h | 2 +- src/opengl/qglpaintdevice.cpp | 2 +- src/opengl/qglpaintdevice_p.h | 2 +- src/opengl/qglpixelbuffer.cpp | 2 +- src/opengl/qglpixelbuffer.h | 2 +- src/opengl/qglpixelbuffer_egl.cpp | 2 +- src/opengl/qglpixelbuffer_mac.mm | 2 +- src/opengl/qglpixelbuffer_p.h | 2 +- src/opengl/qglpixelbuffer_win.cpp | 2 +- src/opengl/qglpixelbuffer_x11.cpp | 2 +- src/opengl/qglpixmapfilter.cpp | 2 +- src/opengl/qglpixmapfilter_p.h | 2 +- src/opengl/qglscreen_qws.cpp | 2 +- src/opengl/qglscreen_qws.h | 2 +- src/opengl/qglshaderprogram.cpp | 2 +- src/opengl/qglshaderprogram.h | 2 +- src/opengl/qglwindowsurface_qws.cpp | 2 +- src/opengl/qglwindowsurface_qws_p.h | 2 +- src/opengl/qgraphicsshadereffect.cpp | 2 +- src/opengl/qgraphicsshadereffect_p.h | 2 +- src/opengl/qgraphicssystem_gl.cpp | 2 +- src/opengl/qgraphicssystem_gl_p.h | 2 +- src/opengl/qpaintengine_opengl.cpp | 2 +- src/opengl/qpaintengine_opengl_p.h | 2 +- src/opengl/qpixmapdata_gl.cpp | 2 +- src/opengl/qpixmapdata_gl_p.h | 2 +- src/opengl/qpixmapdata_x11gl_egl.cpp | 2 +- src/opengl/qpixmapdata_x11gl_p.h | 2 +- src/opengl/qwindowsurface_gl.cpp | 2 +- src/opengl/qwindowsurface_gl_p.h | 2 +- src/opengl/qwindowsurface_x11gl.cpp | 2 +- src/opengl/qwindowsurface_x11gl_p.h | 2 +- src/opengl/util/fragmentprograms_p.h | 2 +- src/opengl/util/generator.cpp | 4 ++-- src/opengl/util/glsl_to_include.sh | 2 +- src/openvg/qpaintengine_vg.cpp | 2 +- src/openvg/qpaintengine_vg_p.h | 2 +- src/openvg/qpixmapdata_vg.cpp | 2 +- src/openvg/qpixmapdata_vg_p.h | 2 +- src/openvg/qpixmapfilter_vg.cpp | 2 +- src/openvg/qpixmapfilter_vg_p.h | 2 +- src/openvg/qvg.h | 2 +- src/openvg/qvg_p.h | 2 +- src/openvg/qvgcompositionhelper_p.h | 2 +- src/openvg/qvgimagepool.cpp | 2 +- src/openvg/qvgimagepool_p.h | 2 +- src/openvg/qwindowsurface_vg.cpp | 2 +- src/openvg/qwindowsurface_vg_p.h | 2 +- src/openvg/qwindowsurface_vgegl.cpp | 2 +- src/openvg/qwindowsurface_vgegl_p.h | 2 +- src/plugins/accessible/compat/main.cpp | 2 +- src/plugins/accessible/compat/q3complexwidgets.cpp | 2 +- src/plugins/accessible/compat/q3complexwidgets.h | 2 +- src/plugins/accessible/compat/q3simplewidgets.cpp | 2 +- src/plugins/accessible/compat/q3simplewidgets.h | 2 +- src/plugins/accessible/compat/qaccessiblecompat.cpp | 2 +- src/plugins/accessible/compat/qaccessiblecompat.h | 2 +- src/plugins/accessible/widgets/complexwidgets.cpp | 2 +- src/plugins/accessible/widgets/complexwidgets.h | 2 +- src/plugins/accessible/widgets/main.cpp | 2 +- src/plugins/accessible/widgets/qaccessiblemenu.cpp | 2 +- src/plugins/accessible/widgets/qaccessiblemenu.h | 2 +- src/plugins/accessible/widgets/qaccessiblewidgets.cpp | 2 +- src/plugins/accessible/widgets/qaccessiblewidgets.h | 2 +- src/plugins/accessible/widgets/rangecontrols.cpp | 2 +- src/plugins/accessible/widgets/rangecontrols.h | 2 +- src/plugins/accessible/widgets/simplewidgets.cpp | 2 +- src/plugins/accessible/widgets/simplewidgets.h | 2 +- src/plugins/codecs/cn/main.cpp | 2 +- src/plugins/codecs/cn/qgb18030codec.cpp | 2 +- src/plugins/codecs/cn/qgb18030codec.h | 2 +- src/plugins/codecs/jp/main.cpp | 2 +- src/plugins/codecs/jp/qeucjpcodec.cpp | 2 +- src/plugins/codecs/jp/qeucjpcodec.h | 2 +- src/plugins/codecs/jp/qfontjpcodec.cpp | 2 +- src/plugins/codecs/jp/qfontjpcodec.h | 2 +- src/plugins/codecs/jp/qjiscodec.cpp | 2 +- src/plugins/codecs/jp/qjiscodec.h | 2 +- src/plugins/codecs/jp/qjpunicode.cpp | 2 +- src/plugins/codecs/jp/qjpunicode.h | 2 +- src/plugins/codecs/jp/qsjiscodec.cpp | 2 +- src/plugins/codecs/jp/qsjiscodec.h | 2 +- src/plugins/codecs/kr/cp949codetbl.h | 2 +- src/plugins/codecs/kr/main.cpp | 2 +- src/plugins/codecs/kr/qeuckrcodec.cpp | 2 +- src/plugins/codecs/kr/qeuckrcodec.h | 2 +- src/plugins/codecs/tw/main.cpp | 2 +- src/plugins/codecs/tw/qbig5codec.cpp | 2 +- src/plugins/codecs/tw/qbig5codec.h | 2 +- src/plugins/decorations/default/main.cpp | 2 +- src/plugins/decorations/styled/main.cpp | 2 +- src/plugins/decorations/windows/main.cpp | 2 +- src/plugins/gfxdrivers/ahi/qscreenahi_qws.cpp | 2 +- src/plugins/gfxdrivers/ahi/qscreenahi_qws.h | 2 +- src/plugins/gfxdrivers/ahi/qscreenahiplugin.cpp | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.h | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbmouse.h | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbscreen.h | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbscreenplugin.cpp | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 2 +- src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h | 2 +- src/plugins/gfxdrivers/linuxfb/main.cpp | 2 +- src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c | 2 +- src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h | 2 +- src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h | 2 +- src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c | 2 +- .../gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp | 2 +- src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h | 2 +- .../gfxdrivers/powervr/pvreglscreen/pvreglscreenplugin.cpp | 2 +- .../powervr/pvreglscreen/pvreglwindowsurface.cpp | 2 +- .../gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h | 2 +- src/plugins/gfxdrivers/qvfb/main.cpp | 2 +- src/plugins/gfxdrivers/transformed/main.cpp | 2 +- src/plugins/gfxdrivers/vnc/main.cpp | 2 +- src/plugins/gfxdrivers/vnc/qscreenvnc_p.h | 2 +- src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp | 2 +- src/plugins/gfxdrivers/vnc/qscreenvnc_qws.h | 2 +- src/plugins/graphicssystems/opengl/main.cpp | 2 +- src/plugins/graphicssystems/openvg/main.cpp | 2 +- src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp | 2 +- src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h | 2 +- src/plugins/graphicssystems/shivavg/main.cpp | 2 +- .../graphicssystems/shivavg/shivavggraphicssystem.cpp | 2 +- .../graphicssystems/shivavg/shivavggraphicssystem.h | 2 +- .../graphicssystems/shivavg/shivavgwindowsurface.cpp | 2 +- src/plugins/graphicssystems/shivavg/shivavgwindowsurface.h | 2 +- src/plugins/graphicssystems/trace/main.cpp | 2 +- .../graphicssystems/trace/qgraphicssystem_trace.cpp | 2 +- .../graphicssystems/trace/qgraphicssystem_trace_p.h | 2 +- src/plugins/iconengines/svgiconengine/main.cpp | 2 +- src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp | 2 +- src/plugins/iconengines/svgiconengine/qsvgiconengine.h | 2 +- src/plugins/imageformats/gif/main.cpp | 2 +- src/plugins/imageformats/gif/qgifhandler.cpp | 2 +- src/plugins/imageformats/gif/qgifhandler.h | 2 +- src/plugins/imageformats/ico/main.cpp | 2 +- src/plugins/imageformats/ico/qicohandler.cpp | 2 +- src/plugins/imageformats/ico/qicohandler.h | 2 +- src/plugins/imageformats/jpeg/main.cpp | 2 +- src/plugins/imageformats/jpeg/qjpeghandler.cpp | 2 +- src/plugins/imageformats/jpeg/qjpeghandler.h | 2 +- src/plugins/imageformats/mng/main.cpp | 2 +- src/plugins/imageformats/mng/qmnghandler.cpp | 2 +- src/plugins/imageformats/mng/qmnghandler.h | 2 +- src/plugins/imageformats/svg/main.cpp | 2 +- src/plugins/imageformats/svg/qsvgiohandler.cpp | 2 +- src/plugins/imageformats/svg/qsvgiohandler.h | 2 +- src/plugins/imageformats/tiff/main.cpp | 2 +- src/plugins/imageformats/tiff/qtiffhandler.cpp | 2 +- src/plugins/imageformats/tiff/qtiffhandler.h | 2 +- src/plugins/inputmethods/imsw-multi/qmultiinputcontext.cpp | 2 +- src/plugins/inputmethods/imsw-multi/qmultiinputcontext.h | 2 +- .../inputmethods/imsw-multi/qmultiinputcontextplugin.cpp | 2 +- .../inputmethods/imsw-multi/qmultiinputcontextplugin.h | 2 +- src/plugins/kbddrivers/linuxinput/main.cpp | 2 +- src/plugins/mousedrivers/linuxtp/main.cpp | 2 +- src/plugins/mousedrivers/pc/main.cpp | 2 +- src/plugins/mousedrivers/tslib/main.cpp | 2 +- src/plugins/s60/src/qcoreapplication_3_1.cpp | 2 +- src/plugins/s60/src/qcoreapplication_3_2.cpp | 2 +- src/plugins/s60/src/qdesktopservices_3_1.cpp | 2 +- src/plugins/s60/src/qdesktopservices_3_2.cpp | 2 +- src/plugins/s60/src/qlocale_3_1.cpp | 2 +- src/plugins/s60/src/qlocale_3_2.cpp | 2 +- src/plugins/script/qtdbus/main.cpp | 2 +- src/plugins/script/qtdbus/main.h | 2 +- src/plugins/sqldrivers/db2/main.cpp | 2 +- src/plugins/sqldrivers/ibase/main.cpp | 2 +- src/plugins/sqldrivers/mysql/main.cpp | 2 +- src/plugins/sqldrivers/oci/main.cpp | 2 +- src/plugins/sqldrivers/odbc/main.cpp | 2 +- src/plugins/sqldrivers/psql/main.cpp | 2 +- src/plugins/sqldrivers/sqlite/smain.cpp | 2 +- src/plugins/sqldrivers/sqlite2/smain.cpp | 2 +- src/plugins/sqldrivers/tds/main.cpp | 2 +- src/qt3support/canvas/q3canvas.cpp | 2 +- src/qt3support/canvas/q3canvas.h | 2 +- src/qt3support/dialogs/q3filedialog.cpp | 2 +- src/qt3support/dialogs/q3filedialog.h | 2 +- src/qt3support/dialogs/q3filedialog_mac.cpp | 2 +- src/qt3support/dialogs/q3filedialog_win.cpp | 2 +- src/qt3support/dialogs/q3progressdialog.cpp | 2 +- src/qt3support/dialogs/q3progressdialog.h | 2 +- src/qt3support/dialogs/q3tabdialog.cpp | 2 +- src/qt3support/dialogs/q3tabdialog.h | 2 +- src/qt3support/dialogs/q3wizard.cpp | 2 +- src/qt3support/dialogs/q3wizard.h | 2 +- src/qt3support/itemviews/q3iconview.cpp | 2 +- src/qt3support/itemviews/q3iconview.h | 2 +- src/qt3support/itemviews/q3listbox.cpp | 2 +- src/qt3support/itemviews/q3listbox.h | 2 +- src/qt3support/itemviews/q3listview.cpp | 2 +- src/qt3support/itemviews/q3listview.h | 2 +- src/qt3support/itemviews/q3table.cpp | 2 +- src/qt3support/itemviews/q3table.h | 2 +- src/qt3support/network/q3dns.cpp | 2 +- src/qt3support/network/q3dns.h | 2 +- src/qt3support/network/q3ftp.cpp | 2 +- src/qt3support/network/q3ftp.h | 2 +- src/qt3support/network/q3http.cpp | 2 +- src/qt3support/network/q3http.h | 2 +- src/qt3support/network/q3localfs.cpp | 2 +- src/qt3support/network/q3localfs.h | 2 +- src/qt3support/network/q3network.cpp | 2 +- src/qt3support/network/q3network.h | 2 +- src/qt3support/network/q3networkprotocol.cpp | 2 +- src/qt3support/network/q3networkprotocol.h | 2 +- src/qt3support/network/q3serversocket.cpp | 2 +- src/qt3support/network/q3serversocket.h | 2 +- src/qt3support/network/q3socket.cpp | 2 +- src/qt3support/network/q3socket.h | 2 +- src/qt3support/network/q3socketdevice.cpp | 2 +- src/qt3support/network/q3socketdevice.h | 2 +- src/qt3support/network/q3socketdevice_unix.cpp | 2 +- src/qt3support/network/q3socketdevice_win.cpp | 2 +- src/qt3support/network/q3url.cpp | 2 +- src/qt3support/network/q3url.h | 2 +- src/qt3support/network/q3urloperator.cpp | 2 +- src/qt3support/network/q3urloperator.h | 2 +- src/qt3support/other/q3accel.cpp | 2 +- src/qt3support/other/q3accel.h | 2 +- src/qt3support/other/q3boxlayout.cpp | 2 +- src/qt3support/other/q3boxlayout.h | 2 +- src/qt3support/other/q3dragobject.cpp | 2 +- src/qt3support/other/q3dragobject.h | 2 +- src/qt3support/other/q3dropsite.cpp | 2 +- src/qt3support/other/q3dropsite.h | 2 +- src/qt3support/other/q3gridlayout.h | 2 +- src/qt3support/other/q3membuf.cpp | 2 +- src/qt3support/other/q3membuf_p.h | 2 +- src/qt3support/other/q3mimefactory.cpp | 2 +- src/qt3support/other/q3mimefactory.h | 2 +- src/qt3support/other/q3polygonscanner.cpp | 2 +- src/qt3support/other/q3polygonscanner.h | 2 +- src/qt3support/other/q3process.cpp | 2 +- src/qt3support/other/q3process.h | 2 +- src/qt3support/other/q3process_unix.cpp | 2 +- src/qt3support/other/q3process_win.cpp | 2 +- src/qt3support/other/qiconset.h | 2 +- src/qt3support/other/qt_compat_pch.h | 2 +- src/qt3support/painting/q3paintdevicemetrics.cpp | 2 +- src/qt3support/painting/q3paintdevicemetrics.h | 2 +- src/qt3support/painting/q3paintengine_svg.cpp | 2 +- src/qt3support/painting/q3paintengine_svg_p.h | 2 +- src/qt3support/painting/q3painter.cpp | 2 +- src/qt3support/painting/q3painter.h | 2 +- src/qt3support/painting/q3picture.cpp | 2 +- src/qt3support/painting/q3picture.h | 2 +- src/qt3support/painting/q3pointarray.cpp | 2 +- src/qt3support/painting/q3pointarray.h | 2 +- src/qt3support/sql/q3databrowser.cpp | 2 +- src/qt3support/sql/q3databrowser.h | 2 +- src/qt3support/sql/q3datatable.cpp | 2 +- src/qt3support/sql/q3datatable.h | 2 +- src/qt3support/sql/q3dataview.cpp | 2 +- src/qt3support/sql/q3dataview.h | 2 +- src/qt3support/sql/q3editorfactory.cpp | 2 +- src/qt3support/sql/q3editorfactory.h | 2 +- src/qt3support/sql/q3sqlcursor.cpp | 2 +- src/qt3support/sql/q3sqlcursor.h | 2 +- src/qt3support/sql/q3sqleditorfactory.cpp | 2 +- src/qt3support/sql/q3sqleditorfactory.h | 2 +- src/qt3support/sql/q3sqlfieldinfo.h | 2 +- src/qt3support/sql/q3sqlfieldinfo.qdoc | 2 +- src/qt3support/sql/q3sqlform.cpp | 2 +- src/qt3support/sql/q3sqlform.h | 2 +- src/qt3support/sql/q3sqlmanager_p.cpp | 2 +- src/qt3support/sql/q3sqlmanager_p.h | 2 +- src/qt3support/sql/q3sqlpropertymap.cpp | 2 +- src/qt3support/sql/q3sqlpropertymap.h | 2 +- src/qt3support/sql/q3sqlrecordinfo.h | 2 +- src/qt3support/sql/q3sqlrecordinfo.qdoc | 2 +- src/qt3support/sql/q3sqlselectcursor.cpp | 2 +- src/qt3support/sql/q3sqlselectcursor.h | 2 +- src/qt3support/text/q3multilineedit.cpp | 2 +- src/qt3support/text/q3multilineedit.h | 2 +- src/qt3support/text/q3richtext.cpp | 2 +- src/qt3support/text/q3richtext_p.cpp | 2 +- src/qt3support/text/q3richtext_p.h | 2 +- src/qt3support/text/q3simplerichtext.cpp | 2 +- src/qt3support/text/q3simplerichtext.h | 2 +- src/qt3support/text/q3stylesheet.cpp | 2 +- src/qt3support/text/q3stylesheet.h | 2 +- src/qt3support/text/q3syntaxhighlighter.cpp | 2 +- src/qt3support/text/q3syntaxhighlighter.h | 2 +- src/qt3support/text/q3syntaxhighlighter_p.h | 2 +- src/qt3support/text/q3textbrowser.cpp | 2 +- src/qt3support/text/q3textbrowser.h | 2 +- src/qt3support/text/q3textedit.cpp | 2 +- src/qt3support/text/q3textedit.h | 2 +- src/qt3support/text/q3textstream.cpp | 2 +- src/qt3support/text/q3textstream.h | 2 +- src/qt3support/text/q3textview.cpp | 2 +- src/qt3support/text/q3textview.h | 2 +- src/qt3support/tools/q3asciicache.h | 2 +- src/qt3support/tools/q3asciicache.qdoc | 2 +- src/qt3support/tools/q3asciidict.h | 2 +- src/qt3support/tools/q3asciidict.qdoc | 2 +- src/qt3support/tools/q3cache.h | 2 +- src/qt3support/tools/q3cache.qdoc | 2 +- src/qt3support/tools/q3cleanuphandler.h | 2 +- src/qt3support/tools/q3cstring.cpp | 2 +- src/qt3support/tools/q3cstring.h | 2 +- src/qt3support/tools/q3deepcopy.cpp | 2 +- src/qt3support/tools/q3deepcopy.h | 2 +- src/qt3support/tools/q3dict.h | 2 +- src/qt3support/tools/q3dict.qdoc | 2 +- src/qt3support/tools/q3garray.cpp | 2 +- src/qt3support/tools/q3garray.h | 2 +- src/qt3support/tools/q3gcache.cpp | 2 +- src/qt3support/tools/q3gcache.h | 2 +- src/qt3support/tools/q3gdict.cpp | 2 +- src/qt3support/tools/q3gdict.h | 2 +- src/qt3support/tools/q3glist.cpp | 2 +- src/qt3support/tools/q3glist.h | 2 +- src/qt3support/tools/q3gvector.cpp | 2 +- src/qt3support/tools/q3gvector.h | 2 +- src/qt3support/tools/q3intcache.h | 2 +- src/qt3support/tools/q3intcache.qdoc | 2 +- src/qt3support/tools/q3intdict.h | 2 +- src/qt3support/tools/q3intdict.qdoc | 2 +- src/qt3support/tools/q3memarray.h | 2 +- src/qt3support/tools/q3memarray.qdoc | 2 +- src/qt3support/tools/q3objectdict.h | 2 +- src/qt3support/tools/q3ptrcollection.cpp | 2 +- src/qt3support/tools/q3ptrcollection.h | 2 +- src/qt3support/tools/q3ptrdict.h | 2 +- src/qt3support/tools/q3ptrdict.qdoc | 2 +- src/qt3support/tools/q3ptrlist.h | 2 +- src/qt3support/tools/q3ptrlist.qdoc | 2 +- src/qt3support/tools/q3ptrqueue.h | 2 +- src/qt3support/tools/q3ptrqueue.qdoc | 2 +- src/qt3support/tools/q3ptrstack.h | 2 +- src/qt3support/tools/q3ptrstack.qdoc | 2 +- src/qt3support/tools/q3ptrvector.h | 2 +- src/qt3support/tools/q3ptrvector.qdoc | 2 +- src/qt3support/tools/q3semaphore.cpp | 2 +- src/qt3support/tools/q3semaphore.h | 2 +- src/qt3support/tools/q3shared.cpp | 2 +- src/qt3support/tools/q3shared.h | 2 +- src/qt3support/tools/q3signal.cpp | 2 +- src/qt3support/tools/q3signal.h | 2 +- src/qt3support/tools/q3sortedlist.h | 2 +- src/qt3support/tools/q3strlist.h | 2 +- src/qt3support/tools/q3strvec.h | 2 +- src/qt3support/tools/q3tl.h | 2 +- src/qt3support/tools/q3valuelist.h | 2 +- src/qt3support/tools/q3valuelist.qdoc | 2 +- src/qt3support/tools/q3valuestack.h | 2 +- src/qt3support/tools/q3valuestack.qdoc | 2 +- src/qt3support/tools/q3valuevector.h | 2 +- src/qt3support/tools/q3valuevector.qdoc | 2 +- src/qt3support/widgets/q3action.cpp | 2 +- src/qt3support/widgets/q3action.h | 2 +- src/qt3support/widgets/q3button.cpp | 2 +- src/qt3support/widgets/q3button.h | 2 +- src/qt3support/widgets/q3buttongroup.cpp | 2 +- src/qt3support/widgets/q3buttongroup.h | 2 +- src/qt3support/widgets/q3combobox.cpp | 2 +- src/qt3support/widgets/q3combobox.h | 2 +- src/qt3support/widgets/q3datetimeedit.cpp | 2 +- src/qt3support/widgets/q3datetimeedit.h | 2 +- src/qt3support/widgets/q3dockarea.cpp | 2 +- src/qt3support/widgets/q3dockarea.h | 2 +- src/qt3support/widgets/q3dockwindow.cpp | 2 +- src/qt3support/widgets/q3dockwindow.h | 2 +- src/qt3support/widgets/q3frame.cpp | 2 +- src/qt3support/widgets/q3frame.h | 2 +- src/qt3support/widgets/q3grid.cpp | 2 +- src/qt3support/widgets/q3grid.h | 2 +- src/qt3support/widgets/q3gridview.cpp | 2 +- src/qt3support/widgets/q3gridview.h | 2 +- src/qt3support/widgets/q3groupbox.cpp | 2 +- src/qt3support/widgets/q3groupbox.h | 2 +- src/qt3support/widgets/q3hbox.cpp | 2 +- src/qt3support/widgets/q3hbox.h | 2 +- src/qt3support/widgets/q3header.cpp | 2 +- src/qt3support/widgets/q3header.h | 2 +- src/qt3support/widgets/q3hgroupbox.cpp | 2 +- src/qt3support/widgets/q3hgroupbox.h | 2 +- src/qt3support/widgets/q3mainwindow.cpp | 2 +- src/qt3support/widgets/q3mainwindow.h | 2 +- src/qt3support/widgets/q3mainwindow_p.h | 2 +- src/qt3support/widgets/q3popupmenu.cpp | 2 +- src/qt3support/widgets/q3popupmenu.h | 2 +- src/qt3support/widgets/q3progressbar.cpp | 2 +- src/qt3support/widgets/q3progressbar.h | 2 +- src/qt3support/widgets/q3rangecontrol.cpp | 2 +- src/qt3support/widgets/q3rangecontrol.h | 2 +- src/qt3support/widgets/q3scrollview.cpp | 2 +- src/qt3support/widgets/q3scrollview.h | 2 +- src/qt3support/widgets/q3spinwidget.cpp | 2 +- src/qt3support/widgets/q3titlebar.cpp | 2 +- src/qt3support/widgets/q3titlebar_p.h | 2 +- src/qt3support/widgets/q3toolbar.cpp | 2 +- src/qt3support/widgets/q3toolbar.h | 2 +- src/qt3support/widgets/q3vbox.cpp | 2 +- src/qt3support/widgets/q3vbox.h | 2 +- src/qt3support/widgets/q3vgroupbox.cpp | 2 +- src/qt3support/widgets/q3vgroupbox.h | 2 +- src/qt3support/widgets/q3whatsthis.cpp | 2 +- src/qt3support/widgets/q3whatsthis.h | 2 +- src/qt3support/widgets/q3widgetstack.cpp | 2 +- src/qt3support/widgets/q3widgetstack.h | 2 +- src/qt_targets.pri | 2 +- src/s60main/qts60main.cpp | 2 +- src/s60main/qts60main_mcrt0.cpp | 2 +- src/script/api/qscriptable.cpp | 2 +- src/script/api/qscriptable.h | 2 +- src/script/api/qscriptable_p.h | 2 +- src/script/api/qscriptclass.cpp | 2 +- src/script/api/qscriptclass.h | 2 +- src/script/api/qscriptclasspropertyiterator.cpp | 2 +- src/script/api/qscriptclasspropertyiterator.h | 2 +- src/script/api/qscriptcontext.cpp | 2 +- src/script/api/qscriptcontext.h | 2 +- src/script/api/qscriptcontext_p.h | 2 +- src/script/api/qscriptcontextinfo.cpp | 2 +- src/script/api/qscriptcontextinfo.h | 2 +- src/script/api/qscriptengine.cpp | 2 +- src/script/api/qscriptengine.h | 2 +- src/script/api/qscriptengine_p.h | 2 +- src/script/api/qscriptengineagent.cpp | 2 +- src/script/api/qscriptengineagent.h | 2 +- src/script/api/qscriptengineagent_p.h | 2 +- src/script/api/qscriptextensioninterface.h | 2 +- src/script/api/qscriptextensionplugin.cpp | 2 +- src/script/api/qscriptextensionplugin.h | 2 +- src/script/api/qscriptprogram.cpp | 2 +- src/script/api/qscriptprogram.h | 2 +- src/script/api/qscriptprogram_p.h | 2 +- src/script/api/qscriptstring.cpp | 2 +- src/script/api/qscriptstring.h | 2 +- src/script/api/qscriptstring_p.h | 2 +- src/script/api/qscriptvalue.cpp | 2 +- src/script/api/qscriptvalue.h | 2 +- src/script/api/qscriptvalue_p.h | 2 +- src/script/api/qscriptvalueiterator.cpp | 2 +- src/script/api/qscriptvalueiterator.h | 2 +- src/script/bridge/qscriptactivationobject.cpp | 2 +- src/script/bridge/qscriptactivationobject_p.h | 2 +- src/script/bridge/qscriptclassobject.cpp | 2 +- src/script/bridge/qscriptclassobject_p.h | 2 +- src/script/bridge/qscriptdeclarativeclass.cpp | 2 +- src/script/bridge/qscriptdeclarativeclass_p.h | 2 +- src/script/bridge/qscriptdeclarativeobject.cpp | 2 +- src/script/bridge/qscriptdeclarativeobject_p.h | 2 +- src/script/bridge/qscriptfunction.cpp | 2 +- src/script/bridge/qscriptfunction_p.h | 2 +- src/script/bridge/qscriptglobalobject.cpp | 2 +- src/script/bridge/qscriptglobalobject_p.h | 2 +- src/script/bridge/qscriptobject.cpp | 2 +- src/script/bridge/qscriptobject_p.h | 2 +- src/script/bridge/qscriptqobject.cpp | 2 +- src/script/bridge/qscriptqobject_p.h | 2 +- src/script/bridge/qscriptvariant.cpp | 2 +- src/script/bridge/qscriptvariant_p.h | 2 +- src/script/parser/make-parser.sh | 2 +- src/script/parser/qscript.g | 6 +++--- src/script/parser/qscriptast.cpp | 2 +- src/script/parser/qscriptast_p.h | 2 +- src/script/parser/qscriptastfwd_p.h | 2 +- src/script/parser/qscriptastvisitor.cpp | 2 +- src/script/parser/qscriptastvisitor_p.h | 2 +- src/script/parser/qscriptgrammar.cpp | 2 +- src/script/parser/qscriptgrammar_p.h | 2 +- src/script/parser/qscriptlexer.cpp | 2 +- src/script/parser/qscriptlexer_p.h | 2 +- src/script/parser/qscriptparser.cpp | 2 +- src/script/parser/qscriptparser_p.h | 2 +- src/script/parser/qscriptsyntaxchecker.cpp | 2 +- src/script/parser/qscriptsyntaxchecker_p.h | 2 +- src/script/utils/qscriptdate.cpp | 2 +- src/script/utils/qscriptdate_p.h | 2 +- src/scripttools/debugging/qscriptbreakpointdata.cpp | 2 +- src/scripttools/debugging/qscriptbreakpointdata_p.h | 2 +- src/scripttools/debugging/qscriptbreakpointsmodel.cpp | 2 +- src/scripttools/debugging/qscriptbreakpointsmodel_p.h | 2 +- src/scripttools/debugging/qscriptbreakpointswidget.cpp | 2 +- src/scripttools/debugging/qscriptbreakpointswidget_p.h | 2 +- .../debugging/qscriptbreakpointswidgetinterface.cpp | 2 +- .../debugging/qscriptbreakpointswidgetinterface_p.h | 2 +- .../debugging/qscriptbreakpointswidgetinterface_p_p.h | 2 +- .../debugging/qscriptcompletionproviderinterface_p.h | 2 +- src/scripttools/debugging/qscriptcompletiontask.cpp | 2 +- src/scripttools/debugging/qscriptcompletiontask_p.h | 2 +- .../debugging/qscriptcompletiontaskinterface.cpp | 2 +- .../debugging/qscriptcompletiontaskinterface_p.h | 2 +- .../debugging/qscriptcompletiontaskinterface_p_p.h | 2 +- src/scripttools/debugging/qscriptdebugger.cpp | 2 +- src/scripttools/debugging/qscriptdebugger_p.h | 2 +- src/scripttools/debugging/qscriptdebuggeragent.cpp | 2 +- src/scripttools/debugging/qscriptdebuggeragent_p.h | 2 +- src/scripttools/debugging/qscriptdebuggeragent_p_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerbackend.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerbackend_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerbackend_p_p.h | 2 +- .../debugging/qscriptdebuggercodefinderwidget.cpp | 2 +- .../debugging/qscriptdebuggercodefinderwidget_p.h | 2 +- .../debugging/qscriptdebuggercodefinderwidgetinterface.cpp | 2 +- .../debugging/qscriptdebuggercodefinderwidgetinterface_p.h | 2 +- .../qscriptdebuggercodefinderwidgetinterface_p_p.h | 2 +- src/scripttools/debugging/qscriptdebuggercodeview.cpp | 2 +- src/scripttools/debugging/qscriptdebuggercodeview_p.h | 2 +- .../debugging/qscriptdebuggercodeviewinterface.cpp | 2 +- .../debugging/qscriptdebuggercodeviewinterface_p.h | 2 +- .../debugging/qscriptdebuggercodeviewinterface_p_p.h | 2 +- src/scripttools/debugging/qscriptdebuggercodewidget.cpp | 2 +- src/scripttools/debugging/qscriptdebuggercodewidget_p.h | 2 +- .../debugging/qscriptdebuggercodewidgetinterface.cpp | 2 +- .../debugging/qscriptdebuggercodewidgetinterface_p.h | 2 +- .../debugging/qscriptdebuggercodewidgetinterface_p_p.h | 2 +- src/scripttools/debugging/qscriptdebuggercommand.cpp | 2 +- src/scripttools/debugging/qscriptdebuggercommand_p.h | 2 +- .../debugging/qscriptdebuggercommandexecutor.cpp | 2 +- .../debugging/qscriptdebuggercommandexecutor_p.h | 2 +- .../debugging/qscriptdebuggercommandschedulerfrontend.cpp | 2 +- .../debugging/qscriptdebuggercommandschedulerfrontend_p.h | 2 +- .../debugging/qscriptdebuggercommandschedulerinterface_p.h | 2 +- .../debugging/qscriptdebuggercommandschedulerjob.cpp | 2 +- .../debugging/qscriptdebuggercommandschedulerjob_p.h | 2 +- .../debugging/qscriptdebuggercommandschedulerjob_p_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerconsole.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerconsole_p.h | 2 +- .../debugging/qscriptdebuggerconsolecommand.cpp | 2 +- .../debugging/qscriptdebuggerconsolecommand_p.h | 2 +- .../debugging/qscriptdebuggerconsolecommand_p_p.h | 2 +- .../debugging/qscriptdebuggerconsolecommandgroupdata.cpp | 2 +- .../debugging/qscriptdebuggerconsolecommandgroupdata_p.h | 2 +- .../debugging/qscriptdebuggerconsolecommandjob.cpp | 2 +- .../debugging/qscriptdebuggerconsolecommandjob_p.h | 2 +- .../debugging/qscriptdebuggerconsolecommandjob_p_p.h | 2 +- .../debugging/qscriptdebuggerconsolecommandmanager.cpp | 2 +- .../debugging/qscriptdebuggerconsolecommandmanager_p.h | 2 +- .../debugging/qscriptdebuggerconsoleglobalobject.cpp | 2 +- .../debugging/qscriptdebuggerconsoleglobalobject_p.h | 2 +- .../debugging/qscriptdebuggerconsolehistorianinterface_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerconsolewidget_p.h | 2 +- .../debugging/qscriptdebuggerconsolewidgetinterface.cpp | 2 +- .../debugging/qscriptdebuggerconsolewidgetinterface_p.h | 2 +- .../debugging/qscriptdebuggerconsolewidgetinterface_p_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerevent.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerevent_p.h | 2 +- .../debugging/qscriptdebuggereventhandlerinterface_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerfrontend.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerfrontend_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerfrontend_p_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerjob.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerjob_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerjob_p_p.h | 2 +- .../debugging/qscriptdebuggerjobschedulerinterface_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerlocalsmodel_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerlocalswidget_p.h | 2 +- .../debugging/qscriptdebuggerlocalswidgetinterface.cpp | 2 +- .../debugging/qscriptdebuggerlocalswidgetinterface_p.h | 2 +- .../debugging/qscriptdebuggerlocalswidgetinterface_p_p.h | 2 +- .../debugging/qscriptdebuggerobjectsnapshotdelta_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerresponse.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerresponse_p.h | 2 +- .../debugging/qscriptdebuggerresponsehandlerinterface_p.h | 2 +- .../debugging/qscriptdebuggerscriptedconsolecommand.cpp | 2 +- .../debugging/qscriptdebuggerscriptedconsolecommand_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerscriptsmodel.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerscriptsmodel_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerscriptswidget.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerscriptswidget_p.h | 2 +- .../debugging/qscriptdebuggerscriptswidgetinterface.cpp | 2 +- .../debugging/qscriptdebuggerscriptswidgetinterface_p.h | 2 +- .../debugging/qscriptdebuggerscriptswidgetinterface_p_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerstackmodel.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerstackmodel_p.h | 2 +- src/scripttools/debugging/qscriptdebuggerstackwidget.cpp | 2 +- src/scripttools/debugging/qscriptdebuggerstackwidget_p.h | 2 +- .../debugging/qscriptdebuggerstackwidgetinterface.cpp | 2 +- .../debugging/qscriptdebuggerstackwidgetinterface_p.h | 2 +- .../debugging/qscriptdebuggerstackwidgetinterface_p_p.h | 2 +- .../debugging/qscriptdebuggerstandardwidgetfactory.cpp | 2 +- .../debugging/qscriptdebuggerstandardwidgetfactory_p.h | 2 +- src/scripttools/debugging/qscriptdebuggervalue.cpp | 2 +- src/scripttools/debugging/qscriptdebuggervalue_p.h | 2 +- src/scripttools/debugging/qscriptdebuggervalueproperty.cpp | 2 +- src/scripttools/debugging/qscriptdebuggervalueproperty_p.h | 2 +- .../debugging/qscriptdebuggerwidgetfactoryinterface_p.h | 2 +- src/scripttools/debugging/qscriptdebugoutputwidget.cpp | 2 +- src/scripttools/debugging/qscriptdebugoutputwidget_p.h | 2 +- .../debugging/qscriptdebugoutputwidgetinterface.cpp | 2 +- .../debugging/qscriptdebugoutputwidgetinterface_p.h | 2 +- .../debugging/qscriptdebugoutputwidgetinterface_p_p.h | 2 +- src/scripttools/debugging/qscriptedit.cpp | 2 +- src/scripttools/debugging/qscriptedit_p.h | 2 +- src/scripttools/debugging/qscriptenginedebugger.cpp | 2 +- src/scripttools/debugging/qscriptenginedebugger.h | 2 +- .../debugging/qscriptenginedebuggerfrontend.cpp | 2 +- .../debugging/qscriptenginedebuggerfrontend_p.h | 2 +- src/scripttools/debugging/qscripterrorlogwidget.cpp | 2 +- src/scripttools/debugging/qscripterrorlogwidget_p.h | 2 +- .../debugging/qscripterrorlogwidgetinterface.cpp | 2 +- .../debugging/qscripterrorlogwidgetinterface_p.h | 2 +- .../debugging/qscripterrorlogwidgetinterface_p_p.h | 2 +- .../debugging/qscriptmessagehandlerinterface_p.h | 2 +- src/scripttools/debugging/qscriptobjectsnapshot.cpp | 2 +- src/scripttools/debugging/qscriptobjectsnapshot_p.h | 2 +- src/scripttools/debugging/qscriptscriptdata.cpp | 2 +- src/scripttools/debugging/qscriptscriptdata_p.h | 2 +- src/scripttools/debugging/qscriptstdmessagehandler.cpp | 2 +- src/scripttools/debugging/qscriptstdmessagehandler_p.h | 2 +- src/scripttools/debugging/qscriptsyntaxhighlighter.cpp | 2 +- src/scripttools/debugging/qscriptsyntaxhighlighter_p.h | 2 +- .../debugging/qscripttooltipproviderinterface_p.h | 2 +- src/scripttools/debugging/qscriptvalueproperty.cpp | 2 +- src/scripttools/debugging/qscriptvalueproperty_p.h | 2 +- src/scripttools/debugging/qscriptxmlparser.cpp | 2 +- src/scripttools/debugging/qscriptxmlparser_p.h | 2 +- src/sql/drivers/db2/qsql_db2.cpp | 2 +- src/sql/drivers/db2/qsql_db2.h | 2 +- src/sql/drivers/ibase/qsql_ibase.cpp | 2 +- src/sql/drivers/ibase/qsql_ibase.h | 2 +- src/sql/drivers/mysql/qsql_mysql.cpp | 2 +- src/sql/drivers/mysql/qsql_mysql.h | 2 +- src/sql/drivers/oci/qsql_oci.cpp | 2 +- src/sql/drivers/oci/qsql_oci.h | 2 +- src/sql/drivers/odbc/qsql_odbc.cpp | 2 +- src/sql/drivers/odbc/qsql_odbc.h | 2 +- src/sql/drivers/psql/qsql_psql.cpp | 2 +- src/sql/drivers/psql/qsql_psql.h | 2 +- src/sql/drivers/sqlite/qsql_sqlite.cpp | 2 +- src/sql/drivers/sqlite/qsql_sqlite.h | 2 +- src/sql/drivers/sqlite2/qsql_sqlite2.cpp | 2 +- src/sql/drivers/sqlite2/qsql_sqlite2.h | 2 +- src/sql/drivers/tds/qsql_tds.cpp | 2 +- src/sql/drivers/tds/qsql_tds.h | 2 +- src/sql/kernel/qsql.h | 2 +- src/sql/kernel/qsql.qdoc | 2 +- src/sql/kernel/qsqlcachedresult.cpp | 2 +- src/sql/kernel/qsqlcachedresult_p.h | 2 +- src/sql/kernel/qsqldatabase.cpp | 2 +- src/sql/kernel/qsqldatabase.h | 2 +- src/sql/kernel/qsqldriver.cpp | 2 +- src/sql/kernel/qsqldriver.h | 2 +- src/sql/kernel/qsqldriverplugin.cpp | 2 +- src/sql/kernel/qsqldriverplugin.h | 2 +- src/sql/kernel/qsqlerror.cpp | 2 +- src/sql/kernel/qsqlerror.h | 2 +- src/sql/kernel/qsqlfield.cpp | 2 +- src/sql/kernel/qsqlfield.h | 2 +- src/sql/kernel/qsqlindex.cpp | 2 +- src/sql/kernel/qsqlindex.h | 2 +- src/sql/kernel/qsqlnulldriver_p.h | 2 +- src/sql/kernel/qsqlquery.cpp | 2 +- src/sql/kernel/qsqlquery.h | 2 +- src/sql/kernel/qsqlrecord.cpp | 2 +- src/sql/kernel/qsqlrecord.h | 2 +- src/sql/kernel/qsqlresult.cpp | 2 +- src/sql/kernel/qsqlresult.h | 2 +- src/sql/models/qsqlquerymodel.cpp | 2 +- src/sql/models/qsqlquerymodel.h | 2 +- src/sql/models/qsqlquerymodel_p.h | 2 +- src/sql/models/qsqlrelationaldelegate.cpp | 2 +- src/sql/models/qsqlrelationaldelegate.h | 2 +- src/sql/models/qsqlrelationaltablemodel.cpp | 2 +- src/sql/models/qsqlrelationaltablemodel.h | 2 +- src/sql/models/qsqltablemodel.cpp | 2 +- src/sql/models/qsqltablemodel.h | 2 +- src/sql/models/qsqltablemodel_p.h | 2 +- src/svg/qgraphicssvgitem.cpp | 2 +- src/svg/qgraphicssvgitem.h | 2 +- src/svg/qsvgfont.cpp | 2 +- src/svg/qsvgfont_p.h | 2 +- src/svg/qsvggenerator.cpp | 2 +- src/svg/qsvggenerator.h | 2 +- src/svg/qsvggraphics.cpp | 2 +- src/svg/qsvggraphics_p.h | 2 +- src/svg/qsvghandler.cpp | 2 +- src/svg/qsvghandler_p.h | 2 +- src/svg/qsvgnode.cpp | 2 +- src/svg/qsvgnode_p.h | 2 +- src/svg/qsvgrenderer.cpp | 2 +- src/svg/qsvgrenderer.h | 2 +- src/svg/qsvgstructure.cpp | 2 +- src/svg/qsvgstructure_p.h | 2 +- src/svg/qsvgstyle.cpp | 2 +- src/svg/qsvgstyle_p.h | 2 +- src/svg/qsvgtinydocument.cpp | 2 +- src/svg/qsvgtinydocument_p.h | 2 +- src/svg/qsvgwidget.cpp | 2 +- src/svg/qsvgwidget.h | 2 +- src/testlib/qabstracttestlogger.cpp | 2 +- src/testlib/qabstracttestlogger_p.h | 2 +- src/testlib/qasciikey.cpp | 2 +- src/testlib/qbenchmark.cpp | 2 +- src/testlib/qbenchmark.h | 2 +- src/testlib/qbenchmark_p.h | 2 +- src/testlib/qbenchmarkevent.cpp | 2 +- src/testlib/qbenchmarkevent_p.h | 2 +- src/testlib/qbenchmarkmeasurement.cpp | 2 +- src/testlib/qbenchmarkmeasurement_p.h | 2 +- src/testlib/qbenchmarkvalgrind.cpp | 2 +- src/testlib/qbenchmarkvalgrind_p.h | 2 +- src/testlib/qplaintestlogger.cpp | 2 +- src/testlib/qplaintestlogger_p.h | 2 +- src/testlib/qsignaldumper.cpp | 2 +- src/testlib/qsignaldumper_p.h | 2 +- src/testlib/qsignalspy.h | 2 +- src/testlib/qsignalspy.qdoc | 2 +- src/testlib/qtest.h | 2 +- src/testlib/qtest_global.h | 2 +- src/testlib/qtest_gui.h | 2 +- src/testlib/qtestaccessible.h | 2 +- src/testlib/qtestassert.h | 2 +- src/testlib/qtestbasicstreamer.cpp | 2 +- src/testlib/qtestbasicstreamer.h | 2 +- src/testlib/qtestcase.cpp | 2 +- src/testlib/qtestcase.h | 2 +- src/testlib/qtestcoreelement.h | 2 +- src/testlib/qtestcorelist.h | 2 +- src/testlib/qtestdata.cpp | 2 +- src/testlib/qtestdata.h | 2 +- src/testlib/qtestelement.cpp | 2 +- src/testlib/qtestelement.h | 2 +- src/testlib/qtestelementattribute.cpp | 2 +- src/testlib/qtestelementattribute.h | 2 +- src/testlib/qtestevent.h | 2 +- src/testlib/qtestevent.qdoc | 2 +- src/testlib/qtesteventloop.h | 2 +- src/testlib/qtestfilelogger.cpp | 2 +- src/testlib/qtestfilelogger.h | 2 +- src/testlib/qtestkeyboard.h | 2 +- src/testlib/qtestlightxmlstreamer.cpp | 2 +- src/testlib/qtestlightxmlstreamer.h | 2 +- src/testlib/qtestlog.cpp | 2 +- src/testlib/qtestlog_p.h | 2 +- src/testlib/qtestlogger.cpp | 2 +- src/testlib/qtestlogger_p.h | 2 +- src/testlib/qtestmouse.h | 2 +- src/testlib/qtestresult.cpp | 2 +- src/testlib/qtestresult_p.h | 2 +- src/testlib/qtestspontaneevent.h | 2 +- src/testlib/qtestsystem.h | 2 +- src/testlib/qtesttable.cpp | 2 +- src/testlib/qtesttable_p.h | 2 +- src/testlib/qtesttouch.h | 2 +- src/testlib/qtestxmlstreamer.cpp | 2 +- src/testlib/qtestxmlstreamer.h | 2 +- src/testlib/qtestxunitstreamer.cpp | 2 +- src/testlib/qtestxunitstreamer.h | 2 +- src/testlib/qxmltestlogger.cpp | 2 +- src/testlib/qxmltestlogger_p.h | 2 +- src/tools/idc/main.cpp | 2 +- src/tools/moc/generator.cpp | 2 +- src/tools/moc/generator.h | 2 +- src/tools/moc/keywords.cpp | 2 +- src/tools/moc/main.cpp | 2 +- src/tools/moc/moc.cpp | 2 +- src/tools/moc/moc.h | 2 +- src/tools/moc/mwerks_mac.cpp | 2 +- src/tools/moc/mwerks_mac.h | 2 +- src/tools/moc/outputrevision.h | 2 +- src/tools/moc/parser.cpp | 2 +- src/tools/moc/parser.h | 2 +- src/tools/moc/ppkeywords.cpp | 2 +- src/tools/moc/preprocessor.cpp | 2 +- src/tools/moc/preprocessor.h | 2 +- src/tools/moc/symbols.h | 2 +- src/tools/moc/token.cpp | 2 +- src/tools/moc/token.h | 2 +- src/tools/moc/util/generate.sh | 2 +- src/tools/moc/util/generate_keywords.cpp | 2 +- src/tools/moc/util/licenseheader.txt | 2 +- src/tools/moc/utils.h | 2 +- src/tools/rcc/main.cpp | 2 +- src/tools/rcc/rcc.cpp | 2 +- src/tools/rcc/rcc.h | 2 +- src/tools/uic/cpp/cppextractimages.cpp | 2 +- src/tools/uic/cpp/cppextractimages.h | 2 +- src/tools/uic/cpp/cppwritedeclaration.cpp | 2 +- src/tools/uic/cpp/cppwritedeclaration.h | 2 +- src/tools/uic/cpp/cppwriteicondata.cpp | 2 +- src/tools/uic/cpp/cppwriteicondata.h | 2 +- src/tools/uic/cpp/cppwriteicondeclaration.cpp | 2 +- src/tools/uic/cpp/cppwriteicondeclaration.h | 2 +- src/tools/uic/cpp/cppwriteiconinitialization.cpp | 2 +- src/tools/uic/cpp/cppwriteiconinitialization.h | 2 +- src/tools/uic/cpp/cppwriteincludes.cpp | 2 +- src/tools/uic/cpp/cppwriteincludes.h | 2 +- src/tools/uic/cpp/cppwriteinitialization.cpp | 2 +- src/tools/uic/cpp/cppwriteinitialization.h | 2 +- src/tools/uic/customwidgetsinfo.cpp | 2 +- src/tools/uic/customwidgetsinfo.h | 2 +- src/tools/uic/databaseinfo.cpp | 2 +- src/tools/uic/databaseinfo.h | 2 +- src/tools/uic/driver.cpp | 2 +- src/tools/uic/driver.h | 2 +- src/tools/uic/globaldefs.h | 2 +- src/tools/uic/main.cpp | 2 +- src/tools/uic/option.h | 2 +- src/tools/uic/treewalker.cpp | 2 +- src/tools/uic/treewalker.h | 2 +- src/tools/uic/ui4.cpp | 2 +- src/tools/uic/ui4.h | 2 +- src/tools/uic/uic.cpp | 2 +- src/tools/uic/uic.h | 2 +- src/tools/uic/utils.h | 2 +- src/tools/uic/validator.cpp | 2 +- src/tools/uic/validator.h | 2 +- src/tools/uic3/converter.cpp | 2 +- src/tools/uic3/deps.cpp | 2 +- src/tools/uic3/domtool.cpp | 2 +- src/tools/uic3/domtool.h | 2 +- src/tools/uic3/embed.cpp | 2 +- src/tools/uic3/form.cpp | 2 +- src/tools/uic3/main.cpp | 2 +- src/tools/uic3/object.cpp | 2 +- src/tools/uic3/parser.cpp | 2 +- src/tools/uic3/parser.h | 2 +- src/tools/uic3/qt3to4.cpp | 2 +- src/tools/uic3/qt3to4.h | 2 +- src/tools/uic3/subclassing.cpp | 2 +- src/tools/uic3/ui3reader.cpp | 2 +- src/tools/uic3/ui3reader.h | 2 +- src/tools/uic3/uic.cpp | 2 +- src/tools/uic3/uic.h | 2 +- src/tools/uic3/widgetinfo.cpp | 2 +- src/tools/uic3/widgetinfo.h | 2 +- src/winmain/qtmain_win.cpp | 2 +- src/xml/dom/qdom.cpp | 2 +- src/xml/dom/qdom.h | 2 +- src/xml/sax/qxml.cpp | 2 +- src/xml/sax/qxml.h | 2 +- src/xml/stream/qxmlstream.h | 2 +- src/xmlpatterns/Mainpage.dox | 2 +- src/xmlpatterns/acceltree/qacceliterators.cpp | 2 +- src/xmlpatterns/acceltree/qacceliterators_p.h | 2 +- src/xmlpatterns/acceltree/qacceltree.cpp | 2 +- src/xmlpatterns/acceltree/qacceltree_p.h | 2 +- src/xmlpatterns/acceltree/qacceltreebuilder.cpp | 2 +- src/xmlpatterns/acceltree/qacceltreebuilder_p.h | 2 +- src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp | 2 +- src/xmlpatterns/acceltree/qacceltreeresourceloader_p.h | 2 +- src/xmlpatterns/acceltree/qcompressedwhitespace.cpp | 2 +- src/xmlpatterns/acceltree/qcompressedwhitespace_p.h | 2 +- src/xmlpatterns/api/qabstractmessagehandler.cpp | 2 +- src/xmlpatterns/api/qabstractmessagehandler.h | 2 +- src/xmlpatterns/api/qabstracturiresolver.cpp | 2 +- src/xmlpatterns/api/qabstracturiresolver.h | 2 +- src/xmlpatterns/api/qabstractxmlforwarditerator.cpp | 2 +- src/xmlpatterns/api/qabstractxmlforwarditerator_p.h | 2 +- src/xmlpatterns/api/qabstractxmlnodemodel.cpp | 2 +- src/xmlpatterns/api/qabstractxmlnodemodel.h | 2 +- src/xmlpatterns/api/qabstractxmlnodemodel_p.h | 2 +- src/xmlpatterns/api/qabstractxmlreceiver.cpp | 2 +- src/xmlpatterns/api/qabstractxmlreceiver.h | 2 +- src/xmlpatterns/api/qabstractxmlreceiver_p.h | 2 +- src/xmlpatterns/api/qcoloringmessagehandler.cpp | 2 +- src/xmlpatterns/api/qcoloringmessagehandler_p.h | 2 +- src/xmlpatterns/api/qcoloroutput.cpp | 2 +- src/xmlpatterns/api/qcoloroutput_p.h | 2 +- src/xmlpatterns/api/qdeviceresourceloader_p.h | 2 +- src/xmlpatterns/api/qiodevicedelegate.cpp | 2 +- src/xmlpatterns/api/qiodevicedelegate_p.h | 2 +- src/xmlpatterns/api/qnetworkaccessdelegator.cpp | 2 +- src/xmlpatterns/api/qnetworkaccessdelegator_p.h | 2 +- src/xmlpatterns/api/qreferencecountedvalue_p.h | 2 +- src/xmlpatterns/api/qresourcedelegator.cpp | 2 +- src/xmlpatterns/api/qresourcedelegator_p.h | 2 +- src/xmlpatterns/api/qsimplexmlnodemodel.cpp | 2 +- src/xmlpatterns/api/qsimplexmlnodemodel.h | 2 +- src/xmlpatterns/api/qsourcelocation.cpp | 2 +- src/xmlpatterns/api/qsourcelocation.h | 2 +- src/xmlpatterns/api/quriloader.cpp | 2 +- src/xmlpatterns/api/quriloader_p.h | 2 +- src/xmlpatterns/api/qvariableloader.cpp | 2 +- src/xmlpatterns/api/qvariableloader_p.h | 2 +- src/xmlpatterns/api/qxmlformatter.cpp | 2 +- src/xmlpatterns/api/qxmlformatter.h | 2 +- src/xmlpatterns/api/qxmlname.cpp | 2 +- src/xmlpatterns/api/qxmlname.h | 2 +- src/xmlpatterns/api/qxmlnamepool.cpp | 2 +- src/xmlpatterns/api/qxmlnamepool.h | 2 +- src/xmlpatterns/api/qxmlpatternistcli_p.h | 2 +- src/xmlpatterns/api/qxmlquery.cpp | 2 +- src/xmlpatterns/api/qxmlquery.h | 2 +- src/xmlpatterns/api/qxmlquery_p.h | 2 +- src/xmlpatterns/api/qxmlresultitems.cpp | 2 +- src/xmlpatterns/api/qxmlresultitems.h | 2 +- src/xmlpatterns/api/qxmlresultitems_p.h | 2 +- src/xmlpatterns/api/qxmlserializer.cpp | 2 +- src/xmlpatterns/api/qxmlserializer.h | 2 +- src/xmlpatterns/api/qxmlserializer_p.h | 2 +- src/xmlpatterns/data/qabstractdatetime.cpp | 2 +- src/xmlpatterns/data/qabstractdatetime_p.h | 2 +- src/xmlpatterns/data/qabstractduration.cpp | 2 +- src/xmlpatterns/data/qabstractduration_p.h | 2 +- src/xmlpatterns/data/qabstractfloat.cpp | 2 +- src/xmlpatterns/data/qabstractfloat_p.h | 2 +- src/xmlpatterns/data/qabstractfloatcasters.cpp | 2 +- src/xmlpatterns/data/qabstractfloatcasters_p.h | 2 +- src/xmlpatterns/data/qabstractfloatmathematician.cpp | 2 +- src/xmlpatterns/data/qabstractfloatmathematician_p.h | 2 +- src/xmlpatterns/data/qanyuri.cpp | 2 +- src/xmlpatterns/data/qanyuri_p.h | 2 +- src/xmlpatterns/data/qatomiccaster.cpp | 2 +- src/xmlpatterns/data/qatomiccaster_p.h | 2 +- src/xmlpatterns/data/qatomiccasters.cpp | 2 +- src/xmlpatterns/data/qatomiccasters_p.h | 2 +- src/xmlpatterns/data/qatomiccomparator.cpp | 2 +- src/xmlpatterns/data/qatomiccomparator_p.h | 2 +- src/xmlpatterns/data/qatomiccomparators.cpp | 2 +- src/xmlpatterns/data/qatomiccomparators_p.h | 2 +- src/xmlpatterns/data/qatomicmathematician.cpp | 2 +- src/xmlpatterns/data/qatomicmathematician_p.h | 2 +- src/xmlpatterns/data/qatomicmathematicians.cpp | 2 +- src/xmlpatterns/data/qatomicmathematicians_p.h | 2 +- src/xmlpatterns/data/qatomicstring.cpp | 2 +- src/xmlpatterns/data/qatomicstring_p.h | 2 +- src/xmlpatterns/data/qatomicvalue.cpp | 2 +- src/xmlpatterns/data/qbase64binary.cpp | 2 +- src/xmlpatterns/data/qbase64binary_p.h | 2 +- src/xmlpatterns/data/qboolean.cpp | 2 +- src/xmlpatterns/data/qboolean_p.h | 2 +- src/xmlpatterns/data/qcommonvalues.cpp | 2 +- src/xmlpatterns/data/qcommonvalues_p.h | 2 +- src/xmlpatterns/data/qdate.cpp | 2 +- src/xmlpatterns/data/qdate_p.h | 2 +- src/xmlpatterns/data/qdaytimeduration.cpp | 2 +- src/xmlpatterns/data/qdaytimeduration_p.h | 2 +- src/xmlpatterns/data/qdecimal.cpp | 2 +- src/xmlpatterns/data/qdecimal_p.h | 2 +- src/xmlpatterns/data/qderivedinteger_p.h | 2 +- src/xmlpatterns/data/qderivedstring_p.h | 2 +- src/xmlpatterns/data/qduration.cpp | 2 +- src/xmlpatterns/data/qduration_p.h | 2 +- src/xmlpatterns/data/qgday.cpp | 2 +- src/xmlpatterns/data/qgday_p.h | 2 +- src/xmlpatterns/data/qgmonth.cpp | 2 +- src/xmlpatterns/data/qgmonth_p.h | 2 +- src/xmlpatterns/data/qgmonthday.cpp | 2 +- src/xmlpatterns/data/qgmonthday_p.h | 2 +- src/xmlpatterns/data/qgyear.cpp | 2 +- src/xmlpatterns/data/qgyear_p.h | 2 +- src/xmlpatterns/data/qgyearmonth.cpp | 2 +- src/xmlpatterns/data/qgyearmonth_p.h | 2 +- src/xmlpatterns/data/qhexbinary.cpp | 2 +- src/xmlpatterns/data/qhexbinary_p.h | 2 +- src/xmlpatterns/data/qinteger.cpp | 2 +- src/xmlpatterns/data/qinteger_p.h | 2 +- src/xmlpatterns/data/qitem.cpp | 2 +- src/xmlpatterns/data/qitem_p.h | 2 +- src/xmlpatterns/data/qnodebuilder.cpp | 2 +- src/xmlpatterns/data/qnodebuilder_p.h | 2 +- src/xmlpatterns/data/qnodemodel.cpp | 2 +- src/xmlpatterns/data/qqnamevalue.cpp | 2 +- src/xmlpatterns/data/qqnamevalue_p.h | 2 +- src/xmlpatterns/data/qresourceloader.cpp | 2 +- src/xmlpatterns/data/qresourceloader_p.h | 2 +- src/xmlpatterns/data/qschemadatetime.cpp | 2 +- src/xmlpatterns/data/qschemadatetime_p.h | 2 +- src/xmlpatterns/data/qschemanumeric.cpp | 2 +- src/xmlpatterns/data/qschemanumeric_p.h | 2 +- src/xmlpatterns/data/qschematime.cpp | 2 +- src/xmlpatterns/data/qschematime_p.h | 2 +- src/xmlpatterns/data/qsequencereceiver.cpp | 2 +- src/xmlpatterns/data/qsequencereceiver_p.h | 2 +- src/xmlpatterns/data/qsorttuple.cpp | 2 +- src/xmlpatterns/data/qsorttuple_p.h | 2 +- src/xmlpatterns/data/quntypedatomic.cpp | 2 +- src/xmlpatterns/data/quntypedatomic_p.h | 2 +- src/xmlpatterns/data/qvalidationerror.cpp | 2 +- src/xmlpatterns/data/qvalidationerror_p.h | 2 +- src/xmlpatterns/data/qyearmonthduration.cpp | 2 +- src/xmlpatterns/data/qyearmonthduration_p.h | 2 +- src/xmlpatterns/documentationGroups.dox | 2 +- src/xmlpatterns/environment/createReportContext.sh | 2 +- src/xmlpatterns/environment/createReportContext.xsl | 4 ++-- src/xmlpatterns/environment/qcurrentitemcontext.cpp | 2 +- src/xmlpatterns/environment/qcurrentitemcontext_p.h | 2 +- src/xmlpatterns/environment/qdelegatingdynamiccontext.cpp | 2 +- src/xmlpatterns/environment/qdelegatingdynamiccontext_p.h | 2 +- src/xmlpatterns/environment/qdelegatingstaticcontext.cpp | 2 +- src/xmlpatterns/environment/qdelegatingstaticcontext_p.h | 2 +- src/xmlpatterns/environment/qdynamiccontext.cpp | 2 +- src/xmlpatterns/environment/qdynamiccontext_p.h | 2 +- src/xmlpatterns/environment/qfocus.cpp | 2 +- src/xmlpatterns/environment/qfocus_p.h | 2 +- src/xmlpatterns/environment/qgenericdynamiccontext.cpp | 2 +- src/xmlpatterns/environment/qgenericdynamiccontext_p.h | 2 +- src/xmlpatterns/environment/qgenericstaticcontext.cpp | 2 +- src/xmlpatterns/environment/qgenericstaticcontext_p.h | 2 +- src/xmlpatterns/environment/qreceiverdynamiccontext.cpp | 2 +- src/xmlpatterns/environment/qreceiverdynamiccontext_p.h | 2 +- src/xmlpatterns/environment/qreportcontext.cpp | 2 +- src/xmlpatterns/environment/qreportcontext_p.h | 2 +- src/xmlpatterns/environment/qstackcontextbase.cpp | 2 +- src/xmlpatterns/environment/qstackcontextbase_p.h | 2 +- src/xmlpatterns/environment/qstaticbaseuricontext.cpp | 2 +- src/xmlpatterns/environment/qstaticbaseuricontext_p.h | 2 +- .../environment/qstaticcompatibilitycontext.cpp | 2 +- .../environment/qstaticcompatibilitycontext_p.h | 2 +- src/xmlpatterns/environment/qstaticcontext.cpp | 2 +- src/xmlpatterns/environment/qstaticcontext_p.h | 2 +- src/xmlpatterns/environment/qstaticcurrentcontext.cpp | 2 +- src/xmlpatterns/environment/qstaticcurrentcontext_p.h | 2 +- src/xmlpatterns/environment/qstaticfocuscontext.cpp | 2 +- src/xmlpatterns/environment/qstaticfocuscontext_p.h | 2 +- src/xmlpatterns/environment/qstaticnamespacecontext.cpp | 2 +- src/xmlpatterns/environment/qstaticnamespacecontext_p.h | 2 +- src/xmlpatterns/expr/qandexpression.cpp | 2 +- src/xmlpatterns/expr/qandexpression_p.h | 2 +- src/xmlpatterns/expr/qapplytemplate.cpp | 2 +- src/xmlpatterns/expr/qapplytemplate_p.h | 2 +- src/xmlpatterns/expr/qargumentreference.cpp | 2 +- src/xmlpatterns/expr/qargumentreference_p.h | 2 +- src/xmlpatterns/expr/qarithmeticexpression.cpp | 2 +- src/xmlpatterns/expr/qarithmeticexpression_p.h | 2 +- src/xmlpatterns/expr/qattributeconstructor.cpp | 2 +- src/xmlpatterns/expr/qattributeconstructor_p.h | 2 +- src/xmlpatterns/expr/qattributenamevalidator.cpp | 2 +- src/xmlpatterns/expr/qattributenamevalidator_p.h | 2 +- src/xmlpatterns/expr/qaxisstep.cpp | 2 +- src/xmlpatterns/expr/qaxisstep_p.h | 2 +- src/xmlpatterns/expr/qcachecells_p.h | 2 +- src/xmlpatterns/expr/qcallsite.cpp | 2 +- src/xmlpatterns/expr/qcallsite_p.h | 2 +- src/xmlpatterns/expr/qcalltargetdescription.cpp | 2 +- src/xmlpatterns/expr/qcalltargetdescription_p.h | 2 +- src/xmlpatterns/expr/qcalltemplate.cpp | 2 +- src/xmlpatterns/expr/qcalltemplate_p.h | 2 +- src/xmlpatterns/expr/qcastableas.cpp | 2 +- src/xmlpatterns/expr/qcastableas_p.h | 2 +- src/xmlpatterns/expr/qcastas.cpp | 2 +- src/xmlpatterns/expr/qcastas_p.h | 2 +- src/xmlpatterns/expr/qcastingplatform.cpp | 2 +- src/xmlpatterns/expr/qcastingplatform_p.h | 2 +- src/xmlpatterns/expr/qcollationchecker.cpp | 2 +- src/xmlpatterns/expr/qcollationchecker_p.h | 2 +- src/xmlpatterns/expr/qcombinenodes.cpp | 2 +- src/xmlpatterns/expr/qcombinenodes_p.h | 2 +- src/xmlpatterns/expr/qcommentconstructor.cpp | 2 +- src/xmlpatterns/expr/qcommentconstructor_p.h | 2 +- src/xmlpatterns/expr/qcomparisonplatform.cpp | 2 +- src/xmlpatterns/expr/qcomparisonplatform_p.h | 2 +- src/xmlpatterns/expr/qcomputednamespaceconstructor.cpp | 2 +- src/xmlpatterns/expr/qcomputednamespaceconstructor_p.h | 2 +- src/xmlpatterns/expr/qcontextitem.cpp | 2 +- src/xmlpatterns/expr/qcontextitem_p.h | 2 +- src/xmlpatterns/expr/qcopyof.cpp | 2 +- src/xmlpatterns/expr/qcopyof_p.h | 2 +- src/xmlpatterns/expr/qcurrentitemstore.cpp | 2 +- src/xmlpatterns/expr/qcurrentitemstore_p.h | 2 +- src/xmlpatterns/expr/qdocumentconstructor.cpp | 2 +- src/xmlpatterns/expr/qdocumentconstructor_p.h | 2 +- src/xmlpatterns/expr/qdocumentcontentvalidator.cpp | 2 +- src/xmlpatterns/expr/qdocumentcontentvalidator_p.h | 2 +- src/xmlpatterns/expr/qdynamiccontextstore.cpp | 2 +- src/xmlpatterns/expr/qdynamiccontextstore_p.h | 2 +- src/xmlpatterns/expr/qelementconstructor.cpp | 2 +- src/xmlpatterns/expr/qelementconstructor_p.h | 2 +- src/xmlpatterns/expr/qemptycontainer.cpp | 2 +- src/xmlpatterns/expr/qemptycontainer_p.h | 2 +- src/xmlpatterns/expr/qemptysequence.cpp | 2 +- src/xmlpatterns/expr/qemptysequence_p.h | 2 +- src/xmlpatterns/expr/qevaluationcache.cpp | 2 +- src/xmlpatterns/expr/qevaluationcache_p.h | 2 +- src/xmlpatterns/expr/qexpression.cpp | 2 +- src/xmlpatterns/expr/qexpression_p.h | 2 +- src/xmlpatterns/expr/qexpressiondispatch_p.h | 2 +- src/xmlpatterns/expr/qexpressionfactory.cpp | 2 +- src/xmlpatterns/expr/qexpressionfactory_p.h | 2 +- src/xmlpatterns/expr/qexpressionsequence.cpp | 2 +- src/xmlpatterns/expr/qexpressionsequence_p.h | 2 +- src/xmlpatterns/expr/qexpressionvariablereference.cpp | 2 +- src/xmlpatterns/expr/qexpressionvariablereference_p.h | 2 +- src/xmlpatterns/expr/qexternalvariableloader.cpp | 2 +- src/xmlpatterns/expr/qexternalvariableloader_p.h | 2 +- src/xmlpatterns/expr/qexternalvariablereference.cpp | 2 +- src/xmlpatterns/expr/qexternalvariablereference_p.h | 2 +- src/xmlpatterns/expr/qfirstitempredicate.cpp | 2 +- src/xmlpatterns/expr/qfirstitempredicate_p.h | 2 +- src/xmlpatterns/expr/qforclause.cpp | 2 +- src/xmlpatterns/expr/qforclause_p.h | 2 +- src/xmlpatterns/expr/qgeneralcomparison.cpp | 2 +- src/xmlpatterns/expr/qgeneralcomparison_p.h | 2 +- src/xmlpatterns/expr/qgenericpredicate.cpp | 2 +- src/xmlpatterns/expr/qgenericpredicate_p.h | 2 +- src/xmlpatterns/expr/qifthenclause.cpp | 2 +- src/xmlpatterns/expr/qifthenclause_p.h | 2 +- src/xmlpatterns/expr/qinstanceof.cpp | 2 +- src/xmlpatterns/expr/qinstanceof_p.h | 2 +- src/xmlpatterns/expr/qletclause.cpp | 2 +- src/xmlpatterns/expr/qletclause_p.h | 2 +- src/xmlpatterns/expr/qliteral.cpp | 2 +- src/xmlpatterns/expr/qliteral_p.h | 2 +- src/xmlpatterns/expr/qliteralsequence.cpp | 2 +- src/xmlpatterns/expr/qliteralsequence_p.h | 2 +- src/xmlpatterns/expr/qnamespaceconstructor.cpp | 2 +- src/xmlpatterns/expr/qnamespaceconstructor_p.h | 2 +- src/xmlpatterns/expr/qncnameconstructor.cpp | 2 +- src/xmlpatterns/expr/qncnameconstructor_p.h | 2 +- src/xmlpatterns/expr/qnodecomparison.cpp | 2 +- src/xmlpatterns/expr/qnodecomparison_p.h | 2 +- src/xmlpatterns/expr/qnodesort.cpp | 2 +- src/xmlpatterns/expr/qnodesort_p.h | 2 +- src/xmlpatterns/expr/qoperandsiterator_p.h | 2 +- src/xmlpatterns/expr/qoptimizationpasses.cpp | 2 +- src/xmlpatterns/expr/qoptimizationpasses_p.h | 2 +- src/xmlpatterns/expr/qoptimizerblocks.cpp | 2 +- src/xmlpatterns/expr/qoptimizerblocks_p.h | 2 +- src/xmlpatterns/expr/qoptimizerframework.cpp | 2 +- src/xmlpatterns/expr/qoptimizerframework_p.h | 2 +- src/xmlpatterns/expr/qorderby.cpp | 2 +- src/xmlpatterns/expr/qorderby_p.h | 2 +- src/xmlpatterns/expr/qorexpression.cpp | 2 +- src/xmlpatterns/expr/qorexpression_p.h | 2 +- src/xmlpatterns/expr/qpaircontainer.cpp | 2 +- src/xmlpatterns/expr/qpaircontainer_p.h | 2 +- src/xmlpatterns/expr/qparentnodeaxis.cpp | 2 +- src/xmlpatterns/expr/qparentnodeaxis_p.h | 2 +- src/xmlpatterns/expr/qpath.cpp | 2 +- src/xmlpatterns/expr/qpath_p.h | 2 +- src/xmlpatterns/expr/qpositionalvariablereference.cpp | 2 +- src/xmlpatterns/expr/qpositionalvariablereference_p.h | 2 +- src/xmlpatterns/expr/qprocessinginstructionconstructor.cpp | 2 +- src/xmlpatterns/expr/qprocessinginstructionconstructor_p.h | 2 +- src/xmlpatterns/expr/qqnameconstructor.cpp | 2 +- src/xmlpatterns/expr/qqnameconstructor_p.h | 2 +- src/xmlpatterns/expr/qquantifiedexpression.cpp | 2 +- src/xmlpatterns/expr/qquantifiedexpression_p.h | 2 +- src/xmlpatterns/expr/qrangeexpression.cpp | 2 +- src/xmlpatterns/expr/qrangeexpression_p.h | 2 +- src/xmlpatterns/expr/qrangevariablereference.cpp | 2 +- src/xmlpatterns/expr/qrangevariablereference_p.h | 2 +- src/xmlpatterns/expr/qreturnorderby.cpp | 2 +- src/xmlpatterns/expr/qreturnorderby_p.h | 2 +- src/xmlpatterns/expr/qsimplecontentconstructor.cpp | 2 +- src/xmlpatterns/expr/qsimplecontentconstructor_p.h | 2 +- src/xmlpatterns/expr/qsinglecontainer.cpp | 2 +- src/xmlpatterns/expr/qsinglecontainer_p.h | 2 +- src/xmlpatterns/expr/qsourcelocationreflection.cpp | 2 +- src/xmlpatterns/expr/qsourcelocationreflection_p.h | 2 +- src/xmlpatterns/expr/qstaticbaseuristore.cpp | 2 +- src/xmlpatterns/expr/qstaticbaseuristore_p.h | 2 +- src/xmlpatterns/expr/qstaticcompatibilitystore.cpp | 2 +- src/xmlpatterns/expr/qstaticcompatibilitystore_p.h | 2 +- src/xmlpatterns/expr/qtemplate.cpp | 2 +- src/xmlpatterns/expr/qtemplate_p.h | 2 +- src/xmlpatterns/expr/qtemplateinvoker.cpp | 2 +- src/xmlpatterns/expr/qtemplateinvoker_p.h | 2 +- src/xmlpatterns/expr/qtemplatemode.cpp | 2 +- src/xmlpatterns/expr/qtemplatemode_p.h | 2 +- src/xmlpatterns/expr/qtemplateparameterreference.cpp | 2 +- src/xmlpatterns/expr/qtemplateparameterreference_p.h | 2 +- src/xmlpatterns/expr/qtemplatepattern_p.h | 2 +- src/xmlpatterns/expr/qtextnodeconstructor.cpp | 2 +- src/xmlpatterns/expr/qtextnodeconstructor_p.h | 2 +- src/xmlpatterns/expr/qtreatas.cpp | 2 +- src/xmlpatterns/expr/qtreatas_p.h | 2 +- src/xmlpatterns/expr/qtriplecontainer.cpp | 2 +- src/xmlpatterns/expr/qtriplecontainer_p.h | 2 +- src/xmlpatterns/expr/qtruthpredicate.cpp | 2 +- src/xmlpatterns/expr/qtruthpredicate_p.h | 2 +- src/xmlpatterns/expr/qunaryexpression.cpp | 2 +- src/xmlpatterns/expr/qunaryexpression_p.h | 2 +- src/xmlpatterns/expr/qunlimitedcontainer.cpp | 2 +- src/xmlpatterns/expr/qunlimitedcontainer_p.h | 2 +- src/xmlpatterns/expr/qunresolvedvariablereference.cpp | 2 +- src/xmlpatterns/expr/qunresolvedvariablereference_p.h | 2 +- src/xmlpatterns/expr/quserfunction.cpp | 2 +- src/xmlpatterns/expr/quserfunction_p.h | 2 +- src/xmlpatterns/expr/quserfunctioncallsite.cpp | 2 +- src/xmlpatterns/expr/quserfunctioncallsite_p.h | 2 +- src/xmlpatterns/expr/qvalidate.cpp | 2 +- src/xmlpatterns/expr/qvalidate_p.h | 2 +- src/xmlpatterns/expr/qvaluecomparison.cpp | 2 +- src/xmlpatterns/expr/qvaluecomparison_p.h | 2 +- src/xmlpatterns/expr/qvariabledeclaration.cpp | 2 +- src/xmlpatterns/expr/qvariabledeclaration_p.h | 2 +- src/xmlpatterns/expr/qvariablereference.cpp | 2 +- src/xmlpatterns/expr/qvariablereference_p.h | 2 +- src/xmlpatterns/expr/qwithparam_p.h | 2 +- src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp | 2 +- src/xmlpatterns/expr/qxsltsimplecontentconstructor_p.h | 2 +- src/xmlpatterns/functions/qabstractfunctionfactory.cpp | 2 +- src/xmlpatterns/functions/qabstractfunctionfactory_p.h | 2 +- src/xmlpatterns/functions/qaccessorfns.cpp | 2 +- src/xmlpatterns/functions/qaccessorfns_p.h | 2 +- src/xmlpatterns/functions/qaggregatefns.cpp | 2 +- src/xmlpatterns/functions/qaggregatefns_p.h | 2 +- src/xmlpatterns/functions/qaggregator.cpp | 2 +- src/xmlpatterns/functions/qaggregator_p.h | 2 +- src/xmlpatterns/functions/qassemblestringfns.cpp | 2 +- src/xmlpatterns/functions/qassemblestringfns_p.h | 2 +- src/xmlpatterns/functions/qbooleanfns.cpp | 2 +- src/xmlpatterns/functions/qbooleanfns_p.h | 2 +- src/xmlpatterns/functions/qcomparescaseaware.cpp | 2 +- src/xmlpatterns/functions/qcomparescaseaware_p.h | 2 +- src/xmlpatterns/functions/qcomparestringfns.cpp | 2 +- src/xmlpatterns/functions/qcomparestringfns_p.h | 2 +- src/xmlpatterns/functions/qcomparingaggregator.cpp | 2 +- src/xmlpatterns/functions/qcomparingaggregator_p.h | 2 +- src/xmlpatterns/functions/qconstructorfunctionsfactory.cpp | 2 +- src/xmlpatterns/functions/qconstructorfunctionsfactory_p.h | 2 +- src/xmlpatterns/functions/qcontextfns.cpp | 2 +- src/xmlpatterns/functions/qcontextfns_p.h | 2 +- src/xmlpatterns/functions/qcontextnodechecker.cpp | 2 +- src/xmlpatterns/functions/qcontextnodechecker_p.h | 2 +- src/xmlpatterns/functions/qcurrentfn.cpp | 2 +- src/xmlpatterns/functions/qcurrentfn_p.h | 2 +- src/xmlpatterns/functions/qdatetimefn.cpp | 2 +- src/xmlpatterns/functions/qdatetimefn_p.h | 2 +- src/xmlpatterns/functions/qdatetimefns.cpp | 2 +- src/xmlpatterns/functions/qdatetimefns_p.h | 2 +- src/xmlpatterns/functions/qdeepequalfn.cpp | 2 +- src/xmlpatterns/functions/qdeepequalfn_p.h | 2 +- src/xmlpatterns/functions/qdocumentfn.cpp | 2 +- src/xmlpatterns/functions/qdocumentfn_p.h | 2 +- src/xmlpatterns/functions/qelementavailablefn.cpp | 2 +- src/xmlpatterns/functions/qelementavailablefn_p.h | 2 +- src/xmlpatterns/functions/qerrorfn.cpp | 2 +- src/xmlpatterns/functions/qerrorfn_p.h | 2 +- src/xmlpatterns/functions/qfunctionargument.cpp | 2 +- src/xmlpatterns/functions/qfunctionargument_p.h | 2 +- src/xmlpatterns/functions/qfunctionavailablefn.cpp | 2 +- src/xmlpatterns/functions/qfunctionavailablefn_p.h | 2 +- src/xmlpatterns/functions/qfunctioncall.cpp | 2 +- src/xmlpatterns/functions/qfunctioncall_p.h | 2 +- src/xmlpatterns/functions/qfunctionfactory.cpp | 2 +- src/xmlpatterns/functions/qfunctionfactory_p.h | 2 +- src/xmlpatterns/functions/qfunctionfactorycollection.cpp | 2 +- src/xmlpatterns/functions/qfunctionfactorycollection_p.h | 2 +- src/xmlpatterns/functions/qfunctionsignature.cpp | 2 +- src/xmlpatterns/functions/qfunctionsignature_p.h | 2 +- src/xmlpatterns/functions/qgenerateidfn.cpp | 2 +- src/xmlpatterns/functions/qgenerateidfn_p.h | 2 +- src/xmlpatterns/functions/qnodefns.cpp | 2 +- src/xmlpatterns/functions/qnodefns_p.h | 2 +- src/xmlpatterns/functions/qnumericfns.cpp | 2 +- src/xmlpatterns/functions/qnumericfns_p.h | 2 +- src/xmlpatterns/functions/qpatternmatchingfns.cpp | 2 +- src/xmlpatterns/functions/qpatternmatchingfns_p.h | 2 +- src/xmlpatterns/functions/qpatternplatform.cpp | 2 +- src/xmlpatterns/functions/qpatternplatform_p.h | 2 +- src/xmlpatterns/functions/qqnamefns.cpp | 2 +- src/xmlpatterns/functions/qqnamefns_p.h | 2 +- src/xmlpatterns/functions/qresolveurifn.cpp | 2 +- src/xmlpatterns/functions/qresolveurifn_p.h | 2 +- src/xmlpatterns/functions/qsequencefns.cpp | 2 +- src/xmlpatterns/functions/qsequencefns_p.h | 2 +- src/xmlpatterns/functions/qsequencegeneratingfns.cpp | 2 +- src/xmlpatterns/functions/qsequencegeneratingfns_p.h | 2 +- src/xmlpatterns/functions/qstaticbaseuricontainer_p.h | 2 +- src/xmlpatterns/functions/qstaticnamespacescontainer.cpp | 2 +- src/xmlpatterns/functions/qstaticnamespacescontainer_p.h | 2 +- src/xmlpatterns/functions/qstringvaluefns.cpp | 2 +- src/xmlpatterns/functions/qstringvaluefns_p.h | 2 +- src/xmlpatterns/functions/qsubstringfns.cpp | 2 +- src/xmlpatterns/functions/qsubstringfns_p.h | 2 +- src/xmlpatterns/functions/qsystempropertyfn.cpp | 2 +- src/xmlpatterns/functions/qsystempropertyfn_p.h | 2 +- src/xmlpatterns/functions/qtimezonefns.cpp | 2 +- src/xmlpatterns/functions/qtimezonefns_p.h | 2 +- src/xmlpatterns/functions/qtracefn.cpp | 2 +- src/xmlpatterns/functions/qtracefn_p.h | 2 +- src/xmlpatterns/functions/qtypeavailablefn.cpp | 2 +- src/xmlpatterns/functions/qtypeavailablefn_p.h | 2 +- src/xmlpatterns/functions/qunparsedentitypublicidfn.cpp | 2 +- src/xmlpatterns/functions/qunparsedentitypublicidfn_p.h | 2 +- src/xmlpatterns/functions/qunparsedentityurifn.cpp | 2 +- src/xmlpatterns/functions/qunparsedentityurifn_p.h | 2 +- src/xmlpatterns/functions/qunparsedtextavailablefn.cpp | 2 +- src/xmlpatterns/functions/qunparsedtextavailablefn_p.h | 2 +- src/xmlpatterns/functions/qunparsedtextfn.cpp | 2 +- src/xmlpatterns/functions/qunparsedtextfn_p.h | 2 +- src/xmlpatterns/functions/qxpath10corefunctions.cpp | 2 +- src/xmlpatterns/functions/qxpath10corefunctions_p.h | 2 +- src/xmlpatterns/functions/qxpath20corefunctions.cpp | 2 +- src/xmlpatterns/functions/qxpath20corefunctions_p.h | 2 +- src/xmlpatterns/functions/qxslt20corefunctions.cpp | 2 +- src/xmlpatterns/functions/qxslt20corefunctions_p.h | 2 +- src/xmlpatterns/iterators/qcachingiterator.cpp | 2 +- src/xmlpatterns/iterators/qcachingiterator_p.h | 2 +- src/xmlpatterns/iterators/qdeduplicateiterator.cpp | 2 +- src/xmlpatterns/iterators/qdeduplicateiterator_p.h | 2 +- src/xmlpatterns/iterators/qdistinctiterator.cpp | 2 +- src/xmlpatterns/iterators/qdistinctiterator_p.h | 2 +- src/xmlpatterns/iterators/qemptyiterator_p.h | 2 +- src/xmlpatterns/iterators/qexceptiterator.cpp | 2 +- src/xmlpatterns/iterators/qexceptiterator_p.h | 2 +- src/xmlpatterns/iterators/qindexofiterator.cpp | 2 +- src/xmlpatterns/iterators/qindexofiterator_p.h | 2 +- src/xmlpatterns/iterators/qinsertioniterator.cpp | 2 +- src/xmlpatterns/iterators/qinsertioniterator_p.h | 2 +- src/xmlpatterns/iterators/qintersectiterator.cpp | 2 +- src/xmlpatterns/iterators/qintersectiterator_p.h | 2 +- src/xmlpatterns/iterators/qitemmappingiterator_p.h | 2 +- src/xmlpatterns/iterators/qrangeiterator.cpp | 2 +- src/xmlpatterns/iterators/qrangeiterator_p.h | 2 +- src/xmlpatterns/iterators/qremovaliterator.cpp | 2 +- src/xmlpatterns/iterators/qremovaliterator_p.h | 2 +- src/xmlpatterns/iterators/qsequencemappingiterator_p.h | 2 +- src/xmlpatterns/iterators/qsingletoniterator_p.h | 2 +- src/xmlpatterns/iterators/qsubsequenceiterator.cpp | 2 +- src/xmlpatterns/iterators/qsubsequenceiterator_p.h | 2 +- src/xmlpatterns/iterators/qtocodepointsiterator.cpp | 2 +- src/xmlpatterns/iterators/qtocodepointsiterator_p.h | 2 +- src/xmlpatterns/iterators/qunioniterator.cpp | 2 +- src/xmlpatterns/iterators/qunioniterator_p.h | 2 +- src/xmlpatterns/janitors/qargumentconverter.cpp | 2 +- src/xmlpatterns/janitors/qargumentconverter_p.h | 2 +- src/xmlpatterns/janitors/qatomizer.cpp | 2 +- src/xmlpatterns/janitors/qatomizer_p.h | 2 +- src/xmlpatterns/janitors/qcardinalityverifier.cpp | 2 +- src/xmlpatterns/janitors/qcardinalityverifier_p.h | 2 +- src/xmlpatterns/janitors/qebvextractor.cpp | 2 +- src/xmlpatterns/janitors/qebvextractor_p.h | 2 +- src/xmlpatterns/janitors/qitemverifier.cpp | 2 +- src/xmlpatterns/janitors/qitemverifier_p.h | 2 +- src/xmlpatterns/janitors/quntypedatomicconverter.cpp | 2 +- src/xmlpatterns/janitors/quntypedatomicconverter_p.h | 2 +- src/xmlpatterns/parser/TokenLookup.gperf | 2 +- src/xmlpatterns/parser/createParser.sh | 2 +- src/xmlpatterns/parser/createTokenLookup.sh | 4 ++-- src/xmlpatterns/parser/createXSLTTokenLookup.sh | 2 +- src/xmlpatterns/parser/qmaintainingreader.cpp | 2 +- src/xmlpatterns/parser/qmaintainingreader_p.h | 2 +- src/xmlpatterns/parser/qparsercontext.cpp | 2 +- src/xmlpatterns/parser/qparsercontext_p.h | 2 +- src/xmlpatterns/parser/qquerytransformparser.cpp | 2 +- src/xmlpatterns/parser/qquerytransformparser_p.h | 2 +- src/xmlpatterns/parser/qtokenizer_p.h | 2 +- src/xmlpatterns/parser/qtokenlookup.cpp | 2 +- src/xmlpatterns/parser/qtokenrevealer.cpp | 2 +- src/xmlpatterns/parser/qtokenrevealer_p.h | 2 +- src/xmlpatterns/parser/qtokensource.cpp | 2 +- src/xmlpatterns/parser/qtokensource_p.h | 2 +- src/xmlpatterns/parser/querytransformparser.ypp | 4 ++-- src/xmlpatterns/parser/qxquerytokenizer.cpp | 2 +- src/xmlpatterns/parser/qxquerytokenizer_p.h | 2 +- src/xmlpatterns/parser/qxslttokenizer.cpp | 2 +- src/xmlpatterns/parser/qxslttokenizer_p.h | 2 +- src/xmlpatterns/parser/qxslttokenlookup.cpp | 2 +- src/xmlpatterns/parser/qxslttokenlookup.xml | 2 +- src/xmlpatterns/parser/qxslttokenlookup_p.h | 2 +- src/xmlpatterns/parser/trolltechHeader.txt | 2 +- src/xmlpatterns/projection/qdocumentprojector.cpp | 2 +- src/xmlpatterns/projection/qdocumentprojector_p.h | 2 +- src/xmlpatterns/projection/qprojectedexpression_p.h | 2 +- src/xmlpatterns/qtokenautomaton/exampleFile.xml | 2 +- src/xmlpatterns/schema/qxsdschemachecker_setup.cpp | 2 +- src/xmlpatterns/schema/qxsdschemaparser.cpp | 2 +- src/xmlpatterns/schema/qxsdschemaparser_setup.cpp | 2 +- src/xmlpatterns/type/qabstractnodetest.cpp | 2 +- src/xmlpatterns/type/qabstractnodetest_p.h | 2 +- src/xmlpatterns/type/qanyitemtype.cpp | 2 +- src/xmlpatterns/type/qanyitemtype_p.h | 2 +- src/xmlpatterns/type/qanynodetype.cpp | 2 +- src/xmlpatterns/type/qanynodetype_p.h | 2 +- src/xmlpatterns/type/qanysimpletype.cpp | 2 +- src/xmlpatterns/type/qanysimpletype_p.h | 2 +- src/xmlpatterns/type/qanytype.cpp | 2 +- src/xmlpatterns/type/qanytype_p.h | 2 +- src/xmlpatterns/type/qatomiccasterlocator.cpp | 2 +- src/xmlpatterns/type/qatomiccasterlocator_p.h | 2 +- src/xmlpatterns/type/qatomiccasterlocators.cpp | 2 +- src/xmlpatterns/type/qatomiccasterlocators_p.h | 2 +- src/xmlpatterns/type/qatomiccomparatorlocator.cpp | 2 +- src/xmlpatterns/type/qatomiccomparatorlocator_p.h | 2 +- src/xmlpatterns/type/qatomiccomparatorlocators.cpp | 2 +- src/xmlpatterns/type/qatomiccomparatorlocators_p.h | 2 +- src/xmlpatterns/type/qatomicmathematicianlocator.cpp | 2 +- src/xmlpatterns/type/qatomicmathematicianlocator_p.h | 2 +- src/xmlpatterns/type/qatomicmathematicianlocators.cpp | 2 +- src/xmlpatterns/type/qatomicmathematicianlocators_p.h | 2 +- src/xmlpatterns/type/qatomictype.cpp | 2 +- src/xmlpatterns/type/qatomictype_p.h | 2 +- src/xmlpatterns/type/qatomictypedispatch_p.h | 2 +- src/xmlpatterns/type/qbasictypesfactory.cpp | 2 +- src/xmlpatterns/type/qbasictypesfactory_p.h | 2 +- src/xmlpatterns/type/qbuiltinatomictype.cpp | 2 +- src/xmlpatterns/type/qbuiltinatomictype_p.h | 2 +- src/xmlpatterns/type/qbuiltinatomictypes.cpp | 2 +- src/xmlpatterns/type/qbuiltinatomictypes_p.h | 2 +- src/xmlpatterns/type/qbuiltinnodetype.cpp | 2 +- src/xmlpatterns/type/qbuiltinnodetype_p.h | 2 +- src/xmlpatterns/type/qbuiltintypes.cpp | 2 +- src/xmlpatterns/type/qbuiltintypes_p.h | 2 +- src/xmlpatterns/type/qcardinality.cpp | 2 +- src/xmlpatterns/type/qcardinality_p.h | 2 +- src/xmlpatterns/type/qcommonsequencetypes.cpp | 2 +- src/xmlpatterns/type/qcommonsequencetypes_p.h | 2 +- src/xmlpatterns/type/qebvtype.cpp | 2 +- src/xmlpatterns/type/qebvtype_p.h | 2 +- src/xmlpatterns/type/qemptysequencetype.cpp | 2 +- src/xmlpatterns/type/qemptysequencetype_p.h | 2 +- src/xmlpatterns/type/qgenericsequencetype.cpp | 2 +- src/xmlpatterns/type/qgenericsequencetype_p.h | 2 +- src/xmlpatterns/type/qitemtype.cpp | 2 +- src/xmlpatterns/type/qitemtype_p.h | 2 +- src/xmlpatterns/type/qlocalnametest.cpp | 2 +- src/xmlpatterns/type/qlocalnametest_p.h | 2 +- src/xmlpatterns/type/qmultiitemtype.cpp | 2 +- src/xmlpatterns/type/qmultiitemtype_p.h | 2 +- src/xmlpatterns/type/qnamespacenametest.cpp | 2 +- src/xmlpatterns/type/qnamespacenametest_p.h | 2 +- src/xmlpatterns/type/qnonetype.cpp | 2 +- src/xmlpatterns/type/qnonetype_p.h | 2 +- src/xmlpatterns/type/qnumerictype.cpp | 2 +- src/xmlpatterns/type/qnumerictype_p.h | 2 +- src/xmlpatterns/type/qprimitives_p.h | 2 +- src/xmlpatterns/type/qqnametest.cpp | 2 +- src/xmlpatterns/type/qqnametest_p.h | 2 +- src/xmlpatterns/type/qschemacomponent.cpp | 2 +- src/xmlpatterns/type/qschemacomponent_p.h | 2 +- src/xmlpatterns/type/qschematype.cpp | 2 +- src/xmlpatterns/type/qschematype_p.h | 2 +- src/xmlpatterns/type/qschematypefactory.cpp | 2 +- src/xmlpatterns/type/qschematypefactory_p.h | 2 +- src/xmlpatterns/type/qsequencetype.cpp | 2 +- src/xmlpatterns/type/qsequencetype_p.h | 2 +- src/xmlpatterns/type/qtypechecker.cpp | 2 +- src/xmlpatterns/type/qtypechecker_p.h | 2 +- src/xmlpatterns/type/quntyped.cpp | 2 +- src/xmlpatterns/type/quntyped_p.h | 2 +- src/xmlpatterns/type/qxsltnodetest.cpp | 2 +- src/xmlpatterns/type/qxsltnodetest_p.h | 2 +- src/xmlpatterns/utils/qautoptr.cpp | 2 +- src/xmlpatterns/utils/qautoptr_p.h | 2 +- src/xmlpatterns/utils/qcommonnamespaces_p.h | 2 +- src/xmlpatterns/utils/qcppcastinghelper_p.h | 2 +- src/xmlpatterns/utils/qdebug_p.h | 2 +- src/xmlpatterns/utils/qdelegatingnamespaceresolver.cpp | 2 +- src/xmlpatterns/utils/qdelegatingnamespaceresolver_p.h | 2 +- src/xmlpatterns/utils/qgenericnamespaceresolver.cpp | 2 +- src/xmlpatterns/utils/qgenericnamespaceresolver_p.h | 2 +- src/xmlpatterns/utils/qnamepool.cpp | 2 +- src/xmlpatterns/utils/qnamepool_p.h | 2 +- src/xmlpatterns/utils/qnamespacebinding_p.h | 2 +- src/xmlpatterns/utils/qnamespaceresolver.cpp | 2 +- src/xmlpatterns/utils/qnamespaceresolver_p.h | 2 +- src/xmlpatterns/utils/qnodenamespaceresolver.cpp | 2 +- src/xmlpatterns/utils/qnodenamespaceresolver_p.h | 2 +- src/xmlpatterns/utils/qoutputvalidator.cpp | 2 +- src/xmlpatterns/utils/qoutputvalidator_p.h | 2 +- src/xmlpatterns/utils/qpatternistlocale.cpp | 2 +- src/xmlpatterns/utils/qpatternistlocale_p.h | 2 +- src/xmlpatterns/utils/qxpathhelper.cpp | 2 +- src/xmlpatterns/utils/qxpathhelper_p.h | 2 +- tests/arthur/common/framework.cpp | 2 +- tests/arthur/common/framework.h | 2 +- tests/arthur/common/paintcommands.cpp | 2 +- tests/arthur/common/paintcommands.h | 2 +- tests/arthur/common/qengines.cpp | 2 +- tests/arthur/common/qengines.h | 2 +- tests/arthur/common/xmldata.cpp | 2 +- tests/arthur/common/xmldata.h | 2 +- tests/arthur/datagenerator/datagenerator.cpp | 2 +- tests/arthur/datagenerator/datagenerator.h | 2 +- tests/arthur/datagenerator/main.cpp | 2 +- tests/arthur/datagenerator/xmlgenerator.cpp | 2 +- tests/arthur/datagenerator/xmlgenerator.h | 2 +- tests/arthur/htmlgenerator/htmlgenerator.cpp | 2 +- tests/arthur/htmlgenerator/htmlgenerator.h | 2 +- tests/arthur/htmlgenerator/main.cpp | 2 +- tests/arthur/lance/interactivewidget.cpp | 2 +- tests/arthur/lance/interactivewidget.h | 2 +- tests/arthur/lance/main.cpp | 2 +- tests/arthur/lance/widgets.h | 2 +- tests/arthur/performancediff/main.cpp | 2 +- tests/arthur/performancediff/performancediff.cpp | 2 +- tests/arthur/performancediff/performancediff.h | 2 +- tests/arthur/shower/main.cpp | 2 +- tests/arthur/shower/shower.cpp | 2 +- tests/arthur/shower/shower.h | 2 +- tests/auto/atwrapper/atWrapper.cpp | 2 +- tests/auto/atwrapper/atWrapper.h | 2 +- tests/auto/atwrapper/atWrapperAutotest.cpp | 2 +- tests/auto/bic/gen.sh | 2 +- tests/auto/bic/qbic.cpp | 2 +- tests/auto/bic/qbic.h | 2 +- tests/auto/bic/tst_bic.cpp | 2 +- tests/auto/checkxmlfiles/tst_checkxmlfiles.cpp | 2 +- tests/auto/collections/tst_collections.cpp | 2 +- tests/auto/compiler/baseclass.cpp | 2 +- tests/auto/compiler/baseclass.h | 2 +- tests/auto/compiler/derivedclass.cpp | 2 +- tests/auto/compiler/derivedclass.h | 2 +- tests/auto/compiler/tst_compiler.cpp | 2 +- tests/auto/compilerwarnings/test_cpp.txt | 2 +- tests/auto/compilerwarnings/tst_compilerwarnings.cpp | 2 +- tests/auto/exceptionsafety/tst_exceptionsafety.cpp | 2 +- tests/auto/exceptionsafety_objects/oomsimulator.h | 2 +- .../tst_exceptionsafety_objects.cpp | 2 +- tests/auto/gestures/tst_gestures.cpp | 2 +- tests/auto/guiapplauncher/tst_guiapplauncher.cpp | 2 +- tests/auto/guiapplauncher/windowmanager.cpp | 2 +- tests/auto/guiapplauncher/windowmanager.h | 2 +- tests/auto/headers/tst_headers.cpp | 2 +- tests/auto/languagechange/tst_languagechange.cpp | 2 +- tests/auto/linguist/lconvert/data/makeplurals.pl | 2 +- tests/auto/linguist/lconvert/tst_lconvert.cpp | 2 +- tests/auto/linguist/lrelease/tst_lrelease.cpp | 2 +- .../lupdate/testdata/good/backslashes/src/main.cpp | 2 +- .../auto/linguist/lupdate/testdata/good/cmdline_order/a.h | 2 +- .../auto/linguist/lupdate/testdata/good/cmdline_order/b.h | 2 +- .../linguist/lupdate/testdata/good/codecforsrc/main.cpp | 2 +- .../linguist/lupdate/testdata/good/codecfortr/main.cpp | 2 +- .../linguist/lupdate/testdata/good/codecfortr1/main.cpp | 2 +- .../linguist/lupdate/testdata/good/codecfortr2/main.cpp | 2 +- .../linguist/lupdate/testdata/good/codecfortr3/main.cpp | 2 +- .../linguist/lupdate/testdata/good/codecfortr4/main.cpp | 2 +- .../lupdate/testdata/good/from_subdir/src/main.cpp | 2 +- .../linguist/lupdate/testdata/good/from_subdir/src/main.h | 2 +- .../linguist/lupdate/testdata/good/heuristics/main.cpp | 2 +- .../linguist/lupdate/testdata/good/lacksqobject/main.cpp | 2 +- .../linguist/lupdate/testdata/good/merge_ordering/foo.cpp | 2 +- .../lupdate/testdata/good/merge_versions/project.ui | 2 +- .../lupdate/testdata/good/merge_whitespace/main.cpp | 2 +- .../linguist/lupdate/testdata/good/mergecpp/finddialog.cpp | 2 +- .../testdata/good/mergecpp_noobsolete/finddialog.cpp | 2 +- .../lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp | 2 +- .../auto/linguist/lupdate/testdata/good/mergeui/project.ui | 2 +- .../testdata/good/multiple_locations/finddialog.cpp | 2 +- .../lupdate/testdata/good/multiple_locations/main.cpp | 2 +- .../linguist/lupdate/testdata/good/namespaces/main.cpp | 2 +- .../lupdate/testdata/good/parse_special_chars/main.cpp | 2 +- .../linguist/lupdate/testdata/good/parsecontexts/main.cpp | 2 +- .../linguist/lupdate/testdata/good/parsecpp/finddialog.cpp | 2 +- .../auto/linguist/lupdate/testdata/good/parsecpp/main.cpp | 2 +- .../auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp | 2 +- tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.h | 2 +- .../linguist/lupdate/testdata/good/parsecpp2/main2.cpp | 2 +- .../linguist/lupdate/testdata/good/parsecpp2/main3.cpp | 2 +- .../linguist/lupdate/testdata/good/parsejava/main.java | 2 +- .../auto/linguist/lupdate/testdata/good/parseui/project.ui | 2 +- tests/auto/linguist/lupdate/testdata/good/prefix/main.cpp | 2 +- .../linguist/lupdate/testdata/good/preprocess/main.cpp | 2 +- .../linguist/lupdate/testdata/good/proparsing/main.cpp | 2 +- .../linguist/lupdate/testdata/good/proparsing/main_mac.cpp | 2 +- .../lupdate/testdata/good/proparsing/main_unix.cpp | 2 +- .../linguist/lupdate/testdata/good/proparsing/main_win.cpp | 2 +- .../good/proparsing/vpaths/dependpath/main_dependpath.cpp | 2 +- .../lupdate/testdata/good/proparsing/wildcard/main1.cpp | 2 +- .../lupdate/testdata/good/proparsing/wildcard/mainfile.cpp | 2 +- .../lupdate/testdata/good/proparsing/wildcard1.cpp | 2 +- .../lupdate/testdata/good/proparsing/wildcard99.cpp | 2 +- tests/auto/linguist/lupdate/testdata/good/proparsing2/a | 2 +- .../auto/linguist/lupdate/testdata/good/proparsing2/a.cpp | 2 +- tests/auto/linguist/lupdate/testdata/good/proparsing2/b | 2 +- .../auto/linguist/lupdate/testdata/good/proparsing2/b.cpp | 2 +- tests/auto/linguist/lupdate/testdata/good/proparsing2/e | 2 +- .../linguist/lupdate/testdata/good/proparsing2/f/g.cpp | 2 +- .../linguist/lupdate/testdata/good/proparsing2/spaces/z | 2 +- .../lupdate/testdata/good/proparsing2/variable_with_spaces | 2 +- tests/auto/linguist/lupdate/testdata/good/proparsing2/with | 2 +- tests/auto/linguist/lupdate/testdata/good/proparsing2/x/d | 2 +- .../linguist/lupdate/testdata/good/proparsing2/x/variable | 2 +- .../lupdate/testdata/good/proparsingpaths/file1.cpp | 2 +- .../lupdate/testdata/good/proparsingpaths/filter.cpp | 2 +- .../lupdate/testdata/good/proparsingpaths/sub/subfile1.cpp | 2 +- .../testdata/good/proparsingpaths/sub/subfilter.cpp | 2 +- .../lupdate/testdata/good/proparsingpri/common/main.cpp | 2 +- .../lupdate/testdata/good/proparsingpri/mac/main_mac.cpp | 2 +- .../testdata/good/proparsingpri/relativity/relativity.cpp | 2 +- .../lupdate/testdata/good/proparsingpri/unix/main_unix.cpp | 2 +- .../lupdate/testdata/good/proparsingpri/win/main_win.cpp | 2 +- .../lupdate/testdata/good/proparsingsubdirs/sub1/main.cpp | 2 +- .../lupdate/testdata/good/proparsingsubs/common/main.cpp | 2 +- .../lupdate/testdata/good/proparsingsubs/mac/main_mac.cpp | 2 +- .../testdata/good/proparsingsubs/unix/main_unix.cpp | 2 +- .../lupdate/testdata/good/proparsingsubs/win/main_win.cpp | 2 +- .../auto/linguist/lupdate/testdata/good/reloutput/main.cpp | 2 +- .../auto/linguist/lupdate/testdata/recursivescan/main.cpp | 2 +- .../linguist/lupdate/testdata/recursivescan/project.ui | 2 +- .../lupdate/testdata/recursivescan/sub/filetypes/main.c++ | 2 +- .../lupdate/testdata/recursivescan/sub/filetypes/main.cpp | 2 +- .../lupdate/testdata/recursivescan/sub/filetypes/main.cxx | 2 +- .../lupdate/testdata/recursivescan/sub/finddialog.cpp | 2 +- .../lupdate/testdata/subdirs_full/subdir1/main.cpp | 2 +- .../lupdate/testdata/subdirs_full/subdir2/subsub1/main.cpp | 2 +- .../lupdate/testdata/subdirs_full/subdir2/subsub2/main.cpp | 2 +- .../lupdate/testdata/subdirs_part/subdir1/main.cpp | 2 +- .../lupdate/testdata/subdirs_part/subdir2/subsub1/main.cpp | 2 +- .../lupdate/testdata/subdirs_part/subdir2/subsub2/main.cpp | 2 +- tests/auto/linguist/lupdate/tst_lupdate.cpp | 2 +- tests/auto/macgui/guitest.cpp | 2 +- tests/auto/macgui/guitest.h | 2 +- tests/auto/macgui/tst_macgui.cpp | 2 +- tests/auto/macplist/app/main.cpp | 2 +- tests/auto/macplist/tst_macplist.cpp | 2 +- tests/auto/maketestselftest/tst_maketestselftest.cpp | 2 +- tests/auto/mediaobject/dummy/audiooutput.cpp | 2 +- tests/auto/mediaobject/dummy/audiooutput.h | 2 +- tests/auto/mediaobject/dummy/backend.cpp | 2 +- tests/auto/mediaobject/dummy/backend.h | 2 +- tests/auto/mediaobject/dummy/mediaobject.cpp | 2 +- tests/auto/mediaobject/dummy/mediaobject.h | 2 +- tests/auto/mediaobject/dummy/videowidget.cpp | 2 +- tests/auto/mediaobject/dummy/videowidget.h | 2 +- tests/auto/mediaobject/qtesthelper.h | 2 +- tests/auto/mediaobject/tst_mediaobject.cpp | 2 +- tests/auto/mediaobject_wince_ds9/dummy.cpp | 2 +- tests/auto/moc/Test.framework/Headers/testinterface.h | 2 +- tests/auto/moc/assign-namespace.h | 2 +- tests/auto/moc/backslash-newlines.h | 2 +- tests/auto/moc/c-comments.h | 2 +- tests/auto/moc/cstyle-enums.h | 2 +- tests/auto/moc/dir-in-include-path.h | 2 +- tests/auto/moc/escapes-in-string-literals.h | 2 +- tests/auto/moc/extraqualification.h | 2 +- tests/auto/moc/forgotten-qinterface.h | 2 +- tests/auto/moc/gadgetwithnoenums.h | 2 +- tests/auto/moc/interface-from-framework.h | 2 +- tests/auto/moc/macro-on-cmdline.h | 2 +- tests/auto/moc/namespaced-flags.h | 2 +- tests/auto/moc/no-keywords.h | 2 +- tests/auto/moc/oldstyle-casts.h | 2 +- tests/auto/moc/parse-boost.h | 2 +- tests/auto/moc/pure-virtual-signals.h | 2 +- tests/auto/moc/qinvokable.h | 2 +- tests/auto/moc/qprivateslots.h | 2 +- tests/auto/moc/single_function_keyword.h | 2 +- tests/auto/moc/slots-with-void-template.h | 2 +- tests/auto/moc/task189996.h | 2 +- tests/auto/moc/task192552.h | 2 +- tests/auto/moc/task234909.h | 2 +- tests/auto/moc/task240368.h | 2 +- tests/auto/moc/task87883.h | 2 +- tests/auto/moc/template-gtgt.h | 2 +- tests/auto/moc/testproject/Plugin/Plugin.h | 2 +- tests/auto/moc/trigraphs.h | 2 +- tests/auto/moc/tst_moc.cpp | 2 +- tests/auto/moc/using-namespaces.h | 2 +- tests/auto/moc/warn-on-multiple-qobject-subclasses.h | 2 +- tests/auto/moc/warn-on-property-without-read.h | 2 +- tests/auto/moc/win-newlines.h | 2 +- tests/auto/modeltest/modeltest.cpp | 2 +- tests/auto/modeltest/modeltest.h | 2 +- tests/auto/modeltest/tst_modeltest.cpp | 2 +- tests/auto/network-settings.h | 2 +- tests/auto/networkselftest/tst_networkselftest.cpp | 2 +- .../tst_patternistexamplefiletree.cpp | 2 +- tests/auto/patternistexamples/tst_patternistexamples.cpp | 2 +- tests/auto/patternistheaders/tst_patternistheaders.cpp | 2 +- tests/auto/q3accel/tst_q3accel.cpp | 2 +- tests/auto/q3action/tst_q3action.cpp | 2 +- tests/auto/q3actiongroup/tst_q3actiongroup.cpp | 2 +- tests/auto/q3buttongroup/clickLock/main.cpp | 2 +- tests/auto/q3buttongroup/tst_q3buttongroup.cpp | 2 +- tests/auto/q3canvas/tst_q3canvas.cpp | 2 +- tests/auto/q3checklistitem/tst_q3checklistitem.cpp | 2 +- tests/auto/q3combobox/tst_q3combobox.cpp | 2 +- tests/auto/q3cstring/tst_q3cstring.cpp | 2 +- tests/auto/q3databrowser/tst_q3databrowser.cpp | 2 +- tests/auto/q3dateedit/tst_q3dateedit.cpp | 2 +- tests/auto/q3datetimeedit/tst_q3datetimeedit.cpp | 2 +- tests/auto/q3deepcopy/tst_q3deepcopy.cpp | 2 +- tests/auto/q3dict/tst_q3dict.cpp | 2 +- tests/auto/q3dns/tst_q3dns.cpp | 2 +- tests/auto/q3dockwindow/tst_q3dockwindow.cpp | 2 +- tests/auto/q3filedialog/tst_q3filedialog.cpp | 2 +- tests/auto/q3frame/tst_q3frame.cpp | 2 +- tests/auto/q3groupbox/tst_q3groupbox.cpp | 2 +- tests/auto/q3hbox/tst_q3hbox.cpp | 2 +- tests/auto/q3header/tst_q3header.cpp | 2 +- tests/auto/q3iconview/tst_q3iconview.cpp | 2 +- tests/auto/q3listbox/tst_qlistbox.cpp | 2 +- tests/auto/q3listview/tst_q3listview.cpp | 2 +- .../q3listviewitemiterator/tst_q3listviewitemiterator.cpp | 2 +- tests/auto/q3mainwindow/tst_q3mainwindow.cpp | 2 +- tests/auto/q3popupmenu/tst_q3popupmenu.cpp | 2 +- tests/auto/q3process/cat/main.cpp | 2 +- tests/auto/q3process/echo/main.cpp | 2 +- tests/auto/q3process/tst_q3process.cpp | 2 +- tests/auto/q3progressbar/tst_q3progressbar.cpp | 2 +- tests/auto/q3progressdialog/tst_q3progressdialog.cpp | 2 +- tests/auto/q3ptrlist/tst_q3ptrlist.cpp | 2 +- tests/auto/q3richtext/tst_q3richtext.cpp | 2 +- tests/auto/q3scrollview/tst_qscrollview.cpp | 2 +- tests/auto/q3semaphore/tst_q3semaphore.cpp | 2 +- tests/auto/q3serversocket/tst_q3serversocket.cpp | 2 +- tests/auto/q3socket/tst_qsocket.cpp | 2 +- tests/auto/q3socketdevice/tst_q3socketdevice.cpp | 2 +- tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp | 2 +- tests/auto/q3sqlselectcursor/tst_q3sqlselectcursor.cpp | 2 +- tests/auto/q3stylesheet/tst_q3stylesheet.cpp | 2 +- tests/auto/q3tabdialog/tst_q3tabdialog.cpp | 2 +- tests/auto/q3table/tst_q3table.cpp | 2 +- tests/auto/q3textbrowser/tst_q3textbrowser.cpp | 2 +- tests/auto/q3textedit/tst_q3textedit.cpp | 2 +- tests/auto/q3textstream/tst_q3textstream.cpp | 2 +- tests/auto/q3timeedit/tst_q3timeedit.cpp | 2 +- tests/auto/q3toolbar/tst_q3toolbar.cpp | 2 +- tests/auto/q3uridrag/tst_q3uridrag.cpp | 2 +- tests/auto/q3urloperator/tst_q3urloperator.cpp | 2 +- tests/auto/q3valuelist/tst_q3valuelist.cpp | 2 +- tests/auto/q3valuevector/tst_q3valuevector.cpp | 2 +- tests/auto/q3widgetstack/tst_q3widgetstack.cpp | 2 +- tests/auto/q_func_info/tst_q_func_info.cpp | 2 +- tests/auto/qabstractbutton/tst_qabstractbutton.cpp | 2 +- tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp | 2 +- tests/auto/qabstractitemview/tst_qabstractitemview.cpp | 2 +- .../tst_qabstractmessagehandler.cpp | 2 +- .../qabstractnetworkcache/tst_qabstractnetworkcache.cpp | 2 +- .../auto/qabstractprintdialog/tst_qabstractprintdialog.cpp | 2 +- tests/auto/qabstractproxymodel/tst_qabstractproxymodel.cpp | 2 +- tests/auto/qabstractscrollarea/tst_qabstractscrollarea.cpp | 2 +- tests/auto/qabstractslider/tst_qabstractslider.cpp | 2 +- tests/auto/qabstractsocket/tst_qabstractsocket.cpp | 2 +- tests/auto/qabstractspinbox/tst_qabstractspinbox.cpp | 2 +- .../tst_qabstracttextdocumentlayout.cpp | 2 +- tests/auto/qabstracturiresolver/TestURIResolver.h | 2 +- .../auto/qabstracturiresolver/tst_qabstracturiresolver.cpp | 2 +- .../auto/qabstractvideobuffer/tst_qabstractvideobuffer.cpp | 2 +- .../qabstractvideosurface/tst_qabstractvideosurface.cpp | 2 +- .../tst_qabstractxmlforwarditerator.cpp | 2 +- tests/auto/qabstractxmlnodemodel/LoadingModel.cpp | 2 +- tests/auto/qabstractxmlnodemodel/LoadingModel.h | 2 +- tests/auto/qabstractxmlnodemodel/TestNodeModel.h | 2 +- .../qabstractxmlnodemodel/tst_qabstractxmlnodemodel.cpp | 2 +- tests/auto/qabstractxmlreceiver/TestAbstractXmlReceiver.h | 2 +- .../auto/qabstractxmlreceiver/tst_qabstractxmlreceiver.cpp | 2 +- tests/auto/qaccessibility/tst_qaccessibility.cpp | 2 +- tests/auto/qaccessibility_mac/tst_qaccessibility_mac.cpp | 2 +- tests/auto/qaction/tst_qaction.cpp | 2 +- tests/auto/qactiongroup/tst_qactiongroup.cpp | 2 +- tests/auto/qalgorithms/tst_qalgorithms.cpp | 2 +- tests/auto/qanimationgroup/tst_qanimationgroup.cpp | 2 +- tests/auto/qapplication/desktopsettingsaware/main.cpp | 2 +- tests/auto/qapplication/tst_qapplication.cpp | 2 +- tests/auto/qapplication/wincmdline/main.cpp | 2 +- .../tst_qapplicationargumentparser.cpp | 2 +- tests/auto/qatomicint/tst_qatomicint.cpp | 2 +- tests/auto/qatomicpointer/tst_qatomicpointer.cpp | 2 +- tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp | 2 +- tests/auto/qaudioformat/tst_qaudioformat.cpp | 2 +- tests/auto/qaudioinput/tst_qaudioinput.cpp | 2 +- tests/auto/qaudiooutput/tst_qaudiooutput.cpp | 2 +- tests/auto/qautoptr/tst_qautoptr.cpp | 2 +- tests/auto/qbitarray/tst_qbitarray.cpp | 2 +- tests/auto/qboxlayout/tst_qboxlayout.cpp | 2 +- tests/auto/qbrush/tst_qbrush.cpp | 2 +- tests/auto/qbuffer/tst_qbuffer.cpp | 2 +- tests/auto/qbuttongroup/tst_qbuttongroup.cpp | 2 +- tests/auto/qbytearray/tst_qbytearray.cpp | 2 +- tests/auto/qbytearraymatcher/tst_qbytearraymatcher.cpp | 2 +- tests/auto/qcache/tst_qcache.cpp | 2 +- tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp | 2 +- tests/auto/qchar/tst_qchar.cpp | 2 +- tests/auto/qcheckbox/tst_qcheckbox.cpp | 2 +- tests/auto/qclipboard/copier/main.cpp | 2 +- tests/auto/qclipboard/paster/main.cpp | 2 +- tests/auto/qclipboard/tst_qclipboard.cpp | 2 +- tests/auto/qcolor/tst_qcolor.cpp | 2 +- tests/auto/qcolordialog/tst_qcolordialog.cpp | 2 +- tests/auto/qcolumnview/tst_qcolumnview.cpp | 2 +- tests/auto/qcombobox/tst_qcombobox.cpp | 2 +- tests/auto/qcommandlinkbutton/tst_qcommandlinkbutton.cpp | 2 +- tests/auto/qcompleter/tst_qcompleter.cpp | 2 +- tests/auto/qcomplextext/bidireorderstring.h | 2 +- tests/auto/qcomplextext/tst_qcomplextext.cpp | 2 +- tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp | 2 +- tests/auto/qcopchannel/testSend/main.cpp | 2 +- tests/auto/qcopchannel/tst_qcopchannel.cpp | 2 +- tests/auto/qcoreapplication/tst_qcoreapplication.cpp | 2 +- tests/auto/qcryptographichash/tst_qcryptographichash.cpp | 2 +- tests/auto/qcssparser/tst_qcssparser.cpp | 2 +- tests/auto/qdatastream/tst_qdatastream.cpp | 2 +- tests/auto/qdatawidgetmapper/tst_qdatawidgetmapper.cpp | 2 +- tests/auto/qdate/tst_qdate.cpp | 2 +- tests/auto/qdatetime/tst_qdatetime.cpp | 2 +- tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp | 2 +- .../auto/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp | 2 +- tests/auto/qdbusabstractinterface/interface.cpp | 2 +- tests/auto/qdbusabstractinterface/interface.h | 2 +- tests/auto/qdbusabstractinterface/pinger.cpp | 4 ++-- tests/auto/qdbusabstractinterface/pinger.h | 4 ++-- .../qdbusabstractinterface/tst_qdbusabstractinterface.cpp | 2 +- tests/auto/qdbusconnection/tst_qdbusconnection.cpp | 2 +- tests/auto/qdbuscontext/tst_qdbuscontext.cpp | 2 +- tests/auto/qdbusinterface/tst_qdbusinterface.cpp | 2 +- tests/auto/qdbuslocalcalls/tst_qdbuslocalcalls.cpp | 2 +- tests/auto/qdbusmarshall/common.h | 2 +- tests/auto/qdbusmarshall/dummy.cpp | 2 +- tests/auto/qdbusmarshall/qpong/qpong.cpp | 2 +- tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp | 2 +- tests/auto/qdbusmetaobject/tst_qdbusmetaobject.cpp | 2 +- tests/auto/qdbusmetatype/tst_qdbusmetatype.cpp | 2 +- tests/auto/qdbuspendingcall/tst_qdbuspendingcall.cpp | 2 +- tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp | 2 +- tests/auto/qdbusperformance/server/server.cpp | 2 +- tests/auto/qdbusperformance/serverobject.h | 2 +- tests/auto/qdbusperformance/tst_qdbusperformance.cpp | 2 +- tests/auto/qdbusreply/tst_qdbusreply.cpp | 2 +- tests/auto/qdbusservicewatcher/tst_qdbusservicewatcher.cpp | 2 +- tests/auto/qdbusthreading/tst_qdbusthreading.cpp | 2 +- tests/auto/qdbusxmlparser/tst_qdbusxmlparser.cpp | 2 +- tests/auto/qdebug/tst_qdebug.cpp | 2 +- tests/auto/qdesktopservices/tst_qdesktopservices.cpp | 2 +- tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp | 2 +- tests/auto/qdial/tst_qdial.cpp | 2 +- tests/auto/qdialog/tst_qdialog.cpp | 2 +- tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp | 2 +- tests/auto/qdir/testdir/dir/qrc_qdir.cpp | 2 +- tests/auto/qdir/testdir/dir/tst_qdir.cpp | 2 +- tests/auto/qdir/tst_qdir.cpp | 2 +- tests/auto/qdirectpainter/runDirectPainter/main.cpp | 2 +- tests/auto/qdirectpainter/tst_qdirectpainter.cpp | 2 +- tests/auto/qdiriterator/tst_qdiriterator.cpp | 2 +- tests/auto/qdirmodel/tst_qdirmodel.cpp | 2 +- tests/auto/qdockwidget/tst_qdockwidget.cpp | 2 +- tests/auto/qdom/tst_qdom.cpp | 2 +- tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp | 2 +- tests/auto/qdoublevalidator/tst_qdoublevalidator.cpp | 2 +- tests/auto/qdrag/tst_qdrag.cpp | 2 +- tests/auto/qeasingcurve/tst_qeasingcurve.cpp | 2 +- tests/auto/qerrormessage/tst_qerrormessage.cpp | 2 +- tests/auto/qevent/tst_qevent.cpp | 2 +- tests/auto/qeventloop/tst_qeventloop.cpp | 2 +- .../tst_qexplicitlyshareddatapointer.cpp | 2 +- tests/auto/qfile/largefile/tst_largefile.cpp | 2 +- tests/auto/qfile/stdinprocess/main.cpp | 2 +- tests/auto/qfile/tst_qfile.cpp | 2 +- tests/auto/qfiledialog/tst_qfiledialog.cpp | 2 +- tests/auto/qfiledialog2/tst_qfiledialog2.cpp | 2 +- tests/auto/qfileiconprovider/tst_qfileiconprovider.cpp | 2 +- tests/auto/qfileinfo/tst_qfileinfo.cpp | 2 +- tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp | 2 +- tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 2 +- tests/auto/qflags/tst_qflags.cpp | 2 +- tests/auto/qfocusevent/tst_qfocusevent.cpp | 2 +- tests/auto/qfocusframe/tst_qfocusframe.cpp | 2 +- tests/auto/qfont/tst_qfont.cpp | 2 +- tests/auto/qfontcombobox/tst_qfontcombobox.cpp | 2 +- tests/auto/qfontdatabase/tst_qfontdatabase.cpp | 2 +- tests/auto/qfontdialog/tst_qfontdialog.cpp | 2 +- tests/auto/qfontdialog/tst_qfontdialog_mac_helpers.mm | 2 +- tests/auto/qfontmetrics/tst_qfontmetrics.cpp | 2 +- tests/auto/qformlayout/tst_qformlayout.cpp | 2 +- tests/auto/qftp/tst_qftp.cpp | 2 +- tests/auto/qfuture/tst_qfuture.cpp | 2 +- tests/auto/qfuture/versioncheck.h | 2 +- tests/auto/qfuturewatcher/tst_qfuturewatcher.cpp | 2 +- tests/auto/qgetputenv/tst_qgetputenv.cpp | 2 +- tests/auto/qgl/tst_qgl.cpp | 2 +- tests/auto/qglobal/tst_qglobal.cpp | 2 +- .../qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp | 2 +- .../qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp | 2 +- tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp | 2 +- .../qgraphicseffectsource/tst_qgraphicseffectsource.cpp | 2 +- tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp | 2 +- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 2 +- .../qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp | 2 +- tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp | 2 +- tests/auto/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp | 2 +- .../qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp | 2 +- tests/auto/qgraphicsobject/tst_qgraphicsobject.cpp | 2 +- tests/auto/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp | 2 +- .../auto/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp | 2 +- .../auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 2 +- tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 2 +- tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp | 2 +- tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp | 2 +- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 2 +- tests/auto/qgraphicsview/tst_qgraphicsview_2.cpp | 2 +- tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | 2 +- tests/auto/qgridlayout/tst_qgridlayout.cpp | 2 +- tests/auto/qgroupbox/tst_qgroupbox.cpp | 2 +- tests/auto/qguard/tst_qguard.cpp | 2 +- tests/auto/qguivariant/tst_qguivariant.cpp | 2 +- tests/auto/qhash/tst_qhash.cpp | 2 +- tests/auto/qheaderview/tst_qheaderview.cpp | 2 +- tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp | 2 +- tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp | 2 +- tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp | 2 +- tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp | 2 +- tests/auto/qhelpprojectdata/tst_qhelpprojectdata.cpp | 2 +- tests/auto/qhostaddress/tst_qhostaddress.cpp | 2 +- tests/auto/qhostinfo/tst_qhostinfo.cpp | 2 +- tests/auto/qhttp/dummyserver.h | 2 +- tests/auto/qhttp/tst_qhttp.cpp | 2 +- .../qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp | 2 +- tests/auto/qhttpnetworkreply/tst_qhttpnetworkreply.cpp | 2 +- tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp | 2 +- tests/auto/qicoimageformat/tst_qicoimageformat.cpp | 2 +- tests/auto/qicon/tst_qicon.cpp | 2 +- tests/auto/qimage/tst_qimage.cpp | 2 +- tests/auto/qimageiohandler/tst_qimageiohandler.cpp | 2 +- tests/auto/qimagereader/tst_qimagereader.cpp | 2 +- tests/auto/qimagewriter/tst_qimagewriter.cpp | 2 +- tests/auto/qinputcontext/tst_qinputcontext.cpp | 2 +- tests/auto/qinputdialog/tst_qinputdialog.cpp | 2 +- tests/auto/qintvalidator/tst_qintvalidator.cpp | 2 +- tests/auto/qiodevice/tst_qiodevice.cpp | 2 +- tests/auto/qitemdelegate/tst_qitemdelegate.cpp | 2 +- tests/auto/qitemeditorfactory/tst_qitemeditorfactory.cpp | 2 +- tests/auto/qitemmodel/modelstotest.cpp | 2 +- tests/auto/qitemmodel/tst_qitemmodel.cpp | 4 ++-- tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp | 2 +- tests/auto/qitemview/tst_qitemview.cpp | 2 +- tests/auto/qitemview/viewstotest.cpp | 2 +- tests/auto/qkeysequence/tst_qkeysequence.cpp | 2 +- tests/auto/qlabel/tst_qlabel.cpp | 2 +- tests/auto/qlayout/tst_qlayout.cpp | 2 +- tests/auto/qlcdnumber/tst_qlcdnumber.cpp | 2 +- tests/auto/qlibrary/lib/mylib.c | 2 +- tests/auto/qlibrary/lib2/mylib.c | 2 +- tests/auto/qlibrary/tst_qlibrary.cpp | 2 +- tests/auto/qline/tst_qline.cpp | 2 +- tests/auto/qlineedit/tst_qlineedit.cpp | 2 +- tests/auto/qlist/tst_qlist.cpp | 2 +- tests/auto/qlistview/tst_qlistview.cpp | 2 +- tests/auto/qlistwidget/tst_qlistwidget.cpp | 2 +- tests/auto/qlocale/syslocaleapp/syslocaleapp.cpp | 2 +- tests/auto/qlocale/tst_qlocale.cpp | 2 +- tests/auto/qlocalsocket/example/client/main.cpp | 2 +- tests/auto/qlocalsocket/example/server/main.cpp | 2 +- tests/auto/qlocalsocket/lackey/main.cpp | 2 +- tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 2 +- tests/auto/qmacstyle/tst_qmacstyle.cpp | 2 +- tests/auto/qmainwindow/tst_qmainwindow.cpp | 2 +- tests/auto/qmake/testcompiler.cpp | 2 +- tests/auto/qmake/testcompiler.h | 2 +- tests/auto/qmake/testdata/findDeps/main.cpp | 2 +- tests/auto/qmake/testdata/findDeps/object1.h | 2 +- tests/auto/qmake/testdata/findDeps/object2.h | 2 +- tests/auto/qmake/testdata/findDeps/object3.h | 2 +- tests/auto/qmake/testdata/findDeps/object4.h | 2 +- tests/auto/qmake/testdata/findDeps/object5.h | 2 +- tests/auto/qmake/testdata/findDeps/object6.h | 2 +- tests/auto/qmake/testdata/findDeps/object7.h | 2 +- tests/auto/qmake/testdata/findDeps/object8.h | 2 +- tests/auto/qmake/testdata/findDeps/object9.h | 2 +- tests/auto/qmake/testdata/findMocs/main.cpp | 2 +- tests/auto/qmake/testdata/findMocs/object1.h | 2 +- tests/auto/qmake/testdata/findMocs/object2.h | 2 +- tests/auto/qmake/testdata/findMocs/object3.h | 2 +- tests/auto/qmake/testdata/findMocs/object4.h | 2 +- tests/auto/qmake/testdata/findMocs/object5.h | 2 +- tests/auto/qmake/testdata/findMocs/object6.h | 2 +- tests/auto/qmake/testdata/findMocs/object7.h | 2 +- tests/auto/qmake/testdata/functions/1.cpp | 2 +- tests/auto/qmake/testdata/functions/2.cpp | 2 +- tests/auto/qmake/testdata/functions/one/1.cpp | 2 +- tests/auto/qmake/testdata/functions/one/2.cpp | 2 +- tests/auto/qmake/testdata/functions/three/wildcard21.cpp | 2 +- tests/auto/qmake/testdata/functions/three/wildcard22.cpp | 2 +- tests/auto/qmake/testdata/functions/two/1.cpp | 2 +- tests/auto/qmake/testdata/functions/two/2.cpp | 2 +- tests/auto/qmake/testdata/functions/wildcard21.cpp | 2 +- tests/auto/qmake/testdata/functions/wildcard22.cpp | 2 +- tests/auto/qmake/testdata/include_dir/main.cpp | 2 +- tests/auto/qmake/testdata/include_dir/test_file.cpp | 2 +- tests/auto/qmake/testdata/include_dir/test_file.h | 2 +- tests/auto/qmake/testdata/include_function/main.cpp | 2 +- tests/auto/qmake/testdata/install_depends/main.cpp | 2 +- tests/auto/qmake/testdata/install_depends/test_file.cpp | 2 +- tests/auto/qmake/testdata/install_depends/test_file.h | 2 +- tests/auto/qmake/testdata/one_space/main.cpp | 2 +- tests/auto/qmake/testdata/quotedfilenames/main.cpp | 2 +- tests/auto/qmake/testdata/shadow_files/main.cpp | 2 +- tests/auto/qmake/testdata/shadow_files/test_file.cpp | 2 +- tests/auto/qmake/testdata/shadow_files/test_file.h | 2 +- tests/auto/qmake/testdata/simple_app/main.cpp | 2 +- tests/auto/qmake/testdata/simple_app/test_file.cpp | 2 +- tests/auto/qmake/testdata/simple_app/test_file.h | 2 +- tests/auto/qmake/testdata/simple_dll/simple.cpp | 2 +- tests/auto/qmake/testdata/simple_dll/simple.h | 2 +- tests/auto/qmake/testdata/simple_lib/simple.cpp | 2 +- tests/auto/qmake/testdata/simple_lib/simple.h | 2 +- tests/auto/qmake/testdata/subdirs/simple_app/main.cpp | 2 +- tests/auto/qmake/testdata/subdirs/simple_app/test_file.cpp | 2 +- tests/auto/qmake/testdata/subdirs/simple_app/test_file.h | 2 +- tests/auto/qmake/testdata/subdirs/simple_dll/simple.cpp | 2 +- tests/auto/qmake/testdata/subdirs/simple_dll/simple.h | 2 +- tests/auto/qmake/tst_qmake.cpp | 2 +- tests/auto/qmap/tst_qmap.cpp | 2 +- tests/auto/qmargins/tst_qmargins.cpp | 2 +- tests/auto/qmath/tst_qmath.cpp | 2 +- tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp | 2 +- tests/auto/qmdiarea/tst_qmdiarea.cpp | 2 +- tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp | 2 +- tests/auto/qmenu/tst_qmenu.cpp | 2 +- tests/auto/qmenubar/tst_qmenubar.cpp | 2 +- tests/auto/qmessagebox/tst_qmessagebox.cpp | 2 +- tests/auto/qmetaobject/tst_qmetaobject.cpp | 2 +- tests/auto/qmetatype/tst_qmetatype.cpp | 2 +- tests/auto/qmouseevent/tst_qmouseevent.cpp | 2 +- tests/auto/qmouseevent_modal/tst_qmouseevent_modal.cpp | 2 +- tests/auto/qmovie/tst_qmovie.cpp | 2 +- tests/auto/qmultiscreen/tst_qmultiscreen.cpp | 2 +- tests/auto/qmutex/tst_qmutex.cpp | 2 +- tests/auto/qmutexlocker/tst_qmutexlocker.cpp | 2 +- tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp | 2 +- .../tst_qnetworkaccessmanager_and_qprogressdialog.cpp | 2 +- .../auto/qnetworkaddressentry/tst_qnetworkaddressentry.cpp | 2 +- .../qnetworkcachemetadata/tst_qnetworkcachemetadata.cpp | 2 +- tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp | 2 +- tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp | 2 +- tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp | 2 +- tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp | 2 +- tests/auto/qnetworkproxy/tst_qnetworkproxy.cpp | 2 +- tests/auto/qnetworkreply/echo/main.cpp | 2 +- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 2 +- tests/auto/qnetworkrequest/tst_qnetworkrequest.cpp | 2 +- tests/auto/qnumeric/tst_qnumeric.cpp | 2 +- tests/auto/qobject/signalbug.cpp | 2 +- tests/auto/qobject/signalbug.h | 2 +- tests/auto/qobject/tst_qobject.cpp | 2 +- tests/auto/qobjectperformance/tst_qobjectperformance.cpp | 2 +- tests/auto/qobjectrace/tst_qobjectrace.cpp | 2 +- tests/auto/qpaintengine/tst_qpaintengine.cpp | 2 +- tests/auto/qpainter/tst_qpainter.cpp | 2 +- tests/auto/qpainter/utils/createImages/main.cpp | 2 +- tests/auto/qpainterpath/tst_qpainterpath.cpp | 2 +- tests/auto/qpainterpathstroker/tst_qpainterpathstroker.cpp | 2 +- tests/auto/qpalette/tst_qpalette.cpp | 2 +- .../tst_qparallelanimationgroup.cpp | 2 +- tests/auto/qpathclipper/paths.cpp | 2 +- tests/auto/qpathclipper/paths.h | 2 +- tests/auto/qpathclipper/tst_qpathclipper.cpp | 2 +- tests/auto/qpauseanimation/tst_qpauseanimation.cpp | 2 +- tests/auto/qpen/tst_qpen.cpp | 2 +- tests/auto/qpicture/tst_qpicture.cpp | 2 +- tests/auto/qpixmap/tst_qpixmap.cpp | 2 +- tests/auto/qpixmapcache/tst_qpixmapcache.cpp | 2 +- tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp | 2 +- tests/auto/qplaintextedit/tst_qplaintextedit.cpp | 2 +- tests/auto/qplugin/debugplugin/main.cpp | 2 +- tests/auto/qplugin/releaseplugin/main.cpp | 2 +- tests/auto/qplugin/tst_qplugin.cpp | 2 +- tests/auto/qpluginloader/almostplugin/almostplugin.cpp | 2 +- tests/auto/qpluginloader/almostplugin/almostplugin.h | 2 +- tests/auto/qpluginloader/lib/mylib.c | 2 +- tests/auto/qpluginloader/theplugin/plugininterface.h | 2 +- tests/auto/qpluginloader/theplugin/theplugin.cpp | 2 +- tests/auto/qpluginloader/theplugin/theplugin.h | 2 +- tests/auto/qpluginloader/tst_qpluginloader.cpp | 2 +- tests/auto/qpoint/tst_qpoint.cpp | 2 +- tests/auto/qpointer/tst_qpointer.cpp | 2 +- tests/auto/qpolygon/tst_qpolygon.cpp | 2 +- tests/auto/qprinter/tst_qprinter.cpp | 2 +- tests/auto/qprinterinfo/tst_qprinterinfo.cpp | 2 +- tests/auto/qprocess/fileWriterProcess/main.cpp | 2 +- tests/auto/qprocess/testDetached/main.cpp | 2 +- tests/auto/qprocess/testExitCodes/main.cpp | 2 +- tests/auto/qprocess/testGuiProcess/main.cpp | 2 +- tests/auto/qprocess/testProcessCrash/main.cpp | 2 +- tests/auto/qprocess/testProcessDeadWhileReading/main.cpp | 2 +- tests/auto/qprocess/testProcessEOF/main.cpp | 2 +- tests/auto/qprocess/testProcessEcho/main.cpp | 2 +- tests/auto/qprocess/testProcessEcho2/main.cpp | 2 +- tests/auto/qprocess/testProcessEcho3/main.cpp | 2 +- tests/auto/qprocess/testProcessEchoGui/main_win.cpp | 2 +- tests/auto/qprocess/testProcessEnvironment/main.cpp | 2 +- tests/auto/qprocess/testProcessLoopback/main.cpp | 2 +- tests/auto/qprocess/testProcessNormal/main.cpp | 2 +- tests/auto/qprocess/testProcessOutput/main.cpp | 2 +- tests/auto/qprocess/testProcessSpacesArgs/main.cpp | 2 +- tests/auto/qprocess/testSetWorkingDirectory/main.cpp | 2 +- tests/auto/qprocess/testSoftExit/main_unix.cpp | 2 +- tests/auto/qprocess/testSoftExit/main_win.cpp | 2 +- tests/auto/qprocess/testSpaceInName/main.cpp | 2 +- tests/auto/qprocess/tst_qprocess.cpp | 2 +- tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp | 2 +- tests/auto/qprogressbar/tst_qprogressbar.cpp | 2 +- tests/auto/qprogressdialog/tst_qprogressdialog.cpp | 2 +- tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp | 2 +- tests/auto/qpushbutton/tst_qpushbutton.cpp | 2 +- tests/auto/qquaternion/tst_qquaternion.cpp | 2 +- tests/auto/qqueue/tst_qqueue.cpp | 2 +- tests/auto/qradiobutton/tst_qradiobutton.cpp | 2 +- tests/auto/qrand/tst_qrand.cpp | 2 +- tests/auto/qreadlocker/tst_qreadlocker.cpp | 2 +- tests/auto/qreadwritelock/tst_qreadwritelock.cpp | 2 +- tests/auto/qrect/tst_qrect.cpp | 2 +- tests/auto/qregexp/tst_qregexp.cpp | 2 +- tests/auto/qregexpvalidator/tst_qregexpvalidator.cpp | 2 +- tests/auto/qregion/tst_qregion.cpp | 2 +- tests/auto/qresourceengine/tst_qresourceengine.cpp | 2 +- tests/auto/qringbuffer/tst_qringbuffer.cpp | 2 +- tests/auto/qs60mainapplication/tst_qs60mainapplication.cpp | 2 +- tests/auto/qscopedpointer/tst_qscopedpointer.cpp | 2 +- tests/auto/qscriptable/tst_qscriptable.cpp | 2 +- tests/auto/qscriptclass/tst_qscriptclass.cpp | 2 +- tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 2 +- tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp | 2 +- tests/auto/qscriptengine/tst_qscriptengine.cpp | 2 +- tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp | 2 +- .../qscriptenginedebugger/tst_qscriptenginedebugger.cpp | 2 +- tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp | 2 +- tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp | 2 +- tests/auto/qscriptstring/tst_qscriptstring.cpp | 2 +- tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp | 2 +- tests/auto/qscriptvalue/testgen/gen.py | 4 ++-- tests/auto/qscriptvalue/testgen/main.cpp | 2 +- tests/auto/qscriptvalue/testgen/testgenerator.cpp | 4 ++-- tests/auto/qscriptvalue/testgen/testgenerator.h | 2 +- tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 2 +- tests/auto/qscriptvalue/tst_qscriptvalue.h | 2 +- tests/auto/qscriptvalue/tst_qscriptvalue_generated.cpp | 2 +- .../auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp | 2 +- tests/auto/qscrollarea/tst_qscrollarea.cpp | 2 +- tests/auto/qscrollbar/tst_qscrollbar.cpp | 2 +- tests/auto/qsemaphore/tst_qsemaphore.cpp | 2 +- .../tst_qsequentialanimationgroup.cpp | 2 +- tests/auto/qset/tst_qset.cpp | 2 +- tests/auto/qsettings/tst_qsettings.cpp | 2 +- tests/auto/qsharedpointer/externaltests.cpp | 2 +- tests/auto/qsharedpointer/externaltests.h | 2 +- tests/auto/qsharedpointer/forwarddeclaration.cpp | 2 +- tests/auto/qsharedpointer/forwarddeclared.cpp | 2 +- tests/auto/qsharedpointer/forwarddeclared.h | 2 +- tests/auto/qsharedpointer/tst_qsharedpointer.cpp | 2 +- tests/auto/qsharedpointer/wrapper.cpp | 2 +- tests/auto/qsharedpointer/wrapper.h | 2 +- .../tst_qsharedpointer_and_qwidget.cpp | 2 +- tests/auto/qshortcut/tst_qshortcut.cpp | 2 +- tests/auto/qsidebar/tst_qsidebar.cpp | 2 +- tests/auto/qsignalmapper/tst_qsignalmapper.cpp | 2 +- tests/auto/qsignalspy/tst_qsignalspy.cpp | 2 +- tests/auto/qsimplexmlnodemodel/TestSimpleNodeModel.h | 2 +- tests/auto/qsimplexmlnodemodel/tst_qsimplexmlnodemodel.cpp | 2 +- tests/auto/qsize/tst_qsize.cpp | 2 +- tests/auto/qsizef/tst_qsizef.cpp | 2 +- tests/auto/qsizegrip/tst_qsizegrip.cpp | 2 +- tests/auto/qslider/tst_qslider.cpp | 2 +- tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp | 2 +- tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp | 2 +- tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp | 2 +- .../qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp | 2 +- tests/auto/qsound/tst_qsound.cpp | 2 +- tests/auto/qsourcelocation/tst_qsourcelocation.cpp | 2 +- tests/auto/qspinbox/tst_qspinbox.cpp | 2 +- tests/auto/qsplitter/tst_qsplitter.cpp | 2 +- tests/auto/qsql/tst_qsql.cpp | 2 +- tests/auto/qsqldatabase/tst_databases.h | 2 +- tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 2 +- tests/auto/qsqldriver/tst_qsqldriver.cpp | 2 +- tests/auto/qsqlerror/tst_qsqlerror.cpp | 2 +- tests/auto/qsqlfield/tst_qsqlfield.cpp | 2 +- tests/auto/qsqlquery/tst_qsqlquery.cpp | 2 +- tests/auto/qsqlquerymodel/tst_qsqlquerymodel.cpp | 2 +- tests/auto/qsqlrecord/tst_qsqlrecord.cpp | 2 +- .../tst_qsqlrelationaltablemodel.cpp | 2 +- tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp | 2 +- tests/auto/qsqlthread/tst_qsqlthread.cpp | 2 +- tests/auto/qsslcertificate/certificates/gencertificates.sh | 2 +- tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 2 +- tests/auto/qsslcipher/tst_qsslcipher.cpp | 2 +- tests/auto/qsslerror/tst_qsslerror.cpp | 2 +- tests/auto/qsslkey/keys/genkeys.sh | 2 +- tests/auto/qsslkey/tst_qsslkey.cpp | 2 +- tests/auto/qsslsocket/tst_qsslsocket.cpp | 2 +- tests/auto/qstackedlayout/tst_qstackedlayout.cpp | 2 +- tests/auto/qstackedwidget/tst_qstackedwidget.cpp | 2 +- tests/auto/qstandarditem/tst_qstandarditem.cpp | 2 +- tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp | 2 +- tests/auto/qstate/tst_qstate.cpp | 2 +- tests/auto/qstatemachine/tst_qstatemachine.cpp | 2 +- tests/auto/qstatusbar/tst_qstatusbar.cpp | 2 +- tests/auto/qstl/tst_qstl.cpp | 2 +- tests/auto/qstring/double_data.h | 2 +- tests/auto/qstring/tst_qstring.cpp | 2 +- tests/auto/qstringbuilder1/stringbuilder.cpp | 2 +- tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp | 2 +- tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp | 2 +- tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp | 2 +- tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp | 2 +- tests/auto/qstringlist/tst_qstringlist.cpp | 2 +- tests/auto/qstringlistmodel/qmodellistener.h | 2 +- tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp | 2 +- tests/auto/qstringmatcher/tst_qstringmatcher.cpp | 2 +- tests/auto/qstyle/tst_qstyle.cpp | 2 +- tests/auto/qstyleoption/tst_qstyleoption.cpp | 2 +- tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp | 2 +- tests/auto/qsvgdevice/tst_qsvgdevice.cpp | 2 +- tests/auto/qsvggenerator/tst_qsvggenerator.cpp | 2 +- tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp | 2 +- tests/auto/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp | 2 +- tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp | 2 +- tests/auto/qtabbar/tst_qtabbar.cpp | 2 +- tests/auto/qtableview/tst_qtableview.cpp | 2 +- tests/auto/qtablewidget/tst_qtablewidget.cpp | 2 +- tests/auto/qtabwidget/tst_qtabwidget.cpp | 2 +- tests/auto/qtconcurrentfilter/tst_qtconcurrentfilter.cpp | 2 +- .../tst_qtconcurrentiteratekernel.cpp | 2 +- tests/auto/qtconcurrentmap/functions.h | 2 +- tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp | 2 +- tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp | 2 +- .../tst_qtconcurrentthreadengine.cpp | 2 +- tests/auto/qtcpserver/crashingServer/main.cpp | 2 +- tests/auto/qtcpserver/tst_qtcpserver.cpp | 2 +- tests/auto/qtcpsocket/stressTest/Test.cpp | 2 +- tests/auto/qtcpsocket/stressTest/Test.h | 2 +- tests/auto/qtcpsocket/stressTest/main.cpp | 2 +- tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 2 +- tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp | 2 +- tests/auto/qtessellator/XrenderFake.h | 2 +- tests/auto/qtessellator/arc.cpp | 2 +- tests/auto/qtessellator/arc.h | 2 +- tests/auto/qtessellator/dataparser.cpp | 2 +- tests/auto/qtessellator/dataparser.h | 2 +- tests/auto/qtessellator/oldtessellator.cpp | 2 +- tests/auto/qtessellator/oldtessellator.h | 2 +- tests/auto/qtessellator/qnum.h | 2 +- tests/auto/qtessellator/sample_data.h | 2 +- tests/auto/qtessellator/simple.cpp | 2 +- tests/auto/qtessellator/simple.h | 2 +- tests/auto/qtessellator/testtessellator.cpp | 2 +- tests/auto/qtessellator/testtessellator.h | 2 +- tests/auto/qtessellator/tst_tessellator.cpp | 2 +- tests/auto/qtessellator/utils.cpp | 2 +- tests/auto/qtessellator/utils.h | 2 +- tests/auto/qtextblock/tst_qtextblock.cpp | 2 +- tests/auto/qtextboundaryfinder/tst_qtextboundaryfinder.cpp | 2 +- tests/auto/qtextbrowser/tst_qtextbrowser.cpp | 2 +- tests/auto/qtextcodec/echo/main.cpp | 2 +- tests/auto/qtextcodec/tst_qtextcodec.cpp | 2 +- tests/auto/qtextcursor/tst_qtextcursor.cpp | 2 +- tests/auto/qtextdocument/common.h | 2 +- tests/auto/qtextdocument/tst_qtextdocument.cpp | 2 +- .../qtextdocumentfragment/tst_qtextdocumentfragment.cpp | 2 +- tests/auto/qtextdocumentlayout/tst_qtextdocumentlayout.cpp | 2 +- tests/auto/qtextedit/tst_qtextedit.cpp | 2 +- tests/auto/qtextformat/tst_qtextformat.cpp | 2 +- tests/auto/qtextlayout/tst_qtextlayout.cpp | 2 +- tests/auto/qtextlist/tst_qtextlist.cpp | 2 +- tests/auto/qtextobject/tst_qtextobject.cpp | 2 +- tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp | 2 +- tests/auto/qtextpiecetable/tst_qtextpiecetable.cpp | 2 +- tests/auto/qtextscriptengine/generate/main.cpp | 2 +- tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp | 2 +- tests/auto/qtextstream/readAllStdinProcess/main.cpp | 2 +- tests/auto/qtextstream/readLineStdinProcess/main.cpp | 2 +- tests/auto/qtextstream/stdinProcess/main.cpp | 2 +- tests/auto/qtextstream/tst_qtextstream.cpp | 2 +- tests/auto/qtexttable/tst_qtexttable.cpp | 2 +- tests/auto/qthread/tst_qthread.cpp | 2 +- tests/auto/qthreadonce/qthreadonce.cpp | 2 +- tests/auto/qthreadonce/qthreadonce.h | 2 +- tests/auto/qthreadonce/tst_qthreadonce.cpp | 2 +- tests/auto/qthreadpool/tst_qthreadpool.cpp | 2 +- tests/auto/qthreadstorage/tst_qthreadstorage.cpp | 2 +- tests/auto/qtime/tst_qtime.cpp | 2 +- tests/auto/qtimeline/tst_qtimeline.cpp | 2 +- tests/auto/qtimer/tst_qtimer.cpp | 2 +- tests/auto/qtipc/lackey/main.cpp | 2 +- .../qtipc/qsharedmemory/qsystemlock/tst_qsystemlock.cpp | 2 +- tests/auto/qtipc/qsharedmemory/src/qsystemlock.cpp | 2 +- tests/auto/qtipc/qsharedmemory/src/qsystemlock.h | 2 +- tests/auto/qtipc/qsharedmemory/src/qsystemlock_p.h | 2 +- tests/auto/qtipc/qsharedmemory/src/qsystemlock_unix.cpp | 2 +- tests/auto/qtipc/qsharedmemory/src/qsystemlock_win.cpp | 2 +- tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp | 2 +- tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp | 2 +- tests/auto/qtmd5/tst_qtmd5.cpp | 2 +- tests/auto/qtokenautomaton/generateTokenizers.sh | 2 +- tests/auto/qtokenautomaton/tokenizers/basic/basic.cpp | 2 +- tests/auto/qtokenautomaton/tokenizers/basic/basic.h | 2 +- .../tokenizers/basicNamespace/basicNamespace.cpp | 2 +- .../tokenizers/basicNamespace/basicNamespace.h | 2 +- .../qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp | 2 +- .../qtokenautomaton/tokenizers/boilerplate/boilerplate.h | 2 +- .../qtokenautomaton/tokenizers/boilerplate/boilerplate.xml | 2 +- .../qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp | 2 +- .../qtokenautomaton/tokenizers/noNamespace/noNamespace.h | 2 +- .../qtokenautomaton/tokenizers/noToString/noToString.cpp | 2 +- .../qtokenautomaton/tokenizers/noToString/noToString.h | 2 +- .../tokenizers/withNamespace/withNamespace.cpp | 2 +- .../tokenizers/withNamespace/withNamespace.h | 2 +- tests/auto/qtokenautomaton/tst_qtokenautomaton.cpp | 2 +- tests/auto/qtoolbar/tst_qtoolbar.cpp | 2 +- tests/auto/qtoolbox/tst_qtoolbox.cpp | 2 +- tests/auto/qtoolbutton/tst_qtoolbutton.cpp | 2 +- tests/auto/qtooltip/tst_qtooltip.cpp | 2 +- tests/auto/qtouchevent/tst_qtouchevent.cpp | 2 +- tests/auto/qtransform/tst_qtransform.cpp | 2 +- tests/auto/qtransformedscreen/tst_qtransformedscreen.cpp | 2 +- tests/auto/qtranslator/tst_qtranslator.cpp | 2 +- tests/auto/qtreeview/tst_qtreeview.cpp | 2 +- tests/auto/qtreewidget/tst_qtreewidget.cpp | 2 +- .../tst_qtreewidgetitemiterator.cpp | 2 +- tests/auto/qtwidgets/mainwindow.cpp | 2 +- tests/auto/qtwidgets/mainwindow.h | 2 +- tests/auto/qtwidgets/tst_qtwidgets.cpp | 2 +- tests/auto/qudpsocket/clientserver/main.cpp | 2 +- tests/auto/qudpsocket/tst_qudpsocket.cpp | 2 +- tests/auto/qudpsocket/udpServer/main.cpp | 2 +- tests/auto/qundogroup/tst_qundogroup.cpp | 2 +- tests/auto/qundostack/tst_qundostack.cpp | 2 +- tests/auto/qurl/idna-test.c | 2 +- tests/auto/qurl/tst_qurl.cpp | 2 +- tests/auto/quuid/tst_quuid.cpp | 2 +- tests/auto/qvariant/tst_qvariant.cpp | 2 +- tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp | 2 +- tests/auto/qvector/tst_qvector.cpp | 2 +- tests/auto/qvectornd/tst_qvectornd.cpp | 2 +- tests/auto/qvideoframe/tst_qvideoframe.cpp | 2 +- tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp | 2 +- tests/auto/qwaitcondition/tst_qwaitcondition.cpp | 2 +- tests/auto/qwebelement/dummy.cpp | 2 +- tests/auto/qwebframe/dummy.cpp | 2 +- tests/auto/qwebhistory/dummy.cpp | 2 +- tests/auto/qwebhistoryinterface/dummy.cpp | 2 +- tests/auto/qwebpage/dummy.cpp | 2 +- tests/auto/qwidget/tst_qwidget.cpp | 2 +- tests/auto/qwidget/tst_qwidget_mac_helpers.h | 2 +- tests/auto/qwidget/tst_qwidget_mac_helpers.mm | 2 +- tests/auto/qwidget_window/tst_qwidget_window.cpp | 2 +- tests/auto/qwidgetaction/tst_qwidgetaction.cpp | 2 +- tests/auto/qwindowsurface/tst_qwindowsurface.cpp | 2 +- tests/auto/qwineventnotifier/tst_qwineventnotifier.cpp | 2 +- tests/auto/qwizard/tst_qwizard.cpp | 2 +- tests/auto/qwmatrix/tst_qwmatrix.cpp | 2 +- tests/auto/qworkspace/tst_qworkspace.cpp | 2 +- tests/auto/qwritelocker/tst_qwritelocker.cpp | 2 +- tests/auto/qwsembedwidget/tst_qwsembedwidget.cpp | 2 +- tests/auto/qwsinputmethod/tst_qwsinputmethod.cpp | 2 +- tests/auto/qwswindowsystem/tst_qwswindowsystem.cpp | 2 +- tests/auto/qx11info/tst_qx11info.cpp | 2 +- tests/auto/qxml/tst_qxml.cpp | 2 +- tests/auto/qxmlformatter/tst_qxmlformatter.cpp | 2 +- tests/auto/qxmlinputsource/tst_qxmlinputsource.cpp | 2 +- tests/auto/qxmlitem/tst_qxmlitem.cpp | 2 +- tests/auto/qxmlname/tst_qxmlname.cpp | 2 +- tests/auto/qxmlnamepool/tst_qxmlnamepool.cpp | 2 +- tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp | 2 +- tests/auto/qxmlquery/MessageSilencer.h | 2 +- tests/auto/qxmlquery/MessageValidator.cpp | 2 +- tests/auto/qxmlquery/MessageValidator.h | 2 +- tests/auto/qxmlquery/NetworkOverrider.h | 2 +- tests/auto/qxmlquery/PushBaseliner.h | 2 +- tests/auto/qxmlquery/TestFundament.cpp | 2 +- tests/auto/qxmlquery/TestFundament.h | 2 +- tests/auto/qxmlquery/tst_qxmlquery.cpp | 2 +- tests/auto/qxmlresultitems/tst_qxmlresultitems.cpp | 2 +- tests/auto/qxmlschema/tst_qxmlschema.cpp | 2 +- tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp | 2 +- tests/auto/qxmlserializer/tst_qxmlserializer.cpp | 2 +- tests/auto/qxmlsimplereader/generate_ref_files.sh | 2 +- tests/auto/qxmlsimplereader/parser/main.cpp | 2 +- tests/auto/qxmlsimplereader/parser/parser.cpp | 2 +- tests/auto/qxmlsimplereader/parser/parser.h | 2 +- tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp | 2 +- tests/auto/qxmlstream/qc14n.h | 2 +- tests/auto/qxmlstream/setupSuite.sh | 2 +- tests/auto/qxmlstream/tst_qxmlstream.cpp | 2 +- tests/auto/qzip/tst_qzip.cpp | 2 +- tests/auto/rcc/tst_rcc.cpp | 2 +- tests/auto/selftests/alive/qtestalive.cpp | 2 +- tests/auto/selftests/alive/tst_alive.cpp | 2 +- tests/auto/selftests/assert/tst_assert.cpp | 2 +- tests/auto/selftests/badxml/tst_badxml.cpp | 2 +- .../selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp | 2 +- .../benchlibeventcounter/tst_benchlibeventcounter.cpp | 2 +- .../auto/selftests/benchliboptions/tst_benchliboptions.cpp | 2 +- .../benchlibtickcounter/tst_benchlibtickcounter.cpp | 2 +- .../selftests/benchlibwalltime/tst_benchlibwalltime.cpp | 2 +- tests/auto/selftests/cmptest/tst_cmptest.cpp | 2 +- .../auto/selftests/commandlinedata/tst_commandlinedata.cpp | 2 +- tests/auto/selftests/crashes/tst_crashes.cpp | 2 +- tests/auto/selftests/datatable/tst_datatable.cpp | 2 +- tests/auto/selftests/datetime/tst_datetime.cpp | 2 +- tests/auto/selftests/differentexec/tst_differentexec.cpp | 2 +- tests/auto/selftests/exceptionthrow/tst_exceptionthrow.cpp | 2 +- tests/auto/selftests/expectfail/tst_expectfail.cpp | 2 +- tests/auto/selftests/failinit/tst_failinit.cpp | 2 +- tests/auto/selftests/failinitdata/tst_failinitdata.cpp | 2 +- tests/auto/selftests/fetchbogus/tst_fetchbogus.cpp | 2 +- tests/auto/selftests/globaldata/tst_globaldata.cpp | 2 +- tests/auto/selftests/longstring/tst_longstring.cpp | 2 +- tests/auto/selftests/maxwarnings/maxwarnings.cpp | 2 +- tests/auto/selftests/multiexec/tst_multiexec.cpp | 2 +- .../auto/selftests/qexecstringlist/tst_qexecstringlist.cpp | 2 +- tests/auto/selftests/singleskip/tst_singleskip.cpp | 2 +- tests/auto/selftests/skip/tst_skip.cpp | 2 +- tests/auto/selftests/skipglobal/tst_skipglobal.cpp | 2 +- tests/auto/selftests/skipinit/tst_skipinit.cpp | 2 +- tests/auto/selftests/skipinitdata/tst_skipinitdata.cpp | 2 +- tests/auto/selftests/sleep/tst_sleep.cpp | 2 +- tests/auto/selftests/strcmp/tst_strcmp.cpp | 2 +- tests/auto/selftests/subtest/tst_subtest.cpp | 2 +- tests/auto/selftests/tst_selftests.cpp | 2 +- tests/auto/selftests/waitwithoutgui/tst_waitwithoutgui.cpp | 2 +- tests/auto/selftests/warnings/tst_warnings.cpp | 2 +- .../symbian/orientationchange/tst_orientationchange.cpp | 2 +- tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp | 2 +- tests/auto/symbols/tst_symbols.cpp | 2 +- tests/auto/test.pl | 2 +- tests/auto/uic/baseline/batchtranslation.ui | 2 +- tests/auto/uic/baseline/batchtranslation.ui.h | 2 +- tests/auto/uic/baseline/config.ui | 2 +- tests/auto/uic/baseline/config.ui.h | 2 +- tests/auto/uic/baseline/config_fromuic3.ui | 2 +- tests/auto/uic/baseline/config_fromuic3.ui.h | 2 +- tests/auto/uic/baseline/finddialog.ui | 2 +- tests/auto/uic/baseline/finddialog.ui.h | 2 +- tests/auto/uic/baseline/formwindowsettings.ui | 2 +- tests/auto/uic/baseline/formwindowsettings.ui.h | 2 +- tests/auto/uic/baseline/helpdialog.ui | 2 +- tests/auto/uic/baseline/helpdialog.ui.h | 2 +- tests/auto/uic/baseline/listwidgeteditor.ui | 2 +- tests/auto/uic/baseline/listwidgeteditor.ui.h | 2 +- tests/auto/uic/baseline/mainwindowbase.ui | 2 +- tests/auto/uic/baseline/mainwindowbase.ui.h | 2 +- tests/auto/uic/baseline/newactiondialog.ui | 2 +- tests/auto/uic/baseline/newactiondialog.ui.h | 2 +- tests/auto/uic/baseline/newform.ui | 2 +- tests/auto/uic/baseline/newform.ui.h | 2 +- tests/auto/uic/baseline/orderdialog.ui | 2 +- tests/auto/uic/baseline/orderdialog.ui.h | 2 +- tests/auto/uic/baseline/paletteeditor.ui | 2 +- tests/auto/uic/baseline/paletteeditor.ui.h | 2 +- tests/auto/uic/baseline/paletteeditoradvancedbase.ui | 2 +- tests/auto/uic/baseline/paletteeditoradvancedbase.ui.h | 2 +- tests/auto/uic/baseline/phrasebookbox.ui | 2 +- tests/auto/uic/baseline/phrasebookbox.ui.h | 2 +- tests/auto/uic/baseline/plugindialog.ui | 2 +- tests/auto/uic/baseline/plugindialog.ui.h | 2 +- tests/auto/uic/baseline/previewwidget.ui | 2 +- tests/auto/uic/baseline/previewwidget.ui.h | 2 +- tests/auto/uic/baseline/previewwidgetbase.ui | 2 +- tests/auto/uic/baseline/previewwidgetbase.ui.h | 2 +- tests/auto/uic/baseline/qfiledialog.ui | 2 +- tests/auto/uic/baseline/qfiledialog.ui.h | 2 +- tests/auto/uic/baseline/qtgradientdialog.ui | 2 +- tests/auto/uic/baseline/qtgradientdialog.ui.h | 2 +- tests/auto/uic/baseline/qtgradienteditor.ui | 2 +- tests/auto/uic/baseline/qtgradienteditor.ui.h | 2 +- tests/auto/uic/baseline/qtgradientviewdialog.ui | 2 +- tests/auto/uic/baseline/qtgradientviewdialog.ui.h | 2 +- tests/auto/uic/baseline/saveformastemplate.ui | 2 +- tests/auto/uic/baseline/saveformastemplate.ui.h | 2 +- tests/auto/uic/baseline/statistics.ui | 2 +- tests/auto/uic/baseline/statistics.ui.h | 2 +- tests/auto/uic/baseline/stringlisteditor.ui | 2 +- tests/auto/uic/baseline/stringlisteditor.ui.h | 2 +- tests/auto/uic/baseline/tabbedbrowser.ui | 2 +- tests/auto/uic/baseline/tabbedbrowser.ui.h | 2 +- tests/auto/uic/baseline/tablewidgeteditor.ui | 2 +- tests/auto/uic/baseline/tablewidgeteditor.ui.h | 2 +- tests/auto/uic/baseline/translatedialog.ui | 2 +- tests/auto/uic/baseline/translatedialog.ui.h | 2 +- tests/auto/uic/baseline/treewidgeteditor.ui | 2 +- tests/auto/uic/baseline/treewidgeteditor.ui.h | 2 +- tests/auto/uic/baseline/trpreviewtool.ui | 2 +- tests/auto/uic/baseline/trpreviewtool.ui.h | 2 +- tests/auto/uic/tst_uic.cpp | 2 +- tests/auto/uic3/baseline/about.ui | 4 ++-- tests/auto/uic3/baseline/about.ui.4 | 4 ++-- tests/auto/uic3/baseline/actioneditor.ui | 2 +- tests/auto/uic3/baseline/actioneditor.ui.4 | 2 +- tests/auto/uic3/baseline/config.ui | 2 +- tests/auto/uic3/baseline/config.ui.4 | 2 +- tests/auto/uic3/baseline/configtoolboxdialog.ui | 2 +- tests/auto/uic3/baseline/configtoolboxdialog.ui.4 | 2 +- tests/auto/uic3/baseline/connectiondialog.ui | 2 +- tests/auto/uic3/baseline/connectiondialog.ui.4 | 2 +- tests/auto/uic3/baseline/createtemplate.ui | 2 +- tests/auto/uic3/baseline/createtemplate.ui.4 | 2 +- tests/auto/uic3/baseline/customwidgeteditor.ui | 2 +- tests/auto/uic3/baseline/customwidgeteditor.ui.4 | 2 +- tests/auto/uic3/baseline/dbconnection.ui | 2 +- tests/auto/uic3/baseline/dbconnection.ui.4 | 2 +- tests/auto/uic3/baseline/dbconnectioneditor.ui | 2 +- tests/auto/uic3/baseline/dbconnectioneditor.ui.4 | 2 +- tests/auto/uic3/baseline/dbconnections.ui | 2 +- tests/auto/uic3/baseline/dbconnections.ui.4 | 2 +- tests/auto/uic3/baseline/editfunctions.ui | 2 +- tests/auto/uic3/baseline/editfunctions.ui.4 | 2 +- tests/auto/uic3/baseline/finddialog.ui | 2 +- tests/auto/uic3/baseline/finddialog.ui.4 | 2 +- tests/auto/uic3/baseline/formsettings.ui | 2 +- tests/auto/uic3/baseline/formsettings.ui.4 | 2 +- tests/auto/uic3/baseline/gotolinedialog.ui | 2 +- tests/auto/uic3/baseline/gotolinedialog.ui.4 | 2 +- tests/auto/uic3/baseline/helpdialog.ui | 2 +- tests/auto/uic3/baseline/helpdialog.ui.4 | 2 +- tests/auto/uic3/baseline/iconvieweditor.ui | 2 +- tests/auto/uic3/baseline/iconvieweditor.ui.4 | 2 +- tests/auto/uic3/baseline/listboxeditor.ui | 2 +- tests/auto/uic3/baseline/listboxeditor.ui.4 | 2 +- tests/auto/uic3/baseline/listeditor.ui | 2 +- tests/auto/uic3/baseline/listeditor.ui.4 | 2 +- tests/auto/uic3/baseline/listvieweditor.ui | 2 +- tests/auto/uic3/baseline/listvieweditor.ui.4 | 2 +- tests/auto/uic3/baseline/mainfilesettings.ui | 2 +- tests/auto/uic3/baseline/mainfilesettings.ui.4 | 2 +- tests/auto/uic3/baseline/mainwindowbase.ui | 2 +- tests/auto/uic3/baseline/mainwindowbase.ui.4 | 2 +- tests/auto/uic3/baseline/mainwindowwizard.ui | 2 +- tests/auto/uic3/baseline/mainwindowwizard.ui.4 | 2 +- tests/auto/uic3/baseline/multilineeditor.ui | 2 +- tests/auto/uic3/baseline/multilineeditor.ui.4 | 2 +- tests/auto/uic3/baseline/newform.ui | 2 +- tests/auto/uic3/baseline/newform.ui.4 | 2 +- tests/auto/uic3/baseline/paletteeditor.ui | 2 +- tests/auto/uic3/baseline/paletteeditor.ui.4 | 2 +- tests/auto/uic3/baseline/paletteeditoradvanced.ui | 2 +- tests/auto/uic3/baseline/paletteeditoradvanced.ui.4 | 2 +- tests/auto/uic3/baseline/paletteeditoradvancedbase.ui | 2 +- tests/auto/uic3/baseline/paletteeditoradvancedbase.ui.4 | 2 +- tests/auto/uic3/baseline/pixmapcollectioneditor.ui | 2 +- tests/auto/uic3/baseline/pixmapcollectioneditor.ui.4 | 2 +- tests/auto/uic3/baseline/pixmapfunction.ui | 2 +- tests/auto/uic3/baseline/pixmapfunction.ui.4 | 2 +- tests/auto/uic3/baseline/preferences.ui | 2 +- tests/auto/uic3/baseline/preferences.ui.4 | 2 +- tests/auto/uic3/baseline/previewwidget.ui | 2 +- tests/auto/uic3/baseline/previewwidget.ui.4 | 2 +- tests/auto/uic3/baseline/previewwidgetbase.ui | 2 +- tests/auto/uic3/baseline/previewwidgetbase.ui.4 | 2 +- tests/auto/uic3/baseline/projectsettings.ui | 2 +- tests/auto/uic3/baseline/projectsettings.ui.4 | 2 +- tests/auto/uic3/baseline/qactivexselect.ui | 2 +- tests/auto/uic3/baseline/qactivexselect.ui.4 | 2 +- tests/auto/uic3/baseline/replacedialog.ui | 2 +- tests/auto/uic3/baseline/replacedialog.ui.4 | 2 +- tests/auto/uic3/baseline/richtextfontdialog.ui | 2 +- tests/auto/uic3/baseline/richtextfontdialog.ui.4 | 2 +- tests/auto/uic3/baseline/settingsdialog.ui | 2 +- tests/auto/uic3/baseline/settingsdialog.ui.4 | 2 +- tests/auto/uic3/baseline/sqlformwizard.ui | 2 +- tests/auto/uic3/baseline/sqlformwizard.ui.4 | 2 +- tests/auto/uic3/baseline/startdialog.ui | 2 +- tests/auto/uic3/baseline/startdialog.ui.4 | 2 +- tests/auto/uic3/baseline/statistics.ui | 2 +- tests/auto/uic3/baseline/statistics.ui.4 | 2 +- tests/auto/uic3/baseline/tabbedbrowser.ui | 2 +- tests/auto/uic3/baseline/tabbedbrowser.ui.4 | 2 +- tests/auto/uic3/baseline/tableeditor.ui | 2 +- tests/auto/uic3/baseline/tableeditor.ui.4 | 2 +- tests/auto/uic3/baseline/topicchooser.ui | 2 +- tests/auto/uic3/baseline/topicchooser.ui.4 | 2 +- tests/auto/uic3/baseline/variabledialog.ui | 2 +- tests/auto/uic3/baseline/variabledialog.ui.4 | 2 +- tests/auto/uic3/baseline/wizardeditor.ui | 2 +- tests/auto/uic3/baseline/wizardeditor.ui.4 | 2 +- tests/auto/uic3/tst_uic3.cpp | 2 +- tests/auto/uiloader/baseline/batchtranslation.ui | 2 +- tests/auto/uiloader/baseline/config.ui | 2 +- tests/auto/uiloader/baseline/finddialog.ui | 2 +- tests/auto/uiloader/baseline/formwindowsettings.ui | 2 +- tests/auto/uiloader/baseline/helpdialog.ui | 2 +- tests/auto/uiloader/baseline/listwidgeteditor.ui | 2 +- tests/auto/uiloader/baseline/mainwindowbase.ui | 2 +- tests/auto/uiloader/baseline/newactiondialog.ui | 2 +- tests/auto/uiloader/baseline/newform.ui | 2 +- tests/auto/uiloader/baseline/orderdialog.ui | 2 +- tests/auto/uiloader/baseline/paletteeditor.ui | 2 +- tests/auto/uiloader/baseline/paletteeditoradvancedbase.ui | 2 +- tests/auto/uiloader/baseline/phrasebookbox.ui | 2 +- tests/auto/uiloader/baseline/plugindialog.ui | 2 +- tests/auto/uiloader/baseline/previewwidget.ui | 2 +- tests/auto/uiloader/baseline/previewwidgetbase.ui | 2 +- tests/auto/uiloader/baseline/qfiledialog.ui | 2 +- tests/auto/uiloader/baseline/qtgradientdialog.ui | 2 +- tests/auto/uiloader/baseline/qtgradienteditor.ui | 2 +- tests/auto/uiloader/baseline/qtgradientviewdialog.ui | 2 +- tests/auto/uiloader/baseline/saveformastemplate.ui | 2 +- tests/auto/uiloader/baseline/statistics.ui | 2 +- tests/auto/uiloader/baseline/stringlisteditor.ui | 2 +- tests/auto/uiloader/baseline/tabbedbrowser.ui | 2 +- tests/auto/uiloader/baseline/tablewidgeteditor.ui | 2 +- tests/auto/uiloader/baseline/translatedialog.ui | 2 +- tests/auto/uiloader/baseline/treewidgeteditor.ui | 2 +- tests/auto/uiloader/baseline/trpreviewtool.ui | 2 +- tests/auto/uiloader/tst_screenshot/main.cpp | 2 +- tests/auto/uiloader/uiloader/tst_uiloader.cpp | 2 +- tests/auto/uiloader/uiloader/uiloader.cpp | 2 +- tests/auto/uiloader/uiloader/uiloader.h | 2 +- tests/auto/utf8/tst_utf8.cpp | 2 +- tests/auto/windowsmobile/test/ddhelper.cpp | 2 +- tests/auto/windowsmobile/test/ddhelper.h | 2 +- tests/auto/windowsmobile/test/tst_windowsmobile.cpp | 2 +- tests/auto/windowsmobile/testQMenuBar/main.cpp | 2 +- tests/auto/xmlpatterns/tst_xmlpatterns.cpp | 2 +- tests/auto/xmlpatternsdiagnosticsts/TestSuite/validate.sh | 2 +- .../tst_xmlpatternsdiagnosticsts.cpp | 2 +- tests/auto/xmlpatternsschema/tst_xmlpatternsschema.cpp | 2 +- tests/auto/xmlpatternsschemats/TESTSUITE/updateSuite.sh | 2 +- tests/auto/xmlpatternsschemats/tst_xmlpatternsschemats.cpp | 2 +- tests/auto/xmlpatternssdk/ASTItem.cpp | 2 +- tests/auto/xmlpatternssdk/ASTItem.h | 2 +- tests/auto/xmlpatternssdk/DebugExpressionFactory.cpp | 2 +- tests/auto/xmlpatternssdk/DebugExpressionFactory.h | 2 +- tests/auto/xmlpatternssdk/ErrorHandler.cpp | 2 +- tests/auto/xmlpatternssdk/ErrorHandler.h | 2 +- tests/auto/xmlpatternssdk/ErrorItem.cpp | 2 +- tests/auto/xmlpatternssdk/ErrorItem.h | 2 +- tests/auto/xmlpatternssdk/ExitCode.h | 2 +- tests/auto/xmlpatternssdk/ExpressionInfo.cpp | 2 +- tests/auto/xmlpatternssdk/ExpressionInfo.h | 2 +- tests/auto/xmlpatternssdk/ExpressionNamer.cpp | 2 +- tests/auto/xmlpatternssdk/ExpressionNamer.h | 2 +- tests/auto/xmlpatternssdk/ExternalSourceLoader.cpp | 2 +- tests/auto/xmlpatternssdk/ExternalSourceLoader.h | 2 +- tests/auto/xmlpatternssdk/Global.cpp | 2 +- tests/auto/xmlpatternssdk/Global.h | 2 +- tests/auto/xmlpatternssdk/ResultThreader.cpp | 2 +- tests/auto/xmlpatternssdk/ResultThreader.h | 2 +- tests/auto/xmlpatternssdk/TestBaseLine.cpp | 2 +- tests/auto/xmlpatternssdk/TestBaseLine.h | 2 +- tests/auto/xmlpatternssdk/TestCase.cpp | 2 +- tests/auto/xmlpatternssdk/TestCase.h | 2 +- tests/auto/xmlpatternssdk/TestContainer.cpp | 2 +- tests/auto/xmlpatternssdk/TestContainer.h | 2 +- tests/auto/xmlpatternssdk/TestGroup.cpp | 2 +- tests/auto/xmlpatternssdk/TestGroup.h | 2 +- tests/auto/xmlpatternssdk/TestItem.h | 2 +- tests/auto/xmlpatternssdk/TestResult.cpp | 2 +- tests/auto/xmlpatternssdk/TestResult.h | 2 +- tests/auto/xmlpatternssdk/TestResultHandler.cpp | 2 +- tests/auto/xmlpatternssdk/TestResultHandler.h | 2 +- tests/auto/xmlpatternssdk/TestSuite.cpp | 2 +- tests/auto/xmlpatternssdk/TestSuite.h | 2 +- tests/auto/xmlpatternssdk/TestSuiteHandler.cpp | 2 +- tests/auto/xmlpatternssdk/TestSuiteHandler.h | 2 +- tests/auto/xmlpatternssdk/TestSuiteResult.cpp | 2 +- tests/auto/xmlpatternssdk/TestSuiteResult.h | 2 +- tests/auto/xmlpatternssdk/TreeItem.cpp | 2 +- tests/auto/xmlpatternssdk/TreeItem.h | 2 +- tests/auto/xmlpatternssdk/TreeModel.cpp | 2 +- tests/auto/xmlpatternssdk/TreeModel.h | 2 +- tests/auto/xmlpatternssdk/Worker.cpp | 2 +- tests/auto/xmlpatternssdk/Worker.h | 2 +- tests/auto/xmlpatternssdk/XMLWriter.cpp | 2 +- tests/auto/xmlpatternssdk/XMLWriter.h | 2 +- tests/auto/xmlpatternssdk/XQTSTestCase.cpp | 2 +- tests/auto/xmlpatternssdk/XQTSTestCase.h | 2 +- tests/auto/xmlpatternssdk/XSDTSTestCase.cpp | 2 +- tests/auto/xmlpatternssdk/XSDTSTestCase.h | 2 +- tests/auto/xmlpatternssdk/XSDTestSuiteHandler.cpp | 2 +- tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h | 2 +- tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp | 2 +- tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h | 2 +- tests/auto/xmlpatternssdk/docs/XMLIndenterExample.cpp | 2 +- tests/auto/xmlpatternssdk/docs/XMLWriterExample.cpp | 2 +- tests/auto/xmlpatternssdk/tests/XMLWriterTest.cpp | 2 +- tests/auto/xmlpatternssdk/tests/XMLWriterTest.h | 2 +- .../auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp | 2 +- tests/auto/xmlpatternsview/tst_xmlpatternsview.cpp | 2 +- tests/auto/xmlpatternsview/view/FunctionSignaturesView.cpp | 2 +- tests/auto/xmlpatternsview/view/FunctionSignaturesView.h | 2 +- tests/auto/xmlpatternsview/view/MainWindow.cpp | 2 +- tests/auto/xmlpatternsview/view/MainWindow.h | 2 +- tests/auto/xmlpatternsview/view/TestCaseView.cpp | 2 +- tests/auto/xmlpatternsview/view/TestCaseView.h | 2 +- tests/auto/xmlpatternsview/view/TestResultView.cpp | 2 +- tests/auto/xmlpatternsview/view/TestResultView.h | 2 +- tests/auto/xmlpatternsview/view/TreeSortFilter.cpp | 2 +- tests/auto/xmlpatternsview/view/TreeSortFilter.h | 2 +- tests/auto/xmlpatternsview/view/UserTestCase.cpp | 2 +- tests/auto/xmlpatternsview/view/UserTestCase.h | 2 +- tests/auto/xmlpatternsview/view/XDTItemItem.cpp | 2 +- tests/auto/xmlpatternsview/view/XDTItemItem.h | 2 +- tests/auto/xmlpatternsview/view/main.cpp | 2 +- tests/auto/xmlpatternsxqts/summarizeBaseline.sh | 2 +- tests/auto/xmlpatternsxqts/tst_suitetest.cpp | 2 +- tests/auto/xmlpatternsxqts/tst_suitetest.h | 2 +- tests/auto/xmlpatternsxqts/tst_xmlpatternsxqts.cpp | 2 +- tests/auto/xmlpatternsxslts/XSLTS/updateSuite.sh | 2 +- tests/auto/xmlpatternsxslts/tst_xmlpatternsxslts.cpp | 2 +- tests/benchmarks/corelib/codecs/qtextcodec/main.cpp | 2 +- .../benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp | 2 +- tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp | 2 +- tests/benchmarks/corelib/io/qdiriterator/main.cpp | 2 +- .../corelib/io/qdiriterator/qfilesystemiterator.cpp | 2 +- .../corelib/io/qdiriterator/qfilesystemiterator.h | 2 +- tests/benchmarks/corelib/io/qfile/main.cpp | 2 +- tests/benchmarks/corelib/io/qfileinfo/main.cpp | 2 +- tests/benchmarks/corelib/io/qiodevice/main.cpp | 2 +- tests/benchmarks/corelib/io/qtemporaryfile/main.cpp | 2 +- tests/benchmarks/corelib/kernel/events/main.cpp | 2 +- tests/benchmarks/corelib/kernel/qmetaobject/main.cpp | 2 +- tests/benchmarks/corelib/kernel/qobject/main.cpp | 2 +- tests/benchmarks/corelib/kernel/qobject/object.cpp | 2 +- tests/benchmarks/corelib/kernel/qobject/object.h | 2 +- tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp | 2 +- .../corelib/thread/qthreadstorage/tst_qthreadstorage.cpp | 2 +- .../corelib/tools/containers-associative/main.cpp | 2 +- .../corelib/tools/containers-sequential/main.cpp | 2 +- tests/benchmarks/corelib/tools/qbytearray/main.cpp | 2 +- tests/benchmarks/corelib/tools/qrect/main.cpp | 2 +- tests/benchmarks/corelib/tools/qregexp/main.cpp | 2 +- tests/benchmarks/corelib/tools/qstring/main.cpp | 2 +- tests/benchmarks/corelib/tools/qstringbuilder/main.cpp | 2 +- tests/benchmarks/corelib/tools/qstringlist/main.cpp | 2 +- .../benchmarks/gui/animation/qanimation/dummyanimation.cpp | 2 +- tests/benchmarks/gui/animation/qanimation/dummyanimation.h | 2 +- tests/benchmarks/gui/animation/qanimation/dummyobject.cpp | 2 +- tests/benchmarks/gui/animation/qanimation/dummyobject.h | 2 +- tests/benchmarks/gui/animation/qanimation/main.cpp | 2 +- .../benchmarks/gui/animation/qanimation/rectanimation.cpp | 2 +- tests/benchmarks/gui/animation/qanimation/rectanimation.h | 2 +- .../graphicsview/functional/GraphicsViewBenchmark/main.cpp | 2 +- .../widgets/abstractitemcontainer.cpp | 2 +- .../GraphicsViewBenchmark/widgets/abstractitemcontainer.h | 2 +- .../GraphicsViewBenchmark/widgets/abstractitemview.cpp | 2 +- .../GraphicsViewBenchmark/widgets/abstractitemview.h | 2 +- .../GraphicsViewBenchmark/widgets/abstractscrollarea.cpp | 2 +- .../GraphicsViewBenchmark/widgets/abstractscrollarea.h | 2 +- .../GraphicsViewBenchmark/widgets/abstractviewitem.cpp | 2 +- .../GraphicsViewBenchmark/widgets/abstractviewitem.h | 2 +- .../GraphicsViewBenchmark/widgets/backgrounditem.cpp | 2 +- .../GraphicsViewBenchmark/widgets/backgrounditem.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/button.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/button.h | 2 +- .../GraphicsViewBenchmark/widgets/commandline.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/commandline.h | 2 +- .../GraphicsViewBenchmark/widgets/dummydatagen.cpp | 2 +- .../GraphicsViewBenchmark/widgets/dummydatagen.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/gvbwidget.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/iconitem.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/iconitem.h | 2 +- .../GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp | 2 +- .../GraphicsViewBenchmark/widgets/itemrecyclinglist.h | 2 +- .../widgets/itemrecyclinglistview.cpp | 2 +- .../GraphicsViewBenchmark/widgets/itemrecyclinglistview.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/label.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/label.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/listitem.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/listitem.h | 2 +- .../GraphicsViewBenchmark/widgets/listitemcache.cpp | 2 +- .../GraphicsViewBenchmark/widgets/listitemcache.h | 2 +- .../GraphicsViewBenchmark/widgets/listitemcontainer.cpp | 2 +- .../GraphicsViewBenchmark/widgets/listitemcontainer.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/listmodel.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/listmodel.h | 2 +- .../GraphicsViewBenchmark/widgets/listwidget.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/listwidget.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/mainview.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/mainview.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/menu.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/menu.h | 2 +- .../GraphicsViewBenchmark/widgets/recycledlistitem.cpp | 2 +- .../GraphicsViewBenchmark/widgets/recycledlistitem.h | 2 +- .../GraphicsViewBenchmark/widgets/resourcemoninterface.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/scrollbar.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/scrollbar.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/scroller.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/scroller.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/scroller_p.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/settings.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/settings.h | 2 +- .../GraphicsViewBenchmark/widgets/simplelist.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/simplelist.h | 2 +- .../GraphicsViewBenchmark/widgets/simplelistview.cpp | 2 +- .../GraphicsViewBenchmark/widgets/simplelistview.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/theme.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/theme.h | 2 +- .../GraphicsViewBenchmark/widgets/themeevent.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/themeevent.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/topbar.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/topbar.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/webview.cpp | 2 +- .../functional/GraphicsViewBenchmark/widgets/webview.h | 2 +- .../functional/GraphicsViewBenchmark/widgets/webview_p.h | 2 +- .../qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp | 2 +- .../gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp | 2 +- .../gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp | 2 +- .../graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp | 2 +- .../graphicsview/qgraphicsview/benchapps/chipTest/chip.h | 2 +- .../graphicsview/qgraphicsview/benchapps/chipTest/main.cpp | 2 +- .../qgraphicsview/benchapps/chipTest/mainwindow.cpp | 2 +- .../qgraphicsview/benchapps/chipTest/mainwindow.h | 2 +- .../graphicsview/qgraphicsview/benchapps/chipTest/view.cpp | 2 +- .../graphicsview/qgraphicsview/benchapps/chipTest/view.h | 2 +- .../qgraphicsview/benchapps/moveItems/main.cpp | 2 +- .../qgraphicsview/benchapps/scrolltest/main.cpp | 2 +- .../gui/graphicsview/qgraphicsview/chiptester/chip.cpp | 2 +- .../gui/graphicsview/qgraphicsview/chiptester/chip.h | 2 +- .../graphicsview/qgraphicsview/chiptester/chiptester.cpp | 2 +- .../gui/graphicsview/qgraphicsview/chiptester/chiptester.h | 2 +- .../gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp | 2 +- .../graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp | 2 +- tests/benchmarks/gui/image/blendbench/main.cpp | 2 +- .../benchmarks/gui/image/qimagereader/tst_qimagereader.cpp | 2 +- tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp | 2 +- .../benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp | 2 +- .../benchmarks/gui/itemviews/qtableview/tst_qtableview.cpp | 2 +- tests/benchmarks/gui/kernel/qapplication/main.cpp | 2 +- tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp | 2 +- tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp | 2 +- .../benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp | 2 +- tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp | 2 +- tests/benchmarks/gui/painting/qregion/main.cpp | 2 +- .../benchmarks/gui/painting/qtransform/tst_qtransform.cpp | 2 +- tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp | 2 +- tests/benchmarks/gui/text/qfontmetrics/main.cpp | 2 +- tests/benchmarks/gui/text/qtext/main.cpp | 2 +- .../network/access/qfile_vs_qnetworkaccessmanager/main.cpp | 2 +- .../network/access/qnetworkreply/tst_qnetworkreply.cpp | 2 +- tests/benchmarks/network/kernel/qhostinfo/main.cpp | 2 +- .../network/socket/qtcpserver/tst_qtcpserver.cpp | 2 +- tests/benchmarks/opengl/main.cpp | 2 +- tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp | 2 +- tests/benchmarks/script/qscriptclass/tst_qscriptclass.cpp | 2 +- .../benchmarks/script/qscriptengine/tst_qscriptengine.cpp | 2 +- tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp | 2 +- tests/benchmarks/svg/qsvgrenderer/tst_qsvgrenderer.cpp | 2 +- tests/manual/gestures/graphicsview/gestures.cpp | 2 +- tests/manual/gestures/graphicsview/gestures.h | 2 +- tests/manual/gestures/graphicsview/imageitem.cpp | 2 +- tests/manual/gestures/graphicsview/imageitem.h | 2 +- tests/manual/gestures/graphicsview/main.cpp | 2 +- .../gestures/graphicsview/mousepangesturerecognizer.cpp | 2 +- .../gestures/graphicsview/mousepangesturerecognizer.h | 2 +- tests/manual/gestures/scrollarea/main.cpp | 2 +- .../gestures/scrollarea/mousepangesturerecognizer.cpp | 2 +- .../manual/gestures/scrollarea/mousepangesturerecognizer.h | 2 +- tests/manual/inputmethodhints/inputmethodhints.cpp | 2 +- tests/manual/inputmethodhints/inputmethodhints.h | 2 +- tests/manual/inputmethodhints/main.cpp | 2 +- tests/manual/keypadnavigation/main.cpp | 2 +- tests/manual/qcursor/allcursors/main.cpp | 2 +- tests/manual/qcursor/allcursors/mainwindow.cpp | 2 +- tests/manual/qcursor/allcursors/mainwindow.h | 2 +- tests/manual/qcursor/grab_override/main.cpp | 2 +- tests/manual/qcursor/grab_override/mainwindow.cpp | 2 +- tests/manual/qcursor/grab_override/mainwindow.h | 2 +- tests/manual/qdesktopwidget/main.cpp | 2 +- tests/manual/qgraphicsitemgroup/customitem.cpp | 2 +- tests/manual/qgraphicsitemgroup/customitem.h | 2 +- tests/manual/qgraphicsitemgroup/main.cpp | 2 +- tests/manual/qgraphicsitemgroup/widget.cpp | 2 +- tests/manual/qgraphicsitemgroup/widget.h | 2 +- tests/manual/qhttpnetworkconnection/main.cpp | 2 +- tests/manual/qimagereader/main.cpp | 2 +- tests/manual/qnetworkreply/main.cpp | 2 +- tests/manual/qtabletevent/device_information/main.cpp | 2 +- .../qtabletevent/device_information/tabletwidget.cpp | 2 +- .../manual/qtabletevent/device_information/tabletwidget.h | 2 +- tests/manual/qtabletevent/event_compression/main.cpp | 2 +- .../qtabletevent/event_compression/mousestatwidget.cpp | 2 +- .../qtabletevent/event_compression/mousestatwidget.h | 2 +- tests/manual/qtouchevent/main.cpp | 2 +- tests/manual/qtouchevent/touchwidget.cpp | 2 +- tests/manual/qtouchevent/touchwidget.h | 2 +- tests/manual/qwidget_zorder/main.cpp | 2 +- tests/manual/textrendering/glyphshaping/main.cpp | 2 +- tests/manual/textrendering/textperformance/main.cpp | 2 +- tests/manual/windowflags/controllerwindow.cpp | 2 +- tests/manual/windowflags/controllerwindow.h | 2 +- tests/manual/windowflags/main.cpp | 2 +- tests/manual/windowflags/previewwindow.cpp | 2 +- tests/manual/windowflags/previewwindow.h | 2 +- tests/shared/filesystem.h | 2 +- tests/shared/util.h | 2 +- tools/activeqt/dumpcpp/main.cpp | 2 +- tools/activeqt/dumpdoc/main.cpp | 2 +- tools/activeqt/testcon/ambientproperties.cpp | 2 +- tools/activeqt/testcon/ambientproperties.h | 2 +- tools/activeqt/testcon/ambientproperties.ui | 2 +- tools/activeqt/testcon/changeproperties.cpp | 2 +- tools/activeqt/testcon/changeproperties.h | 2 +- tools/activeqt/testcon/changeproperties.ui | 2 +- tools/activeqt/testcon/controlinfo.cpp | 2 +- tools/activeqt/testcon/controlinfo.h | 2 +- tools/activeqt/testcon/controlinfo.ui | 2 +- tools/activeqt/testcon/docuwindow.cpp | 2 +- tools/activeqt/testcon/docuwindow.h | 2 +- tools/activeqt/testcon/invokemethod.cpp | 2 +- tools/activeqt/testcon/invokemethod.h | 2 +- tools/activeqt/testcon/invokemethod.ui | 2 +- tools/activeqt/testcon/main.cpp | 2 +- tools/activeqt/testcon/mainwindow.cpp | 2 +- tools/activeqt/testcon/mainwindow.h | 2 +- tools/activeqt/testcon/mainwindow.ui | 2 +- tools/activeqt/testcon/scripts/perlscript.pl | 2 +- tools/activeqt/testcon/scripts/pythonscript.py | 2 +- tools/activeqt/testcon/testcon.rc | 2 +- tools/assistant/compat/config.cpp | 2 +- tools/assistant/compat/config.h | 2 +- tools/assistant/compat/docuparser.cpp | 2 +- tools/assistant/compat/docuparser.h | 2 +- tools/assistant/compat/fontsettingsdialog.cpp | 2 +- tools/assistant/compat/fontsettingsdialog.h | 2 +- tools/assistant/compat/helpdialog.cpp | 2 +- tools/assistant/compat/helpdialog.h | 2 +- tools/assistant/compat/helpdialog.ui | 2 +- tools/assistant/compat/helpwindow.cpp | 2 +- tools/assistant/compat/helpwindow.h | 2 +- tools/assistant/compat/index.cpp | 2 +- tools/assistant/compat/index.h | 2 +- tools/assistant/compat/lib/qassistantclient.cpp | 2 +- tools/assistant/compat/lib/qassistantclient.h | 2 +- tools/assistant/compat/lib/qassistantclient_global.h | 2 +- tools/assistant/compat/main.cpp | 2 +- tools/assistant/compat/mainwindow.cpp | 4 ++-- tools/assistant/compat/mainwindow.h | 2 +- tools/assistant/compat/mainwindow.ui | 2 +- tools/assistant/compat/profile.cpp | 2 +- tools/assistant/compat/profile.h | 2 +- tools/assistant/compat/tabbedbrowser.cpp | 2 +- tools/assistant/compat/tabbedbrowser.h | 2 +- tools/assistant/compat/tabbedbrowser.ui | 2 +- tools/assistant/compat/topicchooser.cpp | 2 +- tools/assistant/compat/topicchooser.h | 2 +- tools/assistant/compat/topicchooser.ui | 2 +- tools/assistant/lib/fulltextsearch/qanalyzer.cpp | 2 +- tools/assistant/lib/fulltextsearch/qanalyzer_p.h | 2 +- tools/assistant/lib/fulltextsearch/qclucene-config_p.h | 2 +- tools/assistant/lib/fulltextsearch/qclucene_global_p.h | 2 +- tools/assistant/lib/fulltextsearch/qdocument.cpp | 2 +- tools/assistant/lib/fulltextsearch/qdocument_p.h | 2 +- tools/assistant/lib/fulltextsearch/qfield.cpp | 2 +- tools/assistant/lib/fulltextsearch/qfield_p.h | 2 +- tools/assistant/lib/fulltextsearch/qfilter.cpp | 2 +- tools/assistant/lib/fulltextsearch/qfilter_p.h | 2 +- tools/assistant/lib/fulltextsearch/qhits.cpp | 2 +- tools/assistant/lib/fulltextsearch/qhits_p.h | 2 +- tools/assistant/lib/fulltextsearch/qindexreader.cpp | 2 +- tools/assistant/lib/fulltextsearch/qindexreader_p.h | 2 +- tools/assistant/lib/fulltextsearch/qindexwriter.cpp | 2 +- tools/assistant/lib/fulltextsearch/qindexwriter_p.h | 2 +- tools/assistant/lib/fulltextsearch/qquery.cpp | 2 +- tools/assistant/lib/fulltextsearch/qquery_p.h | 2 +- tools/assistant/lib/fulltextsearch/qqueryparser.cpp | 2 +- tools/assistant/lib/fulltextsearch/qqueryparser_p.h | 2 +- tools/assistant/lib/fulltextsearch/qreader.cpp | 2 +- tools/assistant/lib/fulltextsearch/qreader_p.h | 2 +- tools/assistant/lib/fulltextsearch/qsearchable.cpp | 2 +- tools/assistant/lib/fulltextsearch/qsearchable_p.h | 2 +- tools/assistant/lib/fulltextsearch/qsort.cpp | 2 +- tools/assistant/lib/fulltextsearch/qsort_p.h | 2 +- tools/assistant/lib/fulltextsearch/qterm.cpp | 2 +- tools/assistant/lib/fulltextsearch/qterm_p.h | 2 +- tools/assistant/lib/fulltextsearch/qtoken.cpp | 2 +- tools/assistant/lib/fulltextsearch/qtoken_p.h | 2 +- tools/assistant/lib/fulltextsearch/qtokenizer.cpp | 2 +- tools/assistant/lib/fulltextsearch/qtokenizer_p.h | 2 +- tools/assistant/lib/fulltextsearch/qtokenstream.cpp | 2 +- tools/assistant/lib/fulltextsearch/qtokenstream_p.h | 2 +- tools/assistant/lib/qhelp_global.cpp | 2 +- tools/assistant/lib/qhelp_global.h | 2 +- tools/assistant/lib/qhelpcollectionhandler.cpp | 2 +- tools/assistant/lib/qhelpcollectionhandler_p.h | 2 +- tools/assistant/lib/qhelpcontentwidget.cpp | 2 +- tools/assistant/lib/qhelpcontentwidget.h | 2 +- tools/assistant/lib/qhelpdatainterface.cpp | 2 +- tools/assistant/lib/qhelpdatainterface_p.h | 2 +- tools/assistant/lib/qhelpdbreader.cpp | 2 +- tools/assistant/lib/qhelpdbreader_p.h | 2 +- tools/assistant/lib/qhelpengine.cpp | 2 +- tools/assistant/lib/qhelpengine.h | 2 +- tools/assistant/lib/qhelpengine_p.h | 2 +- tools/assistant/lib/qhelpenginecore.cpp | 2 +- tools/assistant/lib/qhelpenginecore.h | 2 +- tools/assistant/lib/qhelpgenerator.cpp | 2 +- tools/assistant/lib/qhelpgenerator_p.h | 2 +- tools/assistant/lib/qhelpindexwidget.cpp | 2 +- tools/assistant/lib/qhelpindexwidget.h | 2 +- tools/assistant/lib/qhelpprojectdata.cpp | 2 +- tools/assistant/lib/qhelpprojectdata_p.h | 2 +- tools/assistant/lib/qhelpsearchengine.cpp | 2 +- tools/assistant/lib/qhelpsearchengine.h | 2 +- tools/assistant/lib/qhelpsearchindex_default.cpp | 2 +- tools/assistant/lib/qhelpsearchindex_default_p.h | 2 +- tools/assistant/lib/qhelpsearchindexreader.cpp | 2 +- tools/assistant/lib/qhelpsearchindexreader_clucene.cpp | 2 +- tools/assistant/lib/qhelpsearchindexreader_clucene_p.h | 2 +- tools/assistant/lib/qhelpsearchindexreader_default.cpp | 2 +- tools/assistant/lib/qhelpsearchindexreader_default_p.h | 2 +- tools/assistant/lib/qhelpsearchindexreader_p.h | 2 +- tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp | 2 +- tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h | 2 +- tools/assistant/lib/qhelpsearchindexwriter_default.cpp | 2 +- tools/assistant/lib/qhelpsearchindexwriter_default_p.h | 2 +- tools/assistant/lib/qhelpsearchquerywidget.cpp | 2 +- tools/assistant/lib/qhelpsearchquerywidget.h | 2 +- tools/assistant/lib/qhelpsearchresultwidget.cpp | 2 +- tools/assistant/lib/qhelpsearchresultwidget.h | 2 +- tools/assistant/tools/assistant/aboutdialog.cpp | 2 +- tools/assistant/tools/assistant/aboutdialog.h | 2 +- tools/assistant/tools/assistant/assistant.rc | 2 +- tools/assistant/tools/assistant/bookmarkmanager.cpp | 2 +- tools/assistant/tools/assistant/bookmarkmanager.h | 2 +- tools/assistant/tools/assistant/centralwidget.cpp | 2 +- tools/assistant/tools/assistant/centralwidget.h | 2 +- tools/assistant/tools/assistant/cmdlineparser.cpp | 2 +- tools/assistant/tools/assistant/cmdlineparser.h | 2 +- tools/assistant/tools/assistant/contentwindow.cpp | 2 +- tools/assistant/tools/assistant/contentwindow.h | 2 +- tools/assistant/tools/assistant/doc/assistant.qdoc | 2 +- tools/assistant/tools/assistant/filternamedialog.cpp | 2 +- tools/assistant/tools/assistant/filternamedialog.h | 2 +- tools/assistant/tools/assistant/helpviewer.cpp | 2 +- tools/assistant/tools/assistant/helpviewer.h | 2 +- tools/assistant/tools/assistant/indexwindow.cpp | 2 +- tools/assistant/tools/assistant/indexwindow.h | 2 +- tools/assistant/tools/assistant/installdialog.cpp | 2 +- tools/assistant/tools/assistant/installdialog.h | 2 +- tools/assistant/tools/assistant/main.cpp | 2 +- tools/assistant/tools/assistant/mainwindow.cpp | 4 ++-- tools/assistant/tools/assistant/mainwindow.h | 2 +- tools/assistant/tools/assistant/preferencesdialog.cpp | 2 +- tools/assistant/tools/assistant/preferencesdialog.h | 2 +- tools/assistant/tools/assistant/qtdocinstaller.cpp | 2 +- tools/assistant/tools/assistant/qtdocinstaller.h | 2 +- tools/assistant/tools/assistant/remotecontrol.cpp | 2 +- tools/assistant/tools/assistant/remotecontrol.h | 2 +- tools/assistant/tools/assistant/remotecontrol_win.h | 2 +- tools/assistant/tools/assistant/searchwidget.cpp | 2 +- tools/assistant/tools/assistant/searchwidget.h | 2 +- tools/assistant/tools/assistant/topicchooser.cpp | 2 +- tools/assistant/tools/assistant/topicchooser.h | 2 +- tools/assistant/tools/qcollectiongenerator/main.cpp | 2 +- tools/assistant/tools/qhelpconverter/adpreader.cpp | 2 +- tools/assistant/tools/qhelpconverter/adpreader.h | 2 +- tools/assistant/tools/qhelpconverter/conversionwizard.cpp | 2 +- tools/assistant/tools/qhelpconverter/conversionwizard.h | 2 +- tools/assistant/tools/qhelpconverter/filespage.cpp | 2 +- tools/assistant/tools/qhelpconverter/filespage.h | 2 +- tools/assistant/tools/qhelpconverter/filterpage.cpp | 2 +- tools/assistant/tools/qhelpconverter/filterpage.h | 2 +- tools/assistant/tools/qhelpconverter/finishpage.cpp | 2 +- tools/assistant/tools/qhelpconverter/finishpage.h | 2 +- tools/assistant/tools/qhelpconverter/generalpage.cpp | 2 +- tools/assistant/tools/qhelpconverter/generalpage.h | 2 +- tools/assistant/tools/qhelpconverter/helpwindow.cpp | 2 +- tools/assistant/tools/qhelpconverter/helpwindow.h | 2 +- tools/assistant/tools/qhelpconverter/identifierpage.cpp | 2 +- tools/assistant/tools/qhelpconverter/identifierpage.h | 2 +- tools/assistant/tools/qhelpconverter/inputpage.cpp | 2 +- tools/assistant/tools/qhelpconverter/inputpage.h | 2 +- tools/assistant/tools/qhelpconverter/main.cpp | 2 +- tools/assistant/tools/qhelpconverter/outputpage.cpp | 2 +- tools/assistant/tools/qhelpconverter/outputpage.h | 2 +- tools/assistant/tools/qhelpconverter/pathpage.cpp | 2 +- tools/assistant/tools/qhelpconverter/pathpage.h | 2 +- tools/assistant/tools/qhelpconverter/qhcpwriter.cpp | 2 +- tools/assistant/tools/qhelpconverter/qhcpwriter.h | 2 +- tools/assistant/tools/qhelpconverter/qhpwriter.cpp | 2 +- tools/assistant/tools/qhelpconverter/qhpwriter.h | 2 +- tools/assistant/tools/qhelpgenerator/main.cpp | 2 +- tools/assistant/tools/shared/helpgenerator.cpp | 2 +- tools/assistant/tools/shared/helpgenerator.h | 2 +- tools/checksdk/cesdkhandler.cpp | 2 +- tools/checksdk/cesdkhandler.h | 2 +- tools/checksdk/main.cpp | 2 +- tools/configure/configure_pch.h | 2 +- tools/configure/configureapp.cpp | 2 +- tools/configure/configureapp.h | 2 +- tools/configure/environment.cpp | 2 +- tools/configure/environment.h | 2 +- tools/configure/main.cpp | 2 +- tools/configure/tools.cpp | 2 +- tools/configure/tools.h | 2 +- tools/designer/data/generate_header.xsl | 2 +- tools/designer/data/generate_impl.xsl | 2 +- tools/designer/src/components/buddyeditor/buddyeditor.cpp | 2 +- tools/designer/src/components/buddyeditor/buddyeditor.h | 2 +- .../src/components/buddyeditor/buddyeditor_global.h | 2 +- .../src/components/buddyeditor/buddyeditor_instance.cpp | 2 +- .../src/components/buddyeditor/buddyeditor_plugin.cpp | 2 +- .../src/components/buddyeditor/buddyeditor_plugin.h | 2 +- .../src/components/buddyeditor/buddyeditor_tool.cpp | 2 +- .../designer/src/components/buddyeditor/buddyeditor_tool.h | 2 +- .../src/components/formeditor/brushmanagerproxy.cpp | 2 +- .../designer/src/components/formeditor/brushmanagerproxy.h | 2 +- .../src/components/formeditor/default_actionprovider.cpp | 2 +- .../src/components/formeditor/default_actionprovider.h | 2 +- .../src/components/formeditor/default_container.cpp | 2 +- .../designer/src/components/formeditor/default_container.h | 2 +- .../src/components/formeditor/default_layoutdecoration.cpp | 2 +- .../src/components/formeditor/default_layoutdecoration.h | 2 +- .../src/components/formeditor/deviceprofiledialog.cpp | 2 +- .../src/components/formeditor/deviceprofiledialog.h | 2 +- tools/designer/src/components/formeditor/dpi_chooser.cpp | 2 +- tools/designer/src/components/formeditor/dpi_chooser.h | 2 +- .../src/components/formeditor/embeddedoptionspage.cpp | 2 +- .../src/components/formeditor/embeddedoptionspage.h | 2 +- tools/designer/src/components/formeditor/formeditor.cpp | 2 +- tools/designer/src/components/formeditor/formeditor.h | 2 +- .../designer/src/components/formeditor/formeditor_global.h | 2 +- .../src/components/formeditor/formeditor_optionspage.cpp | 2 +- .../src/components/formeditor/formeditor_optionspage.h | 2 +- tools/designer/src/components/formeditor/formwindow.cpp | 2 +- tools/designer/src/components/formeditor/formwindow.h | 2 +- .../src/components/formeditor/formwindow_dnditem.cpp | 2 +- .../src/components/formeditor/formwindow_dnditem.h | 2 +- .../src/components/formeditor/formwindow_widgetstack.cpp | 2 +- .../src/components/formeditor/formwindow_widgetstack.h | 2 +- .../src/components/formeditor/formwindowcursor.cpp | 2 +- .../designer/src/components/formeditor/formwindowcursor.h | 2 +- .../src/components/formeditor/formwindowmanager.cpp | 2 +- .../designer/src/components/formeditor/formwindowmanager.h | 2 +- .../src/components/formeditor/formwindowsettings.cpp | 2 +- .../src/components/formeditor/formwindowsettings.h | 2 +- .../src/components/formeditor/formwindowsettings.ui | 2 +- tools/designer/src/components/formeditor/iconcache.cpp | 2 +- tools/designer/src/components/formeditor/iconcache.h | 2 +- .../src/components/formeditor/itemview_propertysheet.cpp | 2 +- .../src/components/formeditor/itemview_propertysheet.h | 2 +- .../src/components/formeditor/layout_propertysheet.cpp | 2 +- .../src/components/formeditor/layout_propertysheet.h | 2 +- .../src/components/formeditor/line_propertysheet.cpp | 2 +- .../src/components/formeditor/line_propertysheet.h | 2 +- .../src/components/formeditor/previewactiongroup.cpp | 2 +- .../src/components/formeditor/previewactiongroup.h | 2 +- .../src/components/formeditor/qdesigner_resource.cpp | 2 +- .../src/components/formeditor/qdesigner_resource.h | 2 +- .../components/formeditor/qlayoutwidget_propertysheet.cpp | 2 +- .../components/formeditor/qlayoutwidget_propertysheet.h | 2 +- .../src/components/formeditor/qmainwindow_container.cpp | 2 +- .../src/components/formeditor/qmainwindow_container.h | 2 +- .../src/components/formeditor/qmdiarea_container.cpp | 2 +- .../src/components/formeditor/qmdiarea_container.h | 2 +- .../designer/src/components/formeditor/qtbrushmanager.cpp | 2 +- tools/designer/src/components/formeditor/qtbrushmanager.h | 2 +- .../src/components/formeditor/qwizard_container.cpp | 2 +- .../designer/src/components/formeditor/qwizard_container.h | 2 +- .../src/components/formeditor/qworkspace_container.cpp | 2 +- .../src/components/formeditor/qworkspace_container.h | 2 +- .../src/components/formeditor/spacer_propertysheet.cpp | 2 +- .../src/components/formeditor/spacer_propertysheet.h | 2 +- .../src/components/formeditor/templateoptionspage.cpp | 2 +- .../src/components/formeditor/templateoptionspage.h | 2 +- .../src/components/formeditor/tool_widgeteditor.cpp | 2 +- .../designer/src/components/formeditor/tool_widgeteditor.h | 2 +- .../designer/src/components/formeditor/widgetselection.cpp | 2 +- tools/designer/src/components/formeditor/widgetselection.h | 2 +- tools/designer/src/components/lib/lib_pch.h | 2 +- tools/designer/src/components/lib/qdesigner_components.cpp | 2 +- .../src/components/objectinspector/objectinspector.cpp | 2 +- .../src/components/objectinspector/objectinspector.h | 2 +- .../components/objectinspector/objectinspector_global.h | 2 +- .../components/objectinspector/objectinspectormodel.cpp | 2 +- .../components/objectinspector/objectinspectormodel_p.h | 2 +- .../src/components/propertyeditor/brushpropertymanager.cpp | 2 +- .../src/components/propertyeditor/brushpropertymanager.h | 2 +- tools/designer/src/components/propertyeditor/defs.cpp | 2 +- tools/designer/src/components/propertyeditor/defs.h | 2 +- .../components/propertyeditor/designerpropertymanager.cpp | 2 +- .../components/propertyeditor/designerpropertymanager.h | 2 +- .../designer/src/components/propertyeditor/fontmapping.xml | 2 +- .../src/components/propertyeditor/fontpropertymanager.cpp | 2 +- .../src/components/propertyeditor/fontpropertymanager.h | 2 +- .../components/propertyeditor/newdynamicpropertydialog.cpp | 2 +- .../components/propertyeditor/newdynamicpropertydialog.h | 2 +- .../src/components/propertyeditor/paletteeditor.cpp | 2 +- .../designer/src/components/propertyeditor/paletteeditor.h | 2 +- .../src/components/propertyeditor/paletteeditor.ui | 2 +- .../src/components/propertyeditor/paletteeditorbutton.cpp | 2 +- .../src/components/propertyeditor/paletteeditorbutton.h | 2 +- .../src/components/propertyeditor/previewframe.cpp | 2 +- .../designer/src/components/propertyeditor/previewframe.h | 2 +- .../src/components/propertyeditor/previewwidget.cpp | 2 +- .../designer/src/components/propertyeditor/previewwidget.h | 2 +- .../src/components/propertyeditor/previewwidget.ui | 2 +- .../src/components/propertyeditor/propertyeditor.cpp | 2 +- .../src/components/propertyeditor/propertyeditor.h | 2 +- .../src/components/propertyeditor/propertyeditor_global.h | 2 +- .../src/components/propertyeditor/qlonglongvalidator.cpp | 2 +- .../src/components/propertyeditor/qlonglongvalidator.h | 2 +- .../src/components/propertyeditor/stringlisteditor.cpp | 2 +- .../src/components/propertyeditor/stringlisteditor.h | 2 +- .../src/components/propertyeditor/stringlisteditor.ui | 2 +- .../components/propertyeditor/stringlisteditorbutton.cpp | 2 +- .../src/components/propertyeditor/stringlisteditorbutton.h | 2 +- .../src/components/signalsloteditor/connectdialog.cpp | 2 +- .../src/components/signalsloteditor/connectdialog_p.h | 2 +- .../src/components/signalsloteditor/signalslot_utils.cpp | 2 +- .../src/components/signalsloteditor/signalslot_utils_p.h | 2 +- .../src/components/signalsloteditor/signalsloteditor.cpp | 2 +- .../src/components/signalsloteditor/signalsloteditor.h | 2 +- .../components/signalsloteditor/signalsloteditor_global.h | 2 +- .../signalsloteditor/signalsloteditor_instance.cpp | 2 +- .../src/components/signalsloteditor/signalsloteditor_p.h | 2 +- .../signalsloteditor/signalsloteditor_plugin.cpp | 2 +- .../components/signalsloteditor/signalsloteditor_plugin.h | 2 +- .../components/signalsloteditor/signalsloteditor_tool.cpp | 2 +- .../components/signalsloteditor/signalsloteditor_tool.h | 2 +- .../components/signalsloteditor/signalsloteditorwindow.cpp | 2 +- .../components/signalsloteditor/signalsloteditorwindow.h | 2 +- .../src/components/tabordereditor/tabordereditor.cpp | 2 +- .../src/components/tabordereditor/tabordereditor.h | 2 +- .../src/components/tabordereditor/tabordereditor_global.h | 2 +- .../components/tabordereditor/tabordereditor_instance.cpp | 2 +- .../components/tabordereditor/tabordereditor_plugin.cpp | 2 +- .../src/components/tabordereditor/tabordereditor_plugin.h | 2 +- .../src/components/tabordereditor/tabordereditor_tool.cpp | 2 +- .../src/components/tabordereditor/tabordereditor_tool.h | 2 +- tools/designer/src/components/taskmenu/button_taskmenu.cpp | 2 +- tools/designer/src/components/taskmenu/button_taskmenu.h | 2 +- .../designer/src/components/taskmenu/combobox_taskmenu.cpp | 2 +- tools/designer/src/components/taskmenu/combobox_taskmenu.h | 2 +- .../src/components/taskmenu/containerwidget_taskmenu.cpp | 2 +- .../src/components/taskmenu/containerwidget_taskmenu.h | 2 +- .../designer/src/components/taskmenu/groupbox_taskmenu.cpp | 2 +- tools/designer/src/components/taskmenu/groupbox_taskmenu.h | 2 +- tools/designer/src/components/taskmenu/inplace_editor.cpp | 2 +- tools/designer/src/components/taskmenu/inplace_editor.h | 2 +- .../src/components/taskmenu/inplace_widget_helper.cpp | 2 +- .../src/components/taskmenu/inplace_widget_helper.h | 2 +- tools/designer/src/components/taskmenu/itemlisteditor.cpp | 2 +- tools/designer/src/components/taskmenu/itemlisteditor.h | 2 +- tools/designer/src/components/taskmenu/itemlisteditor.ui | 2 +- tools/designer/src/components/taskmenu/label_taskmenu.cpp | 2 +- tools/designer/src/components/taskmenu/label_taskmenu.h | 2 +- tools/designer/src/components/taskmenu/layouttaskmenu.cpp | 2 +- tools/designer/src/components/taskmenu/layouttaskmenu.h | 2 +- .../designer/src/components/taskmenu/lineedit_taskmenu.cpp | 2 +- tools/designer/src/components/taskmenu/lineedit_taskmenu.h | 2 +- .../src/components/taskmenu/listwidget_taskmenu.cpp | 2 +- .../designer/src/components/taskmenu/listwidget_taskmenu.h | 2 +- .../designer/src/components/taskmenu/listwidgeteditor.cpp | 2 +- tools/designer/src/components/taskmenu/listwidgeteditor.h | 2 +- tools/designer/src/components/taskmenu/menutaskmenu.cpp | 2 +- tools/designer/src/components/taskmenu/menutaskmenu.h | 2 +- .../src/components/taskmenu/tablewidget_taskmenu.cpp | 2 +- .../src/components/taskmenu/tablewidget_taskmenu.h | 2 +- .../designer/src/components/taskmenu/tablewidgeteditor.cpp | 2 +- tools/designer/src/components/taskmenu/tablewidgeteditor.h | 2 +- .../designer/src/components/taskmenu/tablewidgeteditor.ui | 2 +- .../src/components/taskmenu/taskmenu_component.cpp | 2 +- .../designer/src/components/taskmenu/taskmenu_component.h | 2 +- tools/designer/src/components/taskmenu/taskmenu_global.h | 2 +- .../designer/src/components/taskmenu/textedit_taskmenu.cpp | 2 +- tools/designer/src/components/taskmenu/textedit_taskmenu.h | 2 +- .../designer/src/components/taskmenu/toolbar_taskmenu.cpp | 2 +- tools/designer/src/components/taskmenu/toolbar_taskmenu.h | 2 +- .../src/components/taskmenu/treewidget_taskmenu.cpp | 2 +- .../designer/src/components/taskmenu/treewidget_taskmenu.h | 2 +- .../designer/src/components/taskmenu/treewidgeteditor.cpp | 2 +- tools/designer/src/components/taskmenu/treewidgeteditor.h | 2 +- tools/designer/src/components/taskmenu/treewidgeteditor.ui | 2 +- tools/designer/src/components/widgetbox/widgetbox.cpp | 2 +- tools/designer/src/components/widgetbox/widgetbox.h | 2 +- tools/designer/src/components/widgetbox/widgetbox.xml | 2 +- .../src/components/widgetbox/widgetbox_dnditem.cpp | 2 +- .../designer/src/components/widgetbox/widgetbox_dnditem.h | 2 +- tools/designer/src/components/widgetbox/widgetbox_global.h | 2 +- .../src/components/widgetbox/widgetboxcategorylistview.cpp | 2 +- .../src/components/widgetbox/widgetboxcategorylistview.h | 2 +- .../src/components/widgetbox/widgetboxtreewidget.cpp | 2 +- .../src/components/widgetbox/widgetboxtreewidget.h | 2 +- tools/designer/src/designer/appfontdialog.cpp | 2 +- tools/designer/src/designer/appfontdialog.h | 2 +- tools/designer/src/designer/assistantclient.cpp | 2 +- tools/designer/src/designer/assistantclient.h | 2 +- tools/designer/src/designer/designer.rc | 2 +- tools/designer/src/designer/designer_enums.h | 2 +- tools/designer/src/designer/main.cpp | 2 +- tools/designer/src/designer/mainwindow.cpp | 2 +- tools/designer/src/designer/mainwindow.h | 2 +- tools/designer/src/designer/newform.cpp | 2 +- tools/designer/src/designer/newform.h | 2 +- tools/designer/src/designer/preferencesdialog.cpp | 2 +- tools/designer/src/designer/preferencesdialog.h | 2 +- tools/designer/src/designer/qdesigner.cpp | 2 +- tools/designer/src/designer/qdesigner.h | 2 +- tools/designer/src/designer/qdesigner_actions.cpp | 2 +- tools/designer/src/designer/qdesigner_actions.h | 2 +- .../designer/src/designer/qdesigner_appearanceoptions.cpp | 2 +- tools/designer/src/designer/qdesigner_appearanceoptions.h | 2 +- tools/designer/src/designer/qdesigner_formwindow.cpp | 2 +- tools/designer/src/designer/qdesigner_formwindow.h | 2 +- tools/designer/src/designer/qdesigner_pch.h | 2 +- tools/designer/src/designer/qdesigner_server.cpp | 2 +- tools/designer/src/designer/qdesigner_server.h | 2 +- tools/designer/src/designer/qdesigner_settings.cpp | 2 +- tools/designer/src/designer/qdesigner_settings.h | 2 +- tools/designer/src/designer/qdesigner_toolwindow.cpp | 2 +- tools/designer/src/designer/qdesigner_toolwindow.h | 2 +- tools/designer/src/designer/qdesigner_workbench.cpp | 2 +- tools/designer/src/designer/qdesigner_workbench.h | 2 +- tools/designer/src/designer/saveformastemplate.cpp | 2 +- tools/designer/src/designer/saveformastemplate.h | 2 +- tools/designer/src/designer/saveformastemplate.ui | 2 +- tools/designer/src/designer/versiondialog.cpp | 4 ++-- tools/designer/src/designer/versiondialog.h | 2 +- tools/designer/src/lib/components/qdesigner_components.h | 2 +- .../src/lib/components/qdesigner_components_global.h | 2 +- .../src/lib/extension/default_extensionfactory.cpp | 2 +- .../designer/src/lib/extension/default_extensionfactory.h | 2 +- tools/designer/src/lib/extension/extension.cpp | 2 +- tools/designer/src/lib/extension/extension.h | 2 +- tools/designer/src/lib/extension/extension_global.h | 2 +- tools/designer/src/lib/extension/qextensionmanager.cpp | 2 +- tools/designer/src/lib/extension/qextensionmanager.h | 2 +- tools/designer/src/lib/lib_pch.h | 2 +- tools/designer/src/lib/sdk/abstractactioneditor.cpp | 2 +- tools/designer/src/lib/sdk/abstractactioneditor.h | 2 +- tools/designer/src/lib/sdk/abstractbrushmanager.h | 2 +- tools/designer/src/lib/sdk/abstractdialoggui.cpp | 2 +- tools/designer/src/lib/sdk/abstractdialoggui_p.h | 2 +- tools/designer/src/lib/sdk/abstractdnditem.h | 2 +- tools/designer/src/lib/sdk/abstractdnditem.qdoc | 2 +- tools/designer/src/lib/sdk/abstractformeditor.cpp | 2 +- tools/designer/src/lib/sdk/abstractformeditor.h | 2 +- tools/designer/src/lib/sdk/abstractformeditorplugin.cpp | 2 +- tools/designer/src/lib/sdk/abstractformeditorplugin.h | 2 +- tools/designer/src/lib/sdk/abstractformwindow.cpp | 2 +- tools/designer/src/lib/sdk/abstractformwindow.h | 2 +- tools/designer/src/lib/sdk/abstractformwindowcursor.cpp | 2 +- tools/designer/src/lib/sdk/abstractformwindowcursor.h | 2 +- tools/designer/src/lib/sdk/abstractformwindowmanager.cpp | 2 +- tools/designer/src/lib/sdk/abstractformwindowmanager.h | 2 +- tools/designer/src/lib/sdk/abstractformwindowtool.cpp | 2 +- tools/designer/src/lib/sdk/abstractformwindowtool.h | 2 +- tools/designer/src/lib/sdk/abstracticoncache.h | 2 +- tools/designer/src/lib/sdk/abstracticoncache.qdoc | 2 +- tools/designer/src/lib/sdk/abstractintegration.cpp | 2 +- tools/designer/src/lib/sdk/abstractintegration.h | 2 +- tools/designer/src/lib/sdk/abstractintrospection.cpp | 2 +- tools/designer/src/lib/sdk/abstractintrospection_p.h | 2 +- tools/designer/src/lib/sdk/abstractlanguage.h | 2 +- tools/designer/src/lib/sdk/abstractmetadatabase.cpp | 2 +- tools/designer/src/lib/sdk/abstractmetadatabase.h | 2 +- tools/designer/src/lib/sdk/abstractnewformwidget.cpp | 2 +- tools/designer/src/lib/sdk/abstractnewformwidget_p.h | 2 +- tools/designer/src/lib/sdk/abstractobjectinspector.cpp | 2 +- tools/designer/src/lib/sdk/abstractobjectinspector.h | 2 +- tools/designer/src/lib/sdk/abstractoptionspage_p.h | 2 +- tools/designer/src/lib/sdk/abstractpromotioninterface.cpp | 2 +- tools/designer/src/lib/sdk/abstractpromotioninterface.h | 2 +- tools/designer/src/lib/sdk/abstractpropertyeditor.cpp | 2 +- tools/designer/src/lib/sdk/abstractpropertyeditor.h | 2 +- tools/designer/src/lib/sdk/abstractresourcebrowser.cpp | 2 +- tools/designer/src/lib/sdk/abstractresourcebrowser.h | 2 +- tools/designer/src/lib/sdk/abstractsettings_p.h | 2 +- tools/designer/src/lib/sdk/abstractwidgetbox.cpp | 2 +- tools/designer/src/lib/sdk/abstractwidgetbox.h | 2 +- tools/designer/src/lib/sdk/abstractwidgetdatabase.cpp | 2 +- tools/designer/src/lib/sdk/abstractwidgetdatabase.h | 2 +- tools/designer/src/lib/sdk/abstractwidgetfactory.cpp | 2 +- tools/designer/src/lib/sdk/abstractwidgetfactory.h | 2 +- tools/designer/src/lib/sdk/dynamicpropertysheet.h | 2 +- tools/designer/src/lib/sdk/dynamicpropertysheet.qdoc | 2 +- tools/designer/src/lib/sdk/extrainfo.cpp | 2 +- tools/designer/src/lib/sdk/extrainfo.h | 2 +- tools/designer/src/lib/sdk/layoutdecoration.h | 2 +- tools/designer/src/lib/sdk/layoutdecoration.qdoc | 2 +- tools/designer/src/lib/sdk/membersheet.h | 2 +- tools/designer/src/lib/sdk/membersheet.qdoc | 2 +- tools/designer/src/lib/sdk/propertysheet.h | 2 +- tools/designer/src/lib/sdk/propertysheet.qdoc | 2 +- tools/designer/src/lib/sdk/script.cpp | 2 +- tools/designer/src/lib/sdk/script_p.h | 2 +- tools/designer/src/lib/sdk/sdk_global.h | 2 +- tools/designer/src/lib/sdk/taskmenu.h | 2 +- tools/designer/src/lib/sdk/taskmenu.qdoc | 2 +- tools/designer/src/lib/shared/actioneditor.cpp | 2 +- tools/designer/src/lib/shared/actioneditor_p.h | 2 +- tools/designer/src/lib/shared/actionprovider_p.h | 2 +- tools/designer/src/lib/shared/actionrepository.cpp | 2 +- tools/designer/src/lib/shared/actionrepository_p.h | 2 +- tools/designer/src/lib/shared/codedialog.cpp | 2 +- tools/designer/src/lib/shared/codedialog_p.h | 2 +- tools/designer/src/lib/shared/connectionedit.cpp | 2 +- tools/designer/src/lib/shared/connectionedit_p.h | 2 +- tools/designer/src/lib/shared/csshighlighter.cpp | 2 +- tools/designer/src/lib/shared/csshighlighter_p.h | 2 +- tools/designer/src/lib/shared/deviceprofile.cpp | 2 +- tools/designer/src/lib/shared/deviceprofile_p.h | 2 +- tools/designer/src/lib/shared/dialoggui.cpp | 2 +- tools/designer/src/lib/shared/dialoggui_p.h | 2 +- tools/designer/src/lib/shared/extensionfactory_p.h | 2 +- tools/designer/src/lib/shared/filterwidget.cpp | 2 +- tools/designer/src/lib/shared/filterwidget_p.h | 2 +- tools/designer/src/lib/shared/formlayoutmenu.cpp | 2 +- tools/designer/src/lib/shared/formlayoutmenu_p.h | 2 +- tools/designer/src/lib/shared/formwindowbase.cpp | 2 +- tools/designer/src/lib/shared/formwindowbase_p.h | 2 +- tools/designer/src/lib/shared/grid.cpp | 2 +- tools/designer/src/lib/shared/grid_p.h | 2 +- tools/designer/src/lib/shared/gridpanel.cpp | 2 +- tools/designer/src/lib/shared/gridpanel_p.h | 2 +- tools/designer/src/lib/shared/htmlhighlighter.cpp | 2 +- tools/designer/src/lib/shared/htmlhighlighter_p.h | 2 +- tools/designer/src/lib/shared/iconloader.cpp | 2 +- tools/designer/src/lib/shared/iconloader_p.h | 2 +- tools/designer/src/lib/shared/iconselector.cpp | 2 +- tools/designer/src/lib/shared/iconselector_p.h | 2 +- tools/designer/src/lib/shared/invisible_widget.cpp | 2 +- tools/designer/src/lib/shared/invisible_widget_p.h | 2 +- tools/designer/src/lib/shared/layout.cpp | 2 +- tools/designer/src/lib/shared/layout_p.h | 2 +- tools/designer/src/lib/shared/layoutinfo.cpp | 2 +- tools/designer/src/lib/shared/layoutinfo_p.h | 2 +- tools/designer/src/lib/shared/metadatabase.cpp | 2 +- tools/designer/src/lib/shared/metadatabase_p.h | 2 +- tools/designer/src/lib/shared/morphmenu.cpp | 2 +- tools/designer/src/lib/shared/morphmenu_p.h | 2 +- tools/designer/src/lib/shared/newactiondialog.cpp | 2 +- tools/designer/src/lib/shared/newactiondialog.ui | 2 +- tools/designer/src/lib/shared/newactiondialog_p.h | 2 +- tools/designer/src/lib/shared/newformwidget.cpp | 2 +- tools/designer/src/lib/shared/newformwidget.ui | 2 +- tools/designer/src/lib/shared/newformwidget_p.h | 2 +- tools/designer/src/lib/shared/orderdialog.cpp | 2 +- tools/designer/src/lib/shared/orderdialog.ui | 2 +- tools/designer/src/lib/shared/orderdialog_p.h | 2 +- tools/designer/src/lib/shared/plaintexteditor.cpp | 2 +- tools/designer/src/lib/shared/plaintexteditor_p.h | 2 +- tools/designer/src/lib/shared/plugindialog.cpp | 2 +- tools/designer/src/lib/shared/plugindialog.ui | 2 +- tools/designer/src/lib/shared/plugindialog_p.h | 2 +- tools/designer/src/lib/shared/pluginmanager.cpp | 2 +- tools/designer/src/lib/shared/pluginmanager_p.h | 2 +- .../designer/src/lib/shared/previewconfigurationwidget.cpp | 2 +- .../designer/src/lib/shared/previewconfigurationwidget_p.h | 2 +- tools/designer/src/lib/shared/previewmanager.cpp | 2 +- tools/designer/src/lib/shared/previewmanager_p.h | 2 +- tools/designer/src/lib/shared/promotionmodel.cpp | 2 +- tools/designer/src/lib/shared/promotionmodel_p.h | 2 +- tools/designer/src/lib/shared/promotiontaskmenu.cpp | 2 +- tools/designer/src/lib/shared/promotiontaskmenu_p.h | 2 +- tools/designer/src/lib/shared/propertylineedit.cpp | 2 +- tools/designer/src/lib/shared/propertylineedit_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_command.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_command2.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_command2_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_command_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_dnditem.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_dnditem_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_dockwidget.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_dockwidget_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_formbuilder.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_formbuilder_p.h | 2 +- .../src/lib/shared/qdesigner_formeditorcommand.cpp | 2 +- .../src/lib/shared/qdesigner_formeditorcommand_p.h | 2 +- .../src/lib/shared/qdesigner_formwindowcommand.cpp | 2 +- .../src/lib/shared/qdesigner_formwindowcommand_p.h | 2 +- .../src/lib/shared/qdesigner_formwindowmanager.cpp | 2 +- .../src/lib/shared/qdesigner_formwindowmanager_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_integration.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_integration_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_introspection.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_introspection_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_membersheet.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_membersheet_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_menu.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_menu_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_menubar.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_menubar_p.h | 2 +- .../designer/src/lib/shared/qdesigner_objectinspector.cpp | 2 +- .../designer/src/lib/shared/qdesigner_objectinspector_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_promotion.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_promotion_p.h | 2 +- .../designer/src/lib/shared/qdesigner_promotiondialog.cpp | 2 +- .../designer/src/lib/shared/qdesigner_promotiondialog_p.h | 2 +- .../designer/src/lib/shared/qdesigner_propertycommand.cpp | 2 +- .../designer/src/lib/shared/qdesigner_propertycommand_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_propertysheet.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_propertysheet_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_qsettings.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_qsettings_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_stackedbox.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_stackedbox_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_tabwidget.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_tabwidget_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_taskmenu.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_taskmenu_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_toolbar.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_toolbar_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_toolbox.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_toolbox_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_utils.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_utils_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_widget.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_widget_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_widgetbox.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_widgetbox_p.h | 2 +- tools/designer/src/lib/shared/qdesigner_widgetitem.cpp | 2 +- tools/designer/src/lib/shared/qdesigner_widgetitem_p.h | 2 +- tools/designer/src/lib/shared/qlayout_widget.cpp | 2 +- tools/designer/src/lib/shared/qlayout_widget_p.h | 2 +- tools/designer/src/lib/shared/qscripthighlighter.cpp | 2 +- tools/designer/src/lib/shared/qscripthighlighter_p.h | 2 +- tools/designer/src/lib/shared/qsimpleresource.cpp | 2 +- tools/designer/src/lib/shared/qsimpleresource_p.h | 2 +- tools/designer/src/lib/shared/qtresourceeditordialog.cpp | 2 +- tools/designer/src/lib/shared/qtresourceeditordialog_p.h | 2 +- tools/designer/src/lib/shared/qtresourcemodel.cpp | 2 +- tools/designer/src/lib/shared/qtresourcemodel_p.h | 2 +- tools/designer/src/lib/shared/qtresourceview.cpp | 2 +- tools/designer/src/lib/shared/qtresourceview_p.h | 2 +- tools/designer/src/lib/shared/richtexteditor.cpp | 2 +- tools/designer/src/lib/shared/richtexteditor_p.h | 2 +- tools/designer/src/lib/shared/scriptcommand.cpp | 2 +- tools/designer/src/lib/shared/scriptcommand_p.h | 2 +- tools/designer/src/lib/shared/scriptdialog.cpp | 2 +- tools/designer/src/lib/shared/scriptdialog_p.h | 2 +- tools/designer/src/lib/shared/scripterrordialog.cpp | 2 +- tools/designer/src/lib/shared/scripterrordialog_p.h | 2 +- tools/designer/src/lib/shared/shared_enums_p.h | 2 +- tools/designer/src/lib/shared/shared_global_p.h | 2 +- tools/designer/src/lib/shared/shared_settings.cpp | 2 +- tools/designer/src/lib/shared/shared_settings_p.h | 2 +- tools/designer/src/lib/shared/sheet_delegate.cpp | 2 +- tools/designer/src/lib/shared/sheet_delegate_p.h | 2 +- tools/designer/src/lib/shared/signalslotdialog.cpp | 2 +- tools/designer/src/lib/shared/signalslotdialog_p.h | 2 +- tools/designer/src/lib/shared/spacer_widget.cpp | 2 +- tools/designer/src/lib/shared/spacer_widget_p.h | 2 +- tools/designer/src/lib/shared/stylesheeteditor.cpp | 2 +- tools/designer/src/lib/shared/stylesheeteditor_p.h | 2 +- tools/designer/src/lib/shared/textpropertyeditor.cpp | 2 +- tools/designer/src/lib/shared/textpropertyeditor_p.h | 2 +- tools/designer/src/lib/shared/widgetdatabase.cpp | 2 +- tools/designer/src/lib/shared/widgetdatabase_p.h | 2 +- tools/designer/src/lib/shared/widgetfactory.cpp | 2 +- tools/designer/src/lib/shared/widgetfactory_p.h | 2 +- tools/designer/src/lib/shared/zoomwidget.cpp | 2 +- tools/designer/src/lib/shared/zoomwidget_p.h | 2 +- tools/designer/src/lib/uilib/abstractformbuilder.cpp | 2 +- tools/designer/src/lib/uilib/abstractformbuilder.h | 2 +- tools/designer/src/lib/uilib/container.h | 2 +- tools/designer/src/lib/uilib/container.qdoc | 2 +- tools/designer/src/lib/uilib/customwidget.h | 2 +- tools/designer/src/lib/uilib/customwidget.qdoc | 2 +- tools/designer/src/lib/uilib/formbuilder.cpp | 2 +- tools/designer/src/lib/uilib/formbuilder.h | 2 +- tools/designer/src/lib/uilib/formbuilderextra.cpp | 2 +- tools/designer/src/lib/uilib/formbuilderextra_p.h | 2 +- tools/designer/src/lib/uilib/formscriptrunner.cpp | 2 +- tools/designer/src/lib/uilib/formscriptrunner_p.h | 2 +- tools/designer/src/lib/uilib/properties.cpp | 2 +- tools/designer/src/lib/uilib/properties_p.h | 2 +- tools/designer/src/lib/uilib/qdesignerexportwidget.h | 2 +- tools/designer/src/lib/uilib/resourcebuilder.cpp | 2 +- tools/designer/src/lib/uilib/resourcebuilder_p.h | 2 +- tools/designer/src/lib/uilib/textbuilder.cpp | 2 +- tools/designer/src/lib/uilib/textbuilder_p.h | 2 +- tools/designer/src/lib/uilib/ui4.cpp | 2 +- tools/designer/src/lib/uilib/ui4_p.h | 2 +- tools/designer/src/lib/uilib/uilib_global.h | 2 +- tools/designer/src/plugins/activeqt/qaxwidgetextrainfo.cpp | 2 +- tools/designer/src/plugins/activeqt/qaxwidgetextrainfo.h | 2 +- tools/designer/src/plugins/activeqt/qaxwidgetplugin.cpp | 2 +- tools/designer/src/plugins/activeqt/qaxwidgetplugin.h | 2 +- .../src/plugins/activeqt/qaxwidgetpropertysheet.cpp | 2 +- .../designer/src/plugins/activeqt/qaxwidgetpropertysheet.h | 2 +- tools/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp | 2 +- tools/designer/src/plugins/activeqt/qaxwidgettaskmenu.h | 2 +- tools/designer/src/plugins/activeqt/qdesigneraxwidget.cpp | 2 +- tools/designer/src/plugins/activeqt/qdesigneraxwidget.h | 2 +- .../src/plugins/phononwidgets/phononcollection.cpp | 2 +- .../src/plugins/phononwidgets/seeksliderplugin.cpp | 2 +- .../designer/src/plugins/phononwidgets/seeksliderplugin.h | 2 +- .../src/plugins/phononwidgets/videoplayerplugin.cpp | 2 +- .../designer/src/plugins/phononwidgets/videoplayerplugin.h | 2 +- .../src/plugins/phononwidgets/videoplayertaskmenu.cpp | 2 +- .../src/plugins/phononwidgets/videoplayertaskmenu.h | 2 +- .../src/plugins/phononwidgets/volumesliderplugin.cpp | 2 +- .../src/plugins/phononwidgets/volumesliderplugin.h | 2 +- tools/designer/src/plugins/qwebview/qwebview_plugin.cpp | 2 +- tools/designer/src/plugins/qwebview/qwebview_plugin.h | 2 +- tools/designer/src/plugins/tools/view3d/view3d.cpp | 2 +- tools/designer/src/plugins/tools/view3d/view3d.h | 2 +- tools/designer/src/plugins/tools/view3d/view3d_global.h | 2 +- tools/designer/src/plugins/tools/view3d/view3d_plugin.cpp | 2 +- tools/designer/src/plugins/tools/view3d/view3d_plugin.h | 2 +- tools/designer/src/plugins/tools/view3d/view3d_tool.cpp | 2 +- tools/designer/src/plugins/tools/view3d/view3d_tool.h | 2 +- .../plugins/widgets/q3iconview/q3iconview_extrainfo.cpp | 2 +- .../src/plugins/widgets/q3iconview/q3iconview_extrainfo.h | 2 +- .../src/plugins/widgets/q3iconview/q3iconview_plugin.cpp | 2 +- .../src/plugins/widgets/q3iconview/q3iconview_plugin.h | 2 +- .../src/plugins/widgets/q3listbox/q3listbox_extrainfo.cpp | 2 +- .../src/plugins/widgets/q3listbox/q3listbox_extrainfo.h | 2 +- .../src/plugins/widgets/q3listbox/q3listbox_plugin.cpp | 2 +- .../src/plugins/widgets/q3listbox/q3listbox_plugin.h | 2 +- .../plugins/widgets/q3listview/q3listview_extrainfo.cpp | 2 +- .../src/plugins/widgets/q3listview/q3listview_extrainfo.h | 2 +- .../src/plugins/widgets/q3listview/q3listview_plugin.cpp | 2 +- .../src/plugins/widgets/q3listview/q3listview_plugin.h | 2 +- .../widgets/q3mainwindow/q3mainwindow_container.cpp | 2 +- .../plugins/widgets/q3mainwindow/q3mainwindow_container.h | 2 +- .../plugins/widgets/q3mainwindow/q3mainwindow_plugin.cpp | 2 +- .../src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.h | 2 +- .../src/plugins/widgets/q3table/q3table_extrainfo.cpp | 2 +- .../src/plugins/widgets/q3table/q3table_extrainfo.h | 2 +- .../src/plugins/widgets/q3table/q3table_plugin.cpp | 2 +- .../designer/src/plugins/widgets/q3table/q3table_plugin.h | 2 +- .../plugins/widgets/q3textedit/q3textedit_extrainfo.cpp | 2 +- .../src/plugins/widgets/q3textedit/q3textedit_extrainfo.h | 2 +- .../src/plugins/widgets/q3textedit/q3textedit_plugin.cpp | 2 +- .../src/plugins/widgets/q3textedit/q3textedit_plugin.h | 2 +- .../src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.cpp | 2 +- .../src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.h | 2 +- .../src/plugins/widgets/q3toolbar/q3toolbar_plugin.cpp | 2 +- .../src/plugins/widgets/q3toolbar/q3toolbar_plugin.h | 2 +- .../src/plugins/widgets/q3widgets/q3widget_plugins.cpp | 2 +- .../src/plugins/widgets/q3widgets/q3widget_plugins.h | 2 +- .../widgets/q3widgetstack/q3widgetstack_container.cpp | 2 +- .../widgets/q3widgetstack/q3widgetstack_container.h | 2 +- .../plugins/widgets/q3widgetstack/q3widgetstack_plugin.cpp | 2 +- .../plugins/widgets/q3widgetstack/q3widgetstack_plugin.h | 2 +- .../widgets/q3widgetstack/qdesigner_q3widgetstack.cpp | 2 +- .../widgets/q3widgetstack/qdesigner_q3widgetstack_p.h | 2 +- .../src/plugins/widgets/q3wizard/q3wizard_container.cpp | 2 +- .../src/plugins/widgets/q3wizard/q3wizard_container.h | 2 +- .../src/plugins/widgets/q3wizard/q3wizard_plugin.cpp | 2 +- .../src/plugins/widgets/q3wizard/q3wizard_plugin.h | 2 +- tools/designer/src/plugins/widgets/qt3supportwidgets.cpp | 2 +- tools/designer/src/uitools/quiloader.cpp | 2 +- tools/designer/src/uitools/quiloader.h | 2 +- tools/designer/src/uitools/quiloader_p.h | 2 +- tools/kmap2qmap/main.cpp | 2 +- tools/linguist/lconvert/main.cpp | 2 +- tools/linguist/linguist/batchtranslation.ui | 2 +- tools/linguist/linguist/batchtranslationdialog.cpp | 2 +- tools/linguist/linguist/batchtranslationdialog.h | 2 +- tools/linguist/linguist/errorsview.cpp | 2 +- tools/linguist/linguist/errorsview.h | 2 +- tools/linguist/linguist/finddialog.cpp | 2 +- tools/linguist/linguist/finddialog.h | 2 +- tools/linguist/linguist/finddialog.ui | 2 +- tools/linguist/linguist/formpreviewview.cpp | 2 +- tools/linguist/linguist/formpreviewview.h | 2 +- tools/linguist/linguist/globals.cpp | 2 +- tools/linguist/linguist/globals.h | 2 +- tools/linguist/linguist/linguist.rc | 2 +- tools/linguist/linguist/main.cpp | 2 +- tools/linguist/linguist/mainwindow.cpp | 4 ++-- tools/linguist/linguist/mainwindow.h | 2 +- tools/linguist/linguist/mainwindow.ui | 2 +- tools/linguist/linguist/messageeditor.cpp | 2 +- tools/linguist/linguist/messageeditor.h | 2 +- tools/linguist/linguist/messageeditorwidgets.cpp | 2 +- tools/linguist/linguist/messageeditorwidgets.h | 2 +- tools/linguist/linguist/messagehighlighter.cpp | 2 +- tools/linguist/linguist/messagehighlighter.h | 2 +- tools/linguist/linguist/messagemodel.cpp | 2 +- tools/linguist/linguist/messagemodel.h | 2 +- tools/linguist/linguist/phrase.cpp | 2 +- tools/linguist/linguist/phrase.h | 2 +- tools/linguist/linguist/phrasebookbox.cpp | 2 +- tools/linguist/linguist/phrasebookbox.h | 2 +- tools/linguist/linguist/phrasebookbox.ui | 2 +- tools/linguist/linguist/phrasemodel.cpp | 2 +- tools/linguist/linguist/phrasemodel.h | 2 +- tools/linguist/linguist/phraseview.cpp | 2 +- tools/linguist/linguist/phraseview.h | 2 +- tools/linguist/linguist/printout.cpp | 2 +- tools/linguist/linguist/printout.h | 2 +- tools/linguist/linguist/recentfiles.cpp | 2 +- tools/linguist/linguist/recentfiles.h | 2 +- tools/linguist/linguist/sourcecodeview.cpp | 2 +- tools/linguist/linguist/sourcecodeview.h | 2 +- tools/linguist/linguist/statistics.cpp | 2 +- tools/linguist/linguist/statistics.h | 2 +- tools/linguist/linguist/statistics.ui | 2 +- tools/linguist/linguist/translatedialog.cpp | 2 +- tools/linguist/linguist/translatedialog.h | 2 +- tools/linguist/linguist/translatedialog.ui | 2 +- tools/linguist/linguist/translationsettingsdialog.cpp | 2 +- tools/linguist/linguist/translationsettingsdialog.h | 2 +- tools/linguist/lrelease/lrelease.1 | 2 +- tools/linguist/lrelease/main.cpp | 2 +- tools/linguist/lupdate/cpp.cpp | 2 +- tools/linguist/lupdate/java.cpp | 2 +- tools/linguist/lupdate/lupdate.1 | 2 +- tools/linguist/lupdate/lupdate.h | 2 +- tools/linguist/lupdate/main.cpp | 2 +- tools/linguist/lupdate/merge.cpp | 2 +- tools/linguist/lupdate/qscript.cpp | 2 +- tools/linguist/lupdate/qscript.g | 2 +- tools/linguist/lupdate/ui.cpp | 2 +- tools/linguist/shared/abstractproitemvisitor.h | 2 +- tools/linguist/shared/numerus.cpp | 2 +- tools/linguist/shared/po.cpp | 2 +- tools/linguist/shared/profileevaluator.cpp | 2 +- tools/linguist/shared/profileevaluator.h | 2 +- tools/linguist/shared/proitems.cpp | 2 +- tools/linguist/shared/proitems.h | 2 +- tools/linguist/shared/proparserutils.h | 2 +- tools/linguist/shared/qm.cpp | 2 +- tools/linguist/shared/qph.cpp | 2 +- tools/linguist/shared/simtexth.cpp | 2 +- tools/linguist/shared/simtexth.h | 2 +- tools/linguist/shared/translator.cpp | 2 +- tools/linguist/shared/translator.h | 2 +- tools/linguist/shared/translatormessage.cpp | 2 +- tools/linguist/shared/translatormessage.h | 2 +- tools/linguist/shared/ts.cpp | 2 +- tools/linguist/shared/xliff.cpp | 2 +- tools/linguist/tests/data/main.cpp | 2 +- tools/linguist/tests/tst_linguist.cpp | 2 +- tools/linguist/tests/tst_linguist.h | 2 +- tools/linguist/tests/tst_lupdate.cpp | 2 +- tools/linguist/tests/tst_simtexth.cpp | 2 +- tools/macdeployqt/macchangeqt/main.cpp | 2 +- tools/macdeployqt/macdeployqt/main.cpp | 2 +- tools/macdeployqt/shared/shared.cpp | 2 +- tools/macdeployqt/shared/shared.h | 2 +- tools/macdeployqt/tests/tst_deployment_mac.cpp | 2 +- tools/makeqpf/main.cpp | 2 +- tools/makeqpf/mainwindow.cpp | 2 +- tools/makeqpf/mainwindow.h | 2 +- tools/makeqpf/qpf2.cpp | 2 +- tools/makeqpf/qpf2.h | 2 +- tools/pixeltool/main.cpp | 2 +- tools/pixeltool/qpixeltool.cpp | 2 +- tools/pixeltool/qpixeltool.h | 2 +- tools/porting/src/ast.cpp | 2 +- tools/porting/src/ast.h | 2 +- tools/porting/src/codemodel.cpp | 2 +- tools/porting/src/codemodel.h | 2 +- tools/porting/src/codemodelattributes.cpp | 2 +- tools/porting/src/codemodelattributes.h | 2 +- tools/porting/src/codemodelwalker.cpp | 2 +- tools/porting/src/codemodelwalker.h | 2 +- tools/porting/src/cpplexer.cpp | 2 +- tools/porting/src/cpplexer.h | 2 +- tools/porting/src/errors.cpp | 2 +- tools/porting/src/errors.h | 2 +- tools/porting/src/fileporter.cpp | 2 +- tools/porting/src/fileporter.h | 2 +- tools/porting/src/filewriter.cpp | 2 +- tools/porting/src/filewriter.h | 2 +- tools/porting/src/list.h | 2 +- tools/porting/src/logger.cpp | 2 +- tools/porting/src/logger.h | 2 +- tools/porting/src/parser.cpp | 2 +- tools/porting/src/parser.h | 2 +- tools/porting/src/port.cpp | 2 +- tools/porting/src/portingrules.cpp | 2 +- tools/porting/src/portingrules.h | 2 +- tools/porting/src/preprocessorcontrol.cpp | 2 +- tools/porting/src/preprocessorcontrol.h | 2 +- tools/porting/src/projectporter.cpp | 2 +- tools/porting/src/projectporter.h | 2 +- tools/porting/src/proparser.cpp | 2 +- tools/porting/src/proparser.h | 2 +- tools/porting/src/q3porting.xml | 2 +- tools/porting/src/qtsimplexml.cpp | 2 +- tools/porting/src/qtsimplexml.h | 2 +- tools/porting/src/replacetoken.cpp | 2 +- tools/porting/src/replacetoken.h | 2 +- tools/porting/src/rpp.cpp | 2 +- tools/porting/src/rpp.h | 2 +- tools/porting/src/rppexpressionbuilder.cpp | 2 +- tools/porting/src/rppexpressionbuilder.h | 2 +- tools/porting/src/rpplexer.cpp | 2 +- tools/porting/src/rpplexer.h | 2 +- tools/porting/src/rpptreeevaluator.cpp | 2 +- tools/porting/src/rpptreeevaluator.h | 2 +- tools/porting/src/rpptreewalker.cpp | 2 +- tools/porting/src/rpptreewalker.h | 2 +- tools/porting/src/semantic.cpp | 2 +- tools/porting/src/semantic.h | 2 +- tools/porting/src/smallobject.cpp | 2 +- tools/porting/src/smallobject.h | 2 +- tools/porting/src/textreplacement.cpp | 2 +- tools/porting/src/textreplacement.h | 2 +- tools/porting/src/tokenengine.cpp | 2 +- tools/porting/src/tokenengine.h | 2 +- tools/porting/src/tokenizer.cpp | 2 +- tools/porting/src/tokenizer.h | 2 +- tools/porting/src/tokenreplacements.cpp | 2 +- tools/porting/src/tokenreplacements.h | 2 +- tools/porting/src/tokens.h | 2 +- tools/porting/src/tokenstreamadapter.h | 2 +- tools/porting/src/translationunit.cpp | 2 +- tools/porting/src/translationunit.h | 2 +- tools/porting/src/treewalker.cpp | 2 +- tools/porting/src/treewalker.h | 2 +- tools/qconfig/feature.cpp | 2 +- tools/qconfig/feature.h | 2 +- tools/qconfig/featuretreemodel.cpp | 2 +- tools/qconfig/featuretreemodel.h | 2 +- tools/qconfig/graphics.h | 2 +- tools/qconfig/main.cpp | 4 ++-- tools/qdbus/qdbus/qdbus.cpp | 2 +- tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp | 4 ++-- tools/qdbus/qdbusviewer/main.cpp | 2 +- tools/qdbus/qdbusviewer/propertydialog.cpp | 2 +- tools/qdbus/qdbusviewer/propertydialog.h | 2 +- tools/qdbus/qdbusviewer/qdbusmodel.cpp | 2 +- tools/qdbus/qdbusviewer/qdbusmodel.h | 2 +- tools/qdbus/qdbusviewer/qdbusviewer.cpp | 4 ++-- tools/qdbus/qdbusviewer/qdbusviewer.h | 2 +- tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp | 4 ++-- tools/qdoc3/apigenerator.cpp | 2 +- tools/qdoc3/apigenerator.h | 2 +- tools/qdoc3/archiveextractor.cpp | 2 +- tools/qdoc3/archiveextractor.h | 2 +- tools/qdoc3/atom.cpp | 2 +- tools/qdoc3/atom.h | 2 +- tools/qdoc3/bookgenerator.cpp | 2 +- tools/qdoc3/bookgenerator.h | 2 +- tools/qdoc3/ccodeparser.cpp | 2 +- tools/qdoc3/ccodeparser.h | 2 +- tools/qdoc3/codechunk.cpp | 2 +- tools/qdoc3/codechunk.h | 2 +- tools/qdoc3/codemarker.cpp | 2 +- tools/qdoc3/codemarker.h | 2 +- tools/qdoc3/codeparser.cpp | 2 +- tools/qdoc3/codeparser.h | 2 +- tools/qdoc3/command.cpp | 2 +- tools/qdoc3/command.h | 2 +- tools/qdoc3/config.cpp | 2 +- tools/qdoc3/config.h | 2 +- tools/qdoc3/cppcodemarker.cpp | 2 +- tools/qdoc3/cppcodemarker.h | 2 +- tools/qdoc3/cppcodeparser.cpp | 2 +- tools/qdoc3/cppcodeparser.h | 2 +- tools/qdoc3/cpptoqsconverter.cpp | 2 +- tools/qdoc3/cpptoqsconverter.h | 2 +- tools/qdoc3/dcfsection.cpp | 2 +- tools/qdoc3/dcfsection.h | 2 +- tools/qdoc3/doc.cpp | 2 +- tools/qdoc3/doc.h | 2 +- tools/qdoc3/editdistance.cpp | 2 +- tools/qdoc3/editdistance.h | 2 +- tools/qdoc3/generator.cpp | 2 +- tools/qdoc3/generator.h | 2 +- tools/qdoc3/helpprojectwriter.cpp | 2 +- tools/qdoc3/helpprojectwriter.h | 2 +- tools/qdoc3/htmlgenerator.cpp | 2 +- tools/qdoc3/htmlgenerator.h | 2 +- tools/qdoc3/jambiapiparser.cpp | 2 +- tools/qdoc3/jambiapiparser.h | 2 +- tools/qdoc3/javacodemarker.cpp | 2 +- tools/qdoc3/javacodemarker.h | 2 +- tools/qdoc3/javadocgenerator.cpp | 2 +- tools/qdoc3/javadocgenerator.h | 2 +- tools/qdoc3/linguistgenerator.cpp | 2 +- tools/qdoc3/linguistgenerator.h | 2 +- tools/qdoc3/location.cpp | 2 +- tools/qdoc3/location.h | 2 +- tools/qdoc3/loutgenerator.cpp | 2 +- tools/qdoc3/loutgenerator.h | 2 +- tools/qdoc3/main.cpp | 2 +- tools/qdoc3/mangenerator.cpp | 2 +- tools/qdoc3/mangenerator.h | 2 +- tools/qdoc3/node.cpp | 2 +- tools/qdoc3/node.h | 2 +- tools/qdoc3/openedlist.cpp | 2 +- tools/qdoc3/openedlist.h | 2 +- tools/qdoc3/pagegenerator.cpp | 2 +- tools/qdoc3/pagegenerator.h | 2 +- tools/qdoc3/plaincodemarker.cpp | 2 +- tools/qdoc3/plaincodemarker.h | 2 +- tools/qdoc3/polyarchiveextractor.cpp | 2 +- tools/qdoc3/polyarchiveextractor.h | 2 +- tools/qdoc3/polyuncompressor.cpp | 2 +- tools/qdoc3/polyuncompressor.h | 2 +- tools/qdoc3/qsakernelparser.cpp | 2 +- tools/qdoc3/qsakernelparser.h | 2 +- tools/qdoc3/qscodemarker.cpp | 2 +- tools/qdoc3/qscodemarker.h | 2 +- tools/qdoc3/qscodeparser.cpp | 2 +- tools/qdoc3/qscodeparser.h | 2 +- tools/qdoc3/quoter.cpp | 2 +- tools/qdoc3/quoter.h | 2 +- tools/qdoc3/separator.cpp | 2 +- tools/qdoc3/separator.h | 2 +- tools/qdoc3/sgmlgenerator.cpp | 2 +- tools/qdoc3/sgmlgenerator.h | 2 +- tools/qdoc3/text.cpp | 2 +- tools/qdoc3/text.h | 2 +- tools/qdoc3/tokenizer.cpp | 2 +- tools/qdoc3/tokenizer.h | 2 +- tools/qdoc3/tr.h | 2 +- tools/qdoc3/tree.cpp | 2 +- tools/qdoc3/tree.h | 2 +- tools/qdoc3/uncompressor.cpp | 2 +- tools/qdoc3/uncompressor.h | 2 +- tools/qdoc3/webxmlgenerator.cpp | 2 +- tools/qdoc3/webxmlgenerator.h | 2 +- tools/qdoc3/yyindent.cpp | 2 +- tools/qev/qev.cpp | 2 +- tools/qtconcurrent/codegenerator/example/main.cpp | 2 +- tools/qtconcurrent/codegenerator/src/codegenerator.cpp | 2 +- tools/qtconcurrent/codegenerator/src/codegenerator.h | 2 +- tools/qtconcurrent/generaterun/main.cpp | 6 +++--- tools/qtconfig/colorbutton.cpp | 2 +- tools/qtconfig/colorbutton.h | 2 +- tools/qtconfig/main.cpp | 2 +- tools/qtconfig/mainwindow.cpp | 4 ++-- tools/qtconfig/mainwindow.h | 2 +- tools/qtconfig/mainwindowbase.cpp | 2 +- tools/qtconfig/mainwindowbase.h | 2 +- tools/qtconfig/mainwindowbase.ui | 2 +- tools/qtconfig/paletteeditoradvanced.cpp | 2 +- tools/qtconfig/paletteeditoradvanced.h | 2 +- tools/qtconfig/paletteeditoradvancedbase.cpp | 2 +- tools/qtconfig/paletteeditoradvancedbase.h | 2 +- tools/qtconfig/paletteeditoradvancedbase.ui | 2 +- tools/qtconfig/previewframe.cpp | 2 +- tools/qtconfig/previewframe.h | 2 +- tools/qtconfig/previewwidget.cpp | 2 +- tools/qtconfig/previewwidget.h | 2 +- tools/qtconfig/previewwidgetbase.cpp | 2 +- tools/qtconfig/previewwidgetbase.h | 2 +- tools/qtconfig/previewwidgetbase.ui | 2 +- tools/qtestlib/updater/main.cpp | 2 +- tools/qtestlib/wince/cetcpsync/main.cpp | 2 +- tools/qtestlib/wince/cetcpsync/qtcesterconnection.cpp | 2 +- tools/qtestlib/wince/cetcpsync/qtcesterconnection.h | 2 +- tools/qtestlib/wince/cetcpsync/remoteconnection.cpp | 2 +- tools/qtestlib/wince/cetcpsync/remoteconnection.h | 2 +- tools/qtestlib/wince/cetcpsyncserver/commands.cpp | 2 +- tools/qtestlib/wince/cetcpsyncserver/commands.h | 2 +- tools/qtestlib/wince/cetcpsyncserver/connectionmanager.cpp | 2 +- tools/qtestlib/wince/cetcpsyncserver/connectionmanager.h | 2 +- tools/qtestlib/wince/cetcpsyncserver/main.cpp | 2 +- tools/qtestlib/wince/cetcpsyncserver/transfer_global.h | 2 +- tools/qtestlib/wince/cetest/activesyncconnection.cpp | 2 +- tools/qtestlib/wince/cetest/activesyncconnection.h | 2 +- tools/qtestlib/wince/cetest/cetcpsyncconnection.cpp | 2 +- tools/qtestlib/wince/cetest/cetcpsyncconnection.h | 2 +- tools/qtestlib/wince/cetest/deployment.cpp | 2 +- tools/qtestlib/wince/cetest/deployment.h | 2 +- tools/qtestlib/wince/cetest/main.cpp | 2 +- tools/qtestlib/wince/cetest/remoteconnection.cpp | 2 +- tools/qtestlib/wince/cetest/remoteconnection.h | 2 +- tools/qtestlib/wince/remotelib/commands.cpp | 2 +- tools/qtestlib/wince/remotelib/commands.h | 2 +- tools/qttracereplay/main.cpp | 2 +- tools/qvfb/config.ui | 2 +- tools/qvfb/gammaview.h | 2 +- tools/qvfb/main.cpp | 2 +- tools/qvfb/qanimationwriter.cpp | 2 +- tools/qvfb/qanimationwriter.h | 2 +- tools/qvfb/qtopiakeysym.h | 2 +- tools/qvfb/qvfb.cpp | 2 +- tools/qvfb/qvfb.h | 2 +- tools/qvfb/qvfbmmap.cpp | 2 +- tools/qvfb/qvfbmmap.h | 2 +- tools/qvfb/qvfbprotocol.cpp | 2 +- tools/qvfb/qvfbprotocol.h | 2 +- tools/qvfb/qvfbratedlg.cpp | 2 +- tools/qvfb/qvfbratedlg.h | 2 +- tools/qvfb/qvfbshmem.cpp | 2 +- tools/qvfb/qvfbshmem.h | 2 +- tools/qvfb/qvfbview.cpp | 2 +- tools/qvfb/qvfbview.h | 2 +- tools/qvfb/qvfbx11view.cpp | 2 +- tools/qvfb/qvfbx11view.h | 2 +- tools/qvfb/x11keyfaker.cpp | 2 +- tools/qvfb/x11keyfaker.h | 2 +- tools/runonphone/main.cpp | 2 +- tools/runonphone/serenum.h | 2 +- tools/runonphone/serenum_stub.cpp | 2 +- tools/runonphone/serenum_unix.cpp | 2 +- tools/runonphone/serenum_win.cpp | 2 +- tools/runonphone/symbianutils/bluetoothlistener.cpp | 2 +- tools/runonphone/symbianutils/bluetoothlistener.h | 2 +- tools/runonphone/symbianutils/bluetoothlistener_gui.cpp | 2 +- tools/runonphone/symbianutils/bluetoothlistener_gui.h | 2 +- tools/runonphone/symbianutils/callback.h | 2 +- tools/runonphone/symbianutils/communicationstarter.cpp | 2 +- tools/runonphone/symbianutils/communicationstarter.h | 2 +- tools/runonphone/symbianutils/launcher.cpp | 2 +- tools/runonphone/symbianutils/launcher.h | 2 +- tools/runonphone/symbianutils/symbiandevicemanager.cpp | 2 +- tools/runonphone/symbianutils/symbiandevicemanager.h | 2 +- tools/runonphone/symbianutils/symbianutils_global.h | 2 +- tools/runonphone/symbianutils/trkdevice.cpp | 2 +- tools/runonphone/symbianutils/trkdevice.h | 2 +- tools/runonphone/symbianutils/trkutils.cpp | 2 +- tools/runonphone/symbianutils/trkutils.h | 2 +- tools/runonphone/symbianutils/trkutils_p.h | 2 +- tools/runonphone/trksignalhandler.cpp | 2 +- tools/runonphone/trksignalhandler.h | 2 +- tools/shared/deviceskin/deviceskin.cpp | 2 +- tools/shared/deviceskin/deviceskin.h | 2 +- tools/shared/findwidget/abstractfindwidget.cpp | 2 +- tools/shared/findwidget/abstractfindwidget.h | 2 +- tools/shared/findwidget/itemviewfindwidget.cpp | 2 +- tools/shared/findwidget/itemviewfindwidget.h | 2 +- tools/shared/findwidget/texteditfindwidget.cpp | 2 +- tools/shared/findwidget/texteditfindwidget.h | 2 +- tools/shared/fontpanel/fontpanel.cpp | 2 +- tools/shared/fontpanel/fontpanel.h | 2 +- tools/shared/qtgradienteditor/qtcolorbutton.cpp | 2 +- tools/shared/qtgradienteditor/qtcolorbutton.h | 2 +- tools/shared/qtgradienteditor/qtcolorline.cpp | 2 +- tools/shared/qtgradienteditor/qtcolorline.h | 2 +- tools/shared/qtgradienteditor/qtgradientdialog.cpp | 2 +- tools/shared/qtgradienteditor/qtgradientdialog.h | 2 +- tools/shared/qtgradienteditor/qtgradientdialog.ui | 2 +- tools/shared/qtgradienteditor/qtgradienteditor.cpp | 2 +- tools/shared/qtgradienteditor/qtgradienteditor.h | 2 +- tools/shared/qtgradienteditor/qtgradienteditor.ui | 2 +- tools/shared/qtgradienteditor/qtgradientmanager.cpp | 2 +- tools/shared/qtgradienteditor/qtgradientmanager.h | 2 +- .../shared/qtgradienteditor/qtgradientstopscontroller.cpp | 2 +- tools/shared/qtgradienteditor/qtgradientstopscontroller.h | 2 +- tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp | 2 +- tools/shared/qtgradienteditor/qtgradientstopsmodel.h | 2 +- tools/shared/qtgradienteditor/qtgradientstopswidget.cpp | 2 +- tools/shared/qtgradienteditor/qtgradientstopswidget.h | 2 +- tools/shared/qtgradienteditor/qtgradientutils.cpp | 2 +- tools/shared/qtgradienteditor/qtgradientutils.h | 2 +- tools/shared/qtgradienteditor/qtgradientview.cpp | 2 +- tools/shared/qtgradienteditor/qtgradientview.h | 2 +- tools/shared/qtgradienteditor/qtgradientviewdialog.cpp | 2 +- tools/shared/qtgradienteditor/qtgradientviewdialog.h | 2 +- tools/shared/qtgradienteditor/qtgradientviewdialog.ui | 2 +- tools/shared/qtgradienteditor/qtgradientwidget.cpp | 2 +- tools/shared/qtgradienteditor/qtgradientwidget.h | 2 +- tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp | 2 +- tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h | 2 +- tools/shared/qtpropertybrowser/qteditorfactory.cpp | 2 +- tools/shared/qtpropertybrowser/qteditorfactory.h | 2 +- .../shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp | 2 +- tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h | 2 +- tools/shared/qtpropertybrowser/qtpropertybrowser.cpp | 2 +- tools/shared/qtpropertybrowser/qtpropertybrowser.h | 2 +- tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp | 2 +- tools/shared/qtpropertybrowser/qtpropertybrowserutils_p.h | 2 +- tools/shared/qtpropertybrowser/qtpropertymanager.cpp | 2 +- tools/shared/qtpropertybrowser/qtpropertymanager.h | 2 +- tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp | 2 +- tools/shared/qtpropertybrowser/qttreepropertybrowser.h | 2 +- tools/shared/qtpropertybrowser/qtvariantproperty.cpp | 2 +- tools/shared/qtpropertybrowser/qtvariantproperty.h | 2 +- tools/shared/qttoolbardialog/qttoolbardialog.cpp | 2 +- tools/shared/qttoolbardialog/qttoolbardialog.h | 2 +- tools/shared/symbian/epocroot.cpp | 2 +- tools/shared/symbian/epocroot.h | 2 +- tools/shared/windows/registry.cpp | 2 +- tools/shared/windows/registry.h | 2 +- tools/xmlpatterns/main.cpp | 2 +- tools/xmlpatterns/main.h | 2 +- tools/xmlpatterns/qapplicationargument.cpp | 2 +- tools/xmlpatterns/qapplicationargument_p.h | 2 +- tools/xmlpatterns/qapplicationargumentparser.cpp | 2 +- tools/xmlpatterns/qapplicationargumentparser_p.h | 2 +- tools/xmlpatternsvalidator/main.cpp | 2 +- tools/xmlpatternsvalidator/main.h | 2 +- translations/designer_de.ts | 2 +- translations/designer_fr.ts | 4 ++-- translations/designer_ja.ts | 4 ++-- translations/designer_pl.ts | 2 +- translations/designer_ru.ts | 4 ++-- translations/designer_sl.ts | 2 +- translations/designer_zh_CN.ts | 2 +- translations/designer_zh_TW.ts | 4 ++-- translations/linguist_de.ts | 2 +- translations/linguist_fr.ts | 2 +- translations/linguist_ja.ts | 8 ++++---- translations/linguist_pl.ts | 2 +- translations/linguist_ru.ts | 4 ++-- translations/linguist_zh_CN.ts | 4 ++-- translations/linguist_zh_TW.ts | 8 ++++---- translations/qt_ar.ts | 2 +- translations/qt_da.ts | 2 +- translations/qt_de.ts | 2 +- translations/qt_es.ts | 2 +- translations/qt_fr.ts | 2 +- translations/qt_he.ts | 2 +- translations/qt_ja_JP.ts | 4 ++-- translations/qt_pl.ts | 2 +- translations/qt_pt.ts | 2 +- translations/qt_ru.ts | 4 ++-- translations/qt_sk.ts | 2 +- translations/qt_sl.ts | 2 +- translations/qt_sv.ts | 2 +- translations/qt_uk.ts | 2 +- translations/qt_zh_CN.ts | 2 +- translations/qt_zh_TW.ts | 2 +- translations/qtconfig_pl.ts | 2 +- translations/qtconfig_ru.ts | 4 ++-- translations/qtconfig_zh_CN.ts | 2 +- translations/qtconfig_zh_TW.ts | 2 +- util/fixnonlatin1/main.cpp | 2 +- util/gencmap/gencmap.cpp | 2 +- util/lexgen/configfile.cpp | 2 +- util/lexgen/configfile.h | 2 +- util/lexgen/generator.cpp | 2 +- util/lexgen/generator.h | 2 +- util/lexgen/global.h | 2 +- util/lexgen/main.cpp | 2 +- util/lexgen/nfa.cpp | 2 +- util/lexgen/nfa.h | 2 +- util/lexgen/re2nfa.cpp | 2 +- util/lexgen/re2nfa.h | 2 +- util/lexgen/tests/tst_lexgen.cpp | 2 +- util/lexgen/tokenizer.cpp | 2 +- util/local_database/cldr2qlocalexml.py | 2 +- util/local_database/enumdata.py | 2 +- util/local_database/qlocalexml2cpp.py | 2 +- util/local_database/testlocales/localemodel.cpp | 2 +- util/local_database/testlocales/localemodel.h | 2 +- util/local_database/testlocales/localewidget.cpp | 2 +- util/local_database/testlocales/localewidget.h | 2 +- util/local_database/testlocales/main.cpp | 2 +- util/local_database/xpathlite.py | 2 +- util/normalize/main.cpp | 2 +- util/plugintest/main.cpp | 2 +- util/qlalr/compress.cpp | 2 +- util/qlalr/compress.h | 2 +- util/qlalr/cppgenerator.cpp | 4 ++-- util/qlalr/cppgenerator.h | 2 +- util/qlalr/doc/src/qlalr.qdoc | 2 +- util/qlalr/dotgraph.cpp | 2 +- util/qlalr/dotgraph.h | 2 +- util/qlalr/examples/dummy-xml/ll/dummy-xml-ll.cpp | 2 +- util/qlalr/examples/dummy-xml/xml.g | 2 +- util/qlalr/examples/glsl/build.sh | 2 +- util/qlalr/examples/glsl/glsl-lex.l | 2 +- util/qlalr/examples/glsl/glsl.g | 2 +- util/qlalr/examples/lambda/lambda.g | 2 +- util/qlalr/examples/lambda/main.cpp | 2 +- util/qlalr/examples/qparser/calc.g | 2 +- util/qlalr/examples/qparser/calc.l | 2 +- util/qlalr/examples/qparser/qparser.cpp | 2 +- util/qlalr/examples/qparser/qparser.h | 2 +- util/qlalr/grammar.cpp | 2 +- util/qlalr/grammar_p.h | 2 +- util/qlalr/lalr.cpp | 2 +- util/qlalr/lalr.g | 6 +++--- util/qlalr/lalr.h | 2 +- util/qlalr/main.cpp | 2 +- util/qlalr/parsetable.cpp | 2 +- util/qlalr/parsetable.h | 2 +- util/qlalr/recognizer.cpp | 2 +- util/qlalr/recognizer.h | 2 +- util/s60pixelmetrics/bld.inf | 2 +- util/s60pixelmetrics/pixel_metrics.cpp | 2 +- util/s60pixelmetrics/pixel_metrics.h | 2 +- util/s60pixelmetrics/pm_mapper.hrh | 2 +- util/s60pixelmetrics/pm_mapper.mmp | 2 +- util/s60pixelmetrics/pm_mapper.pkg | 2 +- util/s60pixelmetrics/pm_mapper.rss | 2 +- util/s60pixelmetrics/pm_mapper_reg.rss | 2 +- util/s60pixelmetrics/pm_mapperapp.cpp | 2 +- util/s60pixelmetrics/pm_mapperapp.h | 2 +- util/s60pixelmetrics/pm_mapperview.cpp | 2 +- util/s60pixelmetrics/pm_mapperview.h | 2 +- util/s60theme/main.cpp | 2 +- util/s60theme/s60themeconvert.cpp | 2 +- util/s60theme/s60themeconvert.h | 2 +- util/scripts/make_qfeatures_dot_h | 4 ++-- util/unicode/codecs/big5/main.cpp | 2 +- util/unicode/main.cpp | 4 ++-- util/unicode/writingSystems.sh | 2 +- util/xkbdatagen/main.cpp | 4 ++-- 8990 files changed, 9063 insertions(+), 9063 deletions(-) diff --git a/LICENSE.LGPL b/LICENSE.LGPL index 170f02d..a0e8eb8 100644 --- a/LICENSE.LGPL +++ b/LICENSE.LGPL @@ -1,6 +1,6 @@ GNU LESSER GENERAL PUBLIC LICENSE - The Qt GUI Toolkit is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + The Qt GUI Toolkit is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). Contact: Nokia Corporation (qt-info@nokia.com) You may use, distribute and copy the Qt GUI Toolkit under the terms of diff --git a/bin/createpackage.bat b/bin/createpackage.bat index 3960d13..a946278 100755 --- a/bin/createpackage.bat +++ b/bin/createpackage.bat @@ -1,6 +1,6 @@ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: -:: Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +:: Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). :: All rights reserved. :: Contact: Nokia Corporation (qt-info@nokia.com) :: diff --git a/bin/createpackage.pl b/bin/createpackage.pl index 7f803fd..430e6d4 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl ############################################################################# ## -## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## Contact: Nokia Corporation (qt-info@nokia.com) ## diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl index f82c48f..5bb744f 100755 --- a/bin/patch_capabilities.pl +++ b/bin/patch_capabilities.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl ############################################################################# ## -## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## Contact: Nokia Corporation (qt-info@nokia.com) ## diff --git a/bin/setcepaths.bat b/bin/setcepaths.bat index bbabfee..139ea68 100755 --- a/bin/setcepaths.bat +++ b/bin/setcepaths.bat @@ -1,6 +1,6 @@ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: -:: Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +:: Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). :: All rights reserved. :: Contact: Nokia Corporation (qt-info@nokia.com) :: diff --git a/bin/syncqt b/bin/syncqt index cee5398..581157f 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -3,7 +3,7 @@ # # Synchronizes Qt header files - internal development tool. # -# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). # Contact: Nokia Corporation (qt-info@nokia.com) # ###################################################################### diff --git a/bin/syncqt.bat b/bin/syncqt.bat index bd89c2c..dd0da87 100755 --- a/bin/syncqt.bat +++ b/bin/syncqt.bat @@ -1,6 +1,6 @@ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: -:: Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +:: Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). :: All rights reserved. :: Contact: Nokia Corporation (qt-info@nokia.com) :: diff --git a/config.tests/mac/crc/main.cpp b/config.tests/mac/crc/main.cpp index 69270f0..8d44e0a 100644 --- a/config.tests/mac/crc/main.cpp +++ b/config.tests/mac/crc/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/mac/xcodeversion.cpp b/config.tests/mac/xcodeversion.cpp index f41acce..dc7e5fc 100644 --- a/config.tests/mac/xcodeversion.cpp +++ b/config.tests/mac/xcodeversion.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/qws/ahi/ahi.cpp b/config.tests/qws/ahi/ahi.cpp index f368722..330d28b 100644 --- a/config.tests/qws/ahi/ahi.cpp +++ b/config.tests/qws/ahi/ahi.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/qws/directfb/directfb.cpp b/config.tests/qws/directfb/directfb.cpp index afdf563..df6576b 100644 --- a/config.tests/qws/directfb/directfb.cpp +++ b/config.tests/qws/directfb/directfb.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/qws/sound/sound.cpp b/config.tests/qws/sound/sound.cpp index d4c132f..2a5d24d 100644 --- a/config.tests/qws/sound/sound.cpp +++ b/config.tests/qws/sound/sound.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/qws/svgalib/svgalib.cpp b/config.tests/qws/svgalib/svgalib.cpp index f678a69..985c9ae 100644 --- a/config.tests/qws/svgalib/svgalib.cpp +++ b/config.tests/qws/svgalib/svgalib.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/3dnow/3dnow.cpp b/config.tests/unix/3dnow/3dnow.cpp index 0516fbc..a56e209 100644 --- a/config.tests/unix/3dnow/3dnow.cpp +++ b/config.tests/unix/3dnow/3dnow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/alsa/alsatest.cpp b/config.tests/unix/alsa/alsatest.cpp index 566b625..d3292f6 100644 --- a/config.tests/unix/alsa/alsatest.cpp +++ b/config.tests/unix/alsa/alsatest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/clock-gettime/clock-gettime.cpp b/config.tests/unix/clock-gettime/clock-gettime.cpp index 096f41c..52696f1 100644 --- a/config.tests/unix/clock-gettime/clock-gettime.cpp +++ b/config.tests/unix/clock-gettime/clock-gettime.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/clock-monotonic/clock-monotonic.cpp b/config.tests/unix/clock-monotonic/clock-monotonic.cpp index 03244d1..ec045aa 100644 --- a/config.tests/unix/clock-monotonic/clock-monotonic.cpp +++ b/config.tests/unix/clock-monotonic/clock-monotonic.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/cups/cups.cpp b/config.tests/unix/cups/cups.cpp index 2f17c1c..09b8edf 100644 --- a/config.tests/unix/cups/cups.cpp +++ b/config.tests/unix/cups/cups.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/db2/db2.cpp b/config.tests/unix/db2/db2.cpp index c7cf551..e03712c 100644 --- a/config.tests/unix/db2/db2.cpp +++ b/config.tests/unix/db2/db2.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/dbus/dbus.cpp b/config.tests/unix/dbus/dbus.cpp index aca2b20..88e8a5e 100644 --- a/config.tests/unix/dbus/dbus.cpp +++ b/config.tests/unix/dbus/dbus.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/doubleformat/doubleformattest.cpp b/config.tests/unix/doubleformat/doubleformattest.cpp index 8e83251..f28d5c6a 100644 --- a/config.tests/unix/doubleformat/doubleformattest.cpp +++ b/config.tests/unix/doubleformat/doubleformattest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/egl/egl.cpp b/config.tests/unix/egl/egl.cpp index b03c173..db6956a 100644 --- a/config.tests/unix/egl/egl.cpp +++ b/config.tests/unix/egl/egl.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/egl4gles1/egl4gles1.cpp b/config.tests/unix/egl4gles1/egl4gles1.cpp index 0024fb5..e146680 100644 --- a/config.tests/unix/egl4gles1/egl4gles1.cpp +++ b/config.tests/unix/egl4gles1/egl4gles1.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/endian/endiantest.cpp b/config.tests/unix/endian/endiantest.cpp index 907056e..296f890 100644 --- a/config.tests/unix/endian/endiantest.cpp +++ b/config.tests/unix/endian/endiantest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/floatmath/floatmath.cpp b/config.tests/unix/floatmath/floatmath.cpp index 3d57636..e076a5c 100644 --- a/config.tests/unix/floatmath/floatmath.cpp +++ b/config.tests/unix/floatmath/floatmath.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/freetype/freetype.cpp b/config.tests/unix/freetype/freetype.cpp index e0963b2..3c157e1 100644 --- a/config.tests/unix/freetype/freetype.cpp +++ b/config.tests/unix/freetype/freetype.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/getaddrinfo/getaddrinfotest.cpp b/config.tests/unix/getaddrinfo/getaddrinfotest.cpp index 0c482cc..901a6e2 100644 --- a/config.tests/unix/getaddrinfo/getaddrinfotest.cpp +++ b/config.tests/unix/getaddrinfo/getaddrinfotest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/getifaddrs/getifaddrs.cpp b/config.tests/unix/getifaddrs/getifaddrs.cpp index e545e90..f8cdf0a 100644 --- a/config.tests/unix/getifaddrs/getifaddrs.cpp +++ b/config.tests/unix/getifaddrs/getifaddrs.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/glib/glib.cpp b/config.tests/unix/glib/glib.cpp index 084e5b2..6784454 100644 --- a/config.tests/unix/glib/glib.cpp +++ b/config.tests/unix/glib/glib.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp b/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp index 5569651..722522d 100644 --- a/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp +++ b/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/gstreamer/gstreamer.cpp b/config.tests/unix/gstreamer/gstreamer.cpp index 55e4bd6..43d9b98 100644 --- a/config.tests/unix/gstreamer/gstreamer.cpp +++ b/config.tests/unix/gstreamer/gstreamer.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/ibase/ibase.cpp b/config.tests/unix/ibase/ibase.cpp index b83428e..aaba0f9 100644 --- a/config.tests/unix/ibase/ibase.cpp +++ b/config.tests/unix/ibase/ibase.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/iconv/iconv.cpp b/config.tests/unix/iconv/iconv.cpp index e6d79a5..568b6bd 100644 --- a/config.tests/unix/iconv/iconv.cpp +++ b/config.tests/unix/iconv/iconv.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/inotify/inotifytest.cpp b/config.tests/unix/inotify/inotifytest.cpp index 92523fc..a08df3f 100644 --- a/config.tests/unix/inotify/inotifytest.cpp +++ b/config.tests/unix/inotify/inotifytest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/iodbc/iodbc.cpp b/config.tests/unix/iodbc/iodbc.cpp index c50efa6..6b4cc3d 100644 --- a/config.tests/unix/iodbc/iodbc.cpp +++ b/config.tests/unix/iodbc/iodbc.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/ipv6/ipv6test.cpp b/config.tests/unix/ipv6/ipv6test.cpp index 4fb27f2..ad85b13 100644 --- a/config.tests/unix/ipv6/ipv6test.cpp +++ b/config.tests/unix/ipv6/ipv6test.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/ipv6ifname/ipv6ifname.cpp b/config.tests/unix/ipv6ifname/ipv6ifname.cpp index 4f592b3..7bde426 100644 --- a/config.tests/unix/ipv6ifname/ipv6ifname.cpp +++ b/config.tests/unix/ipv6ifname/ipv6ifname.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/iwmmxt/iwmmxt.cpp b/config.tests/unix/iwmmxt/iwmmxt.cpp index 0066490..25d042a 100644 --- a/config.tests/unix/iwmmxt/iwmmxt.cpp +++ b/config.tests/unix/iwmmxt/iwmmxt.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/javascriptcore-jit/hwcap_test.cpp b/config.tests/unix/javascriptcore-jit/hwcap_test.cpp index ca488a6..0ee717a 100644 --- a/config.tests/unix/javascriptcore-jit/hwcap_test.cpp +++ b/config.tests/unix/javascriptcore-jit/hwcap_test.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/largefile/largefiletest.cpp b/config.tests/unix/largefile/largefiletest.cpp index bf25de9..a2b9466 100644 --- a/config.tests/unix/largefile/largefiletest.cpp +++ b/config.tests/unix/largefile/largefiletest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/libjpeg/libjpeg.cpp b/config.tests/unix/libjpeg/libjpeg.cpp index b2b77e0..efff11c 100644 --- a/config.tests/unix/libjpeg/libjpeg.cpp +++ b/config.tests/unix/libjpeg/libjpeg.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/libmng/libmng.cpp b/config.tests/unix/libmng/libmng.cpp index e4b6dcd..d3c0f68 100644 --- a/config.tests/unix/libmng/libmng.cpp +++ b/config.tests/unix/libmng/libmng.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/libpng/libpng.cpp b/config.tests/unix/libpng/libpng.cpp index 174293c..835e99f 100644 --- a/config.tests/unix/libpng/libpng.cpp +++ b/config.tests/unix/libpng/libpng.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/libtiff/libtiff.cpp b/config.tests/unix/libtiff/libtiff.cpp index 115b332..cad731d 100644 --- a/config.tests/unix/libtiff/libtiff.cpp +++ b/config.tests/unix/libtiff/libtiff.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/mmx/mmx.cpp b/config.tests/unix/mmx/mmx.cpp index d91f184..25dc64d 100644 --- a/config.tests/unix/mmx/mmx.cpp +++ b/config.tests/unix/mmx/mmx.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/mremap/mremap.cpp b/config.tests/unix/mremap/mremap.cpp index 28b42f9..8fdc9a4 100644 --- a/config.tests/unix/mremap/mremap.cpp +++ b/config.tests/unix/mremap/mremap.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/mysql/mysql.cpp b/config.tests/unix/mysql/mysql.cpp index 8073cdb..457f93d 100644 --- a/config.tests/unix/mysql/mysql.cpp +++ b/config.tests/unix/mysql/mysql.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/neon/neon.cpp b/config.tests/unix/neon/neon.cpp index 9e4dc20..d868197 100644 --- a/config.tests/unix/neon/neon.cpp +++ b/config.tests/unix/neon/neon.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/nis/nis.cpp b/config.tests/unix/nis/nis.cpp index fead9fd..ccbd88b 100644 --- a/config.tests/unix/nis/nis.cpp +++ b/config.tests/unix/nis/nis.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/oci/oci.cpp b/config.tests/unix/oci/oci.cpp index 0e7eb2a..37821a2 100644 --- a/config.tests/unix/oci/oci.cpp +++ b/config.tests/unix/oci/oci.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/odbc/odbc.cpp b/config.tests/unix/odbc/odbc.cpp index 32602c0..ee63ebd 100644 --- a/config.tests/unix/odbc/odbc.cpp +++ b/config.tests/unix/odbc/odbc.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/opengles1/opengles1.cpp b/config.tests/unix/opengles1/opengles1.cpp index 85312a5..caef9a9 100644 --- a/config.tests/unix/opengles1/opengles1.cpp +++ b/config.tests/unix/opengles1/opengles1.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/opengles1cl/opengles1cl.cpp b/config.tests/unix/opengles1cl/opengles1cl.cpp index 4f27c75..2f1a0c0 100644 --- a/config.tests/unix/opengles1cl/opengles1cl.cpp +++ b/config.tests/unix/opengles1cl/opengles1cl.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/opengles2/opengles2.cpp b/config.tests/unix/opengles2/opengles2.cpp index b75e333..caf02e6 100644 --- a/config.tests/unix/opengles2/opengles2.cpp +++ b/config.tests/unix/opengles2/opengles2.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/openssl/openssl.cpp b/config.tests/unix/openssl/openssl.cpp index 6cff58b..39f59b2 100644 --- a/config.tests/unix/openssl/openssl.cpp +++ b/config.tests/unix/openssl/openssl.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/openvg/openvg.cpp b/config.tests/unix/openvg/openvg.cpp index fe4de70..6cf0472 100644 --- a/config.tests/unix/openvg/openvg.cpp +++ b/config.tests/unix/openvg/openvg.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/psql/psql.cpp b/config.tests/unix/psql/psql.cpp index 9d1b0d1..3292442 100644 --- a/config.tests/unix/psql/psql.cpp +++ b/config.tests/unix/psql/psql.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/ptrsize/ptrsizetest.cpp b/config.tests/unix/ptrsize/ptrsizetest.cpp index bcd199f..d24799d 100644 --- a/config.tests/unix/ptrsize/ptrsizetest.cpp +++ b/config.tests/unix/ptrsize/ptrsizetest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/shivavg/shivavg.cpp b/config.tests/unix/shivavg/shivavg.cpp index eae6608..65c0fee 100644 --- a/config.tests/unix/shivavg/shivavg.cpp +++ b/config.tests/unix/shivavg/shivavg.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/sqlite/sqlite.cpp b/config.tests/unix/sqlite/sqlite.cpp index 4890c5f..ac35001 100644 --- a/config.tests/unix/sqlite/sqlite.cpp +++ b/config.tests/unix/sqlite/sqlite.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/sqlite2/sqlite2.cpp b/config.tests/unix/sqlite2/sqlite2.cpp index 8fd0e1f..e5d9d04 100644 --- a/config.tests/unix/sqlite2/sqlite2.cpp +++ b/config.tests/unix/sqlite2/sqlite2.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/sse/sse.cpp b/config.tests/unix/sse/sse.cpp index d8683da..e130a83 100644 --- a/config.tests/unix/sse/sse.cpp +++ b/config.tests/unix/sse/sse.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/sse2/sse2.cpp b/config.tests/unix/sse2/sse2.cpp index a48e2ce..255854f 100644 --- a/config.tests/unix/sse2/sse2.cpp +++ b/config.tests/unix/sse2/sse2.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/stdint/main.cpp b/config.tests/unix/stdint/main.cpp index 846e2d2..eeaa814 100644 --- a/config.tests/unix/stdint/main.cpp +++ b/config.tests/unix/stdint/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/stl/stltest.cpp b/config.tests/unix/stl/stltest.cpp index ff9b8f9..089bf90 100644 --- a/config.tests/unix/stl/stltest.cpp +++ b/config.tests/unix/stl/stltest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/tds/tds.cpp b/config.tests/unix/tds/tds.cpp index 50a3fb2..4705e28 100644 --- a/config.tests/unix/tds/tds.cpp +++ b/config.tests/unix/tds/tds.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/tslib/tslib.cpp b/config.tests/unix/tslib/tslib.cpp index 4da32fe..1aecf65 100644 --- a/config.tests/unix/tslib/tslib.cpp +++ b/config.tests/unix/tslib/tslib.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/unix/zlib/zlib.cpp b/config.tests/unix/zlib/zlib.cpp index 86c2b6b..c4dc663 100644 --- a/config.tests/unix/zlib/zlib.cpp +++ b/config.tests/unix/zlib/zlib.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/fontconfig/fontconfig.cpp b/config.tests/x11/fontconfig/fontconfig.cpp index 85dbc73..0e856de 100644 --- a/config.tests/x11/fontconfig/fontconfig.cpp +++ b/config.tests/x11/fontconfig/fontconfig.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/glxfbconfig/glxfbconfig.cpp b/config.tests/x11/glxfbconfig/glxfbconfig.cpp index 4a4b23a..f111784 100644 --- a/config.tests/x11/glxfbconfig/glxfbconfig.cpp +++ b/config.tests/x11/glxfbconfig/glxfbconfig.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/mitshm/mitshm.cpp b/config.tests/x11/mitshm/mitshm.cpp index d78cadd..de80e3a 100644 --- a/config.tests/x11/mitshm/mitshm.cpp +++ b/config.tests/x11/mitshm/mitshm.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/notype/notypetest.cpp b/config.tests/x11/notype/notypetest.cpp index b1e0583..4002313 100644 --- a/config.tests/x11/notype/notypetest.cpp +++ b/config.tests/x11/notype/notypetest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/opengl/opengl.cpp b/config.tests/x11/opengl/opengl.cpp index 3802365..527e28d 100644 --- a/config.tests/x11/opengl/opengl.cpp +++ b/config.tests/x11/opengl/opengl.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/sm/sm.cpp b/config.tests/x11/sm/sm.cpp index dec4020..6dd8183 100644 --- a/config.tests/x11/sm/sm.cpp +++ b/config.tests/x11/sm/sm.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/xcursor/xcursor.cpp b/config.tests/x11/xcursor/xcursor.cpp index 9a810bf..f979b7b 100644 --- a/config.tests/x11/xcursor/xcursor.cpp +++ b/config.tests/x11/xcursor/xcursor.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/xfixes/xfixes.cpp b/config.tests/x11/xfixes/xfixes.cpp index 930caa8..afa54bd 100644 --- a/config.tests/x11/xfixes/xfixes.cpp +++ b/config.tests/x11/xfixes/xfixes.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/xinerama/xinerama.cpp b/config.tests/x11/xinerama/xinerama.cpp index cae7987..d686d99 100644 --- a/config.tests/x11/xinerama/xinerama.cpp +++ b/config.tests/x11/xinerama/xinerama.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/xinput/xinput.cpp b/config.tests/x11/xinput/xinput.cpp index 9532472..92a3d41 100644 --- a/config.tests/x11/xinput/xinput.cpp +++ b/config.tests/x11/xinput/xinput.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/xkb/xkb.cpp b/config.tests/x11/xkb/xkb.cpp index f9f98c4..84e272e 100644 --- a/config.tests/x11/xkb/xkb.cpp +++ b/config.tests/x11/xkb/xkb.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/xlib/xlib.cpp b/config.tests/x11/xlib/xlib.cpp index 07a931a..234b221 100644 --- a/config.tests/x11/xlib/xlib.cpp +++ b/config.tests/x11/xlib/xlib.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/xrandr/xrandr.cpp b/config.tests/x11/xrandr/xrandr.cpp index fa5f869..0c93f01 100644 --- a/config.tests/x11/xrandr/xrandr.cpp +++ b/config.tests/x11/xrandr/xrandr.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/xrender/xrender.cpp b/config.tests/x11/xrender/xrender.cpp index 3f532c1..d99f9c2 100644 --- a/config.tests/x11/xrender/xrender.cpp +++ b/config.tests/x11/xrender/xrender.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/xshape/xshape.cpp b/config.tests/x11/xshape/xshape.cpp index 08d74cb..1b3972c 100644 --- a/config.tests/x11/xshape/xshape.cpp +++ b/config.tests/x11/xshape/xshape.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/config.tests/x11/xsync/xsync.cpp b/config.tests/x11/xsync/xsync.cpp index 9d3818b..795eef2 100644 --- a/config.tests/x11/xsync/xsync.cpp +++ b/config.tests/x11/xsync/xsync.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/configure b/configure index f3420c8..6d0c841 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #!/bin/sh ############################################################################# ## -## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## Contact: Nokia Corporation (qt-info@nokia.com) ## diff --git a/demos/affine/main.cpp b/demos/affine/main.cpp index 85da546..24dd65c 100644 --- a/demos/affine/main.cpp +++ b/demos/affine/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/affine/xform.cpp b/demos/affine/xform.cpp index 0d9422c..724b640 100644 --- a/demos/affine/xform.cpp +++ b/demos/affine/xform.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/affine/xform.h b/demos/affine/xform.h index 5966157..80e672b 100644 --- a/demos/affine/xform.h +++ b/demos/affine/xform.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/arthurplugin/plugin.cpp b/demos/arthurplugin/plugin.cpp index 2096895..336e88d 100644 --- a/demos/arthurplugin/plugin.cpp +++ b/demos/arthurplugin/plugin.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/books/bookdelegate.cpp b/demos/books/bookdelegate.cpp index f44fbe4..eb5d95b 100644 --- a/demos/books/bookdelegate.cpp +++ b/demos/books/bookdelegate.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/books/bookdelegate.h b/demos/books/bookdelegate.h index 4e9f462..bb1d824 100644 --- a/demos/books/bookdelegate.h +++ b/demos/books/bookdelegate.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/books/bookwindow.cpp b/demos/books/bookwindow.cpp index 089d5e0..14bc388 100644 --- a/demos/books/bookwindow.cpp +++ b/demos/books/bookwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/books/bookwindow.h b/demos/books/bookwindow.h index a6b3f5f..96545d7 100644 --- a/demos/books/bookwindow.h +++ b/demos/books/bookwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/books/initdb.h b/demos/books/initdb.h index aa64959..5351ad5 100644 --- a/demos/books/initdb.h +++ b/demos/books/initdb.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/books/main.cpp b/demos/books/main.cpp index 7fd0bae..3481c9a 100644 --- a/demos/books/main.cpp +++ b/demos/books/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/basic.fsh b/demos/boxes/basic.fsh index 0ba381d..175b718 100644 --- a/demos/boxes/basic.fsh +++ b/demos/boxes/basic.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/basic.vsh b/demos/boxes/basic.vsh index 6ead8ce..989b571 100644 --- a/demos/boxes/basic.vsh +++ b/demos/boxes/basic.vsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/dotted.fsh b/demos/boxes/dotted.fsh index eb3497c..8f4621d 100644 --- a/demos/boxes/dotted.fsh +++ b/demos/boxes/dotted.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/fresnel.fsh b/demos/boxes/fresnel.fsh index 38ce69a..02d6b0c 100644 --- a/demos/boxes/fresnel.fsh +++ b/demos/boxes/fresnel.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/glass.fsh b/demos/boxes/glass.fsh index 100a94d..9dad845 100644 --- a/demos/boxes/glass.fsh +++ b/demos/boxes/glass.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/glbuffers.cpp b/demos/boxes/glbuffers.cpp index 694d05b..c27a765 100644 --- a/demos/boxes/glbuffers.cpp +++ b/demos/boxes/glbuffers.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/glbuffers.h b/demos/boxes/glbuffers.h index 67a4ea6..d874af7 100644 --- a/demos/boxes/glbuffers.h +++ b/demos/boxes/glbuffers.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/glextensions.cpp b/demos/boxes/glextensions.cpp index f7feb5e..1021594 100644 --- a/demos/boxes/glextensions.cpp +++ b/demos/boxes/glextensions.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/glextensions.h b/demos/boxes/glextensions.h index afeb90d..342e5d8 100644 --- a/demos/boxes/glextensions.h +++ b/demos/boxes/glextensions.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/gltrianglemesh.h b/demos/boxes/gltrianglemesh.h index 4c5beba..d0afa35 100644 --- a/demos/boxes/gltrianglemesh.h +++ b/demos/boxes/gltrianglemesh.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/granite.fsh b/demos/boxes/granite.fsh index 5e808f2..025153b 100644 --- a/demos/boxes/granite.fsh +++ b/demos/boxes/granite.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/main.cpp b/demos/boxes/main.cpp index 6280dc0..568031e 100644 --- a/demos/boxes/main.cpp +++ b/demos/boxes/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/marble.fsh b/demos/boxes/marble.fsh index e5b57e0..fbd1f5c 100644 --- a/demos/boxes/marble.fsh +++ b/demos/boxes/marble.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/qtbox.cpp b/demos/boxes/qtbox.cpp index 3aaf985..f761b52 100644 --- a/demos/boxes/qtbox.cpp +++ b/demos/boxes/qtbox.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/qtbox.h b/demos/boxes/qtbox.h index 5bda7d1..71c1304 100644 --- a/demos/boxes/qtbox.h +++ b/demos/boxes/qtbox.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/reflection.fsh b/demos/boxes/reflection.fsh index f9c1170..50b0a4a 100644 --- a/demos/boxes/reflection.fsh +++ b/demos/boxes/reflection.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/refraction.fsh b/demos/boxes/refraction.fsh index 74700e9..c846d6a 100644 --- a/demos/boxes/refraction.fsh +++ b/demos/boxes/refraction.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/roundedbox.cpp b/demos/boxes/roundedbox.cpp index 4a3fd96..913cc54 100644 --- a/demos/boxes/roundedbox.cpp +++ b/demos/boxes/roundedbox.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/roundedbox.h b/demos/boxes/roundedbox.h index 508df75..a19f1a3 100644 --- a/demos/boxes/roundedbox.h +++ b/demos/boxes/roundedbox.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/scene.cpp b/demos/boxes/scene.cpp index 97953f2..9b94dc0 100644 --- a/demos/boxes/scene.cpp +++ b/demos/boxes/scene.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/scene.h b/demos/boxes/scene.h index 79daea9..d1c6526 100644 --- a/demos/boxes/scene.h +++ b/demos/boxes/scene.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/trackball.cpp b/demos/boxes/trackball.cpp index 7bfbf6f..8a6a014 100644 --- a/demos/boxes/trackball.cpp +++ b/demos/boxes/trackball.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/trackball.h b/demos/boxes/trackball.h index ba233e7..e43b00d 100644 --- a/demos/boxes/trackball.h +++ b/demos/boxes/trackball.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/boxes/wood.fsh b/demos/boxes/wood.fsh index c7bd4fc..8e47b69 100644 --- a/demos/boxes/wood.fsh +++ b/demos/boxes/wood.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/autosaver.cpp b/demos/browser/autosaver.cpp index 380eef8..1691471 100644 --- a/demos/browser/autosaver.cpp +++ b/demos/browser/autosaver.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/autosaver.h b/demos/browser/autosaver.h index be7fefa..2485cd3 100644 --- a/demos/browser/autosaver.h +++ b/demos/browser/autosaver.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/bookmarks.cpp b/demos/browser/bookmarks.cpp index 48fb148..730e35b 100644 --- a/demos/browser/bookmarks.cpp +++ b/demos/browser/bookmarks.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/bookmarks.h b/demos/browser/bookmarks.h index 167d405..d990430 100644 --- a/demos/browser/bookmarks.h +++ b/demos/browser/bookmarks.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/browserapplication.cpp b/demos/browser/browserapplication.cpp index ed95d32..41845fa 100644 --- a/demos/browser/browserapplication.cpp +++ b/demos/browser/browserapplication.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/browserapplication.h b/demos/browser/browserapplication.h index 88b4f2b..f9e121d 100644 --- a/demos/browser/browserapplication.h +++ b/demos/browser/browserapplication.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/browsermainwindow.cpp b/demos/browser/browsermainwindow.cpp index ed36c25..3ff2aa8 100644 --- a/demos/browser/browsermainwindow.cpp +++ b/demos/browser/browsermainwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/browsermainwindow.h b/demos/browser/browsermainwindow.h index 848085f..0080d88 100644 --- a/demos/browser/browsermainwindow.h +++ b/demos/browser/browsermainwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/chasewidget.cpp b/demos/browser/chasewidget.cpp index 2e7bc71..284fbf5 100644 --- a/demos/browser/chasewidget.cpp +++ b/demos/browser/chasewidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/chasewidget.h b/demos/browser/chasewidget.h index 336aacd..4c2d805 100644 --- a/demos/browser/chasewidget.h +++ b/demos/browser/chasewidget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/cookiejar.cpp b/demos/browser/cookiejar.cpp index 835b61b..5657255 100644 --- a/demos/browser/cookiejar.cpp +++ b/demos/browser/cookiejar.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/cookiejar.h b/demos/browser/cookiejar.h index 6a45c9b..3d8e707 100644 --- a/demos/browser/cookiejar.h +++ b/demos/browser/cookiejar.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/data/browser.svg b/demos/browser/data/browser.svg index e7ee2c5..0aefed4 100644 --- a/demos/browser/data/browser.svg +++ b/demos/browser/data/browser.svg @@ -276,7 +276,7 @@ </dc:creator> <dc:rights> <cc:Agent> - <dc:title>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</dc:title> + <dc:title>Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).</dc:title> </cc:Agent> </dc:rights> </cc:Work> diff --git a/demos/browser/downloadmanager.cpp b/demos/browser/downloadmanager.cpp index 876ec1d..f812bb9 100644 --- a/demos/browser/downloadmanager.cpp +++ b/demos/browser/downloadmanager.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/downloadmanager.h b/demos/browser/downloadmanager.h index 415269f..59bb51d 100644 --- a/demos/browser/downloadmanager.h +++ b/demos/browser/downloadmanager.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/edittableview.cpp b/demos/browser/edittableview.cpp index 675307b..4c331fa 100644 --- a/demos/browser/edittableview.cpp +++ b/demos/browser/edittableview.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/edittableview.h b/demos/browser/edittableview.h index 18f1379..1de0190 100644 --- a/demos/browser/edittableview.h +++ b/demos/browser/edittableview.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/edittreeview.cpp b/demos/browser/edittreeview.cpp index 0ee5e5e..aff1281 100644 --- a/demos/browser/edittreeview.cpp +++ b/demos/browser/edittreeview.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/edittreeview.h b/demos/browser/edittreeview.h index a1a97e0..ac0777a 100644 --- a/demos/browser/edittreeview.h +++ b/demos/browser/edittreeview.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/history.cpp b/demos/browser/history.cpp index 386d65c..6e34eed 100644 --- a/demos/browser/history.cpp +++ b/demos/browser/history.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/history.h b/demos/browser/history.h index 9771dda..b003982 100644 --- a/demos/browser/history.h +++ b/demos/browser/history.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/main.cpp b/demos/browser/main.cpp index 036a0cd..ff6be67 100644 --- a/demos/browser/main.cpp +++ b/demos/browser/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/modelmenu.cpp b/demos/browser/modelmenu.cpp index fe5e750..8722f1b 100644 --- a/demos/browser/modelmenu.cpp +++ b/demos/browser/modelmenu.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/modelmenu.h b/demos/browser/modelmenu.h index ff2dbce..9a21491 100644 --- a/demos/browser/modelmenu.h +++ b/demos/browser/modelmenu.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/networkaccessmanager.cpp b/demos/browser/networkaccessmanager.cpp index 70a9305..9e717bb 100644 --- a/demos/browser/networkaccessmanager.cpp +++ b/demos/browser/networkaccessmanager.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/networkaccessmanager.h b/demos/browser/networkaccessmanager.h index e213034..76fc198 100644 --- a/demos/browser/networkaccessmanager.h +++ b/demos/browser/networkaccessmanager.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/searchlineedit.cpp b/demos/browser/searchlineedit.cpp index 239c5e7..56336dd 100644 --- a/demos/browser/searchlineedit.cpp +++ b/demos/browser/searchlineedit.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/searchlineedit.h b/demos/browser/searchlineedit.h index 5eb423e..d748636 100644 --- a/demos/browser/searchlineedit.h +++ b/demos/browser/searchlineedit.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/settings.cpp b/demos/browser/settings.cpp index 5ceca67..cbb0a0a 100644 --- a/demos/browser/settings.cpp +++ b/demos/browser/settings.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/settings.h b/demos/browser/settings.h index 136d3e2..0230dda 100644 --- a/demos/browser/settings.h +++ b/demos/browser/settings.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/squeezelabel.cpp b/demos/browser/squeezelabel.cpp index abe97f1..3c34a5a 100644 --- a/demos/browser/squeezelabel.cpp +++ b/demos/browser/squeezelabel.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/squeezelabel.h b/demos/browser/squeezelabel.h index 43c019e..bc25580 100644 --- a/demos/browser/squeezelabel.h +++ b/demos/browser/squeezelabel.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/tabwidget.cpp b/demos/browser/tabwidget.cpp index ae0c88e..f0a74cb 100644 --- a/demos/browser/tabwidget.cpp +++ b/demos/browser/tabwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/tabwidget.h b/demos/browser/tabwidget.h index ce823ce..296655e 100644 --- a/demos/browser/tabwidget.h +++ b/demos/browser/tabwidget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/toolbarsearch.cpp b/demos/browser/toolbarsearch.cpp index f8540ad..c696bb7 100644 --- a/demos/browser/toolbarsearch.cpp +++ b/demos/browser/toolbarsearch.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/toolbarsearch.h b/demos/browser/toolbarsearch.h index 00f52f9..deb7a6e 100644 --- a/demos/browser/toolbarsearch.h +++ b/demos/browser/toolbarsearch.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/urllineedit.cpp b/demos/browser/urllineedit.cpp index 9f68a88..60a0979 100644 --- a/demos/browser/urllineedit.cpp +++ b/demos/browser/urllineedit.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/urllineedit.h b/demos/browser/urllineedit.h index 6cf5872..fd06260 100644 --- a/demos/browser/urllineedit.h +++ b/demos/browser/urllineedit.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/webview.cpp b/demos/browser/webview.cpp index 2f9b3e6..81bc5e1 100644 --- a/demos/browser/webview.cpp +++ b/demos/browser/webview.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/webview.h b/demos/browser/webview.h index f81d8af..8c93f54 100644 --- a/demos/browser/webview.h +++ b/demos/browser/webview.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/xbel.cpp b/demos/browser/xbel.cpp index 9e93cf7..9ebd5db 100644 --- a/demos/browser/xbel.cpp +++ b/demos/browser/xbel.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/browser/xbel.h b/demos/browser/xbel.h index 607f35b..94321c0 100644 --- a/demos/browser/xbel.h +++ b/demos/browser/xbel.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/chip/chip.cpp b/demos/chip/chip.cpp index 5478142..6f3b529 100644 --- a/demos/chip/chip.cpp +++ b/demos/chip/chip.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/chip/chip.h b/demos/chip/chip.h index a34efe8..dca63b7 100644 --- a/demos/chip/chip.h +++ b/demos/chip/chip.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/chip/main.cpp b/demos/chip/main.cpp index 2307542..a4353bf 100644 --- a/demos/chip/main.cpp +++ b/demos/chip/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/chip/mainwindow.cpp b/demos/chip/mainwindow.cpp index db56c59..825c388 100644 --- a/demos/chip/mainwindow.cpp +++ b/demos/chip/mainwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/chip/mainwindow.h b/demos/chip/mainwindow.h index 2983d59..9c8ac03 100644 --- a/demos/chip/mainwindow.h +++ b/demos/chip/mainwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/chip/view.cpp b/demos/chip/view.cpp index 7af3074..a80bf82 100644 --- a/demos/chip/view.cpp +++ b/demos/chip/view.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/chip/view.h b/demos/chip/view.h index 8047b8b..fc819df 100644 --- a/demos/chip/view.h +++ b/demos/chip/view.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/composition/composition.cpp b/demos/composition/composition.cpp index deca5dc..15f5529 100644 --- a/demos/composition/composition.cpp +++ b/demos/composition/composition.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/composition/composition.h b/demos/composition/composition.h index f5a9fc3..e1b5ed7 100644 --- a/demos/composition/composition.h +++ b/demos/composition/composition.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/composition/main.cpp b/demos/composition/main.cpp index aa8c139..f68d75f 100644 --- a/demos/composition/main.cpp +++ b/demos/composition/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/deform/main.cpp b/demos/deform/main.cpp index 4539973..8eb781b 100644 --- a/demos/deform/main.cpp +++ b/demos/deform/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/deform/pathdeform.cpp b/demos/deform/pathdeform.cpp index 636d103..15a79b6 100644 --- a/demos/deform/pathdeform.cpp +++ b/demos/deform/pathdeform.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/deform/pathdeform.h b/demos/deform/pathdeform.h index cc6ca1b..1305543 100644 --- a/demos/deform/pathdeform.h +++ b/demos/deform/pathdeform.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/AddressBar.cpp b/demos/embedded/anomaly/src/AddressBar.cpp index 12523f2..17eca15 100644 --- a/demos/embedded/anomaly/src/AddressBar.cpp +++ b/demos/embedded/anomaly/src/AddressBar.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/AddressBar.h b/demos/embedded/anomaly/src/AddressBar.h index 4999e96..a4cabc4 100644 --- a/demos/embedded/anomaly/src/AddressBar.h +++ b/demos/embedded/anomaly/src/AddressBar.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/BookmarksView.cpp b/demos/embedded/anomaly/src/BookmarksView.cpp index 729bf73..cef109a 100644 --- a/demos/embedded/anomaly/src/BookmarksView.cpp +++ b/demos/embedded/anomaly/src/BookmarksView.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/BookmarksView.h b/demos/embedded/anomaly/src/BookmarksView.h index 86cd214..f9fb9d9 100644 --- a/demos/embedded/anomaly/src/BookmarksView.h +++ b/demos/embedded/anomaly/src/BookmarksView.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/BrowserView.cpp b/demos/embedded/anomaly/src/BrowserView.cpp index 41318ad..14cb44e 100644 --- a/demos/embedded/anomaly/src/BrowserView.cpp +++ b/demos/embedded/anomaly/src/BrowserView.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/BrowserView.h b/demos/embedded/anomaly/src/BrowserView.h index 5ab1dd7..10d57da 100644 --- a/demos/embedded/anomaly/src/BrowserView.h +++ b/demos/embedded/anomaly/src/BrowserView.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/BrowserWindow.cpp b/demos/embedded/anomaly/src/BrowserWindow.cpp index 9d90254..be7432b 100644 --- a/demos/embedded/anomaly/src/BrowserWindow.cpp +++ b/demos/embedded/anomaly/src/BrowserWindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/BrowserWindow.h b/demos/embedded/anomaly/src/BrowserWindow.h index d70ea7f..2f4793d 100644 --- a/demos/embedded/anomaly/src/BrowserWindow.h +++ b/demos/embedded/anomaly/src/BrowserWindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/ControlStrip.cpp b/demos/embedded/anomaly/src/ControlStrip.cpp index c9c81c0..2a51a74 100644 --- a/demos/embedded/anomaly/src/ControlStrip.cpp +++ b/demos/embedded/anomaly/src/ControlStrip.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/ControlStrip.h b/demos/embedded/anomaly/src/ControlStrip.h index b6003a1..f72e488 100644 --- a/demos/embedded/anomaly/src/ControlStrip.h +++ b/demos/embedded/anomaly/src/ControlStrip.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/HomeView.cpp b/demos/embedded/anomaly/src/HomeView.cpp index 8052172..b69e6a6 100644 --- a/demos/embedded/anomaly/src/HomeView.cpp +++ b/demos/embedded/anomaly/src/HomeView.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/HomeView.h b/demos/embedded/anomaly/src/HomeView.h index 4844dd7..9b68cb7 100644 --- a/demos/embedded/anomaly/src/HomeView.h +++ b/demos/embedded/anomaly/src/HomeView.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/Main.cpp b/demos/embedded/anomaly/src/Main.cpp index 78bc9b1..cfb2851 100644 --- a/demos/embedded/anomaly/src/Main.cpp +++ b/demos/embedded/anomaly/src/Main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/TitleBar.cpp b/demos/embedded/anomaly/src/TitleBar.cpp index da68dcb..e9244d1 100644 --- a/demos/embedded/anomaly/src/TitleBar.cpp +++ b/demos/embedded/anomaly/src/TitleBar.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/TitleBar.h b/demos/embedded/anomaly/src/TitleBar.h index b5ec288..8cee108 100644 --- a/demos/embedded/anomaly/src/TitleBar.h +++ b/demos/embedded/anomaly/src/TitleBar.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/ZoomStrip.cpp b/demos/embedded/anomaly/src/ZoomStrip.cpp index 3bf8129..69b44ba 100644 --- a/demos/embedded/anomaly/src/ZoomStrip.cpp +++ b/demos/embedded/anomaly/src/ZoomStrip.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/ZoomStrip.h b/demos/embedded/anomaly/src/ZoomStrip.h index baef922..80ceaf6 100644 --- a/demos/embedded/anomaly/src/ZoomStrip.h +++ b/demos/embedded/anomaly/src/ZoomStrip.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/flickcharm.cpp b/demos/embedded/anomaly/src/flickcharm.cpp index 9ad7c40..3524301 100644 --- a/demos/embedded/anomaly/src/flickcharm.cpp +++ b/demos/embedded/anomaly/src/flickcharm.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/flickcharm.h b/demos/embedded/anomaly/src/flickcharm.h index 1164028..77b3bcc 100644 --- a/demos/embedded/anomaly/src/flickcharm.h +++ b/demos/embedded/anomaly/src/flickcharm.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/webview.cpp b/demos/embedded/anomaly/src/webview.cpp index 5cb913b..b794b7c 100644 --- a/demos/embedded/anomaly/src/webview.cpp +++ b/demos/embedded/anomaly/src/webview.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/anomaly/src/webview.h b/demos/embedded/anomaly/src/webview.h index ecd9f5a..a73ab56 100644 --- a/demos/embedded/anomaly/src/webview.h +++ b/demos/embedded/anomaly/src/webview.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp index fa9c586..cb9500d 100644 --- a/demos/embedded/desktopservices/contenttab.cpp +++ b/demos/embedded/desktopservices/contenttab.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h index 72c7f4c..ec9aa8a 100644 --- a/demos/embedded/desktopservices/contenttab.h +++ b/demos/embedded/desktopservices/contenttab.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp index 39a56a4..f3d094f 100644 --- a/demos/embedded/desktopservices/desktopwidget.cpp +++ b/demos/embedded/desktopservices/desktopwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/demos/embedded/desktopservices/desktopwidget.h b/demos/embedded/desktopservices/desktopwidget.h index 6781c05..3de8a6e 100644 --- a/demos/embedded/desktopservices/desktopwidget.h +++ b/demos/embedded/desktopservices/desktopwidget.h @@ -1,6 +