diff options
author | Liang Qi <liang.qi@qt.io> | 2016-11-04 11:27:59 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-11-04 11:30:39 +0100 |
commit | 21c61b26bfb7d6bafac848effd0a169db48ad991 (patch) | |
tree | 4506020e9c61afd641a442b71e33ef661bab847e | |
parent | ae9472a39327ce5d5d6735308bd2aef272771391 (diff) | |
parent | b5cb222357841b8dad6fc80aa8e6e88047f20c00 (diff) | |
download | qttools-21c61b26bfb7d6bafac848effd0a169db48ad991.tar.gz |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I4ee208f69bed72c480c636cb18f22fd88c02d1e5
35 files changed, 421 insertions, 141 deletions
diff --git a/src/designer/src/components/formeditor/formeditor.qrc b/src/designer/src/components/formeditor/formeditor.qrc index 38fbb6200..351658088 100644 --- a/src/designer/src/components/formeditor/formeditor.qrc +++ b/src/designer/src/components/formeditor/formeditor.qrc @@ -61,7 +61,10 @@ <file>images/mac/forward.png</file> <file>images/mac/down.png</file> <file>images/mac/up.png</file> - <file>images/qtlogo.png</file> + <file>images/qtlogo16x16.png</file> + <file>images/qtlogo24x24.png</file> + <file>images/qtlogo32x32.png</file> + <file>images/qtlogo64x64.png</file> <file>images/qt3logo.png</file> <file>images/resetproperty.png</file> <file>images/cleartext.png</file> diff --git a/src/designer/src/components/formeditor/images/qtlogo.png b/src/designer/src/components/formeditor/images/qtlogo.png Binary files differdeleted file mode 100644 index 7d472572b..000000000 --- a/src/designer/src/components/formeditor/images/qtlogo.png +++ /dev/null diff --git a/src/designer/src/components/formeditor/images/qtlogo16x16.png b/src/designer/src/components/formeditor/images/qtlogo16x16.png Binary files differnew file mode 100644 index 000000000..30bcb45ed --- /dev/null +++ b/src/designer/src/components/formeditor/images/qtlogo16x16.png diff --git a/src/designer/src/components/formeditor/images/qtlogo24x24.png b/src/designer/src/components/formeditor/images/qtlogo24x24.png Binary files differnew file mode 100644 index 000000000..058bf6972 --- /dev/null +++ b/src/designer/src/components/formeditor/images/qtlogo24x24.png diff --git a/src/designer/src/components/formeditor/images/qtlogo32x32.png b/src/designer/src/components/formeditor/images/qtlogo32x32.png Binary files differnew file mode 100644 index 000000000..d609c1e1e --- /dev/null +++ b/src/designer/src/components/formeditor/images/qtlogo32x32.png diff --git a/src/designer/src/components/formeditor/images/qtlogo64x64.png b/src/designer/src/components/formeditor/images/qtlogo64x64.png Binary files differnew file mode 100644 index 000000000..3bc03b7c7 --- /dev/null +++ b/src/designer/src/components/formeditor/images/qtlogo64x64.png diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp index 0132ea2d7..6b87e8131 100644 --- a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp +++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp @@ -110,7 +110,7 @@ WidgetBoxTreeWidget::WidgetBoxTreeWidget(QDesignerFormEditorInterface *core, QWi QIcon WidgetBoxTreeWidget::iconForWidget(QString iconName) const { if (iconName.isEmpty()) - iconName = QLatin1String(qtLogoC); + return qdesigner_internal::qtLogoIcon(); if (iconName.startsWith(QLatin1String(iconPrefixC))) { const IconCache::const_iterator it = m_pluginIcons.constFind(iconName); @@ -647,8 +647,6 @@ WidgetBoxTreeWidget::CategoryList WidgetBoxTreeWidget::loadCustomCategoryList() icon_name = iconPrefix; icon_name += pluginName; m_pluginIcons.insert(icon_name, icon); - } else { - icon_name = QLatin1String(qtLogoC); } cat.addWidget(Widget(displayName, dom_xml, icon_name, Widget::Custom)); diff --git a/src/designer/src/designer/doc/src/designer-manual.qdoc b/src/designer/src/designer/doc/src/designer-manual.qdoc index 39d0d5451..55fb81c32 100644 --- a/src/designer/src/designer/doc/src/designer-manual.qdoc +++ b/src/designer/src/designer/doc/src/designer-manual.qdoc @@ -89,7 +89,7 @@ Some source code in \QD is licensed under specific highly permissive licenses from the original authors. The Qt team gratefully acknowledges - these contributions to \QD and all uses of \QD should also acknowledge + these contributions to \QD and all users of \QD should also acknowledge these contributions and quote the following license statements in an appendix to the documentation. diff --git a/src/designer/src/lib/shared/iconloader.cpp b/src/designer/src/lib/shared/iconloader.cpp index 9ac8e96b9..6af620372 100644 --- a/src/designer/src/lib/shared/iconloader.cpp +++ b/src/designer/src/lib/shared/iconloader.cpp @@ -60,6 +60,27 @@ QDESIGNER_SHARED_EXPORT QIcon emptyIcon() return QIcon(QStringLiteral(":/qt-project.org/formeditor/images/emptyicon.png")); } +static QIcon buildIcon(const QString &prefix, const int *sizes, size_t sizeCount) +{ + QIcon result; + for (size_t i = 0; i < sizeCount; ++i) { + const QString size = QString::number(sizes[i]); + const QPixmap pixmap(prefix + size + QLatin1Char('x') + size + QStringLiteral(".png")); + Q_ASSERT(!pixmap.size().isEmpty()); + result.addPixmap(pixmap); + } + return result; +} + +QDESIGNER_SHARED_EXPORT QIcon qtLogoIcon() +{ + static const int sizes[] = {16, 24, 32, 64}; + static const QIcon result = + buildIcon(QStringLiteral(":/qt-project.org/formeditor/images/qtlogo"), + sizes, sizeof(sizes) / sizeof(sizes[0])); + return result; +} + } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/lib/shared/iconloader_p.h b/src/designer/src/lib/shared/iconloader_p.h index 8596bb4f4..5932a18c1 100644 --- a/src/designer/src/lib/shared/iconloader_p.h +++ b/src/designer/src/lib/shared/iconloader_p.h @@ -51,6 +51,7 @@ namespace qdesigner_internal { QDESIGNER_SHARED_EXPORT QIcon createIconSet(const QString &name); QDESIGNER_SHARED_EXPORT QIcon emptyIcon(); +QDESIGNER_SHARED_EXPORT QIcon qtLogoIcon(); } // namespace qdesigner_internal diff --git a/src/designer/src/lib/shared/plugindialog.cpp b/src/designer/src/lib/shared/plugindialog.cpp index 827dd8c68..1d948aee6 100644 --- a/src/designer/src/lib/shared/plugindialog.cpp +++ b/src/designer/src/lib/shared/plugindialog.cpp @@ -29,6 +29,7 @@ #include "plugindialog_p.h" #include "pluginmanager_p.h" +#include "iconloader_p.h" #include <QtDesigner/QDesignerFormEditorInterface> #include <QtDesigner/QDesignerIntegrationInterface> @@ -129,14 +130,6 @@ void PluginDialog::populateTreeWidget() } } -QIcon PluginDialog::pluginIcon(const QIcon &icon) -{ - if (icon.isNull()) - return QIcon(QStringLiteral(":/qt-project.org/formeditor/images/qtlogo.png")); - - return icon; -} - QTreeWidgetItem* PluginDialog::setTopLevelItem(const QString &itemName) { QTreeWidgetItem *topLevelItem = new QTreeWidgetItem(ui.treeWidget); @@ -170,7 +163,7 @@ void PluginDialog::setItem(QTreeWidgetItem *pluginItem, const QString &name, item->setText(0, name); item->setToolTip(0, toolTip); item->setWhatsThis(0, whatsThis); - item->setIcon(0, pluginIcon(icon)); + item->setIcon(0, icon.isNull() ? qtLogoIcon() : icon); } void PluginDialog::updateCustomWidgetPlugins() diff --git a/src/designer/src/lib/shared/plugindialog_p.h b/src/designer/src/lib/shared/plugindialog_p.h index 4a8eae98a..ddd352164 100644 --- a/src/designer/src/lib/shared/plugindialog_p.h +++ b/src/designer/src/lib/shared/plugindialog_p.h @@ -59,7 +59,6 @@ private slots: private: void populateTreeWidget(); - QIcon pluginIcon(const QIcon &icon); QTreeWidgetItem* setTopLevelItem(const QString &itemName); QTreeWidgetItem* setPluginItem(QTreeWidgetItem *topLevelItem, const QString &itemName, const QFont &font); diff --git a/src/linguist/linguist/doc/src/linguist-manual.qdoc b/src/linguist/linguist/doc/src/linguist-manual.qdoc index d5492a1ae..a035827f2 100644 --- a/src/linguist/linguist/doc/src/linguist-manual.qdoc +++ b/src/linguist/linguist/doc/src/linguist-manual.qdoc @@ -847,7 +847,8 @@ The \c lupdate tool extracts user interface strings from your application. It reads the application .pro file to identify which source files contain text to be translated. This means your source files must be listed - in the \c SOURCES or \c HEADERS entry in the .pro file. If your files are + in the \c SOURCES or \c HEADERS entry in the .pro file, or in resource + files listed in the \c RESOURCE entry. If your files are not listed, the text in them will not be found. An example of a complete \c .pro file with four translation source @@ -870,37 +871,6 @@ \snippet doc_src_linguist-manual.cpp 3 - \section2 Use a Conditional to Hide QML Source From the Compiler - - The SOURCES variable is intended for C++ source files. If you list QML - or JavaScript source files there, the compiler tries to build them as though - they are C++ files. As a workaround, you can use an \c lupdate_only{...} - conditional statement so the \c lupdate tool sees the .qml files but the C++ - compiler ignores them. - - For example, the following .pro file snippet specifies two .qml files in - the application: - - \code - lupdate_only { - SOURCES = main.qml \ - MainPage.qml - } - \endcode - - You can also specify the .qml source files with a wildcard match. The - search is not recursive so you need to specify each directory where there - are user interface strings in the source code: - - \code - lupdate_only { - SOURCES = *.qml \ - *.js \ - content/*.qml \ - content/*.js - } - \endcode - \section1 Internationalizing Applications Design your application so that it can be adapted to various languages and diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp index 3e6a4fd5b..04730ddd7 100644 --- a/src/linguist/lupdate/main.cpp +++ b/src/linguist/lupdate/main.cpp @@ -44,6 +44,7 @@ #include <QtCore/QStringList> #include <QtCore/QTranslator> #include <QtCore/QLibraryInfo> +#include <QtCore/QXmlStreamReader> #include <iostream> @@ -390,6 +391,73 @@ public: static EvalHandler evalHandler; +static bool isSupportedExtension(const QString &ext) +{ + return ext == QLatin1String("qml") + || ext == QLatin1String("js") || ext == QLatin1String("qs") + || ext == QLatin1String("ui") || ext == QLatin1String("jui"); +} + +static QStringList getResources(const QString &resourceFile, QMakeVfs *vfs) +{ + Q_ASSERT(vfs); + if (!vfs->exists(resourceFile)) + return QStringList(); + QString content; + QString errStr; + if (!vfs->readFile(resourceFile, &content, &errStr)) { + printErr(LU::tr("lupdate error: Can not read %1: %2\n").arg(resourceFile, errStr)); + return QStringList(); + } + QStringList fileList; + QString dirPath = QFileInfo(resourceFile).path(); + QXmlStreamReader reader(content); + bool isFileTag = false; + QStringList tagStack; + tagStack << QLatin1String("RCC") << QLatin1String("qresource") << QLatin1String("file"); + int curDepth = 0; + while (!reader.atEnd()) { + QXmlStreamReader::TokenType t = reader.readNext(); + switch (t) { + case QXmlStreamReader::StartElement: + if (curDepth >= tagStack.count() || reader.name() != tagStack.at(curDepth)) { + printErr(LU::tr("unexpected <%1> tag\n").arg(reader.name().toString())); + continue; + } + if (++curDepth == tagStack.count()) + isFileTag = true; + break; + + case QXmlStreamReader::EndElement: + isFileTag = false; + if (curDepth == 0 || reader.name() != tagStack.at(curDepth - 1)) { + printErr(LU::tr("unexpected closing <%1> tag\n").arg(reader.name().toString())); + continue; + } + --curDepth; + break; + + case QXmlStreamReader::Characters: + if (isFileTag) { + QString fn = reader.text().toString(); + if (!QFileInfo(fn).isAbsolute()) + fn = dirPath + QLatin1Char('/') + fn; + QFileInfo cfi(fn); + if (isSupportedExtension(cfi.suffix())) + fileList << cfi.filePath(); + } + break; + + default: + break; + } + } + if (reader.error() != QXmlStreamReader::NoError) + printErr(LU::tr("lupdate error: %1:%2: %3\n") + .arg(resourceFile, QString::number(reader.lineNumber()), reader.errorString())); + return fileList; +} + static QStringList getSources(const char *var, const char *vvar, const QStringList &baseVPaths, const QString &projectDir, const ProFileEvaluator &visitor) { @@ -400,7 +468,7 @@ static QStringList getSources(const char *var, const char *vvar, const QStringLi } static QStringList getSources(const ProFileEvaluator &visitor, const QString &projectDir, - const QStringList &excludes) + const QStringList &excludes, QMakeVfs *vfs) { QStringList baseVPaths; baseVPaths += visitor.absolutePathValues(QLatin1String("VPATH"), projectDir); @@ -415,6 +483,10 @@ static QStringList getSources(const ProFileEvaluator &visitor, const QString &pr sourceFiles += getSources("FORMS", "VPATH_FORMS", baseVPaths, projectDir, visitor); + QStringList resourceFiles = getSources("RESOURCES", "VPATH_RESOURCES", baseVPaths, projectDir, visitor); + foreach (const QString &resource, resourceFiles) + sourceFiles += getResources(resource, vfs); + QStringList installs = visitor.values(QLatin1String("INSTALLS")) + visitor.values(QLatin1String("DEPLOYMENT")); installs.removeDuplicates(); @@ -440,12 +512,8 @@ static QStringList getSources(const ProFileEvaluator &visitor, const QString &pr while (iterator.hasNext()) { iterator.next(); QFileInfo cfi = iterator.fileInfo(); - QString ext = cfi.suffix(); - if (ext == QLatin1String("qml") - || ext == QLatin1String("js") || ext == QLatin1String("qs") - || ext == QLatin1String("ui") || ext == QLatin1String("jui")) { + if (isSupportedExtension(cfi.suffix())) sourceFiles << cfi.filePath(); - } } } } @@ -607,7 +675,7 @@ static void processProject( cd.m_sourceIsUtf16 = options & SourceIsUtf16; cd.m_includePath = visitor.absolutePathValues(QLatin1String("INCLUDEPATH"), proPath); cd.m_excludes = getExcludes(visitor, proPath); - QStringList sourceFiles = getSources(visitor, proPath, cd.m_excludes); + QStringList sourceFiles = getSources(visitor, proPath, cd.m_excludes, vfs); QSet<QString> sourceDirs; sourceDirs.insert(proPath + QLatin1Char('/')); foreach (const QString &sf, sourceFiles) @@ -718,7 +786,7 @@ int main(int argc, char **argv) #endif // Q_OS_WIN32 #endif - m_defaultExtensions = QLatin1String("java,jui,ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx,js,qs,qml"); + m_defaultExtensions = QLatin1String("java,jui,ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx,js,qs,qml,qrc"); QStringList args = app.arguments(); QStringList tsFileNames; @@ -728,6 +796,7 @@ int main(int argc, char **argv) QMultiHash<QString, QString> allCSources; QSet<QString> projectRoots; QStringList sourceFiles; + QStringList resourceFiles; QStringList includePath; QStringList alienFiles; QString targetLanguage; @@ -981,25 +1050,33 @@ int main(int argc, char **argv) int scanRootLen = dir.absolutePath().length(); foreach (const QFileInfo &fi, fileinfolist) { QString fn = QDir::cleanPath(fi.absoluteFilePath()); - sourceFiles << fn; - - if (!fn.endsWith(QLatin1String(".java")) - && !fn.endsWith(QLatin1String(".jui")) - && !fn.endsWith(QLatin1String(".ui")) - && !fn.endsWith(QLatin1String(".js")) - && !fn.endsWith(QLatin1String(".qs")) - && !fn.endsWith(QLatin1String(".qml"))) { - int offset = 0; - int depth = 0; - do { - offset = fn.lastIndexOf(QLatin1Char('/'), offset - 1); - QString ffn = fn.mid(offset + 1); - allCSources.insert(ffn, fn); - } while (++depth < 3 && offset > scanRootLen); + if (fn.endsWith(QLatin1String(".qrc"), Qt::CaseInsensitive)) { + resourceFiles << fn; + } else { + sourceFiles << fn; + + if (!fn.endsWith(QLatin1String(".java")) + && !fn.endsWith(QLatin1String(".jui")) + && !fn.endsWith(QLatin1String(".ui")) + && !fn.endsWith(QLatin1String(".js")) + && !fn.endsWith(QLatin1String(".qs")) + && !fn.endsWith(QLatin1String(".qml"))) { + int offset = 0; + int depth = 0; + do { + offset = fn.lastIndexOf(QLatin1Char('/'), offset - 1); + QString ffn = fn.mid(offset + 1); + allCSources.insert(ffn, fn); + } while (++depth < 3 && offset > scanRootLen); + } } } } else { - sourceFiles << QDir::cleanPath(fi.absoluteFilePath());; + QString fn = QDir::cleanPath(fi.absoluteFilePath()); + if (fn.endsWith(QLatin1String(".qrc"), Qt::CaseInsensitive)) + resourceFiles << fn; + else + sourceFiles << fn; projectRoots.insert(fi.absolutePath() + QLatin1Char('/')); } } @@ -1029,11 +1106,16 @@ int main(int argc, char **argv) cd.m_projectRoots = projectRoots; cd.m_includePath = includePath; cd.m_allCSources = allCSources; + if (!resourceFiles.isEmpty()) { + QMakeVfs vfs; + foreach (const QString &resource, resourceFiles) + sourceFiles << getResources(resource, &vfs); + } processSources(fetchedTor, sourceFiles, cd); updateTsFiles(fetchedTor, tsFileNames, alienFiles, sourceLanguage, targetLanguage, options, &fail); } else { - if (!sourceFiles.isEmpty() || !includePath.isEmpty()) { + if (!sourceFiles.isEmpty() || !resourceFiles.isEmpty() || !includePath.isEmpty()) { printErr(LU::tr("lupdate error:" " Both project and source files / include paths specified.\n")); return 1; diff --git a/src/linguist/shared/exclusive_builds.prf b/src/linguist/shared/exclusive_builds.prf new file mode 100644 index 000000000..b312a4c58 --- /dev/null +++ b/src/linguist/shared/exclusive_builds.prf @@ -0,0 +1,6 @@ +# Lupdate doesn't execute the build passes, so prevent that they are +# created in the first place. This tricks for example resources.prf +# into actually creating the QML resource file, so we can scan it. + +defineTest(addExclusiveBuilds) { +} diff --git a/src/linguist/shared/proparser.pri b/src/linguist/shared/proparser.pri index 124227bc4..f3fcad515 100644 --- a/src/linguist/shared/proparser.pri +++ b/src/linguist/shared/proparser.pri @@ -23,3 +23,6 @@ SOURCES += \ $$PWD/qmakeevaluator.cpp \ $$PWD/qmakebuiltins.cpp \ $$PWD/profileevaluator.cpp + +RESOURCES += $$PWD/proparser.qrc +DEFINES += QMAKE_BUILTIN_PRFS QMAKE_OVERRIDE_PRFS diff --git a/src/linguist/shared/proparser.qrc b/src/linguist/shared/proparser.qrc new file mode 100644 index 000000000..77ffd258a --- /dev/null +++ b/src/linguist/shared/proparser.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/qmake/override_features" > + <file>exclusive_builds.prf</file> + </qresource> +</RCC> diff --git a/src/linguist/shared/qmakeevaluator.cpp b/src/linguist/shared/qmakeevaluator.cpp index 6a7e7fa8c..7d09ef9b3 100644 --- a/src/linguist/shared/qmakeevaluator.cpp +++ b/src/linguist/shared/qmakeevaluator.cpp @@ -1947,23 +1947,34 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFeatureFile( // needs to be determined. Failed lookups are represented via non-null empty strings. QString *fnp = &m_featureRoots->cache[qMakePair(fn, currFn)]; if (fnp->isNull()) { - int start_root = 0; - const QStringList &paths = m_featureRoots->paths; - if (!currFn.isEmpty()) { - QStringRef currPath = IoUtils::pathName(currFn); - for (int root = 0; root < paths.size(); ++root) - if (currPath == paths.at(root)) { - start_root = root + 1; - break; - } - } - for (int root = start_root; root < paths.size(); ++root) { - QString fname = paths.at(root) + fn; - if (IoUtils::exists(fname)) { - fn = fname; +#ifdef QMAKE_OVERRIDE_PRFS + { + QString ovrfn(QLatin1String(":/qmake/override_features/") + fn); + if (QFileInfo::exists(ovrfn)) { + fn = ovrfn; goto cool; } } +#endif + { + int start_root = 0; + const QStringList &paths = m_featureRoots->paths; + if (!currFn.isEmpty()) { + QStringRef currPath = IoUtils::pathName(currFn); + for (int root = 0; root < paths.size(); ++root) + if (currPath == paths.at(root)) { + start_root = root + 1; + break; + } + } + for (int root = start_root; root < paths.size(); ++root) { + QString fname = paths.at(root) + fn; + if (IoUtils::exists(fname)) { + fn = fname; + goto cool; + } + } + } #ifdef QMAKE_BUILTIN_PRFS fn.prepend(QLatin1String(":/qmake/features/")); if (QFileInfo::exists(fn)) diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index 47bd70e17..e57bc785d 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -996,6 +996,22 @@ DeploymentInfo deployQtFrameworks(const QString &appBundlePath, const QStringLis } } +QString getLibInfix(const QStringList &deployedFrameworks) +{ + QString libInfix; + foreach (const QString &framework, deployedFrameworks) { + if (framework.startsWith(QStringLiteral("QtCore"))) { + Q_ASSERT(framework.length() >= 16); + // 16 == "QtCore" + ".framework" + const int lengthOfLibInfix = framework.length() - 16; + if (lengthOfLibInfix) + libInfix = framework.mid(6, lengthOfLibInfix); + break; + } + } + return libInfix; +} + void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pluginSourcePath, const QString pluginDestinationPath, DeploymentInfo deploymentInfo, bool useDebugLibs) { @@ -1013,8 +1029,11 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl // Cocoa print support pluginList.append("printsupport/libcocoaprintersupport.dylib"); + // Check if Qt was configured with -libinfix + const QString libInfixWithFramework = getLibInfix(deploymentInfo.deployedFrameworks) + QStringLiteral(".framework"); + // Network - if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtNetwork.framework"))) { + if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtNetwork") + libInfixWithFramework)) { QStringList bearerPlugins = QDir(pluginSourcePath + QStringLiteral("/bearer")).entryList(QStringList() << QStringLiteral("*.dylib")); foreach (const QString &plugin, bearerPlugins) { if (!plugin.endsWith(QStringLiteral("_debug.dylib"))) @@ -1026,7 +1045,7 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl QStringList imagePlugins = QDir(pluginSourcePath + QStringLiteral("/imageformats")).entryList(QStringList() << QStringLiteral("*.dylib")); foreach (const QString &plugin, imagePlugins) { if (plugin.contains(QStringLiteral("qsvg"))) { - if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtSvg.framework"))) + if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtSvg") + libInfixWithFramework)) pluginList.append(QStringLiteral("imageformats/") + plugin); } else if (!plugin.endsWith(QStringLiteral("_debug.dylib"))) { pluginList.append(QStringLiteral("imageformats/") + plugin); @@ -1034,7 +1053,7 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl } // Sql plugins if QtSql.framework is in use - if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtSql.framework"))) { + if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtSql") + libInfixWithFramework)) { QStringList sqlPlugins = QDir(pluginSourcePath + QStringLiteral("/sqldrivers")).entryList(QStringList() << QStringLiteral("*.dylib")); foreach (const QString &plugin, sqlPlugins) { if (plugin.endsWith(QStringLiteral("_debug.dylib"))) @@ -1054,7 +1073,7 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl } // multimedia plugins if QtMultimedia.framework is in use - if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtMultimedia.framework"))) { + if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtMultimedia") + libInfixWithFramework)) { QStringList plugins = QDir(pluginSourcePath + QStringLiteral("/mediaservice")).entryList(QStringList() << QStringLiteral("*.dylib")); foreach (const QString &plugin, plugins) { if (!plugin.endsWith(QStringLiteral("_debug.dylib"))) @@ -1252,7 +1271,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf // 2) QtQuick.Controls is used // The intended failure mode is that libwidgetsplugin.dylib will be present // in the app bundle but not used at run-time. - if (deploymentInfo.deployedFrameworks.contains("QtWidgets.framework") && qtQuickContolsInUse) { + + // Check if Qt was configured with -libinfix + const QString libInfixWithFramework = getLibInfix(deploymentInfo.deployedFrameworks) + QStringLiteral(".framework"); + + if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtWidgets") + libInfixWithFramework) + && qtQuickContolsInUse) { LogNormal() << "Deploying QML import QtQuick.PrivateWidgets"; QString name = "QtQuick/PrivateWidgets"; QString path = qmlImportsPath + QLatin1Char('/') + name; diff --git a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc index 8a3bf75a1..e4f8f048c 100644 --- a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc @@ -3277,9 +3277,14 @@ Elsewhere, the documentation identified as \e{\\legalese} command can be accumulated using \l {generatelist-command} {\\generatelist} - with \c {legalese-command} as the argument. This is useful for - generating an overview of the license agreements associated with - the source code. + with \c {legalese} as the argument. This is useful for generating + an overview of the license agreements associated with the source + code. + + \note The output of the \c {\generatelist legalese} command includes + the \\legalese texts in the current documentation project only. If + the current documentation project depends on other modules, their + license texts will not be listed. \target warning-command \section1 \\warning @@ -3536,38 +3541,9 @@ \section2 \c legalese - The \c legalese argument tells QDoc to generate a complete list of - licenses in the documentation. Each license is identified using - the \l {legalese-command} {\\legalese} command. This command is - used to generate the \e {Qt license information} - page this way: - - \code - / *! - \page licenses.html - \title Other Licenses Used in Qt - \ingroup licensing - \brief Information about other licenses used for Qt components and third-party code. - - Qt contains some code that is not provided under the - \l{GNU General Public License (GPL)}, - \l{GNU Lesser General Public License (LGPL)} or the - \l{Qt Commercial Edition}{Qt Commercial License Agreement}, but rather under - specific licenses from the original authors. Some pieces of code were developed - by The Qt Company and others originated from third parties. - This page lists the licenses used, names the authors, and links - to the places where it is used. - - The Qt Company gratefully acknowledges these and other contributions - to Qt. We recommend that programs that use Qt also acknowledge - these contributions, and quote these license statements in an - appendix to the documentation. - - See also: \l{Licenses for Fonts Used in Qt for Embedded Linux} - - \generatelist legalese - * / - \endcode + The \c legalese argument tells QDoc to generate a list of licenses in + the current documentation project. Each license is identified using + the \l {legalese-command} {\\legalese} command. \section2 \c overviews diff --git a/src/windeployqt/utils.cpp b/src/windeployqt/utils.cpp index c0a6f8526..667dad064 100644 --- a/src/windeployqt/utils.cpp +++ b/src/windeployqt/utils.cpp @@ -192,7 +192,8 @@ static HANDLE createInheritableTemporaryFile() securityAttributes.bInheritHandle = TRUE; return CreateFile(name, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, &securityAttributes, - TRUNCATE_EXISTING, FILE_ATTRIBUTE_TEMPORARY, NULL); + TRUNCATE_EXISTING, + FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, NULL); } // runProcess helper: Rewind and read out a temporary file for stdout/stderr. diff --git a/tests/auto/linguist/lconvert/tst_lconvert.cpp b/tests/auto/linguist/lconvert/tst_lconvert.cpp index fad27ab04..bf4ca9510 100644 --- a/tests/auto/linguist/lconvert/tst_lconvert.cpp +++ b/tests/auto/linguist/lconvert/tst_lconvert.cpp @@ -34,7 +34,9 @@ class tst_lconvert : public QObject Q_OBJECT public: - tst_lconvert() : dataDir(QFINDTESTDATA("data/")), binDir(QLibraryInfo::location(QLibraryInfo::BinariesPath)) {} + tst_lconvert() + : dataDir(QFINDTESTDATA("data/")) + , lconvert(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/lconvert") {} private slots: void initTestCase(); @@ -61,7 +63,7 @@ private: const QList<QStringList> &args); QString dataDir; - QString binDir; + QString lconvert; }; void tst_lconvert::initTestCase() @@ -140,7 +142,7 @@ void tst_lconvert::doCompare(QIODevice *actualDev, const QString &expectedFn) void tst_lconvert::verifyReadFail(const QString &fn) { QProcess cvt; - cvt.start(binDir + "/lconvert", QStringList() << (dataDir + fn)); + cvt.start(lconvert, QStringList() << (dataDir + fn)); QVERIFY(cvt.waitForFinished(10000)); QVERIFY(cvt.exitStatus() == QProcess::NormalExit); QVERIFY2(cvt.exitCode() == 2, "Accepted invalid input"); @@ -167,7 +169,7 @@ void tst_lconvert::convertChain(const QString &_inFileName, const QString &_outF if (!argList.isEmpty()) args += argList[i]; args << "-if" << stations[i] << "-i" << "-" << "-of" << stations[i + 1]; - cvts.at(i)->start(binDir + "/lconvert", args, QIODevice::ReadWrite | QIODevice::Text); + cvts.at(i)->start(lconvert, args, QIODevice::ReadWrite | QIODevice::Text); } int st = 0; foreach (QProcess *cvt, cvts) @@ -233,7 +235,7 @@ void tst_lconvert::converts() QString outFileNameFq = dataDir + outFileName; QProcess cvt; - cvt.start(binDir + "/lconvert", + cvt.start(lconvert, QStringList() << "-i" << (dataDir + inFileName) << "-of" << format, QIODevice::ReadWrite | QIODevice::Text); doWait(&cvt, 0); @@ -328,7 +330,7 @@ void tst_lconvert::merge() QProcess cvt; QStringList args; args << (dataDir + "idxmerge.ts") << (dataDir + "idxmerge-add.ts"); - cvt.start(binDir + "/lconvert", args, QIODevice::ReadWrite | QIODevice::Text); + cvt.start(lconvert, args, QIODevice::ReadWrite | QIODevice::Text); doWait(&cvt, 1); if (!QTest::currentTestFailed()) doCompare(&cvt, dataDir + "idxmerge.ts.out"); diff --git a/tests/auto/linguist/lrelease/tst_lrelease.cpp b/tests/auto/linguist/lrelease/tst_lrelease.cpp index 2da0435d3..19ed47f52 100644 --- a/tests/auto/linguist/lrelease/tst_lrelease.cpp +++ b/tests/auto/linguist/lrelease/tst_lrelease.cpp @@ -39,7 +39,7 @@ class tst_lrelease : public QObject public: tst_lrelease() - : binDir(QLibraryInfo::location(QLibraryInfo::BinariesPath)) + : lrelease(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/lrelease") , dataDir(QFINDTESTDATA("testdata/")) {} @@ -55,7 +55,7 @@ private slots: private: void doCompare(const QStringList &actual, const QString &expectedFn); - QString binDir; + QString lrelease; QString dataDir; }; @@ -109,7 +109,7 @@ void tst_lrelease::doCompare(const QStringList &actual, const QString &expectedF void tst_lrelease::translate() { - QVERIFY(!QProcess::execute(binDir + "/lrelease " + dataDir + "translate.ts")); + QVERIFY(!QProcess::execute(lrelease, QStringList() << (dataDir + "translate.ts"))); QTranslator translator; QVERIFY(translator.load(dataDir + "translate.qm")); @@ -159,7 +159,7 @@ void tst_lrelease::translate() void tst_lrelease::compressed() { - QVERIFY(!QProcess::execute(binDir + "/lrelease -compress " + dataDir + "compressed.ts")); + QVERIFY(!QProcess::execute(lrelease, QStringList() << "-compress" << (dataDir + "compressed.ts"))); QTranslator translator; QVERIFY(translator.load(dataDir + "compressed.qm")); @@ -176,7 +176,7 @@ void tst_lrelease::compressed() void tst_lrelease::idbased() { - QVERIFY(!QProcess::execute(binDir + "/lrelease -idbased " + dataDir + "idbased.ts")); + QVERIFY(!QProcess::execute(lrelease, QStringList() << "-idbased" << (dataDir + "idbased.ts"))); QTranslator translator; QVERIFY(translator.load(dataDir + "idbased.qm")); @@ -188,7 +188,7 @@ void tst_lrelease::idbased() void tst_lrelease::markuntranslated() { - QVERIFY(!QProcess::execute(binDir + "/lrelease -markuntranslated # -idbased " + dataDir + "idbased.ts")); + QVERIFY(!QProcess::execute(lrelease, QStringList() << "-markuntranslated" << "#" << "-idbased" << (dataDir + "idbased.ts"))); QTranslator translator; QVERIFY(translator.load(dataDir + "idbased.qm")); @@ -201,7 +201,7 @@ void tst_lrelease::markuntranslated() void tst_lrelease::dupes() { QProcess proc; - proc.start(binDir + "/lrelease " + dataDir + "dupes.ts", QIODevice::ReadWrite | QIODevice::Text); + proc.start(lrelease, QStringList() << (dataDir + "dupes.ts"), QIODevice::ReadWrite | QIODevice::Text); QVERIFY(proc.waitForFinished()); QVERIFY(proc.exitStatus() == QProcess::NormalExit); doCompare(QString(proc.readAllStandardError()).trimmed().split('\n'), dataDir + "dupes.errors"); diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.cpp new file mode 100644 index 000000000..7108f6784 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.cpp @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// IMPORTANT!!!! If you want to add testdata to this file, +// always add it to the end in order to not change the linenumbers of translations!!! + + +void func1() { + QApplication::tr("Hello world"); +} + + diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.js b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.js new file mode 100644 index 000000000..b2e1dd9e0 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.js @@ -0,0 +1 @@ +qsTr("From JavaScript file"); diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.qml b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.qml new file mode 100644 index 000000000..ea2258343 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +QtObject { + function translate() { + qsTr("From QML file in root"); + } +} diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.pro b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.pro new file mode 100644 index 000000000..5000c7396 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.pro @@ -0,0 +1,7 @@ + +SOURCES += main.cpp + +RESOURCES += project.qrc +RESOURCES += main.qml + +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.qrc b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.qrc new file mode 100644 index 000000000..87bacf228 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="/"> + <file>main.js</file> +</qresource> +</RCC> diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.ts.result new file mode 100644 index 000000000..6dcd8c2a5 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.ts.result @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1"> +<context> + <name>QApplication</name> + <message> + <location filename="main.cpp" line="39"/> + <source>Hello world</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>main</name> + <message> + <location filename="main.js" line="1"/> + <source>From JavaScript file</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.qml" line="38"/> + <source>From QML file in root</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/lupdatecmd new file mode 100644 index 000000000..f3709944b --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/lupdatecmd @@ -0,0 +1 @@ +lupdate project.qrc -ts project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.js b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.js new file mode 100644 index 000000000..b2e1dd9e0 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.js @@ -0,0 +1 @@ +qsTr("From JavaScript file"); diff --git a/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.qml b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.qml new file mode 100644 index 000000000..ea2258343 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +QtObject { + function translate() { + qsTr("From QML file in root"); + } +} diff --git a/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.qrc b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.qrc new file mode 100644 index 000000000..c5bf15067 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="/"> + <file>main.qml</file> + <file>main.js</file> +</qresource> +</RCC> diff --git a/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.ts.result new file mode 100644 index 000000000..82719c026 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.ts.result @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1"> +<context> + <name>main</name> + <message> + <location filename="main.qml" line="38"/> + <source>From QML file in root</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.js" line="1"/> + <source>From JavaScript file</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp index 71d42dbb3..ea049a1f9 100644 --- a/tests/auto/linguist/lupdate/tst_lupdate.cpp +++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp @@ -283,7 +283,7 @@ void tst_lupdate::good() QProcess proc; proc.setWorkingDirectory(workDir); proc.setProcessChannelMode(QProcess::MergedChannels); - const QString command = m_cmdLupdate + QLatin1Char(' ') + lupdatecmd; + const QString command = QLatin1Char('"') + m_cmdLupdate + QLatin1String("\" ") + lupdatecmd; proc.start(command, QIODevice::ReadWrite | QIODevice::Text); QVERIFY2(proc.waitForStarted(), qPrintable(command + QLatin1String(" :") + proc.errorString())); QVERIFY2(proc.waitForFinished(30000), qPrintable(command)); |