summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2010-11-18 01:19:33 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-11-18 01:19:33 (GMT)
commit051793b7558ed16dfcb84f62ce3bd4a1545906a7 (patch)
tree2496fdaec40857e9982c93d18107e09e233145d4 /tools
parent14ddf44ce2fdd7195741b9683226a3cd774e17e4 (diff)
parentcca7c5b40751e2192ba2c7c7422557eeb5672a17 (diff)
downloadQt-051793b7558ed16dfcb84f62ce3bd4a1545906a7.zip
Qt-051793b7558ed16dfcb84f62ce3bd4a1545906a7.tar.gz
Qt-051793b7558ed16dfcb84f62ce3bd4a1545906a7.tar.bz2
Merge remote branch 'qt/4.7' into 4.7
Conflicts: tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt.qdocconf
Diffstat (limited to 'tools')
-rw-r--r--tools/qdoc3/helpprojectwriter.cpp16
-rw-r--r--tools/qdoc3/htmlgenerator.cpp9
-rw-r--r--tools/qdoc3/htmlgenerator.h2
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf8
-rw-r--r--tools/qdoc3/test/qt.qdocconf6
-rw-r--r--tools/qml/qdeclarativetester.cpp26
6 files changed, 42 insertions, 25 deletions
diff --git a/tools/qdoc3/helpprojectwriter.cpp b/tools/qdoc3/helpprojectwriter.cpp
index 98246c4..63e8df7 100644
--- a/tools/qdoc3/helpprojectwriter.cpp
+++ b/tools/qdoc3/helpprojectwriter.cpp
@@ -49,6 +49,7 @@
#include "config.h"
#include "node.h"
#include "tree.h"
+#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -250,8 +251,9 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
foreach (const QString &name, project.subprojects.keys()) {
SubProject subproject = project.subprojects[name];
// No selectors: accept all nodes.
- if (subproject.selectors.isEmpty())
+ if (subproject.selectors.isEmpty()) {
project.subprojects[name].nodes[objName] = node;
+ }
else if (subproject.selectors.contains(node->type())) {
// Accept only the node types in the selectors hash.
if (node->type() != Node::Fake)
@@ -262,9 +264,10 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
const FakeNode *fakeNode = static_cast<const FakeNode *>(node);
if (subproject.selectors[node->type()].contains(fakeNode->subType()) &&
fakeNode->subType() != Node::ExternalPage &&
- !fakeNode->fullTitle().isEmpty())
+ !fakeNode->fullTitle().isEmpty()) {
project.subprojects[name].nodes[objName] = node;
+ }
}
}
}
@@ -527,13 +530,11 @@ void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer
writer.writeStartElement("section");
writer.writeAttribute("ref", href);
writer.writeAttribute("title", fakeNode->fullTitle());
- // qDebug() << "Title:" << fakeNode->fullTitle();
- if (fakeNode->subType() == Node::HeaderFile) {
-
+ if ((fakeNode->subType() == Node::HeaderFile) || (fakeNode->subType() == Node::QmlClass)) {
// Write subsections for all members, obsolete members and Qt 3
// members.
- if (!project.memberStatus[node].isEmpty()) {
+ if (!project.memberStatus[node].isEmpty() || (fakeNode->subType() == Node::QmlClass)) {
QString membersPath = href.left(href.size()-5) + "-members.html";
writer.writeStartElement("section");
writer.writeAttribute("ref", membersPath);
@@ -690,8 +691,9 @@ void HelpProjectWriter::generateProject(HelpProject &project)
if (subproject.sortPages) {
QStringList titles = subproject.nodes.keys();
titles.sort();
- foreach (const QString &title, titles)
+ foreach (const QString &title, titles) {
writeNode(project, writer, subproject.nodes[title]);
+ }
} else {
// Find a contents node and navigate from there, using the NextLink values.
foreach (const Node *node, subproject.nodes) {
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 9e45f8c..76ee4e8 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -3413,7 +3413,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;
@@ -3544,8 +3544,11 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative)
return QString();
fn = fileName(node);
-/* if (!node->url().isEmpty())
- return fn;*/
+#if 0
+ if (!node->url().isEmpty())
+ return fn;
+#endif
+
#if 0
// ### reintroduce this test, without breaking .dcf files
if (fn != outFileName())
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index d885ada..b96d737 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -241,7 +241,7 @@ class HtmlGenerator : public PageGenerator
void generateStatus(const Node *node, CodeMarker *marker);
QString registerRef(const QString& ref);
- QString fileBase(const Node *node);
+ virtual QString fileBase(const Node *node) const;
#if 0
QString fileBase(const Node *node, const SectionIterator& section);
#endif
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index 5fae2f6..12dac9c 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -62,11 +62,15 @@ qhp.Qt.extraFiles = index.html \
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 qmlelements overviews examples
qhp.Qt.subprojects.classes.title = Classes
-qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
+qhp.Qt.subprojects.classes.indexTitle = All Classes
qhp.Qt.subprojects.classes.selectors = class fake:headerfile
qhp.Qt.subprojects.classes.sortPages = true
+qhp.Qt.subprojects.qmlelements.title = QML Elements
+qhp.Qt.subprojects.qmlelements.indexTitle = QML Elements
+qhp.Qt.subprojects.qmlelements.selectors = fake:qmlclass
+qhp.Qt.subprojects.qmlelements.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
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index 8998751..66f62ad 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -62,11 +62,15 @@ qhp.Qt.extraFiles = index.html \
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 qmlelements 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.qmlelements.title = QML Elements
+qhp.Qt.subprojects.qmlelements.indexTitle = QML Elements
+qhp.Qt.subprojects.qmlelements.selectors = fake:qmlclass
+qhp.Qt.subprojects.qmlelements.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
diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp
index eaf3403..a516fd7 100644
--- a/tools/qml/qdeclarativetester.cpp
+++ b/tools/qml/qdeclarativetester.cpp
@@ -62,6 +62,12 @@ QDeclarativeTester::QDeclarativeTester(const QString &script, QDeclarativeViewer
parent->viewport()->installEventFilter(this);
parent->installEventFilter(this);
QUnifiedTimer::instance()->setConsistentTiming(true);
+
+ //Font antialiasing makes tests system-specific, so disable it
+ QFont noAA = QApplication::font();
+ noAA.setStyleStrategy(QFont::NoAntialias);
+ QApplication::setFont(noAA);
+
if (options & QDeclarativeViewer::Play)
this->run();
start();
@@ -268,14 +274,7 @@ void QDeclarativeTester::updateCurrentTime(int msec)
if (options & QDeclarativeViewer::TestImages) {
img.fill(qRgb(255,255,255));
-#ifdef Q_WS_MAC
- bool oldSmooth = qt_applefontsmoothing_enabled;
- qt_applefontsmoothing_enabled = false;
-#endif
QPainter p(&img);
-#ifdef Q_WS_MAC
- qt_applefontsmoothing_enabled = oldSmooth;
-#endif
m_view->render(&p);
}
@@ -286,7 +285,7 @@ void QDeclarativeTester::updateCurrentTime(int msec)
fe.msec = msec;
if (msec == 0 || !(options & QDeclarativeViewer::TestImages)) {
// Skip first frame, skip if not doing images
- } else if (0 == (m_savedFrameEvents.count() % 60) || snapshot) {
+ } else if (0 == ((m_savedFrameEvents.count()-1) % 60) || snapshot) {
fe.image = img;
} else {
QCryptographicHash hash(QCryptographicHash::Md5);
@@ -337,14 +336,14 @@ void QDeclarativeTester::updateCurrentTime(int msec)
if (QDeclarativeVisualTestFrame *frame = qobject_cast<QDeclarativeVisualTestFrame *>(event)) {
if (frame->msec() < msec) {
if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) {
- qWarning() << "QDeclarativeTester: Extra frame. Seen:"
+ qWarning() << "QDeclarativeTester(" << m_script << "): Extra frame. Seen:"
<< msec << "Expected:" << frame->msec();
imagefailure();
}
} else if (frame->msec() == msec) {
if (!frame->hash().isEmpty() && frame->hash().toUtf8() != fe.hash.toHex()) {
if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) {
- qWarning() << "QDeclarativeTester: Mismatched frame hash at" << msec
+ qWarning() << "QDeclarativeTester(" << m_script << "): Mismatched frame hash at" << msec
<< ". Seen:" << fe.hash.toHex()
<< "Expected:" << frame->hash().toUtf8();
imagefailure();
@@ -356,9 +355,14 @@ void QDeclarativeTester::updateCurrentTime(int msec)
if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record) && !frame->image().isEmpty()) {
QImage goodImage(frame->image().toLocalFile());
+ if (frame->msec() == 16 && goodImage.size() != img.size()){
+ //Also an image mismatch, but this warning is more informative. Only checked at start though.
+ qWarning() << "QDeclarativeTester(" << m_script << "): Size mismatch. This test must be run at " << goodImage.size();
+ imagefailure();
+ }
if (goodImage != img) {
QString reject(frame->image().toLocalFile() + ".reject.png");
- qWarning() << "QDeclarativeTester: Image mismatch. Reject saved to:"
+ qWarning() << "QDeclarativeTester(" << m_script << "): Image mismatch. Reject saved to:"
<< reject;
img.save(reject);
bool doDiff = (goodImage.size() == img.size());