summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2010-05-04 13:33:02 (GMT)
committerMartin Smith <msmith@trolltech.com>2010-05-04 13:33:02 (GMT)
commit409ced7dc098438e185b9a6db6b3f53b1472839d (patch)
tree912a5a7c3cc9dd0b99005a9c7b06bc9eb7c81ec3
parentae0dfbf4718fc24a8f68a8c7b307b2a808d0f4dc (diff)
downloadQt-409ced7dc098438e185b9a6db6b3f53b1472839d.zip
Qt-409ced7dc098438e185b9a6db6b3f53b1472839d.tar.gz
Qt-409ced7dc098438e185b9a6db6b3f53b1472839d.tar.bz2
qdoc: Fixed the alphabet index in the compact list.
Now it leaves out any letter that doesn't appear in the list. i.e. If there are no classes that begin with QJ... J does not appear in the alphabet index.
-rw-r--r--doc/src/declarative/declarativeui.qdoc8
-rw-r--r--tools/qdoc3/htmlgenerator.cpp13
2 files changed, 8 insertions, 13 deletions
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index 6a1f5c5..5283ba8 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -74,7 +74,7 @@ strengths}. QML can be be used to incrementally extend an existing
application or to build completely new applications. QML is fully \l
{Extending QML in C++}{extensible from C++}.
-\section1 Getting Started:
+\section1 Getting Started
\list
\o \l {Introduction to the QML language}
@@ -84,7 +84,7 @@ application or to build completely new applications. QML is fully \l
\o \l {QML for Qt programmers}
\endlist
-\section1 Core QML Features:
+\section1 Core QML Features
\list
\o \l {QML Documents}
\o \l {Property Binding}
@@ -102,7 +102,7 @@ application or to build completely new applications. QML is fully \l
\o \l {qmlruntime.html}{The Qt Declarative Runtime}
\endlist
-\section1 Using QML with C++:
+\section1 Using QML with C++
\list
\o \l {Tutorial: Writing QML extensions with C++}
\o \l {Extending QML in C++}
@@ -110,7 +110,7 @@ application or to build completely new applications. QML is fully \l
\o \l {Integrating QML with existing Qt UI code}
\endlist
-\section1 Reference:
+\section1 Reference
\list
\o \l {QML Elements}
\o \l {QML Global Object}
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 569d1cd..d32ae99 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -2399,6 +2399,7 @@ void HtmlGenerator::generateCompactList(const Node *relative,
*/
NodeMap paragraph[NumParagraphs+1];
QString paragraphName[NumParagraphs+1];
+ QSet<char> usedParagraphNames;
NodeMap::ConstIterator c = classMap.begin();
while (c != classMap.end()) {
@@ -2422,6 +2423,7 @@ void HtmlGenerator::generateCompactList(const Node *relative,
}
paragraphName[paragraphNo] = key[0].toUpper();
+ usedParagraphNames.insert(key[0].toLower().cell());
paragraph[paragraphNo].insert(key, c.value());
++c;
}
@@ -2469,12 +2471,12 @@ void HtmlGenerator::generateCompactList(const Node *relative,
out() << "<p class=\"centerAlign functionIndex\"><b>";
for (int i = 0; i < 26; i++) {
QChar ch('a' + i);
- out() << QString("<a href=\"#%1\">%2</a>&nbsp;").arg(ch).arg(ch.toUpper());
+ if (usedParagraphNames.contains(char('a' + i)))
+ out() << QString("<a href=\"#%1\">%2</a>&nbsp;").arg(ch).arg(ch.toUpper());
}
out() << "</b></p>\n";
}
- QSet<char> used;
out() << "<table class=\"generic\">\n";
for (k = 0; k < numRows; k++) {
out() << "<tr>\n";
@@ -2502,7 +2504,6 @@ void HtmlGenerator::generateCompactList(const Node *relative,
if (includeAlphabet) {
QChar c = paragraphName[currentParagraphNo[i]][0].toLower();
out() << QString("<a name=\"%1\"></a>").arg(c);
- used.insert(c.cell());
}
out() << "<b>"
<< paragraphName[currentParagraphNo[i]]
@@ -2545,12 +2546,6 @@ void HtmlGenerator::generateCompactList(const Node *relative,
out() << "</tr>\n";
}
out() << "</table>\n";
- char C = 'a';
- while (C <= 'z') {
- if (!used.contains(C))
- out() << QString("<a name=\"%1\"></a>").arg(C);
- ++C;
- }
}
void HtmlGenerator::generateFunctionIndex(const Node *relative,