summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-04-27 21:36:32 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-04-27 21:36:32 +0200
commit1c8451bdbbd6ca909dfc5b96a24be909810522fc (patch)
tree9cc69a4794e23f7224d75fc2323fc70e294a9454 /src/tools
parent7ebec0fa848de299d4cdee06ccc611ee46494fbf (diff)
parent0635b1a69dd666f5eed4b096895bd80b1a9420ff (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts: src/tools/qdoc/tree.cpp tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: Iaa78f601a63191fa643aabf853520f913f2f0fdc
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/moc/moc.cpp3
-rw-r--r--src/tools/qdoc/generator.cpp57
-rw-r--r--src/tools/qdoc/generator.h1
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp57
-rw-r--r--src/tools/qdoc/htmlgenerator.h1
-rw-r--r--src/tools/qdoc/tree.cpp7
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp7
7 files changed, 70 insertions, 63 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index a9e33da01d..7300429fe0 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -140,7 +140,8 @@ bool Moc::parseClassHead(ClassDef *def)
}
} while (test(COMMA));
- if (knownGadgets.contains(def->superclassList.first().first)) {
+ if (!def->superclassList.isEmpty()
+ && knownGadgets.contains(def->superclassList.first().first)) {
// Q_GADGET subclasses are treated as Q_GADGETs
knownGadgets.insert(def->classname, def->qualified);
knownGadgets.insert(def->qualified, def->qualified);
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 99dec06233..2fdba5483a 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -419,6 +419,59 @@ QString Generator::fileName(const Node* node) const
return name;
}
+QString Generator::cleanRef(const QString& ref)
+{
+ QString clean;
+
+ if (ref.isEmpty())
+ return clean;
+
+ clean.reserve(ref.size() + 20);
+ const QChar c = ref[0];
+ const uint u = c.unicode();
+
+ if ((u >= 'a' && u <= 'z') ||
+ (u >= 'A' && u <= 'Z') ||
+ (u >= '0' && u <= '9')) {
+ clean += c;
+ } else if (u == '~') {
+ clean += "dtor.";
+ } else if (u == '_') {
+ clean += "underscore.";
+ } else {
+ clean += QLatin1Char('A');
+ }
+
+ for (int i = 1; i < (int) ref.length(); i++) {
+ 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 == '.') {
+ clean += c;
+ } else if (c.isSpace()) {
+ clean += QLatin1Char('-');
+ } else if (u == '!') {
+ clean += "-not";
+ } else if (u == '&') {
+ clean += "-and";
+ } else if (u == '<') {
+ clean += "-lt";
+ } else if (u == '=') {
+ clean += "-eq";
+ } else if (u == '>') {
+ clean += "-gt";
+ } else if (u == '#') {
+ clean += QLatin1Char('#');
+ } else {
+ clean += QLatin1Char('-');
+ clean += QString::number((int)u, 16);
+ }
+ }
+ return clean;
+}
+
QMap<QString, QString>& Generator::formattingLeftMap()
{
return fmtLeftMaps[format()];
@@ -521,10 +574,10 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
return fullDocumentLocation(functionNode->associatedProperty());
else if (functionNode->overloadNumber() > 1)
- anchorRef = QLatin1Char('#') + functionNode->name()
+ anchorRef = QLatin1Char('#') + cleanRef(functionNode->name())
+ QLatin1Char('-') + QString::number(functionNode->overloadNumber());
else
- anchorRef = QLatin1Char('#') + functionNode->name();
+ anchorRef = QLatin1Char('#') + cleanRef(functionNode->name());
break;
}
/*
diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h
index 8f7e293eb3..535b508595 100644
--- a/src/tools/qdoc/generator.h
+++ b/src/tools/qdoc/generator.h
@@ -103,6 +103,7 @@ public:
static bool useOutputSubdirs() { return useOutputSubdirs_; }
static void setQmlTypeContext(QmlTypeNode* t) { qmlTypeContext_ = t; }
static QmlTypeNode* qmlTypeContext() { return qmlTypeContext_; }
+ static QString cleanRef(const QString& ref);
protected:
virtual void beginSubPage(const Aggregate* node, const QString& fileName);
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 058fb38c17..7509af868a 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -3355,7 +3355,7 @@ void HtmlGenerator::generateSectionInheritedList(const Section& section, const N
out() << section.pluralMember;
}
out() << " inherited from <a href=\"" << fileName((*p).first)
- << '#' << HtmlGenerator::cleanRef(section.name.toLower()) << "\">"
+ << '#' << Generator::cleanRef(section.name.toLower()) << "\">"
<< protectEnc((*p).first->plainFullName(relative))
<< "</a></li>\n";
++p;
@@ -3610,62 +3610,9 @@ void HtmlGenerator::generateLink(const Atom* atom, CodeMarker* marker)
}
}
-QString HtmlGenerator::cleanRef(const QString& ref)
-{
- QString clean;
-
- if (ref.isEmpty())
- return clean;
-
- clean.reserve(ref.size() + 20);
- const QChar c = ref[0];
- const uint u = c.unicode();
-
- if ((u >= 'a' && u <= 'z') ||
- (u >= 'A' && u <= 'Z') ||
- (u >= '0' && u <= '9')) {
- clean += c;
- } else if (u == '~') {
- clean += "dtor.";
- } else if (u == '_') {
- clean += "underscore.";
- } else {
- clean += QLatin1Char('A');
- }
-
- for (int i = 1; i < (int) ref.length(); i++) {
- 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 == '.') {
- clean += c;
- } else if (c.isSpace()) {
- clean += QLatin1Char('-');
- } else if (u == '!') {
- clean += "-not";
- } else if (u == '&') {
- clean += "-and";
- } else if (u == '<') {
- clean += "-lt";
- } else if (u == '=') {
- clean += "-eq";
- } else if (u == '>') {
- clean += "-gt";
- } else if (u == '#') {
- clean += QLatin1Char('#');
- } else {
- clean += QLatin1Char('-');
- clean += QString::number((int)u, 16);
- }
- }
- return clean;
-}
-
QString HtmlGenerator::registerRef(const QString& ref)
{
- QString clean = HtmlGenerator::cleanRef(ref);
+ QString clean = Generator::cleanRef(ref);
for (;;) {
QString& prevRef = refMap[clean.toLower()];
diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h
index fe710024e0..615de8e8a3 100644
--- a/src/tools/qdoc/htmlgenerator.h
+++ b/src/tools/qdoc/htmlgenerator.h
@@ -85,7 +85,6 @@ public:
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:
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp
index ca044ff78f..0da963fe0b 100644
--- a/src/tools/qdoc/tree.cpp
+++ b/src/tools/qdoc/tree.cpp
@@ -388,7 +388,6 @@ void Tree::resolveInheritanceHelper(int pass, ClassNode* cn)
while (b != bases.end()) {
if (!(*b).node_) {
Node* n = qdb_->findClassNode((*b).path_);
-#if 0
/*
If the node for the base class was not found,
the reason might be that the subclass is in a
@@ -401,9 +400,11 @@ void Tree::resolveInheritanceHelper(int pass, ClassNode* cn)
*/
if (!n) {
Aggregate* parent = cn->parent();
- n = findClassNode((*b).path_, parent);
+ if (parent)
+ // Exclude the root namespace
+ if (parent->isNamespace() && !parent->name().isEmpty())
+ n = findClassNode((*b).path_, parent);
}
-#endif
if (n) {
ClassNode* bcn = static_cast<ClassNode*>(n);
(*b).node_ = bcn;
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index 78f243a6d3..b02e2dc0ed 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -1176,6 +1176,7 @@ void WriteInitialization::writeProperties(const QString &varName,
continue;
QString propertyName = p->attributeName();
QString propertyValue;
+ bool delayProperty = false;
// special case for the property `geometry': Do not use position
if (isTopLevel && propertyName == QLatin1String("geometry") && p->elementRect()) {
@@ -1204,6 +1205,10 @@ void WriteInitialization::writeProperties(const QString &varName,
&& m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) {
// already done ;)
continue;
+ } else if (propertyName == QLatin1String("default")
+ && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QPushButton"))) {
+ // QTBUG-44406: Setting of QPushButton::default needs to be delayed until the parent is set
+ delayProperty = true;
} else if (propertyName == QLatin1String("database")
&& p->elementStringList()) {
// Sql support
@@ -1479,7 +1484,7 @@ void WriteInitialization::writeProperties(const QString &varName,
else if (propertyName == QLatin1String("accessibleName") || propertyName == QLatin1String("accessibleDescription"))
defineC = accessibilityDefineC;
- QTextStream &o = autoTrOutput(p);
+ QTextStream &o = delayProperty ? m_delayedOut : autoTrOutput(p);
if (defineC)
openIfndef(o, QLatin1String(defineC));