diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-05-25 10:27:18 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-05-25 10:27:18 (GMT) |
commit | 0dff624cc550254b804540b77b9ddd3c41a26f16 (patch) | |
tree | ed4b7815c0bdf13c1cffd9af6d13f79c4b28e5e2 /tools | |
parent | b5702253a08e315b4db5620a1d4b0ffd4c8e0d0f (diff) | |
parent | 2447c023bc0113bace6f31d93ea942f7b8cb17da (diff) | |
download | Qt-0dff624cc550254b804540b77b9ddd3c41a26f16.zip Qt-0dff624cc550254b804540b77b9ddd3c41a26f16.tar.gz Qt-0dff624cc550254b804540b77b9ddd3c41a26f16.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 193 | ||||
-rw-r--r-- | tools/qml/content/Browser.qml | 42 | ||||
-rw-r--r-- | tools/qml/qmlruntime.cpp | 3 |
3 files changed, 133 insertions, 105 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index cf8ea7c..42db4e8 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -434,6 +434,9 @@ void HtmlGenerator::startText(const Node * /* relative */, sectionNumber.clear(); } +/*! + Generate html from an instance of Atom. + */ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker) @@ -1217,6 +1220,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, return skipAhead; } +/*! + Generate a reference page for a C++ class. + */ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, CodeMarker *marker) { @@ -1466,6 +1472,10 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, appendDcfSubSection(&dcfClassesRoot, classSection); } +/*! + 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) { SubTitleSize subTitleSize = LargeSubTitle; @@ -1682,6 +1692,9 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) } } +/*! + Returns "html" for this subclass of Generator. + */ QString HtmlGenerator::fileExtension(const Node * /* node */) const { return "html"; @@ -1735,10 +1748,10 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, } else if (node->subType() == Node::Page) { if (fn->name() == QString("examples.html")) { - out() << " <li><a href=\"examples.html\">All Examples</a></li>"; + out() << " <li><a href=\"all-examples.html\">Examples</a></li>"; } else if (fn->name().startsWith("examples-")) { - out() << " <li><a href=\"examples.html\">All Examples</a></li>"; + out() << " <li><a href=\"all-examples.html\">Examples</a></li>"; out() << " <li><a href=\"" << fn->name() << "\">" << title << "</a></li>"; } @@ -1756,7 +1769,7 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, << "</a></li>"; } else if (node->subType() == Node::Example) { - out() << " <li><a href=\"examples.html\">All Examples</a></li>"; + out() << " <li><a href=\"all-examples.html\">Examples</a></li>"; QStringList sl = fn->name().split('/'); QString name = "examples-" + sl.at(0) + ".html"; QString t = CodeParser::titleFromName(name); @@ -2332,7 +2345,6 @@ void HtmlGenerator::generateCompactList(const Node *relative, QString commonPrefix) { const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' - const int NumColumns = 1; // number of columns in the result if (classMap.isEmpty()) return; @@ -2415,18 +2427,18 @@ void HtmlGenerator::generateCompactList(const Node *relative, else key = pieces.last().toLower(); - int paragraphNo = NumParagraphs - 1; + int paragraphNr = NumParagraphs - 1; if (key[0].digitValue() != -1) { - paragraphNo = key[0].digitValue(); + paragraphNr = key[0].digitValue(); } else if (key[0] >= QLatin1Char('a') && key[0] <= QLatin1Char('z')) { - paragraphNo = 10 + key[0].unicode() - 'a'; + paragraphNr = 10 + key[0].unicode() - 'a'; } - paragraphName[paragraphNo] = key[0].toUpper(); + paragraphName[paragraphNr] = key[0].toUpper(); usedParagraphNames.insert(key[0].toLower().cell()); - paragraph[paragraphNo].insert(key, c.value()); + paragraph[paragraphNr].insert(key, c.value()); ++c; } @@ -2439,36 +2451,16 @@ void HtmlGenerator::generateCompactList(const Node *relative, start at offsets 0, 3, 4, 8, 9, 14, 23. */ int paragraphOffset[NumParagraphs + 1]; // 37 + 1 - int i, j, k; - paragraphOffset[0] = 0; - for (j = 0; j < NumParagraphs; j++) // j = 0..36 - paragraphOffset[j + 1] = paragraphOffset[j] + paragraph[j].count(); - - int firstOffset[NumColumns + 1]; - int currentOffset[NumColumns]; - int currentParagraphNo[NumColumns]; - int currentOffsetInParagraph[NumColumns]; + for (int i=0; i<NumParagraphs; i++) // i = 0..36 + paragraphOffset[i+1] = paragraphOffset[i] + paragraph[i].count(); - int numRows = (classMap.count() + NumColumns - 1) / NumColumns; - int curParagNo = 0; - - for (i = 0; i < NumColumns; i++) { - firstOffset[i] = qMin(i * numRows, classMap.size()); - currentOffset[i] = firstOffset[i]; - - for (j = curParagNo; j < NumParagraphs; j++) { - if (paragraphOffset[j] > firstOffset[i]) - break; - if (paragraphOffset[j] <= firstOffset[i]) - curParagNo = j; - } - currentParagraphNo[i] = curParagNo; - currentOffsetInParagraph[i] = firstOffset[i] - - paragraphOffset[curParagNo]; - } - firstOffset[NumColumns] = classMap.count(); + int curParNr = 0; + int curParOffset = 0; + /* + Output the alphabet as a row of links. + */ if (includeAlphabet) { out() << "<p class=\"centerAlign functionIndex\"><b>"; for (int i = 0; i < 26; i++) { @@ -2479,80 +2471,73 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "</b></p>\n"; } + /* + Output a <div> element to contain all the <dl> elements. + */ out() << "<div class=\"flowListDiv\">\n"; - for (k = 0; k < numRows; k++) { - if (++numTableRows % 2 == 1) - out() << "<dl class=\"flowList odd\">"; - else - out() << "<dl class=\"flowList even\">"; - //break; - -// out() << "<tr>\n"; - for (i = 0; i < NumColumns; i++) { - if (currentOffset[i] >= firstOffset[i + 1]) { - // this column is finished - out() << "<dd>\n</dd>\n"; // check why? + + for (int i=0; i<classMap.count()-1; i++) { + while ((curParNr < NumParagraphs) && + (curParOffset == paragraph[curParNr].count())) { + ++curParNr; + curParOffset = 0; + } + + /* + Starting a new paragraph means starting a new <dl>. + */ + if (curParOffset == 0) { + if (i > 0) + out() << "</dl>\n"; + if (++numTableRows % 2 == 1) + out() << "<dl class=\"flowList odd\">"; + else + out() << "<dl class=\"flowList even\">"; + out() << "<dt class=\"alphaChar\"><p>"; + if (includeAlphabet) { + QChar c = paragraphName[curParNr][0].toLower(); + out() << QString("<a name=\"%1\"></a>").arg(c); } - else { - while ((currentParagraphNo[i] < NumParagraphs) && - (currentOffsetInParagraph[i] == paragraph[currentParagraphNo[i]].count())) { - ++currentParagraphNo[i]; - currentOffsetInParagraph[i] = 0; - } -#if 0 - if (currentParagraphNo[i] >= NumParagraphs) { - qDebug() << "### Internal error ###" << __FILE__ << __LINE__ - << currentParagraphNo[i] << NumParagraphs; - currentParagraphNo[i] = NumParagraphs - 1; - } -#endif - out() << "<dt class=\"alphaChar\"><p>"; - if (currentOffsetInParagraph[i] == 0) { - // start a new paragraph - if (includeAlphabet) { - QChar c = paragraphName[currentParagraphNo[i]][0].toLower(); - out() << QString("<a name=\"%1\"></a>").arg(c); - } - out() << "<b>" - << paragraphName[currentParagraphNo[i]] - << "</b>"; - } - out() << "</p></dt>\n"; - - out() << "<dd><p>"; - if ((currentParagraphNo[i] < NumParagraphs) && - !paragraphName[currentParagraphNo[i]].isEmpty()) { - NodeMap::Iterator it; - it = paragraph[currentParagraphNo[i]].begin(); - for (j = 0; j < currentOffsetInParagraph[i]; j++) - ++it; - - // Previously, we used generateFullName() for this, but we - // require some special formatting. - out() << "<a 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() << "</a>"; - if (pieces.size() > 1) { - out() << " ("; - generateFullName(it.value()->parent(), relative, marker); - out() << ")"; - } - } - out() << "</p></dd>\n"; + out() << "<b>" + << paragraphName[curParNr] + << "</b>"; + out() << "</p></dt>\n"; + } - currentOffset[i]++; - currentOffsetInParagraph[i]++; + /* + Output a <dd> for the current offset in the current paragraph. + */ + out() << "<dd><p>"; + if ((curParNr < NumParagraphs) && + !paragraphName[curParNr].isEmpty()) { + NodeMap::Iterator it; + it = paragraph[curParNr].begin(); + for (int i=0; i<curParOffset; i++) + ++it; + + /* + Previously, we used generateFullName() for this, but we + require some special formatting. + */ + out() << "<a 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() << "</a>"; + if (pieces.size() > 1) { + out() << " ("; + generateFullName(it.value()->parent(), relative, marker); + out() << ")"; } } - out() << "</dl>\n"; + out() << "</p></dd>\n"; + curParOffset++; } + out() << "</dl>\n"; out() << "</div>\n"; } diff --git a/tools/qml/content/Browser.qml b/tools/qml/content/Browser.qml index 7238203..838a848 100644 --- a/tools/qml/content/Browser.qml +++ b/tools/qml/content/Browser.qml @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + import Qt 4.7 import Qt.labs.folderlistmodel 1.0 @@ -88,6 +129,7 @@ Rectangle { anchors.leftMargin: 54 font.pixelSize: 32 color: (wrapper.ListView.isCurrentItem && root.keyPressed) ? palette.highlightedText : palette.windowText + elide: Text.ElideRight } MouseArea { id: mouseRegion diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 8df250f..5136872 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -1240,7 +1240,8 @@ void QDeclarativeViewer::setUseGL(bool useGL) #endif QGLWidget *glWidget = new QGLWidget(format); - glWidget->setAutoFillBackground(false); + //### potentially faster, but causes junk to appear if top-level is Item, not Rectangle + //glWidget->setAutoFillBackground(false); canvas->setViewport(glWidget); } |