diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-01-18 14:25:51 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-01-18 14:25:51 +0100 |
commit | a7bac5437c59b53887c25b3c0d6ecf0689859c39 (patch) | |
tree | 0dcec7fe3975938cb525b49c10bb3a4dd36f6628 /src | |
parent | a802a3b6786e8d94b17acbb6d76826eb103e3d15 (diff) | |
parent | 61383ceca69001c292b31188b04fba304f8fbbbe (diff) |
Merge remote-tracking branch 'origin/5.12.1' into 5.12
Change-Id: I8ea54fdacbda23e07d79a543e3c70c0a02cf5092
Diffstat (limited to 'src')
31 files changed, 617 insertions, 675 deletions
diff --git a/src/assistant/assistant.pro b/src/assistant/assistant.pro index 2d3ca5690..1529167c0 100644 --- a/src/assistant/assistant.pro +++ b/src/assistant/assistant.pro @@ -4,7 +4,8 @@ TEMPLATE = subdirs SUBDIRS += \ help \ assistant \ - qhelpgenerator + qhelpgenerator \ + qcollectiongenerator assistant.depends = help qhelpgenerator.depends = help @@ -12,4 +13,5 @@ qhelpgenerator.depends = help qtNomakeTools( \ assistant \ qhelpgenerator \ + qcollectiongenerator \ ) diff --git a/src/assistant/assistant/main.cpp b/src/assistant/assistant/main.cpp index ac20872bd..3f4390450 100644 --- a/src/assistant/assistant/main.cpp +++ b/src/assistant/assistant/main.cpp @@ -302,6 +302,7 @@ int main(int argc, char *argv[]) QScopedPointer<QHelpEngineCore> collection; if (collectionFileGiven) { collection.reset(new QHelpEngineCore(collectionFile)); + collection->setProperty("_q_readonly", QVariant::fromValue<bool>(true)); if (!collection->setupData()) { cmd.showMessage(QCoreApplication::translate("Assistant", "Error reading collection file '%1': %2."). diff --git a/src/assistant/assistant/mainwindow.cpp b/src/assistant/assistant/mainwindow.cpp index 392af9224..b5288771d 100644 --- a/src/assistant/assistant/mainwindow.cpp +++ b/src/assistant/assistant/mainwindow.cpp @@ -905,7 +905,7 @@ void MainWindow::showAboutDialog() "<p>Version %2</p>" "<p>Browser: %3</p></center>" "<p>Copyright (C) %4 The Qt Company Ltd.</p>") - .arg(tr("Qt Assistant"), QLatin1String(QT_VERSION_STR), browser, QStringLiteral("2018")), + .arg(tr("Qt Assistant"), QLatin1String(QT_VERSION_STR), browser, QStringLiteral("2019")), resources); QLatin1String path(":/qt-project.org/assistant/images/assistant-128.png"); aboutDia.setPixmap(QString(path)); diff --git a/src/assistant/help/Qt5HelpConfigExtras.cmake.in b/src/assistant/help/Qt5HelpConfigExtras.cmake.in index b8ce04427..3b97923a9 100644 --- a/src/assistant/help/Qt5HelpConfigExtras.cmake.in +++ b/src/assistant/help/Qt5HelpConfigExtras.cmake.in @@ -1,4 +1,19 @@ +if (NOT TARGET Qt5::qcollectiongenerator) + add_executable(Qt5::qcollectiongenerator IMPORTED) + +!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) + set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\") +!!ELSE + set(imported_location \"$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\") +!!ENDIF + _qt5_Help_check_file_exists(${imported_location}) + + set_target_properties(Qt5::qcollectiongenerator PROPERTIES + IMPORTED_LOCATION ${imported_location} + ) +endif() + if (NOT TARGET Qt5::qhelpgenerator) add_executable(Qt5::qhelpgenerator IMPORTED) diff --git a/src/assistant/help/qhelpcollectionhandler.cpp b/src/assistant/help/qhelpcollectionhandler.cpp index a3e44816a..c67c92518 100644 --- a/src/assistant/help/qhelpcollectionhandler.cpp +++ b/src/assistant/help/qhelpcollectionhandler.cpp @@ -152,6 +152,9 @@ bool QHelpCollectionHandler::openCollectionFile() } } + if (m_readOnly) + return true; + m_query->exec(QLatin1String("PRAGMA synchronous=OFF")); m_query->exec(QLatin1String("PRAGMA cache_size=3000")); @@ -1770,4 +1773,9 @@ QMap<QString, QUrl> QHelpCollectionHandler::linksForField(const QString &fieldNa return linkMap; } +void QHelpCollectionHandler::setReadOnly(bool readOnly) +{ + m_readOnly = readOnly; +} + QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpcollectionhandler_p.h b/src/assistant/help/qhelpcollectionhandler_p.h index e8cfe3474..a0a8ace7a 100644 --- a/src/assistant/help/qhelpcollectionhandler_p.h +++ b/src/assistant/help/qhelpcollectionhandler_p.h @@ -141,6 +141,8 @@ public: QMap<QString, QUrl> linksForKeyword(const QString &keyword, const QStringList &filterAttributes) const; + void setReadOnly(bool readOnly); + signals: void error(const QString &msg) const; @@ -169,6 +171,7 @@ private: QString m_connectionName; QSqlQuery *m_query = nullptr; bool m_vacuumScheduled = false; + bool m_readOnly = false; }; QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpenginecore.cpp b/src/assistant/help/qhelpenginecore.cpp index 238fbfce3..0e8535415 100644 --- a/src/assistant/help/qhelpenginecore.cpp +++ b/src/assistant/help/qhelpenginecore.cpp @@ -83,6 +83,10 @@ bool QHelpEngineCorePrivate::setup() emit q->setupStarted(); emitReadersAboutToBeInvalidated(); + const QVariant readOnlyVariant = q->property("_q_readonly"); + const bool readOnly = readOnlyVariant.isValid() + ? readOnlyVariant.toBool() : false; + collectionHandler->setReadOnly(readOnly); const bool opened = collectionHandler->openCollectionFile(); if (opened) q->currentFilter(); diff --git a/src/assistant/qcollectiongenerator/main.c b/src/assistant/qcollectiongenerator/main.c new file mode 100644 index 000000000..5e4e02630 --- /dev/null +++ b/src/assistant/qcollectiongenerator/main.c @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** 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 The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef _WIN32 +#include <process.h> +#else +#include <unistd.h> +#endif + +static const char collectionGeneratorName[] = "qcollectiongenerator"; +static const char helpGeneratorName[] = "qhelpgenerator"; + +#ifdef _WIN32 +static const char separator = '\\'; +#else +static const char separator = '/'; +#endif + +int main(int argc, char *argv[]) +{ + printf("The \"%s\" tool is deprecated, use \"%s\" instead.\n\n", + collectionGeneratorName, helpGeneratorName); + + // Replace the "qcollectiongenerator" with "qhelpgenerator" + // in passed argv[0], keeping the path. + + const size_t currentNameSize = strlen(argv[0]); + const size_t collectionGeneratorNameSize = strlen(collectionGeneratorName); + const ptrdiff_t maxPathOffset = currentNameSize - collectionGeneratorNameSize; + ptrdiff_t pathOffset = maxPathOffset; + + if (maxPathOffset >= 0 && strchr(argv[0] + maxPathOffset, separator)) + pathOffset = -1; // Separator detected. Wrong filename. + + while (pathOffset >= 0) { + const char *fileName = argv[0] + pathOffset; + + if (fileName[0] == separator) { // Separator detected. Wrong filename. + pathOffset = -1; + break; + } + + if (!strncmp(fileName, collectionGeneratorName, collectionGeneratorNameSize)) + break; + + --pathOffset; + } + + if (pathOffset < 0) { + fprintf(stderr, "Wrong tool name. " + "The tool name is expected to contain: \"%s\", got: \"%s\" instead.\n", + collectionGeneratorName, argv[0]); + return 3; + } + + const size_t helpGeneratorNameSize = strlen(helpGeneratorName); + // Allocate a buffer for the new full path, consisting of the pathSize + new name + char *newPath = (char *) malloc((maxPathOffset + helpGeneratorNameSize + 1) * sizeof(char)); + // Copy the path + memcpy(newPath, argv[0], pathOffset); + // Copy the new name + memcpy(newPath + pathOffset, helpGeneratorName, helpGeneratorNameSize); + // Copy the remaining part + memcpy(newPath + pathOffset + helpGeneratorNameSize, + argv[0] + pathOffset + collectionGeneratorNameSize, + currentNameSize - pathOffset - collectionGeneratorNameSize + 1); + + argv[0] = newPath; +#ifdef _WIN32 + const intptr_t ret = _spawnvp(_P_WAIT, newPath, argv); + if (ret == -1) { + fprintf(stderr, "Error while executing \"%s\" tool.\n", newPath); + return 3; + } + return ret; +#else + execvp(newPath, argv); + fprintf(stderr, "Error while executing \"%s\" tool.\n", newPath); + return 3; +#endif +} + diff --git a/src/assistant/qcollectiongenerator/qcollectiongenerator.pro b/src/assistant/qcollectiongenerator/qcollectiongenerator.pro new file mode 100644 index 000000000..491c8f927 --- /dev/null +++ b/src/assistant/qcollectiongenerator/qcollectiongenerator.pro @@ -0,0 +1,7 @@ +CONFIG += console +CONFIG -= qt app_bundle +SOURCES += main.c + +QMAKE_TARGET_DESCRIPTION = "Qt Help Collection File Generator" +load(qt_tool) + diff --git a/src/assistant/qhelpgenerator/main.cpp b/src/assistant/qhelpgenerator/main.cpp index ce9d46498..74d2275a7 100644 --- a/src/assistant/qhelpgenerator/main.cpp +++ b/src/assistant/qhelpgenerator/main.cpp @@ -70,7 +70,7 @@ int generateCollectionFile(const QByteArray &data, const QString &basePath, cons if (config.hasError()) { fputs(qPrintable(QHG::tr("Collection config file error: %1\n") .arg(config.errorString())), stderr); - return -1; + return 1; } const QMap<QString, QString> &filesToGenerate = config.filesToGenerate(); @@ -79,13 +79,13 @@ int generateCollectionFile(const QByteArray &data, const QString &basePath, cons QHelpProjectData helpData; if (!helpData.readData(absoluteFilePath(basePath, it.key()))) { fprintf(stderr, "%s\n", qPrintable(helpData.errorMessage())); - return -1; + return 1; } HelpGenerator helpGenerator; if (!helpGenerator.generate(&helpData, absoluteFilePath(basePath, it.value()))) { fprintf(stderr, "%s\n", qPrintable(helpGenerator.error())); - return -1; + return 1; } } @@ -96,20 +96,20 @@ int generateCollectionFile(const QByteArray &data, const QString &basePath, cons if (!colFi.dir().remove(colFi.fileName())) { fputs(qPrintable(QHG::tr("The file %1 cannot be overwritten.\n") .arg(outputFile)), stderr); - return -1; + return 1; } } QHelpEngineCore helpEngine(outputFile); if (!helpEngine.setupData()) { fprintf(stderr, "%s\n", qPrintable(helpEngine.error())); - return -1; + return 1; } for (const QString &file : config.filesToRegister()) { if (!helpEngine.registerDocumentation(absoluteFilePath(basePath, file))) { fprintf(stderr, "%s\n", qPrintable(helpEngine.error())); - return -1; + return 1; } } if (!config.filesToRegister().isEmpty()) { @@ -165,7 +165,7 @@ int generateCollectionFile(const QByteArray &data, const QString &basePath, cons QFile icon(absoluteFilePath(basePath, config.applicationIcon())); if (!icon.open(QIODevice::ReadOnly)) { fputs(qPrintable(QHG::tr("Cannot open %1.\n").arg(icon.fileName())), stderr); - return -1; + return 1; } CollectionConfiguration::setApplicationIcon(helpEngine, icon.readAll()); } @@ -183,7 +183,7 @@ int generateCollectionFile(const QByteArray &data, const QString &basePath, cons QFile icon(absoluteFilePath(basePath, config.aboutIcon())); if (!icon.open(QIODevice::ReadOnly)) { fputs(qPrintable(QHG::tr("Cannot open %1.\n").arg(icon.fileName())), stderr); - return -1; + return 1; } CollectionConfiguration::setAboutIcon(helpEngine, icon.readAll()); } @@ -205,7 +205,7 @@ int generateCollectionFile(const QByteArray &data, const QString &basePath, cons QFile f(fi.absoluteFilePath()); if (!f.open(QIODevice::ReadOnly)) { fputs(qPrintable(QHG::tr("Cannot open %1.\n").arg(f.fileName())), stderr); - return -1; + return 1; } QByteArray data = f.readAll(); s << data; @@ -350,7 +350,7 @@ int main(int argc, char *argv[]) return 0; } else if (!error.isEmpty()) { fprintf(stderr, "%s\n\n%s", qPrintable(error), qPrintable(help)); - return -1; + return 1; } // detect input file type (qhp or qhcp) @@ -358,7 +358,7 @@ int main(int argc, char *argv[]) QFile file(inputFile); if (!file.open(QIODevice::ReadOnly)) { fputs(qPrintable(QHG::tr("Could not open %1.\n").arg(inputFile)), stderr); - return -1; + return 1; } const QString outputExtension = inputType == InputQhp ? QCH : QHC; @@ -385,7 +385,7 @@ int main(int argc, char *argv[]) QHelpProjectData *helpData = new QHelpProjectData(); if (!helpData->readData(inputFile)) { fprintf(stderr, "%s\n", qPrintable(helpData->errorMessage())); - return -1; + return 1; } HelpGenerator generator(silent); @@ -397,7 +397,7 @@ int main(int argc, char *argv[]) delete helpData; if (!success) { fprintf(stderr, "%s\n", qPrintable(generator.error())); - return -1; + return 1; } } else { const QByteArray data = file.readAll(); diff --git a/src/designer/src/designer/versiondialog.cpp b/src/designer/src/designer/versiondialog.cpp index abbcabd65..0e5bb58d1 100644 --- a/src/designer/src/designer/versiondialog.cpp +++ b/src/designer/src/designer/versiondialog.cpp @@ -160,7 +160,7 @@ VersionDialog::VersionDialog(QWidget *parent) lbl->setText(tr("%1" "<br/>Copyright (C) %2 The Qt Company Ltd." - ).arg(version, QStringLiteral("2018"))); + ).arg(version, QStringLiteral("2019"))); lbl->setWordWrap(true); lbl->setOpenExternalLinks(true); diff --git a/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.cpp b/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.cpp index 0d4d228e3..a843e1052 100644 --- a/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.cpp +++ b/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.cpp @@ -65,7 +65,7 @@ QString QQuickWidgetPlugin::whatsThis() const QString QQuickWidgetPlugin::includeFile() const { - return QStringLiteral("QtQuickWidgets/QQuickWidget"); + return QStringLiteral("<QtQuickWidgets/QQuickWidget>"); } QIcon QQuickWidgetPlugin::icon() const diff --git a/src/designer/src/plugins/qwebview/qwebview_plugin.cpp b/src/designer/src/plugins/qwebview/qwebview_plugin.cpp index c91c77327..5f72a6185 100644 --- a/src/designer/src/plugins/qwebview/qwebview_plugin.cpp +++ b/src/designer/src/plugins/qwebview/qwebview_plugin.cpp @@ -63,7 +63,7 @@ QString QWebViewPlugin::whatsThis() const QString QWebViewPlugin::includeFile() const { - return QStringLiteral("QtWebKitWidgets/QWebView"); + return QStringLiteral("<QtWebKitWidgets/QWebView>"); } QIcon QWebViewPlugin::icon() const diff --git a/src/distancefieldgenerator/mainwindow.cpp b/src/distancefieldgenerator/mainwindow.cpp index eef116ded..763aeaa6b 100644 --- a/src/distancefieldgenerator/mainwindow.cpp +++ b/src/distancefieldgenerator/mainwindow.cpp @@ -756,7 +756,7 @@ void MainWindow::about() "to prepare a font cache for Qt applications.</p>" "<p>Copyright (C) %2 The Qt Company Ltd.</p>") .arg(QLatin1String(QT_VERSION_STR)) - .arg(QLatin1String("2018"))); + .arg(QLatin1String("2019"))); msgBox->show(); } diff --git a/src/linguist/linguist/mainwindow.cpp b/src/linguist/linguist/mainwindow.cpp index 620ee7f70..6095c17de 100644 --- a/src/linguist/linguist/mainwindow.cpp +++ b/src/linguist/linguist/mainwindow.cpp @@ -1361,7 +1361,7 @@ void MainWindow::about() "<p>Qt Linguist is a tool for adding translations to Qt " "applications.</p>" "<p>Copyright (C) %2 The Qt Company Ltd." - ).arg(version, QStringLiteral("2018"))); + ).arg(version, QStringLiteral("2019"))); box.setWindowTitle(QApplication::translate("AboutDialog", "Qt Linguist")); box.setIcon(QMessageBox::NoIcon); diff --git a/src/qdbus/qdbusviewer/mainwindow.cpp b/src/qdbus/qdbusviewer/mainwindow.cpp index f1935d605..ed0f882c9 100644 --- a/src/qdbus/qdbusviewer/mainwindow.cpp +++ b/src/qdbus/qdbusviewer/mainwindow.cpp @@ -90,7 +90,7 @@ void MainWindow::about() "<h3>%1</h3>" "<p>Version %2</p></center>" "<p>Copyright (C) %3 The Qt Company Ltd.</p>") - .arg(tr("D-Bus Viewer"), QLatin1String(QT_VERSION_STR), QStringLiteral("2018"))); + .arg(tr("D-Bus Viewer"), QLatin1String(QT_VERSION_STR), QStringLiteral("2019"))); box.setWindowTitle(tr("D-Bus Viewer")); box.exec(); } diff --git a/src/qdoc/configure.json b/src/qdoc/configure.json new file mode 100644 index 000000000..6b757737c --- /dev/null +++ b/src/qdoc/configure.json @@ -0,0 +1,43 @@ +{ + "module": "qdoc", + "tests": { + "libclang": { + "label": "libclang", + "test": "libclang", + "type": "libclang" + } + }, + "features": { + "qdoc": { + "label": "QDoc", + "condition": "tests.libclang", + "output": [ + "privateFeature", + { "type": "varAssign", "name": "CLANG_LIBS", "value": "tests.libclang.libs" }, + { "type": "varAssign", "name": "CLANG_INCLUDEPATH", "value": "tests.libclang.includepath" }, + { "type": "varAssign", "name": "CLANG_LIBDIR", "value": "tests.libclang.libdir" }, + { "type": "varAssign", "name": "CLANG_DEFINES", "value": "tests.libclang.defines" }, + { "type": "varAssign", "name": "CLANG_VERSION", "value": "tests.libclang.version" } + ] + } + }, + "report": [ + { + "type": "warning", + "condition": "!features.qdoc", + "message": "QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation. + +Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation. +On Linux systems you may be able to install libclang from a package. On macOS you could use Homebrew's llvm package. +On Windows you need to set LLVM_INSTALL_DIR to the installation path." + } + ], + "summary": [ + { + "section": "Qt Tools", + "entries": [ + "qdoc" + ] + } + ] +} diff --git a/src/qdoc/configure.pri b/src/qdoc/configure.pri new file mode 100644 index 000000000..8fd43401a --- /dev/null +++ b/src/qdoc/configure.pri @@ -0,0 +1,360 @@ +defineReplace(extractVersion) { return($$replace(1, ^(\\d+\\.\\d+\\.\\d+)(svn)?$, \\1)) } +defineReplace(extractMajorVersion) { return($$replace(1, ^(\\d+)\\.\\d+\\.\\d+(svn)?$, \\1)) } +defineReplace(extractMinorVersion) { return($$replace(1, ^\\d+\\.(\\d+)\\.\\d+(svn)?$, \\1)) } +defineReplace(extractPatchVersion) { return($$replace(1, ^\\d+\\.\\d+\\.(\\d+)(svn)?$, \\1)) } + +defineTest(versionIsAtLeast) { + actual_major_version = $$extractMajorVersion($$1) + actual_minor_version = $$extractMinorVersion($$1) + actual_patch_version = $$extractPatchVersion($$1) + required_min_major_version = $$extractMajorVersion($$2) + required_min_minor_version = $$extractMinorVersion($$2) + required_min_patch_version = $$extractPatchVersion($$2) + + isEqual(actual_major_version, $$required_min_major_version) { + isEqual(actual_minor_version, $$required_min_minor_version) { + isEqual(actual_patch_version, $$required_min_patch_version): return(true) + greaterThan(actual_patch_version, $$required_min_patch_version): return(true) + } + greaterThan(actual_minor_version, $$required_min_minor_version): return(true) + } + greaterThan(actual_major_version, $$required_min_major_version): return(true) + + return(false) +} + +defineReplace(findLLVMVersionFromLibDir) { + libdir = $$1 + version_dirs = $$files($$libdir/clang/*) + for (version_dir, version_dirs) { + fileName = $$basename(version_dir) + version = $$find(fileName, ^(\\d+\\.\\d+\\.\\d+)$) + !isEmpty(version) { + isEmpty(candidateVersion): candidateVersion = $$version + else: versionIsAtLeast($$version, $$candidateVersion): candidateVersion = $$version + } + } + return($$candidateVersion) +} + +defineTest(qtConfTest_libclang) { + isEmpty(QDOC_USE_STATIC_LIBCLANG): QDOC_USE_STATIC_LIBCLANG = $$(QDOC_USE_STATIC_LIBCLANG) + + equals(QMAKE_HOST.os, Windows) { + # on Windows we have only two host compilers, MSVC or mingw. The former we never + # use for cross-compilation where it isn't also the target compiler. The latter + # is not detectable as this .prf file is evaluated against the target configuration + # and therefore checking for "mingw" won't work when the target compiler is clang (Android) + # or qcc (QNX). + msvc { + isEmpty(LLVM_INSTALL_DIR): LLVM_INSTALL_DIR = $$(LLVM_INSTALL_DIR_MSVC) + } else { + isEmpty(LLVM_INSTALL_DIR): LLVM_INSTALL_DIR = $$(LLVM_INSTALL_DIR_MINGW) + } + } + isEmpty(LLVM_INSTALL_DIR): LLVM_INSTALL_DIR = $$(LLVM_INSTALL_DIR) + + # Assume libclang is installed on the target system + isEmpty(LLVM_INSTALL_DIR) { + llvmConfigCandidates = \ + llvm-config-7 \ + llvm-config-6.0 \ + llvm-config-5.0 \ + llvm-config-4.0 \ + llvm-config-3.9 \ + llvm-config + + for (candidate, llvmConfigCandidates) { + LLVM_INSTALL_DIR = $$system("$$candidate --prefix 2>$$QMAKE_SYSTEM_NULL_DEVICE") + !isEmpty(LLVM_INSTALL_DIR) { + qtLog("Using Clang installation found in $${LLVM_INSTALL_DIR}." \ + "Set the LLVM_INSTALL_DIR environment variable to override.") + break() + } + } + } + LLVM_INSTALL_DIR = $$clean_path($$LLVM_INSTALL_DIR) + + contains(QMAKE_HOST.arch, x86_64): \ + clangInstallDir = $$replace(LLVM_INSTALL_DIR, _ARCH_, 64) + else: \ + clangInstallDir = $$replace(LLVM_INSTALL_DIR, _ARCH_, 32) + isEmpty(LLVM_INSTALL_DIR) { + win32 { + return(false) + } + macos { + # Default to homebrew llvm on macOS. The CLANG_VERSION test below will complain if missing. + clangInstallDir = $$system("brew --prefix llvm") + } else { + clangInstallDir = /usr + } + } + + # note: llvm_config only exits on unix + llvm_config = $$clangInstallDir/bin/llvm-config + exists($$llvm_config) { + CLANG_LIBDIR = $$system("$$llvm_config --libdir 2>/dev/null") + CLANG_INCLUDEPATH = $$system("$$llvm_config --includedir 2>/dev/null") + output = $$system("$$llvm_config --version 2>/dev/null") + CLANG_VERSION = $$extractVersion($$output) + } else { + CLANG_LIBDIR = $$clangInstallDir/lib + CLANG_INCLUDEPATH = $$clangInstallDir/include + CLANG_VERSION = $$findLLVMVersionFromLibDir($$CLANG_LIBDIR) + } + isEmpty(CLANG_VERSION) { + !isEmpty(LLVM_INSTALL_DIR): \ + qtLog("Cannot determine version of clang installation in $${clangInstallDir}.") + return(false) + } + + LIBCLANG_MAIN_HEADER = $$CLANG_INCLUDEPATH/clang-c/Index.h + !exists($$LIBCLANG_MAIN_HEADER) { + !isEmpty(LLVM_INSTALL_DIR): \ + qtLog("Cannot find libclang's main header file, candidate: $${LIBCLANG_MAIN_HEADER}.") + return(false) + } + + !contains(QMAKE_DEFAULT_LIBDIRS, $$CLANG_LIBDIR): CLANG_LIBS = -L$${CLANG_LIBDIR} + + CLANG_DEFINES = + + isEmpty(QDOC_USE_STATIC_LIBCLANG) { + equals(QMAKE_HOST.os, Windows): \ + CLANG_LIBS += -llibclang -ladvapi32 -lshell32 + else: \ + CLANG_LIBS += -lclang + } else { + msvc { + CLANG_DEFINES += CINDEX_LINKAGE= + CLANG_LIBS += -llibclang_static -ladvapi32 -lshell32 -lMincore + } else { + !equals(QMAKE_HOST.os, Darwin): CLANG_LIBS+=-Wl,--start-group + CLANG_LIBS += -lclangAnalysis \ + -lclangApplyReplacements \ + -lclangARCMigrate \ + -lclangAST \ + -lclangASTMatchers \ + -lclangBasic \ + -lclangChangeNamespace \ + -lclangCodeGen \ + -lclangCrossTU \ + -lclangDaemon \ + -lclangDriver \ + -lclangDynamicASTMatchers \ + -lclangEdit \ + -lclangFormat \ + -lclangFrontend \ + -lclangFrontendTool \ + -lclangHandleCXX \ + -lclangIncludeFixer \ + -lclangIncludeFixerPlugin \ + -lclangIndex \ + -lclangLex \ + -lclangMove \ + -lclangParse \ + -lclangQuery \ + -lclangReorderFields \ + -lclangRewrite \ + -lclangRewriteFrontend \ + -lclangSema \ + -lclangSerialization \ + -lclang_static \ + -lclangStaticAnalyzerCheckers \ + -lclangStaticAnalyzerCore \ + -lclangStaticAnalyzerFrontend \ + -lclangTidy \ + -lclangTidyAndroidModule \ + -lclangTidyBoostModule \ + -lclangTidyBugproneModule \ + -lclangTidyCERTModule \ + -lclangTidyCppCoreGuidelinesModule \ + -lclangTidyFuchsiaModule \ + -lclangTidyGoogleModule \ + -lclangTidyHICPPModule \ + -lclangTidyLLVMModule \ + -lclangTidyMiscModule \ + -lclangTidyModernizeModule \ + -lclangTidyMPIModule \ + -lclangTidyObjCModule \ + -lclangTidyPerformanceModule \ + -lclangTidyPlugin \ + -lclangTidyReadabilityModule \ + -lclangTidyUtils \ + -lclangTooling \ + -lclangToolingASTDiff \ + -lclangToolingCore \ + -lclangToolingRefactor \ + -lfindAllSymbols \ + -lLLVMAArch64AsmParser \ + -lLLVMAArch64AsmPrinter \ + -lLLVMAArch64CodeGen \ + -lLLVMAArch64Desc \ + -lLLVMAArch64Disassembler \ + -lLLVMAArch64Info \ + -lLLVMAArch64Utils \ + -lLLVMAMDGPUAsmParser \ + -lLLVMAMDGPUAsmPrinter \ + -lLLVMAMDGPUCodeGen \ + -lLLVMAMDGPUDesc \ + -lLLVMAMDGPUDisassembler \ + -lLLVMAMDGPUInfo \ + -lLLVMAMDGPUUtils \ + -lLLVMAnalysis \ + -lLLVMARMAsmParser \ + -lLLVMARMAsmPrinter \ + -lLLVMARMCodeGen \ + -lLLVMARMDesc \ + -lLLVMARMDisassembler \ + -lLLVMARMInfo \ + -lLLVMARMUtils \ + -lLLVMAsmParser \ + -lLLVMAsmPrinter \ + -lLLVMBinaryFormat \ + -lLLVMBitReader \ + -lLLVMBitWriter \ + -lLLVMBPFAsmParser \ + -lLLVMBPFAsmPrinter \ + -lLLVMBPFCodeGen \ + -lLLVMBPFDesc \ + -lLLVMBPFDisassembler \ + -lLLVMBPFInfo \ + -lLLVMCodeGen \ + -lLLVMCore \ + -lLLVMCoroutines \ + -lLLVMCoverage \ + -lLLVMDebugInfoCodeView \ + -lLLVMDebugInfoDWARF \ + -lLLVMDebugInfoMSF \ + -lLLVMDebugInfoPDB \ + -lLLVMDemangle \ + -lLLVMDlltoolDriver \ + -lLLVMExecutionEngine \ + -lLLVMFuzzMutate \ + -lLLVMGlobalISel \ + -lLLVMHexagonAsmParser \ + -lLLVMHexagonCodeGen \ + -lLLVMHexagonDesc \ + -lLLVMHexagonDisassembler \ + -lLLVMHexagonInfo \ + -lLLVMInstCombine \ + -lLLVMInstrumentation \ + -lLLVMInterpreter \ + -lLLVMipo \ + -lLLVMIRReader \ + -lLLVMLanaiAsmParser \ + -lLLVMLanaiAsmPrinter \ + -lLLVMLanaiCodeGen \ + -lLLVMLanaiDesc \ + -lLLVMLanaiDisassembler \ + -lLLVMLanaiInfo \ + -lLLVMLibDriver \ + -lLLVMLineEditor \ + -lLLVMLinker \ + -lLLVMLTO \ + -lLLVMMC \ + -lLLVMMCDisassembler \ + -lLLVMMCJIT \ + -lLLVMMCParser \ + -lLLVMMipsAsmParser \ + -lLLVMMipsAsmPrinter \ + -lLLVMMipsCodeGen \ + -lLLVMMipsDesc \ + -lLLVMMipsDisassembler \ + -lLLVMMipsInfo \ + -lLLVMMIRParser \ + -lLLVMMSP430AsmPrinter \ + -lLLVMMSP430CodeGen \ + -lLLVMMSP430Desc \ + -lLLVMMSP430Info \ + -lLLVMNVPTXAsmPrinter \ + -lLLVMNVPTXCodeGen \ + -lLLVMNVPTXDesc \ + -lLLVMNVPTXInfo \ + -lLLVMObjCARCOpts \ + -lLLVMObject \ + -lLLVMObjectYAML \ + -lLLVMOption \ + -lLLVMOrcJIT \ + -lLLVMPasses \ + -lLLVMPowerPCAsmParser \ + -lLLVMPowerPCAsmPrinter \ + -lLLVMPowerPCCodeGen \ + -lLLVMPowerPCDesc \ + -lLLVMPowerPCDisassembler \ + -lLLVMPowerPCInfo \ + -lLLVMProfileData \ + -lLLVMRuntimeDyld \ + -lLLVMScalarOpts \ + -lLLVMSelectionDAG \ + -lLLVMSparcAsmParser \ + -lLLVMSparcAsmPrinter \ + -lLLVMSparcCodeGen \ + -lLLVMSparcDesc \ + -lLLVMSparcDisassembler \ + -lLLVMSparcInfo \ + -lLLVMSupport \ + -lLLVMSymbolize \ + -lLLVMSystemZAsmParser \ + -lLLVMSystemZAsmPrinter \ + -lLLVMSystemZCodeGen \ + -lLLVMSystemZDesc \ + -lLLVMSystemZDisassembler \ + -lLLVMSystemZInfo \ + -lLLVMTableGen \ + -lLLVMTarget \ + -lLLVMTransformUtils \ + -lLLVMVectorize \ + -lLLVMWindowsManifest \ + -lLLVMX86AsmParser \ + -lLLVMX86AsmPrinter \ + -lLLVMX86CodeGen \ + -lLLVMX86Desc \ + -lLLVMX86Disassembler \ + -lLLVMX86Info \ + -lLLVMX86Utils \ + -lLLVMXCoreAsmPrinter \ + -lLLVMXCoreCodeGen \ + -lLLVMXCoreDesc \ + -lLLVMXCoreDisassembler \ + -lLLVMXCoreInfo \ + -lLLVMXRay + !equals(QMAKE_HOST.os, Darwin): CLANG_LIBS+=-Wl,--end-group + CLANG_LIBS += -lz + equals(QMAKE_HOST.os, Windows): CLANG_LIBS += -lpsapi -lshell32 -lole32 -luuid -ladvapi32 -lversion + else: CLANG_LIBS += -ldl + equals(QMAKE_HOST.os, Darwin): CLANG_LIBS += -lcurses -lm -lxml2 + } + } + + !versionIsAtLeast($$CLANG_VERSION, "3.9.0") { + log("LLVM/Clang version >= 3.9.0 required, version provided: $${CLANG_VERSION}.$$escape_expand(\\n)") + return(false) + } + + $${1}.libs = $$CLANG_LIBS + export($${1}.libs) + $${1}.cache += libs + + $${1}.includepath = $$CLANG_INCLUDEPATH + export($${1}.includepath) + $${1}.cache += includepath + + $${1}.libdir = $$CLANG_LIBDIR + export($${1}.libdir) + $${1}.cache += libdir + + $${1}.defines = $$CLANG_DEFINES + export($${1}.defines) + $${1}.cache += defines + + $${1}.version = $$CLANG_VERSION + export($${1}.version) + $${1}.cache += version + + export($${1}.cache) + + return(true) +} + diff --git a/src/qdoc/doc/examples/componentset/ProgressBar.qml b/src/qdoc/doc/examples/componentset/ProgressBar.qml deleted file mode 100644 index 2a40cc488..000000000 --- a/src/qdoc/doc/examples/componentset/ProgressBar.qml +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -/*! - \qmltype ProgressBar - \inqmlmodule UIComponents - \brief A component that shows the progress of an event. - - A ProgressBar shows the linear progress of an event as its \l value. - The range is specified using the \l {minimum} and the \l{maximum} values. - - The ProgressBar component is part of the \l {UI Components} module. - - This documentation is part of the \l{componentset}{UIComponents} example. -*/ -Item { - id: progressbar - - /*! - The minimum value of the ProgressBar range. - The \l value must not be less than this value. - */ - property int minimum: 0 - - /*! - The maximum value of the ProgressBar range. - The \l value must not be more than this value. - */ - property int maximum: 100 - - /*! - The value of the progress. - */ - property int value: 0 - - /*! - \qmlproperty color ProgressBar::color - The color of the ProgressBar's gradient. Must bind to a color type. - - \omit - The "\qmlproperty <type> <property name>" is needed because - property alias need to have their types manually entered. - - QDoc will not publish the documentation within omit and endomit. - \endomit - - \sa secondColor - */ - property alias color: gradient1.color - - /*! - \qmlproperty color ProgressBar::secondColor - The second color of the ProgressBar's gradient. - Must bind to a color type. - - \omit - The "\qmlproperty <type> <property name>" is needed because - property alias need to have their types manually entered. - - QDoc will not publish the documentation within omit and endomit. - \endomit - - \sa color - */ - property alias secondColor: gradient2.color - - width: 250; height: 23 - clip: true - - Rectangle { - id: highlight - - /*! - An internal documentation comment. The widthDest property is not - a public API and therefore will not be exposed. - */ - property int widthDest: ((progressbar.width * (value - minimum)) / (maximum - minimum) - 6) - - width: highlight.widthDest - Behavior on width { SmoothedAnimation { velocity: 1200 } } - - anchors { left: parent.left; top: parent.top; bottom: parent.bottom; margins: 3 } - radius: 1 - gradient: Gradient { - GradientStop { id: gradient1; position: 0.0 } - GradientStop { id: gradient2; position: 1.0 } - } - - } - Text { - anchors { right: highlight.right; rightMargin: 6; verticalCenter: parent.verticalCenter } - color: "white" - font.bold: true - text: Math.floor((value - minimum) / (maximum - minimum) * 100) + '%' - } -} diff --git a/src/qdoc/doc/examples/componentset/Switch.qml b/src/qdoc/doc/examples/componentset/Switch.qml deleted file mode 100644 index db9616b69..000000000 --- a/src/qdoc/doc/examples/componentset/Switch.qml +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -/*! - \qmltype ToggleSwitch - \inqmlmodule UIComponents - \brief A component that can be turned on or off. - - A toggle switch has two states: an \c on and an \c off state. The \c off - state is when the \l on property is set to \c false. - - The ToggleSwitch component is part of the \l {UI Components} module. - - This documentation is part of the \l{componentset}{UIComponents} example. - -*/ -Item { - id: toggleswitch - width: background.width; height: background.height - - /*! - Indicates the state of the switch. If \c false, then the switch is in - the \c off state. - - \omit - The \qmlproperty <type> <propertyname> is not necessary as QDoc - will associate this property to the ToggleSwitch - - QDoc will not publish the documentation within omit and endomit. - \endomit - */ - property bool on: false - - - /*! - A method to toggle the switch. If the switch is \c on, the toggling it - will turn it \c off. Toggling a switch in the \c off position will - turn it \c on. - */ - function toggle() { - if (toggleswitch.state == "on") - toggleswitch.state = "off"; - else - toggleswitch.state = "on"; - } - - - /*! - \internal - - An internal function to synchronize the switch's internals. This - function is not for public access. The \internal command will - prevent QDoc from publishing this comment in the public API. - */ - function releaseSwitch() { - if (knob.x == 1) { - if (toggleswitch.state == "off") return; - } - if (knob.x == 78) { - if (toggleswitch.state == "on") return; - } - toggle(); - } - - Rectangle { - id: background - width: 130; height: 48 - radius: 48 - color: "lightsteelblue" - MouseArea { anchors.fill: parent; onClicked: toggle() } - } - - Rectangle { - id: knob - width: 48; height: 48 - radius: width - color: "lightblue" - - MouseArea { - anchors.fill: parent - drag.target: knob; drag.axis: Drag.XAxis; drag.minimumX: 1; drag.maximumX: 78 - onClicked: toggle() - onReleased: releaseSwitch() - } - } - - states: [ - State { - name: "on" - PropertyChanges { target: knob; x: 78 } - PropertyChanges { target: toggleswitch; on: true } - }, - State { - name: "off" - PropertyChanges { target: knob; x: 1 } - PropertyChanges { target: toggleswitch; on: false } - } - ] - - transitions: Transition { - NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad; duration: 200 } - } -} diff --git a/src/qdoc/doc/examples/componentset/TabWidget.qml b/src/qdoc/doc/examples/componentset/TabWidget.qml deleted file mode 100644 index 07fd40db9..000000000 --- a/src/qdoc/doc/examples/componentset/TabWidget.qml +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -/*! - \qmltype TabWidget - \inqmlmodule UIComponents - \brief A widget that places its children as tabs. - - A TabWidget places its children as tabs in a view. Selecting - a tab involves selecting the tab at the top. - - The TabWidget component is part of the \l {UI Components} module. - - This documentation is part of the \l{componentset}{UIComponents} example. - - \section1 Adding Tabs - - To add a tab, declare the tab as a child of the TabWidget. - - \code - TabWidget { - id: tabwidget - - Rectangle { - id: tab1 - color: "red" - //... omitted - } - Rectangle { - id: tab2 - color: "blue" - //... omitted - } - - } - \endcode - -*/ -Item { - id: tabWidget - - /*! - \internal - - Setting the default property to stack.children means any child items - of the TabWidget are actually added to the 'stack' item's children. - - See the \l{"Property Binding in QML"} - documentation for details on default properties. - - This is an implementation detail, not meant for public knowledge. Putting - the \internal command at the beginning will cause QDoc to not publish this - documentation in the public API page. - - Normally, a property alias needs to have a - "\qmlproperty <type> <propertyname>" to assign the alias a type. - - */ - default property alias content: stack.children - - - /*! - The currently active tab in the TabWidget. - */ - property int current: 0 - - /*! - A sample \c{read-only} property. - A contrived property to demonstrate QDoc's ability to detect - read-only properties. - - The signature is: - \code - readonly property int sampleReadOnlyProperty: 0 - \endcode - - Note that the property must be initialized to a value. - - */ - readonly property int sampleReadOnlyProperty: 0 - - /*! - \internal - - This handler is an implementation - detail. The \c{\internal} command will prevent QDoc from publishing this - documentation on the public API. - */ - onCurrentChanged: setOpacities() - Component.onCompleted: setOpacities() - - /*! - \internal - - An internal function to set the opacity. - The \internal command will prevent QDoc from publishing this - documentation on the public API. - */ - function setOpacities() { - for (var i = 0; i < stack.children.length; ++i) { - stack.children[i].opacity = (i == current ? 1 : 0) - } - } - - Row { - id: header - - Repeater { - model: stack.children.length - delegate: Rectangle { - width: tabWidget.width / stack.children.length; height: 36 - - Rectangle { - width: parent.width; height: 1 - anchors { bottom: parent.bottom; bottomMargin: 1 } - color: "#acb2c2" - } - BorderImage { - anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 } - border { left: 7; right: 7 } - source: "tab.png" - visible: tabWidget.current == index - } - Text { - horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter - anchors.fill: parent - text: stack.children[index].title - elide: Text.ElideRight - font.bold: tabWidget.current == index - } - MouseArea { - anchors.fill: parent - onClicked: tabWidget.current = index - } - } - } - } - - Item { - id: stack - width: tabWidget.width - anchors.top: header.bottom; anchors.bottom: tabWidget.bottom - } -} diff --git a/src/qdoc/doc/examples/componentset/componentset.pro b/src/qdoc/doc/examples/componentset/componentset.pro deleted file mode 100644 index 5b44737c2..000000000 --- a/src/qdoc/doc/examples/componentset/componentset.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = componentset.pro \ - ProgressBar.qml \ - Switch.qml \ - TabWidget.qml \ - uicomponents.qdoc diff --git a/src/qdoc/doc/examples/componentset/uicomponents.qdoc.sample b/src/qdoc/doc/examples/componentset/uicomponents.qdoc.sample deleted file mode 100644 index 0c6d187ed..000000000 --- a/src/qdoc/doc/examples/componentset/uicomponents.qdoc.sample +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \qmlmodule UIComponents 1.0 - \title UI Components - \brief Basic set of UI components - - This is a listing of a list of UI components implemented by QML types. These - files are available for general import and they are based off the \l{Qt - Quick Code Samples}. - - This module is part of the \l{componentset}{UIComponents} example. -*/ diff --git a/src/qdoc/doc/examples/examples.qdoc b/src/qdoc/doc/examples/examples.qdoc deleted file mode 100644 index 7c780eca8..000000000 --- a/src/qdoc/doc/examples/examples.qdoc +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example componentset - \title QML Documentation Example - - This example demonstrates one of the ways to document QML types. - - In particular, there are sample types that are documented with QDoc - commands comments. There are documentation comments for the QML types - and their public interfaces. The types are grouped into a module, the - \l{UI Components} module. - - The \l{componentset/uicomponents.qdoc.sample}{uicomponents.qdoc} file generates - the overview page for the \l{UI Components} module page. - - The generated documentation is available in the \l{UI Components} module. - - \section1 QML Class - - The QML types use the \l{qmltype-command}{\\qmltype} to document the - type. In addition, they have the \l{inmodule-command}{\\inmodule} - command in order for QDoc to associate them to the \c UIComponents module. - - QDoc uses the \l{brief-command}{\\brief} command to place a basic - description when listing the types. - - \section1 Properties, Signals, Handlers, and Methods - - The types have their properties, signals, handlers, and methods - defined in their respective QML files. QDoc associates the properties and - methods to the types, therefore, you only need to place the - documentation above the property, method, or signal. - - To document the type of a \e {property alias}, you must use the - \l{qmlproperty-command}{\\qmlproperty} command to specify the data type. - - \code - \qmlproperty int anAliasedProperty - An aliased property of type int. - \endcode - - \section2 Internal Documentation - - You may declare that a documentation is for internal use by placing the - \l{internal-command}{\\internal} command after the beginning QDoc comment - \begincomment. QDoc will prevent the internal documentation from appearing - in the public API. - - If you wish to omit certain parts of the documentation, you may use the - \l{omit-command}{\\omit} and \l{omit-command}{\\endomit} command. - - \section1 QML Types with C++ Implementation - - This example only demonstrates the documentation for types in QML - files, but the regular \l{qml-documentation}{QML commands} may be placed - inside C++ classes to define the public API of the QML type. - -*/ - - -/*! - \qmlmodule UIComponents 1.0 - \title UI Components - \brief Basic set of UI components - - This is a listing of a list of UI components implemented by QML types. These - files are available for general import and they are based on the - \l{Qt Quick Examples and Tutorials}{Qt Quick Code Samples}. - - This module is part of the \l{componentset}{UIComponents} example. -*/ diff --git a/src/qdoc/doc/examples/minimum.qdocconf b/src/qdoc/doc/examples/minimum.qdocconf index 1d686cfe8..8f53ffc11 100644 --- a/src/qdoc/doc/examples/minimum.qdocconf +++ b/src/qdoc/doc/examples/minimum.qdocconf @@ -2,41 +2,35 @@ # and there are some compatibility issues between old and new # practices. For that reason, any QDoc configuration file needs to # include compat.qdocconf. - #include(compat.qdocconf) -# QDoc needs lists of file extensions to know which files -# to process in different situations. +# QDoc needs lists of file extensions to know which files to process in +# different situations. Uncomment the following include statement to get +# a pre-defined list of file extensions. +#include(fileextensions.qdocconf) -include(fileextensions.qdocconf) +# You can also specify file extensions manually. +headers.fileextensions = "*.h *.hpp" +sources.fileextensions = "*.cpp *.qml *.qdoc" # The outputdir variable specifies the directory # where QDoc will put the generated documentation. - outputdir = html - # The headerdirs variable specifies the directories # containing the header files associated # with the .cpp source files used in the documentation. - headerdirs = . - # The sourcedirs variable specifies the # directories containing the .cpp or .qdoc # files used in the documentation. - -#sourcedirs = . - +sourcedirs = . # The exampledirs variable specifies the directories containing # the source code of the example files. - exampledirs = . - # The imagedirs variable specifies the # directories containing the images used in the documentation. - imagedirs = ./images diff --git a/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc b/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc index 7d006ada0..7f355b2fe 100644 --- a/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc +++ b/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc @@ -68,7 +68,6 @@ \li \l{C++ Documentation Style} \li \l{QML Documentation Style} \endlist - \li \l{QML Documentation Example} \endlist */ @@ -397,7 +396,6 @@ \page qdoc-categories.html \title Categories of Documentation \previouspage Writing Documentation - \nextpage QML Documentation Example \brief Describes the different types such as How-To's, Tutorials, Overviews, Examples, and Class Documentation. diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 633ebfa0f..7eeb3705c 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -1915,13 +1915,29 @@ void HtmlGenerator::generateNavigationBar(const QString &title, if (buildversion.isEmpty()) return; - if (tableItems) { + navigationbar.clear(); + + if (tableItems) { out() << "</tr></table><table class=\"buildversion\"><tr>\n" - << "<td id=\"buildversion\" width=\"100%\" align=\"right\">" - << buildversion << "</td>\n"; + << "<td id=\"buildversion\" width=\"100%\" align=\"right\">"; + } else { + out() << "<li id=\"buildversion\">"; + } + + // Link buildversion string to navigation.landingpage + if (!landingpage.isEmpty() && landingtitle != title) { + navigationbar << Atom(Atom::NavLink, landingpage) + << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK) + << Atom(Atom::String, buildversion) + << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK); + generateText(navigationbar, node, marker); } else { - out() << "<li id=\"buildversion\">" << buildversion << "</li>\n"; + out() << buildversion; } + if (tableItems) + out() << "</td>\n"; + else + out() << "</li>\n"; } void HtmlGenerator::generateHeader(const QString& title, diff --git a/src/qdoc/qdoc.pro b/src/qdoc/qdoc.pro index bc543c1e8..3c88e2643 100644 --- a/src/qdoc/qdoc.pro +++ b/src/qdoc/qdoc.pro @@ -11,6 +11,8 @@ qtHaveModule(qmldevtools-private) { DEFINES += QT_NO_DECLARATIVE } +include($$OUT_PWD/qtqdoc-config.pri) + LIBS += $$CLANG_LIBS !contains(QMAKE_DEFAULT_INCDIRS, $$CLANG_INCLUDEPATH): INCLUDEPATH += $$CLANG_INCLUDEPATH DEFINES += $$CLANG_DEFINES diff --git a/src/qdoc/sections.cpp b/src/qdoc/sections.cpp index d9bfb624a..4913f66a5 100644 --- a/src/qdoc/sections.cpp +++ b/src/qdoc/sections.cpp @@ -186,7 +186,7 @@ void Section::insert(Node *node) FunctionNode *func = static_cast<FunctionNode *>(node); irrelevant = (inherited && (func->isSomeCtor() || func->isDtor())); } - else if (node->isClass() || node->isEnumType() || node->isTypedef()) { + else if (node->isClass() || node->isEnumType() || node->isTypedef() || node->isVariable()) { irrelevant = (inherited && style_ != AllMembers); if (!irrelevant && style_ == Details && node->isTypedef()) { const TypedefNode* tdn = static_cast<const TypedefNode*>(node); @@ -200,9 +200,13 @@ void Section::insert(Node *node) if (node->isObsolete()) { obsoleteMemberMap_.insertMulti(key, node); } else { - if (!inherited) { + if (!inherited) memberMap_.insertMulti(key, node); - } else if (node->parent()->isClass() || node->parent()->isNamespace()) { + else if (style_ == AllMembers) { + if (!memberMap_.contains(key)) + memberMap_.insertMulti(key, node); + } + if (inherited && (node->parent()->isClass() || node->parent()->isNamespace())) { if (inheritedMembers_.isEmpty() || inheritedMembers_.last().first != node->parent()) { QPair<Aggregate *, int> p(node->parent(), 0); inheritedMembers_.append(p); diff --git a/src/src.pro b/src/src.pro index 7a1af0078..c954cf98a 100644 --- a/src/src.pro +++ b/src/src.pro @@ -23,7 +23,9 @@ qtConfig(library) { !android|android_app: SUBDIRS += qtplugininfo } -config_clang: qtConfig(thread): SUBDIRS += qdoc +include($$OUT_PWD/qdoc/qtqdoc-config.pri) +QT_FOR_CONFIG += qdoc-private +qtConfig(qdoc): qtConfig(thread): SUBDIRS += qdoc !android|android_app: SUBDIRS += qtpaths diff --git a/src/windeployqt/main.cpp b/src/windeployqt/main.cpp index 6b6e67d6c..955a3077c 100644 --- a/src/windeployqt/main.cpp +++ b/src/windeployqt/main.cpp @@ -805,6 +805,7 @@ static const PluginModuleMapping pluginModuleMappings[] = {"imageformats", QtGuiModule}, {"platforms", QtGuiModule}, {"platforminputcontexts", QtGuiModule}, + {"virtualkeyboard", QtGuiModule}, {"geoservices", QtLocationModule}, {"audio", QtMultimediaModule}, {"mediaservice", QtMultimediaModule}, |