diff options
Diffstat (limited to 'tools')
38 files changed, 684 insertions, 126 deletions
diff --git a/tools/assistant/lib/qhelpprojectdata.cpp b/tools/assistant/lib/qhelpprojectdata.cpp index 83491a0..b0faf0c 100644 --- a/tools/assistant/lib/qhelpprojectdata.cpp +++ b/tools/assistant/lib/qhelpprojectdata.cpp @@ -47,6 +47,7 @@ #include <QtCore/QStack> #include <QtCore/QMap> #include <QtCore/QRegExp> +#include <QtCore/QUrl> #include <QtCore/QVariant> #include <QtXml/QXmlStreamReader> @@ -77,6 +78,7 @@ private: void readFiles(); void raiseUnknownTokenError(); void addMatchingFiles(const QString &pattern); + bool hasValidSyntax(const QString &nameSpace, const QString &vFolder) const; QMap<QString, QStringList> dirEntriesCache; }; @@ -115,16 +117,14 @@ void QHelpProjectDataPrivate::readProject() if (isStartElement()) { if (name() == QLatin1String("virtualFolder")) { virtualFolder = readElementText(); - if (virtualFolder.contains(QLatin1String("/"))) + if (!hasValidSyntax(QLatin1String("test"), virtualFolder)) raiseError(QCoreApplication::translate("QHelpProject", - "A virtual folder must not contain " - "a \'/\' character!")); + "Virtual folder has invalid syntax.")); } else if (name() == QLatin1String("namespace")) { namespaceName = readElementText(); - if (namespaceName.contains(QLatin1String("/"))) + if (!hasValidSyntax(namespaceName, QLatin1String("test"))) raiseError(QCoreApplication::translate("QHelpProject", - "A namespace must not contain a " - "\'/\' character!")); + "Namespace has invalid syntax.")); } else if (name() == QLatin1String("customFilter")) { readCustomFilter(); } else if (name() == QLatin1String("filterSection")) { @@ -318,6 +318,22 @@ void QHelpProjectDataPrivate::addMatchingFiles(const QString &pattern) filterSectionList.last().addFile(pattern); } +bool QHelpProjectDataPrivate::hasValidSyntax(const QString &nameSpace, + const QString &vFolder) const +{ + const QLatin1Char slash('/'); + if (nameSpace.contains(slash) || vFolder.contains(slash)) + return false; + QUrl url; + const QLatin1String scheme("qthelp"); + url.setScheme(scheme); + url.setHost(nameSpace); + url.setPath(vFolder); + + const QString expectedUrl(scheme + QLatin1String("://") + nameSpace + slash + vFolder); + return url.isValid() && url.toString() == expectedUrl; +} + /*! \internal \class QHelpProjectData diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 9b06400..0c51a02 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -63,6 +63,45 @@ QString AbstractHelpViewer::PageNotFoundMessage = "align=\"center\"><br><br><h1>The page could not be found</h1><br><h3>'%1'" "</h3></div>"); +struct ExtensionMap { + const char *extension; + const char *mimeType; +} extensionMap[] = { + { ".bmp", "image/bmp" }, + { ".css", "text/css" }, + { ".gif", "image/gif" }, + { ".html", "text/html" }, + { ".htm", "text/html" }, + { ".ico", "image/x-icon" }, + { ".jpeg", "image/jpeg" }, + { ".jpg", "image/jpeg" }, + { ".js", "application/x-javascript" }, + { ".mng", "video/x-mng" }, + { ".pbm", "image/x-portable-bitmap" }, + { ".pgm", "image/x-portable-graymap" }, + { ".pdf", "application/pdf" }, + { ".png", "image/png" }, + { ".ppm", "image/x-portable-pixmap" }, + { ".rss", "application/rss+xml" }, + { ".svg", "image/svg+xml" }, + { ".svgz", "image/svg+xml" }, + { ".text", "text/plain" }, + { ".tif", "image/tiff" }, + { ".tiff", "image/tiff" }, + { ".txt", "text/plain" }, + { ".xbm", "image/x-xbitmap" }, + { ".xml", "text/xml" }, + { ".xpm", "image/x-xpm" }, + { ".xsl", "text/xsl" }, + { ".xhtml", "application/xhtml+xml" }, + { ".wml", "text/vnd.wap.wml" }, + { ".wmlc", "application/vnd.wap.wmlc" }, + { "about:blank", 0 }, + { 0, 0 } +}; + +// -- AbstractHelpViewer + AbstractHelpViewer::AbstractHelpViewer() { } @@ -86,9 +125,22 @@ bool AbstractHelpViewer::isLocalUrl(const QUrl &url) bool AbstractHelpViewer::canOpenPage(const QString &url) { TRACE_OBJ - return url.endsWith(QLatin1String(".html"), Qt::CaseInsensitive) - || url.endsWith(QLatin1String(".htm"), Qt::CaseInsensitive) - || url == QLatin1String("about:blank"); + return !mimeFromUrl(url).isEmpty(); +} + +QString AbstractHelpViewer::mimeFromUrl(const QString &url) +{ + TRACE_OBJ + const int index = url.lastIndexOf(QLatin1Char('.')); + const QByteArray &ext = url.mid(index).toUtf8().toLower(); + + const ExtensionMap *e = extensionMap; + while (e->extension) { + if (ext == e->extension) + return QLatin1String(e->mimeType); + ++e; + } + return QLatin1String(""); } bool AbstractHelpViewer::launchWithExternalApp(const QUrl &url) diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index 9e8f5f4..6f1f48d 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -47,6 +47,7 @@ QT_BEGIN_NAMESPACE +class QMouseEvent; class QUrl; class AbstractHelpViewer @@ -64,12 +65,15 @@ public: virtual void resetScale() = 0; virtual qreal scale() const = 0; + virtual bool handleForwardBackwardMouseButtons(QMouseEvent *e) = 0; + static QString AboutBlank; static QString LocalHelpFile; static QString PageNotFoundMessage; static bool isLocalUrl(const QUrl &url); static bool canOpenPage(const QString &url); + static QString mimeFromUrl(const QString &url); static bool launchWithExternalApp(const QUrl &url); }; diff --git a/tools/assistant/tools/assistant/helpviewer_qtb.cpp b/tools/assistant/tools/assistant/helpviewer_qtb.cpp index 07b89eb..3ff64e8 100644 --- a/tools/assistant/tools/assistant/helpviewer_qtb.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qtb.cpp @@ -127,6 +127,20 @@ void HelpViewer::resetScale() zoomCount = 0; } +bool HelpViewer::handleForwardBackwardMouseButtons(QMouseEvent *e) +{ + if (e->button() == Qt::XButton1) { + QTextBrowser::backward(); + return true; + } + + if (e->button() == Qt::XButton2) { + QTextBrowser::forward(); + return true; + } + return false; +} + void HelpViewer::setSource(const QUrl &url) { TRACE_OBJ @@ -229,15 +243,10 @@ void HelpViewer::contextMenuEvent(QContextMenuEvent *e) void HelpViewer::mouseReleaseEvent(QMouseEvent *e) { TRACE_OBJ - if (e->button() == Qt::XButton1) { - QTextBrowser::backward(); - return; - } - - if (e->button() == Qt::XButton2) { - QTextBrowser::forward(); +#ifndef Q_OS_LINUX + if (handleForwardBackwardMouseButtons(e)) return; - } +#endif controlPressed = e->modifiers() & Qt::ControlModifier; if ((controlPressed && hasAnchorAt(e->pos())) || @@ -249,6 +258,15 @@ void HelpViewer::mouseReleaseEvent(QMouseEvent *e) QTextBrowser::mouseReleaseEvent(e); } +void HelpViewer::mousePressEvent(QMouseEvent *e) +{ +#ifdef Q_OS_LINUX + if (handleForwardBackwardMouseButtons(e)) + return; +#endif + QTextBrowser::mousePressEvent(e); +} + void HelpViewer::keyPressEvent(QKeyEvent *e) { TRACE_OBJ diff --git a/tools/assistant/tools/assistant/helpviewer_qtb.h b/tools/assistant/tools/assistant/helpviewer_qtb.h index a05782c..acb734b 100644 --- a/tools/assistant/tools/assistant/helpviewer_qtb.h +++ b/tools/assistant/tools/assistant/helpviewer_qtb.h @@ -72,6 +72,8 @@ public: void resetScale(); qreal scale() const { return zoomCount; } + bool handleForwardBackwardMouseButtons(QMouseEvent *e); + void setSource(const QUrl &url); inline bool hasSelection() const @@ -91,6 +93,7 @@ private: void contextMenuEvent(QContextMenuEvent *e); void mouseReleaseEvent(QMouseEvent *e); void keyPressEvent(QKeyEvent *e); + void mousePressEvent(QMouseEvent *e); private slots: void openLinkInNewTab(); diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp index 582d013..db1cd58 100644 --- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp @@ -129,26 +129,15 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, const QNetworkRequest &request, QIODevice* /*outgoingData*/) { TRACE_OBJ - const QUrl& url = request.url(); - QString mimeType = url.toString(); - if (mimeType.endsWith(QLatin1String(".svg")) - || mimeType.endsWith(QLatin1String(".svgz"))) { - mimeType = QLatin1String("image/svg+xml"); - } else if (mimeType.endsWith(QLatin1String(".css"))) { - mimeType = QLatin1String("text/css"); - } else if (mimeType.endsWith(QLatin1String(".js"))) { - mimeType = QLatin1String("text/javascript"); - } else if (mimeType.endsWith(QLatin1String(".txt"))) { - mimeType = QLatin1String("text/plain"); - } else { - mimeType = QLatin1String("text/html"); - } - + const QUrl &url = request.url(); + const QString &mimeType = AbstractHelpViewer::mimeFromUrl(url.toString()); + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); const QByteArray &data = helpEngine.findFile(url).isValid() ? helpEngine.fileData(url) : AbstractHelpViewer::PageNotFoundMessage.arg(url.toString()).toUtf8(); - return new HelpNetworkReply(request, data, mimeType); + return new HelpNetworkReply(request, data, mimeType.isEmpty() + ? QLatin1String("application/octet-stream") : mimeType); } class HelpPage : public QWebPage @@ -312,6 +301,22 @@ void HelpViewer::resetScale() setTextSizeMultiplier(1.0); } +bool HelpViewer::handleForwardBackwardMouseButtons(QMouseEvent *e) +{ + TRACE_OBJ + if (e->button() == Qt::XButton1) { + triggerPageAction(QWebPage::Back); + return true; + } + + if (e->button() == Qt::XButton2) { + triggerPageAction(QWebPage::Forward); + return true; + } + + return false; +} + void HelpViewer::setSource(const QUrl &url) { TRACE_OBJ @@ -339,15 +344,10 @@ void HelpViewer::wheelEvent(QWheelEvent *e) void HelpViewer::mouseReleaseEvent(QMouseEvent *e) { TRACE_OBJ - if (e->button() == Qt::XButton1) { - triggerPageAction(QWebPage::Back); +#ifndef Q_OS_LINUX + if (handleForwardBackwardMouseButtons(e)) return; - } - - if (e->button() == Qt::XButton2) { - triggerPageAction(QWebPage::Forward); - return; - } +#endif QWebView::mouseReleaseEvent(e); } @@ -367,6 +367,11 @@ void HelpViewer::actionChanged() void HelpViewer::mousePressEvent(QMouseEvent *event) { TRACE_OBJ +#ifdef Q_OS_LINUX + if (handleForwardBackwardMouseButtons(event)) + return; +#endif + HelpPage *currentPage = static_cast<HelpPage*>(page()); if (currentPage) { currentPage->m_pressedButtons = event->buttons(); diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.h b/tools/assistant/tools/assistant/helpviewer_qwv.h index 41ee553..a2c0389 100644 --- a/tools/assistant/tools/assistant/helpviewer_qwv.h +++ b/tools/assistant/tools/assistant/helpviewer_qwv.h @@ -69,6 +69,8 @@ public: void resetScale(); qreal scale() const { return textSizeMultiplier(); } + bool handleForwardBackwardMouseButtons(QMouseEvent *e); + void setSource(const QUrl &url); inline QUrl source() const { return url(); } diff --git a/tools/linguist/linguist.pro b/tools/linguist/linguist.pro index 85ecd5a..248c89e 100644 --- a/tools/linguist/linguist.pro +++ b/tools/linguist/linguist.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs SUBDIRS = \ - linguist \ lrelease \ lupdate \ lconvert +!no-png:!contains(QT_CONFIG, no-gui):SUBDIRS += linguist diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp index 465355d..c86a9dd 100644 --- a/tools/linguist/shared/translator.cpp +++ b/tools/linguist/shared/translator.cpp @@ -45,8 +45,13 @@ #include <stdio.h> #ifdef Q_OS_WIN -#include <io.h> // required for _setmode, to avoid _O_TEXT streams... -#include <fcntl.h> // for _O_BINARY +// required for _setmode, to avoid _O_TEXT streams... +# ifdef Q_OS_WINCE +# include <stdlib.h> +# else +# include <io.h> // for _setmode +# include <fcntl.h> // for _O_BINARY +# endif #endif #include <QtCore/QDebug> @@ -213,7 +218,11 @@ bool Translator::load(const QString &filename, ConversionData &cd, const QString if (filename.isEmpty() || filename == QLatin1String("-")) { #ifdef Q_OS_WIN // QFile is broken for text files +# ifdef Q_OS_WINCE + ::_setmode(stdin, _O_BINARY); +# else ::_setmode(0, _O_BINARY); +# endif #endif if (!file.open(stdin, QIODevice::ReadOnly)) { cd.appendError(QString::fromLatin1("Cannot open stdin!? (%1)") @@ -253,7 +262,11 @@ bool Translator::save(const QString &filename, ConversionData &cd, const QString if (filename.isEmpty() || filename == QLatin1String("-")) { #ifdef Q_OS_WIN // QFile is broken for text files +# ifdef Q_OS_WINCE + ::_setmode(stdout, _O_BINARY); +# else ::_setmode(1, _O_BINARY); +# endif #endif if (!file.open(stdout, QIODevice::WriteOnly)) { cd.appendError(QString::fromLatin1("Cannot open stdout!? (%1)") diff --git a/tools/qdbus/qdbus.pro b/tools/qdbus/qdbus.pro index 01cd246..a264882 100644 --- a/tools/qdbus/qdbus.pro +++ b/tools/qdbus/qdbus.pro @@ -1,2 +1,3 @@ TEMPLATE = subdirs -SUBDIRS = qdbus qdbusxml2cpp qdbuscpp2xml qdbusviewer +SUBDIRS = qdbus qdbusxml2cpp qdbuscpp2xml +!contains(QT_CONFIG, no-gui): SUBDIRS += qdbusviewer diff --git a/tools/qdoc3/config.cpp b/tools/qdoc3/config.cpp index 3150f28..4d1c378 100644 --- a/tools/qdoc3/config.cpp +++ b/tools/qdoc3/config.cpp @@ -528,8 +528,11 @@ QString Config::findFile(const Location& location, { QStringList::ConstIterator e = fileExtensions.begin(); while (e != fileExtensions.end()) { - QString filePath = findFile(location, files, dirs, fileBase + "." + *e, - userFriendlyFilePath); + QString filePath = findFile(location, + files, + dirs, + fileBase + "." + *e, + userFriendlyFilePath); if (!filePath.isEmpty()) return filePath; ++e; diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h index 6f23469..980d1fb 100644 --- a/tools/qdoc3/config.h +++ b/tools/qdoc3/config.h @@ -149,12 +149,16 @@ class Config #define CONFIG_PROJECT "project" #define CONFIG_QHP "qhp" #define CONFIG_QUOTINGINFORMATION "quotinginformation" +#define CONFIG_SCRIPTDIRS "scriptdirs" +#define CONFIG_SCRIPTS "scripts" #define CONFIG_SLOW "slow" #define CONFIG_SHOWINTERNAL "showinternal" #define CONFIG_SOURCEDIRS "sourcedirs" #define CONFIG_SOURCEENCODING "sourceencoding" #define CONFIG_SOURCES "sources" #define CONFIG_SPURIOUS "spurious" +#define CONFIG_STYLEDIRS "styledirs" +#define CONFIG_STYLES "styles" #define CONFIG_STYLESHEETS "stylesheets" #define CONFIG_TABSIZE "tabsize" #define CONFIG_TAGFILE "tagfile" diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 3f955bf..24219a1 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -66,6 +66,10 @@ QStringList Generator::imageFiles; QStringList Generator::imageDirs; QStringList Generator::exampleDirs; QStringList Generator::exampleImgExts; +QStringList Generator::scriptFiles; +QStringList Generator::scriptDirs; +QStringList Generator::styleFiles; +QStringList Generator::styleDirs; QString Generator::outDir; QString Generator::project; @@ -124,10 +128,20 @@ void Generator::initialize(const Config &config) if (!dirInfo.mkdir(outDir + "/images/used-in-examples")) config.lastLocation().fatal(tr("Cannot create output directory '%1'") .arg(outDir + "/images/used-in-examples")); + if (!dirInfo.mkdir(outDir + "/scripts")) + config.lastLocation().fatal(tr("Cannot create output directory '%1'") + .arg(outDir + "/scripts")); + if (!dirInfo.mkdir(outDir + "/style")) + config.lastLocation().fatal(tr("Cannot create output directory '%1'") + .arg(outDir + "/style")); } imageFiles = config.getStringList(CONFIG_IMAGES); imageDirs = config.getStringList(CONFIG_IMAGEDIRS); + scriptFiles = config.getStringList(CONFIG_SCRIPTS); + scriptDirs = config.getStringList(CONFIG_SCRIPTDIRS); + styleFiles = config.getStringList(CONFIG_STYLES); + styleDirs = config.getStringList(CONFIG_STYLEDIRS); exampleDirs = config.getStringList(CONFIG_EXAMPLEDIRS); exampleImgExts = config.getStringList(CONFIG_EXAMPLES + Config::dot + CONFIG_IMAGEEXTENSIONS); @@ -165,6 +179,47 @@ void Generator::initialize(const Config &config) "/images"); ++e; } + + QStringList noExts; + QStringList scripts = + config.getStringList(CONFIG_SCRIPTS+Config::dot+(*g)->format()); + e = scripts.begin(); + while (e != scripts.end()) { + QString userFriendlyFilePath; + QString filePath = Config::findFile(config.lastLocation(), + scriptFiles, + scriptDirs, + *e, + noExts, + userFriendlyFilePath); + if (!filePath.isEmpty()) + Config::copyFile(config.lastLocation(), + filePath, + userFriendlyFilePath, + (*g)->outputDir() + + "/scripts"); + ++e; + } + + QStringList styles = + config.getStringList(CONFIG_STYLES+Config::dot+(*g)->format()); + e = styles.begin(); + while (e != styles.end()) { + QString userFriendlyFilePath; + QString filePath = Config::findFile(config.lastLocation(), + styleFiles, + styleDirs, + *e, + noExts, + userFriendlyFilePath); + if (!filePath.isEmpty()) + Config::copyFile(config.lastLocation(), + filePath, + userFriendlyFilePath, + (*g)->outputDir() + + "/style"); + ++e; + } } ++g; } diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index 30d9af4..326a247 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -191,6 +191,10 @@ class Generator static QStringList imageDirs; static QStringList exampleDirs; static QStringList exampleImgExts; + static QStringList scriptFiles; + static QStringList scriptDirs; + static QStringList styleFiles; + static QStringList styleDirs; static QString outDir; static QString project; }; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index fb9fa95..4985f64 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -333,6 +333,7 @@ QString HtmlGenerator::format() */ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) { +#if 0 // Copy the stylesheets from the directory containing the qdocconf file. // ### This should be changed to use a special directory in doc/src. QStringList::ConstIterator styleIter = stylesheets.begin(); @@ -342,7 +343,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) Config::copyFile(Location(), filePath, filePath, outputDir()); ++styleIter; } - +#endif myTree = tree; nonCompatClasses.clear(); mainClasses.clear(); @@ -1356,10 +1357,10 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, if (!inner->doc().isEmpty()) { out() << "<hr />\n" - << "<div class=\"descr\"/>\n" + << "<div class=\"descr\"/>\n" // QTBUG-9504 << "<h2>" << "Detailed Description" << "</h2>\n"; generateBody(inner, marker); - out() << "</div>\n"; + out() << "</div>\n"; // QTBUG-9504 generateAlsoList(inner, marker); } @@ -1368,7 +1369,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, while (s != sections.end()) { out() << "<hr />\n"; if (!(*s).divClass.isEmpty()) - out() << "<div class=\"" << (*s).divClass << "\"/>\n"; + out() << "<div class=\"" << (*s).divClass << "\"/>\n"; // QTBUG-9504 out() << "<h2>" << protectEnc((*s).name) << "</h2>\n"; NodeList::ConstIterator m = (*s).members.begin(); @@ -1419,7 +1420,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, ++m; } if (!(*s).divClass.isEmpty()) - out() << "</div>\n"; + out() << "</div>\n"; // QTBUG-9504 ++s; } generateFooter(inner); @@ -1468,6 +1469,14 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) } generateHeader(htmlTitle, fake, marker, true); + + /* + 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); + generateTitle(fullTitle, Text() << fake->subTitle(), subTitleSize, @@ -1591,10 +1600,14 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) Text brief = fake->doc().briefText(); if (fake->subType() == Node::Module && !brief.isEmpty()) { out() << "<a name=\"" << registerRef("details") << "\"></a>\n"; + out() << "<div class=\"descr\"/>\n"; // QTBUG-9504 out() << "<h2>" << "Detailed Description" << "</h2>\n"; } + else + out() << "<div class=\"descr\"/>\n"; // QTBUG-9504 generateBody(fake, marker); + out() << "</div>\n"; // QTBUG-9504 generateAlsoList(fake, marker); if (!fake->groupMembers().isEmpty()) { @@ -1653,13 +1666,79 @@ QString HtmlGenerator::fileExtension(const Node * /* node */) const return "html"; } +#if 0 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>Qt Reference Documentation</title> + <link rel="stylesheet" type="text/css" href="style/style.css" /> + <!--[if IE]> + <meta name="MSSmartTagsPreventParsing" content="true"> + <meta http-equiv="imagetoolbar" content="no"> + <![endif]--> + <!--[if lt IE 7]> + <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> + <![endif]--> + <!--[if IE 7]> + <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> + <![endif]--> + <!--[if IE 8]> + <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> + <![endif]--> + + <script src="scripts/jquery.js" type="text/javascript"></script> + +</head> +#endif + void HtmlGenerator::generateHeader(const QString& title, const Node *node, CodeMarker *marker, bool mainPage) { out() << QString("<?xml version=\"1.0\" encoding=\"%1\"?>\n").arg(outputEncoding); - + out() << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"; + out() << "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"; + out() << "<head>\n"; + out() << " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n"; + QString shortVersion; + shortVersion = project + " " + shortVersion + ": "; + if (node && !node->doc().location().isEmpty()) + out() << "<!-- " << node->doc().location().fileName() << " -->\n"; + + 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() << " <title>" << shortVersion << protectEnc(title) << "</title>\n"; + + //out() << " <title>Qt Reference Documentation</title>"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />\n"; + out() << " <!--[if IE]>\n"; + out() << " <meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n"; + out() << " <meta http-equiv=\"imagetoolbar\" content=\"no\">\n"; + out() << " <![endif]-->\n"; + out() << " <!--[if lt IE 7]>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n"; + out() << " <![endif]-->\n"; + out() << " <!--[if IE 7]>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n"; + out() << " <![endif]-->\n"; + out() << " <!--[if IE 8]>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n"; + out() << " <![endif]-->\n"; + out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n"; + out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; + out() << "</head>\n"; + +#if 0 out() << "<!DOCTYPE html\n" " PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n"; out() << QString("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"%1\" lang=\"%1\">\n").arg(naturalLanguage); @@ -1791,14 +1870,16 @@ void HtmlGenerator::generateHeader(const QString& title, } out() << "</head>\n" - "<body>\n"; + #endif + out() << "<body class=\"\">\n"; if (mainPage) generateMacRef(node, marker); out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - +#if 0 if (node && !node->links().empty()) out() << "<p>\n" << navigationLinks << "</p>\n"; +#endif } void HtmlGenerator::generateTitle(const QString& title, @@ -1857,6 +1938,9 @@ void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) } } +/*! + Generates a table of contents begining at \a node. + */ void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker, Doc::SectioningUnit sectioningUnit, @@ -1938,6 +2022,71 @@ void HtmlGenerator::generateTableOfContents(const Node *node, inLink = false; } +/*! + Revised for the new doc format. + Generates a table of contents begining at \a node. + */ +void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker) +{ + if (!node->doc().hasTableOfContents()) + return; + QList<Atom *> toc = node->doc().tableOfContents(); + if (toc.isEmpty()) + return; + + Doc::SectioningUnit sectioningUnit = Doc::Section4; + QString nodeName = node->name(); + + QStringList sectionNumber; + int columnSize = 0; + + // disable nested links in table of contents + inContents = true; + inLink = true; + + out() << "<div class=\"toc\">\n"; + + 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() << "<ul>\n"; + sectionNumber.append("1"); + } while (sectionNumber.size() < nextLevel); + } + else { + while (sectionNumber.size() > nextLevel) { + out() << "</ul>\n"; + sectionNumber.removeLast(); + } + sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1); + } + int numAtoms; + Text headingText = Text::sectionHeading(atom); + out() << "<li>"; + out() << "<a href=\"" + << "#" + << Doc::canonicalTitle(headingText.toString()) + << "\">"; + generateAtomList(headingText.firstAtom(), node, marker, true, numAtoms); + out() << "</a></li>\n"; + + ++columnSize; + } + while (!sectionNumber.isEmpty()) { + out() << "</ul>\n"; + sectionNumber.removeLast(); + } + out() << "</div>\n"; + inContents = false; + inLink = false; +} + #if 0 void HtmlGenerator::generateNavigationBar(const NavigationBar& bar, const Node *node, @@ -2172,7 +2321,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, QString commonPrefix) { const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' - const int NumColumns = 4; // number of columns in the result + const int NumColumns = 3; // number of columns in the result if (classMap.isEmpty()) return; diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 8fe0331..ec96c34 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -153,6 +153,7 @@ class HtmlGenerator : public PageGenerator Doc::SectioningUnit sectioningUnit, int numColumns, const Node *relative = 0); + void generateTableOfContents(const Node *node, CodeMarker *marker); QString generateListOfAllMemberFile(const InnerNode *inner, CodeMarker *marker); QString generateLowStatusMemberFile(const InnerNode *inner, CodeMarker *marker, diff --git a/tools/qdoc3/location.cpp b/tools/qdoc3/location.cpp index 19625da..dee87d1 100644 --- a/tools/qdoc3/location.cpp +++ b/tools/qdoc3/location.cpp @@ -265,6 +265,8 @@ void Location::error(const QString& message, const QString& details) const void Location::fatal(const QString& message, const QString& details) const { emitMessage(Error, message, details); + information(message); + information(details); information("Aborting"); exit(EXIT_FAILURE); } diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 63455f1..5308afd 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -40,6 +40,7 @@ exampledirs = $QT_SOURCE_TREE \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src -imagedirs = $QT_SOURCE_TREE/doc/src/images +imagedirs = $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc-build/html-assistant base = file:$QT_BUILD_TREE/doc-build/html-assistant diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index b0c88f1..2eb3d96 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -46,6 +46,7 @@ exampledirs = $QT_SOURCE_TREE \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src -imagedirs = $QT_SOURCE_TREE/doc/src/images +imagedirs = $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc-build/html-designer base = file:$QT_BUILD_TREE/doc-build/html-designer diff --git a/tools/qdoc3/test/jambi.qdocconf b/tools/qdoc3/test/jambi.qdocconf index 04bb51b..aa87826 100644 --- a/tools/qdoc3/test/jambi.qdocconf +++ b/tools/qdoc3/test/jambi.qdocconf @@ -16,7 +16,8 @@ outputdir = $JAMBI/doc/html/com/trolltech/qt imagedirs = $QTDIR/doc/src/images \ $QTDIR/examples \ $JAMBI/doc/src/images \ - ../doc/src/images + ../doc/src/images \ + $QTDIR/doc/src/template/images extraimages.javadoc = qt-logo \ qt-logo.png diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index 6acd2c6..ac536be 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -42,6 +42,7 @@ exampledirs = $QT_SOURCE_TREE \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src -imagedirs = $QT_SOURCE_TREE/doc/src/images +imagedirs = $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc-build/html-linguist base = file:$QT_BUILD_TREE/doc-build/html-linguist diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf index e5b883a..03514c1 100644 --- a/tools/qdoc3/test/qdeclarative.qdocconf +++ b/tools/qdoc3/test/qdeclarative.qdocconf @@ -58,7 +58,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ $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/declarative/pics \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc-build/html-qml tagfile = $QT_BUILD_TREE/doc-build/html-qml/qt.tags base = file:$QT_BUILD_TREE/doc/html-qml diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index 76e7012..bd47028 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -35,6 +35,7 @@ exampledirs = $QT_SOURCE_TREE \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src -imagedirs = $QT_SOURCE_TREE/doc/src/images +imagedirs = $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc-build/html-qmake base = file:$QT_BUILD_TREE/doc-build/html-qmake diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index fb2c3c1..c9392c0 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -106,7 +106,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ $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/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 diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index 7a77f54..19db8a9 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -76,7 +76,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ $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/examples \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc/html_zh_CN tagfile = $QT_BUILD_TREE/doc/html_zh_CN/qt.tags base = file:$QT_BUILD_TREE/doc/html_zh_CN diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf index b22727f..e1a008e 100644 --- a/tools/qdoc3/test/qt-defines.qdocconf +++ b/tools/qdoc3/test/qt-defines.qdocconf @@ -19,8 +19,48 @@ codeindent = 1 # See also qhp.Qt.extraFiles extraimages.HTML = qt-logo \ trolltech-logo \ + api_examples.png \ + bg_ll.png \ + bg_ul_blank.png \ + bullet_gt.png \ + horBar.png \ + qt_ref_doc.png \ + api_lookup.png \ + bg_ll_blank.png \ + bg_ur.png \ + bullet_sq.png \ + page_bg.png \ + qt_tools.png \ + api_topics.png \ + bg_lr.png \ + bg_ur_blank.png \ + content_bg.png \ + print.png \ + sep.png \ + bg_l.png \ + bg_r.png \ + box_bg.png \ + feedbackground.png \ + qt_guide.png \ + sprites-combined.png \ + bg_l_blank.png \ + bg_ul.png \ + breadcrumb.png \ + form_bg.png \ + qt_icon.png \ taskmenuextension-example.png \ coloreditorfactoryimage.png \ dynamiclayouts-example.png \ stylesheet-coffee-plastique.png -
\ No newline at end of file + +# This stuff is used by the new doc format. +scriptdirs = $QTDIR/doc/src/template/scripts +styledirs = $QTDIR/doc/src/template/style + +scripts.HTML = functions.js \ + jquery.js + +styles.HTML = style.css \ + style_ie6.css \ + style_ie7.css \ + style_ie8.css diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 60d6b61..5bb4382 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -1,25 +1,145 @@ -HTML.stylesheets = classic.css -HTML.postheader = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n" \ - "<tr>\n" \ - "<td align=\"left\" valign=\"top\" width=\"32\">" \ - "<a href=\"http://qt.nokia.com/\"><img src=\"images/qt-logo.png\" align=\"left\" border=\"0\" /></a>" \ - "</td>\n" \ - "<td width=\"1\"> </td>" \ - "<td class=\"postheader\" valign=\"center\">" \ - "<a href=\"index.html\">" \ - "<font color=\"#004faf\">Home</font></a> ·" \ - " <a href=\"classes.html\">" \ - "<font color=\"#004faf\">All Classes</font></a> ·" \ - " <a href=\"functions.html\">" \ - "<font color=\"#004faf\">All Functions</font></a> ·" \ - " <a href=\"overviews.html\">" \ - "<font color=\"#004faf\">Overviews</font></a>" \ - "</td>" \ - "</tr></table>" +HTML.stylesheets = style/style.css +HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ + " <div id=\"nav-logo\">\n" \ + " <a href=\"index.html\">Home</a></div>\n" \ + " <a href=\"#\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \ + " <div id=\"nav-topright\">\n" \ + " <ul>\n" \ + " <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \ + " <li class=\"nav-topright-dev\"><a href=\"http://qt.nokia.com/developer\">DEV</a></li>\n" \ + " <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \ + " <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \ + " DOC</a></li>\n" \ + " <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \ + " <li class=\"nav-topright-shop\"><a title=\"SHOP\" href=\"http://shop.qt.nokia.com\">SHOP</a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div id=\"shortCut\">\n" \ + " <ul>\n" \ + " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">VERSION 4.7</a></span></li>\n" \ + " <li class=\"shortCut-topleft-active\"><a href=\"http://qt.nokia.com/doc/\">ALL QT VERSIONS" \ + " </a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"wrapper\">\n" \ + " <div class=\"hd\">\n" \ + " <span></span>\n" \ + " </div>\n" \ + " <div class=\"bd group\">\n" \ + " <div class=\"sidebar\">\n" \ + " <div class=\"searchlabel\">\n" \ + " Search index:</div>\n" \ + " <div class=\"search\">\n" \ + " <form id=\"qtdocsearch\" action=\"#\">\n" \ + " <fieldset>\n" \ + " <input type=\"text\" name=\"searchstring\" id=\"searchstring\" value=\"\" onkeyup=\"doSearch(this.value);\" />\n" \ + " </fieldset>\n" \ + " </form>\n" \ + " </div>\n" \ + " <div class=\"box first bottombar\" id=\"lookup\">\n" \ + " <h2>\n" \ + " API Lookup</h2>\n" \ + " <div class=\"list\">\n" \ + " <ul>\n" \ + " <li><a href=\"modules.html\">All modules</a></li>\n" \ + " <li><a href=\"classes.html\">All classes</a></li>\n" \ + " <li><a href=\"functions.html\">All functions</a></li>\n" \ + " <li><a href=\"platform-specific.html\">Platform specifics</a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div class=\"live\">\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"box bottombar\" id=\"topics\">\n" \ + " <h2>\n" \ + " API Topics</h2>\n" \ + " <div class=\"list\">\n" \ + " <ul>\n" \ + " <li><a href=\"object.html\">QObject model</a></li>\n" \ + " <li><a href=\"eventsandfilters.html\">Events, signals & slots</a></li>\n" \ + " <li><a href=\"paintsystem.html\">Graphics & Paint system</a></li>\n" \ + " <li><a href=\"declarativeui.html\">Qt Quick</a></li>\n" \ + " <li><a href=\"widgets-and-layouts.html\">Widget style & layout</a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div class=\"live\">\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"box\" id=\"examples\">\n" \ + " <h2>\n" \ + " API Examples</h2>\n" \ + " <div class=\"list\">\n" \ + " <ul>\n" \ + " <li><a href=\"examples.html\">All examples</a></li>\n" \ + " <li><a href=\"tutorials.html\">All tutorials</a></li>\n" \ + " <li><a href=\"#\">Qt Quick examples</a></li>\n" \ + " <li><a href=\"#\">Desktop examples</a></li>\n" \ + " <li><a href=\"#\">Device examples</a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div class=\"live\">\n" \ + " </div>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"wrap\">\n" \ + " <div class=\"toolbar\">\n" \ + " <div class=\"breadcrumb toolblock\">\n" \ + " <ul>\n" \ + " <li class=\"first\"><a href=\"index.html\">Home</a></li>\n" \ + " <!-- Bread crumbs goes here -->\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div class=\"toolbuttons toolblock\">\n" \ + " <ul>\n" \ + " <li id=\"smallA\" class=\"t_button\">A</li>\n" \ + " <li id=\"medA\" class=\"t_button active\">A</li>\n" \ + " <li id=\"bigA\" class=\"t_button\">A</li>\n" \ + " <li id=\"print\" class=\"t_button\"><a href=\"javascript:this.print();\">\n" \ + " <img src=\"images/sep.png\" /><img id=\"printIcon\" src=\"images/print.png\" alt=\"Print this page\" /></a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"content\">\n" -HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ - "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ - "<td width=\"40%\" align=\"left\">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ - "<td width=\"20%\" align=\"center\"><a href=\"trademarks.html\">Trademarks</a></td>\n" \ - "<td width=\"40%\" align=\"right\"><div align=\"right\">Qt \\version</div></td>\n" \ - "</tr></table></div></address>" +HTML.footer = " </div>\n" \ + " <div class=\"feedback t_button\" onclick=\"$(\'#feedbackBox\').show();$(\'#blurpage\').show()\">\n" \ + " [+] Documentation Feedback</div>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"ft\">\n" \ + " <span></span>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"footer\">\n" \ + " <p>\n" \ + " <acronym title=\"Copyright\">©</acronym> 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.</p>\n" \ + " <p>\n" \ + " All other trademarks are property of their respective owners. <a title=\"Privacy Policy\">\n" \ + " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \ + " </div>\n" \ + " <div id=\"feedbackBox\">\n" \ + " <form action=\"#\">\n" \ + " <div id=\"feedcloseX\">\n" \ + " <a href=\"#\" onclick=\"$(\'#feedbackBox\').hide();$(\'#blurpage\').hide()\">X</a>\n" \ + " </div>\n" \ + " <textarea id=\"feedbox\" rows=\"5\" cols=\"40\">Please submit you feedback...</textarea>\n" \ + " <input id=\"feedsubmit\" type=\"submit\" onclick=\"$(\'#feedbackBox\').hide();$(\'#blurpage\').hide()\">\n" \ + " name=\"feedback\" />\n" \ + " </form>\n" \ + " </div>\n" \ + " <div id=\"blurpage\">\n" \ + " </div>\n" \ + " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n" \ + "<script type=\"text/javascript\">\n" \ + " var _gaq = _gaq || [];>\n" \ + " _gaq.push([\'_setAccount\', \'UA-4457116-5\']);>\n" \ + " _gaq.push([\'_trackPageview\']);>\n" \ + " (function() {>\n" \ + " var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;>\n" \ + " ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';>\n" \ + " var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);>\n" \ + " })();>\n" \ + "</script>\n" diff --git a/tools/qdoc3/test/qt-webxml.qdocconf b/tools/qdoc3/test/qt-webxml.qdocconf index 3ad0457..80ced42 100644 --- a/tools/qdoc3/test/qt-webxml.qdocconf +++ b/tools/qdoc3/test/qt-webxml.qdocconf @@ -2,7 +2,8 @@ include(qt.qdocconf) quotinginformation = true imagedirs = $QTDIR/doc/src/images \ - $QTDIR/examples + $QTDIR/examples \ + $QTDIR/doc/src/template/images outputdir = $QTDIR/doc/webxml outputformats = WebXML diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index d8b9136..29b49e2 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -108,7 +108,8 @@ exampledirs = $QTDIR/doc/src \ $QTDIR/src/3rdparty/webkit/WebKit/qt/docs imagedirs = $QTDIR/doc/src/images \ $QTDIR/examples \ - $QTDIR/doc/src/declarative/pics + $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 diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf index 8c7e64a..980c542 100644 --- a/tools/qdoc3/test/qt_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt_zh_CN.qdocconf @@ -78,7 +78,8 @@ exampledirs = $QTDIR/doc/src \ $QTDIR/qmake/examples \ $QTDIR/src/3rdparty/webkit/WebKit/qt/docs imagedirs = $QTDIR/doc/src/images \ - $QTDIR/examples + $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 diff --git a/tools/qml/Info_mac.plist b/tools/qml/Info_mac.plist new file mode 100644 index 0000000..ce4ebe3 --- /dev/null +++ b/tools/qml/Info_mac.plist @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> +<plist version="0.1"> +<dict> + <key>CFBundleIdentifier</key> + <string>com.nokia.qt.qml</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleGetInfoString</key> + <string>Created by Qt/QMake</string> + <key>CFBundleSignature</key> + <string>@TYPEINFO@</string> + <key>CFBundleExecutable</key> + <string>@EXECUTABLE@</string> +</dict> +</plist> diff --git a/tools/qml/content/Browser.qml b/tools/qml/content/Browser.qml index 391ded8..8882d5a 100644 --- a/tools/qml/content/Browser.qml +++ b/tools/qml/content/Browser.qml @@ -3,8 +3,8 @@ import Qt 4.6 Rectangle { id: root property bool keyPressed: false - property var folders: folders1 - property var view: view1 + property variant folders: folders1 + property variant view: view1 width: 320 height: 480 color: palette.window diff --git a/tools/qml/deviceorientation_maemo.cpp b/tools/qml/deviceorientation_maemo.cpp index fa2c6e5..9f12f3d 100644 --- a/tools/qml/deviceorientation_maemo.cpp +++ b/tools/qml/deviceorientation_maemo.cpp @@ -50,6 +50,10 @@ public: MaemoOrientation() : DeviceOrientation(),m_current(Portrait), m_lastSeen(Portrait), m_lastSeenCount(0) { + m_current = get(); + if (m_current == UnknownOrientation) + m_current = Portrait; + startTimer(100); } @@ -57,14 +61,7 @@ public: return m_current; } - void setOrientation(Orientation orient) { - //XXX maybe better to just ignore - if (orient != m_current) { - m_current = orient; - emit orientationChanged(); - } - } - + void setOrientation(Orientation) { } protected: virtual void timerEvent(QTimerEvent *) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 5099e49..01b3912 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -101,8 +101,9 @@ void usage() qWarning(" -dragthreshold <size> .................... set mouse drag threshold size"); qWarning(" -netcache <size> ......................... set disk cache to size bytes"); qWarning(" -translation <translationfile> ........... set the language to run in"); - qWarning(" -L <directory> ........................... prepend to the library search path,"); + qWarning(" -I <directory> ........................... prepend to the module import search path,"); qWarning(" display path if <directory> is empty"); + qWarning(" -P <directory> ........................... prepend to the plugin search path"); qWarning(" -opengl .................................. use a QGLWidget for the viewport"); qWarning(" -script <path> ........................... set the script to use"); qWarning(" -scriptopts <options>|help ............... set the script options to use"); @@ -167,7 +168,8 @@ int main(int argc, char ** argv) QString dither = "none"; QString recordfile; QStringList recordargs; - QStringList libraries; + QStringList imports; + QStringList plugins; QString skin; QString script; QString scriptopts; @@ -239,14 +241,19 @@ int main(int argc, char ** argv) useGL = true; } else if (arg == "-qmlbrowser") { useNativeFileBrowser = false; - } else if (arg == "-L") { + } else if (arg == "-I" || arg == "-L") { + if (arg == "-L") + fprintf(stderr, "-L option provided for compatibility only, use -I instead"); if (lastArg) { QDeclarativeEngine tmpEngine; QString paths = tmpEngine.importPathList().join(QLatin1String(":")); fprintf(stderr, "Current search path: %s\n", paths.toLocal8Bit().constData()); return 0; } - libraries << QString(argv[++i]); + imports << QString(argv[++i]); + } else if (arg == "-P") { + if (lastArg) usage(); + plugins << QString(argv[++i]); } else if (arg == "-script") { if (lastArg) usage(); script = QString(argv[++i]); @@ -320,9 +327,12 @@ int main(int argc, char ** argv) viewer.addLibraryPath(QCoreApplication::applicationDirPath()); - foreach (QString lib, libraries) + foreach (QString lib, imports) viewer.addLibraryPath(lib); + foreach (QString plugin, plugins) + viewer.addPluginPath(plugin); + viewer.setNetworkCacheSize(cache); viewer.setRecordFile(recordfile); if (resizeview) @@ -349,6 +359,21 @@ int main(int argc, char ** argv) viewer.setUseNativeFileBrowser(useNativeFileBrowser); if (fullScreen && maximized) qWarning() << "Both -fullscreen and -maximized specified. Using -fullscreen."; + + if (fileName.isEmpty()) { + QFile qmlapp(QLatin1String("qmlapp")); + if (qmlapp.exists() && qmlapp.open(QFile::ReadOnly)) { + QString content = QString::fromUtf8(qmlapp.readAll()); + qmlapp.close(); + + int newline = content.indexOf(QLatin1Char('\n')); + if (newline >= 0) + fileName = content.left(newline); + else + fileName = content; + } + } + if (!fileName.isEmpty()) { viewer.open(fileName); fullScreen ? viewer.showFullScreen() : maximized ? viewer.showMaximized() : viewer.show(); diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro index ebf5366..bc6d032 100644 --- a/tools/qml/qml.pro +++ b/tools/qml/qml.pro @@ -58,3 +58,7 @@ symbian { LIBS += -lesock -lcommdb -lconnmon -linsock TARGET.CAPABILITY = "All -TCB" } +mac { + QMAKE_INFO_PLIST=Info_mac.plist + TARGET=Qml +} diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 1ab528e..c4ebd80 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -870,6 +870,11 @@ void QDeclarativeViewer::addLibraryPath(const QString& lib) canvas->engine()->addImportPath(lib); } +void QDeclarativeViewer::addPluginPath(const QString& plugin) +{ + canvas->engine()->addPluginPath(plugin); +} + void QDeclarativeViewer::reload() { openQml(currentFileOrUrl); diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index 01777bd..6f1e425 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -96,6 +96,7 @@ public: void setDeviceKeys(bool); void setNetworkCacheSize(int size); void addLibraryPath(const QString& lib); + void addPluginPath(const QString& plugin); void setUseGL(bool use); void setUseNativeFileBrowser(bool); diff --git a/tools/tools.pro b/tools/tools.pro index 3ed07b1..7598962 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -1,32 +1,39 @@ TEMPLATE = subdirs -no-png { - message("Some graphics-related tools are unavailable without PNG support") -} else { - SUBDIRS += assistant \ - pixeltool \ - porting \ - qtestlib \ - qttracereplay - contains(QT_EDITION, Console) { - SUBDIRS += designer/src/uitools # Linguist depends on this - } else { - SUBDIRS += designer - } - SUBDIRS += linguist - symbian: SUBDIRS = designer - wince*: SUBDIRS = qtestlib designer - unix:!mac:!embedded:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig - win32:!wince*:SUBDIRS += activeqt +!contains(QT_CONFIG, no-gui) { + no-png { + message("Some graphics-related tools are unavailable without PNG support") + } else { + symbian { + SUBDIRS = designer + } else:wince* { + SUBDIRS = qtestlib designer + } else { + SUBDIRS = assistant \ + pixeltool \ + porting \ + qtestlib \ + qttracereplay + contains(QT_EDITION, Console) { + SUBDIRS += designer/src/uitools # Linguist depends on this + } else { + SUBDIRS += designer + } + } + unix:!mac:!embedded:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig + win32:!wince*:SUBDIRS += activeqt + } + contains(QT_CONFIG, declarative):SUBDIRS += qml } +!wince*:!symbian:SUBDIRS += linguist + mac { SUBDIRS += macdeployqt } embedded:SUBDIRS += kmap2qmap -contains(QT_CONFIG, declarative):SUBDIRS += qml contains(QT_CONFIG, dbus):SUBDIRS += qdbus !wince*:contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns xmlpatternsvalidator embedded: SUBDIRS += makeqpf |