diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-08-27 22:51:09 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-08-27 22:51:09 +0200 |
commit | 190fa97c83472863fd886e86f626ab8196ed51b3 (patch) | |
tree | 49edb9f6a41d6c999c9bb43ae28911a8e7212757 /src/tools | |
parent | 3aa163491c9c8f28c88ac87cafc6418f2c0e46c5 (diff) | |
parent | 5971e0918757737425151c39a5f81a238663a17a (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
examples/widgets/doc/src/addressbook-fr.qdoc
Change-Id: Id1196e8e0c6445f1616c3f29234c974d809f8e48
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/moc/generator.cpp | 20 | ||||
-rw-r--r-- | src/tools/moc/preprocessor.cpp | 4 | ||||
-rw-r--r-- | src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc | 86 | ||||
-rw-r--r-- | src/tools/qdoc/doc/qtgui-qdocconf.qdoc | 18 |
4 files changed, 122 insertions, 6 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 4757fdad93..50da6d2e54 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -184,6 +184,18 @@ bool Generator::registerableMetaType(const QByteArray &propertyType) return false; } +/* returns true if name and qualifiedName refers to the same name. + * If qualified name is "A::B::C", it returns true for "C", "B::C" or "A::B::C" */ +static bool qualifiedNameEquals(const QByteArray &qualifiedName, const QByteArray &name) +{ + if (qualifiedName == name) + return true; + int index = qualifiedName.indexOf("::"); + if (index == -1) + return false; + return qualifiedNameEquals(qualifiedName.mid(index+2), name); +} + void Generator::generateCode() { bool isQt = (cdef->classname == "Qt"); @@ -431,7 +443,7 @@ void Generator::generateCode() int s = p.type.lastIndexOf("::"); if (s > 0) { QByteArray scope = p.type.left(s); - if (scope != "Qt" && scope != cdef->classname && !extraList.contains(scope)) + if (scope != "Qt" && !qualifiedNameEquals(cdef->qualified, scope) && !extraList.contains(scope)) extraList += scope; } } @@ -446,7 +458,7 @@ void Generator::generateCode() int s = enumKey.lastIndexOf("::"); if (s > 0) { QByteArray scope = enumKey.left(s); - if (scope != "Qt" && scope != cdef->classname && !extraList.contains(scope)) + if (scope != "Qt" && !qualifiedNameEquals(cdef->qualified, scope) && !extraList.contains(scope)) extraList += scope; } } @@ -972,9 +984,9 @@ void Generator::generateMetacall() if (!p.notify.isEmpty() && p.notifyId != -1) { const FunctionDef &f = cdef->signalList.at(p.notifyId); if (f.arguments.size() == 0) - fprintf(out, " emit %s();\n", p.notify.constData()); + fprintf(out, " Q_EMIT %s();\n", p.notify.constData()); else if (f.arguments.size() == 1 && f.arguments.at(0).normalizedType == p.type) - fprintf(out, " emit %s(%s%s);\n", + fprintf(out, " Q_EMIT %s(%s%s);\n", p.notify.constData(), prefix.constData(), p.member.constData()); } fprintf(out, " }\n"); diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp index 8f4b84a9c8..06758e67bd 100644 --- a/src/tools/moc/preprocessor.cpp +++ b/src/tools/moc/preprocessor.cpp @@ -645,7 +645,7 @@ Symbols Preprocessor::macroExpandIdentifier(Preprocessor *that, SymbolStack &sym // 0 argument macros are a bit special. They are ok if the // argument is pure whitespace or empty (macro.arguments.size() != 0 || arguments.size() != 1 || !arguments.at(0).isEmpty())) - that->error("Macro argument mismatch."); + that->warning("Macro argument mismatch."); // now replace the macro arguments with the expanded arguments enum Mode { @@ -662,7 +662,7 @@ Symbols Preprocessor::macroExpandIdentifier(Preprocessor *that, SymbolStack &sym } int index = macro.arguments.indexOf(s); if (mode == Normal) { - if (index >= 0) { + if (index >= 0 && index < arguments.size()) { // each argument undoergoes macro expansion if it's not used as part of a # or ## if (i == macro.symbols.size() - 1 || macro.symbols.at(i + 1).token != PP_HASHHASH) { Symbols arg = arguments.at(index); diff --git a/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc b/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc new file mode 100644 index 0000000000..4289f357e9 --- /dev/null +++ b/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ +/*! +\page qdoc-minimum-qdocconf.html +\title A minimal qdocconf file with comments + +\brief Describes a minimal .qdocconf file + +Below you will find the full contents of qtgui.qdocconf. The subsequent section will discuss +every statement in the qdocconf file. + +\code + #include(compat.qdocconf) + outputdir = html + headerdirs = . + sourcedirs = . + exampledirs = . + imagedirs = ./images +\endcode + +\title Notes + +\code + #include(compat.qdocconf) +\endcode + +For compatibility with older versions of Qt, it is recommended +to include compat.qdocconf. + +\code + outputdir = html +\endcode + +QDoc will put the documentation generated in the html directory. + +\code + headerdirs = . +\endcode + +The header file associated with the \e .cpp source files can be found in the +current directory. + +\code + sourcedirs = . +\endcode + +The current directory is the directory containing the source files: the \e .cpp +and \e .qdoc files used in the documentation. + +\code + exampledirs = . +\endcode + +The source code of the example files can be found in the current directory. + +\code + imagedirs = ./images +\endcode + +The image files can be found in the underlying directory "images". + +*/ diff --git a/src/tools/qdoc/doc/qtgui-qdocconf.qdoc b/src/tools/qdoc/doc/qtgui-qdocconf.qdoc index 7e6da0feb5..767934986f 100644 --- a/src/tools/qdoc/doc/qtgui-qdocconf.qdoc +++ b/src/tools/qdoc/doc/qtgui-qdocconf.qdoc @@ -83,6 +83,8 @@ every statement in the qdocconf file. sourcedirs += .. \ ../../../examples/gui/doc/src + excludedirs = ../../../examples/gui/doc/src/tmp + exampledirs += ../../../examples/gui \ snippets @@ -273,14 +275,30 @@ Add the specified directories to the list of directories containing the \e .cpp \e .qdoc files used in the documentation. \code + excludedirs = ../../../examples/gui/doc/src/tmp +\endcode + +The \c excludedirs variable is for listing directories that should not be processed +by qdoc, even if the same directories are included by the \c sourcedirs or \c headerdirs +variables. + +When executed, QDoc will ignore the directories listed. +\sa excludefiles + +\code exampledirs += ../../../examples/gui \ snippets \endcode +\sa examples \sa examplesinstallpath Add the two directories specified to the list of directories containing the source code of the example files. +If QDoc encounters both \c exampledirs and \c examples, it will look first in the +\c examples directory. QDoc will accept the first matching file it finds. QDoc will +search in the directories specified, not in their subdirectories. + \code imagedirs += images \ ../../../examples/gui/doc/images \ |