summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-09-05 16:46:13 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-09-05 16:46:33 +0200
commit99dfabc44a46be0a1a16600435a911a4816afc8c (patch)
tree647ee6c958d35c25dfea133fdfb4aa3b17f8b48c /src
parent29ca3235df5430965b788daf78a8fd8a34ad6c96 (diff)
parentcfe5b8686e58e4f4e0020dd2a7d2972acc421f43 (diff)
downloadqttools-99dfabc44a46be0a1a16600435a911a4816afc8c.tar.gz
Merge remote-tracking branch 'origin/dev' into wip/qdoc-clang
Change-Id: I1ed3009c1ffa4494fcb3880db7ae4ec1bbdc4e22
Diffstat (limited to 'src')
-rw-r--r--src/androiddeployqt/main.cpp3
-rw-r--r--src/assistant/help/qhelpgenerator.cpp3
-rw-r--r--src/designer/src/components/formeditor/formwindow.h11
-rw-r--r--src/designer/src/components/formeditor/formwindowmanager.cpp8
-rw-r--r--src/designer/src/components/formeditor/widgetselection.cpp13
-rw-r--r--src/designer/src/components/lib/lib_pch.h2
-rw-r--r--src/designer/src/uitools/quiloader_p.h21
-rw-r--r--src/qtattributionsscanner/main.cpp49
-rw-r--r--src/qtattributionsscanner/scanner.cpp2
-rw-r--r--src/qtattributionsscanner/scanner.h1
-rw-r--r--src/windeployqt/main.cpp9
-rw-r--r--src/windeployqt/qmlutils.cpp16
-rw-r--r--src/windeployqt/qmlutils.h2
-rw-r--r--src/winrtrunner/appxlocalengine.cpp25
14 files changed, 114 insertions, 51 deletions
diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp
index dd5b74bd6..51b514f51 100644
--- a/src/androiddeployqt/main.cpp
+++ b/src/androiddeployqt/main.cpp
@@ -774,7 +774,8 @@ bool readInputFile(Options *options)
{
const QJsonValue deploymentDependencies = jsonObject.value(QStringLiteral("deployment-dependencies"));
if (!deploymentDependencies.isUndefined()) {
- const auto dependencies = deploymentDependencies.toString().splitRef(QLatin1Char(','));
+ QString deploymentDependenciesString = deploymentDependencies.toString();
+ const auto dependencies = deploymentDependenciesString.splitRef(QLatin1Char(','));
for (const QStringRef &dependency : dependencies) {
QString path = options->qtInstallDirectory + QLatin1Char('/') + dependency;
if (QFileInfo(path).isDir()) {
diff --git a/src/assistant/help/qhelpgenerator.cpp b/src/assistant/help/qhelpgenerator.cpp
index c8722499e..d341a04de 100644
--- a/src/assistant/help/qhelpgenerator.cpp
+++ b/src/assistant/help/qhelpgenerator.cpp
@@ -311,9 +311,6 @@ bool QHelpGenerator::createTables()
"NamespaceId INTEGER, "
"FileId INTEGER, "
"Anchor TEXT )")
- << QLatin1String("CREATE TABLE IndexItemTable ("
- "Id INTEGER, "
- "IndexId INTEGER )")
<< QLatin1String("CREATE TABLE IndexFilterTable ("
"FilterAttributeId INTEGER, "
"IndexId INTEGER )")
diff --git a/src/designer/src/components/formeditor/formwindow.h b/src/designer/src/components/formeditor/formwindow.h
index bda20077f..aca354728 100644
--- a/src/designer/src/components/formeditor/formwindow.h
+++ b/src/designer/src/components/formeditor/formwindow.h
@@ -70,6 +70,13 @@ class QT_FORMEDITOR_EXPORT FormWindow: public FormWindowBase
Q_OBJECT
public:
+ enum HandleOperation
+ {
+ NoHandleOperation,
+ ResizeHandleOperation,
+ ChangeLayoutSpanHandleOperation
+ };
+
explicit FormWindow(FormEditor *core, QWidget *parent = 0, Qt::WindowFlags flags = 0);
virtual ~FormWindow();
@@ -199,6 +206,9 @@ public:
bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
+ HandleOperation handleOperation() const { return m_handleOperation; }
+ void setHandleOperation(HandleOperation o) { m_handleOperation = o; }
+
signals:
void contextMenuRequested(QMenu *menu, QWidget *widget);
@@ -354,6 +364,7 @@ private:
QStringList m_includeHints;
QPoint m_contextMenuPosition;
+ HandleOperation m_handleOperation = NoHandleOperation;
private:
friend class WidgetEditorTool;
diff --git a/src/designer/src/components/formeditor/formwindowmanager.cpp b/src/designer/src/components/formeditor/formwindowmanager.cpp
index 2cccd851e..0341c920b 100644
--- a/src/designer/src/components/formeditor/formwindowmanager.cpp
+++ b/src/designer/src/components/formeditor/formwindowmanager.cpp
@@ -209,6 +209,14 @@ bool FormWindowManager::eventFilter(QObject *o, QEvent *e)
return true;
}
switch (eventType) {
+ case QEvent::LayoutRequest:
+ // QTBUG-61439: Suppress layout request while changing the QGridLayout
+ // span of a QTabWidget, which sends LayoutRequest in resizeEvent().
+ if (fw->handleOperation() == FormWindow::ChangeLayoutSpanHandleOperation) {
+ e->ignore();
+ return true;
+ }
+ break;
case QEvent::WindowActivate: {
if (fw->parentWidget()->isWindow() && fw->isMainContainer(managedWidget) && activeFormWindow() != fw) {
diff --git a/src/designer/src/components/formeditor/widgetselection.cpp b/src/designer/src/components/formeditor/widgetselection.cpp
index eda77e213..fcb54de92 100644
--- a/src/designer/src/components/formeditor/widgetselection.cpp
+++ b/src/designer/src/components/formeditor/widgetselection.cpp
@@ -178,6 +178,17 @@ void WidgetHandle::mousePressEvent(QMouseEvent *e)
m_origPressPos = container->mapFromGlobal(e->globalPos());
m_geom = m_origGeom = m_widget->geometry();
+
+ switch (WidgetSelection::widgetState(m_formWindow->core(), m_widget)) {
+ case WidgetSelection::UnlaidOut:
+ case WidgetSelection::LaidOut:
+ m_formWindow->setHandleOperation(FormWindow::ResizeHandleOperation);
+ break;
+ case WidgetSelection::ManagedGridLayout:
+ case WidgetSelection::ManagedFormLayout:
+ m_formWindow->setHandleOperation(FormWindow::ChangeLayoutSpanHandleOperation);
+ break;
+ }
}
void WidgetHandle::mouseMoveEvent(QMouseEvent *e)
@@ -326,6 +337,8 @@ void WidgetHandle::mouseMoveEvent(QMouseEvent *e)
void WidgetHandle::mouseReleaseEvent(QMouseEvent *e)
{
+ m_formWindow->setHandleOperation(FormWindow::NoHandleOperation);
+
if (e->button() != Qt::LeftButton || !m_active)
return;
diff --git a/src/designer/src/components/lib/lib_pch.h b/src/designer/src/components/lib/lib_pch.h
index f2f226797..d03a498c2 100644
--- a/src/designer/src/components/lib/lib_pch.h
+++ b/src/designer/src/components/lib/lib_pch.h
@@ -26,5 +26,7 @@
**
****************************************************************************/
+#if defined __cplusplus
#include <QtDesigner/QtDesigner>
#include <QtDesigner/QExtensionManager>
+#endif
diff --git a/src/designer/src/uitools/quiloader_p.h b/src/designer/src/uitools/quiloader_p.h
index f9371fac4..86e970f49 100644
--- a/src/designer/src/uitools/quiloader_p.h
+++ b/src/designer/src/uitools/quiloader_p.h
@@ -1,11 +1,11 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -14,13 +14,24 @@
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
** 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
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** 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.
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/qtattributionsscanner/main.cpp b/src/qtattributionsscanner/main.cpp
index cd9bc1fed..700bf8814 100644
--- a/src/qtattributionsscanner/main.cpp
+++ b/src/qtattributionsscanner/main.cpp
@@ -44,12 +44,13 @@ int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
a.setApplicationName(QStringLiteral("Qt Attributions Scanner"));
- a.setApplicationVersion(QStringLiteral("1.0"));
+ a.setApplicationVersion(QStringLiteral("1.1"));
QCommandLineParser parser;
- parser.setApplicationDescription(tr("Searches and processes qt_attribution.json files in Qt sources."));
- parser.addPositionalArgument(QStringLiteral("directory"),
- tr("The directory to scan recursively."));
+ parser.setApplicationDescription(tr("Processes qt_attribution.json files in Qt sources."));
+ parser.addPositionalArgument(QStringLiteral("path"),
+ tr("Path to a qt_attribution.json file, "
+ "or a directory to be scannned recursively."));
parser.addHelpOption();
parser.addVersionOption();
@@ -60,6 +61,10 @@ int main(int argc, char *argv[])
QCommandLineOption filterOption(QStringLiteral("filter"),
tr("Filter packages according to <filter> (e.g. QDocModule=qtcore)"),
QStringLiteral("expression"));
+ QCommandLineOption baseDirOption(QStringLiteral("basedir"),
+ tr("Paths in documentation are made relative to this "
+ "directory."),
+ QStringLiteral("directory"));
QCommandLineOption outputOption({ QStringLiteral("o"), QStringLiteral("output") },
tr("Write generated data to <file>."),
QStringLiteral("file"));
@@ -70,6 +75,7 @@ int main(int argc, char *argv[])
parser.addOption(generatorOption);
parser.addOption(filterOption);
+ parser.addOption(baseDirOption);
parser.addOption(outputOption);
parser.addOption(verboseOption);
parser.addOption(silentOption);
@@ -90,13 +96,22 @@ int main(int argc, char *argv[])
if (parser.positionalArguments().size() != 1)
parser.showHelp(2);
- const QString directory = parser.positionalArguments().last();
-
- if (logLevel == VerboseLog)
- std::cerr << qPrintable(tr("Recursively scanning %1 for qt_attribution.json files...").arg(
- QDir::toNativeSeparators(directory))) << std::endl;
-
- QVector<Package> packages = Scanner::scanDirectory(directory, logLevel);
+ const QString path = parser.positionalArguments().last();
+
+ QVector<Package> packages;
+ const QFileInfo pathInfo(path);
+ if (pathInfo.isDir()) {
+ if (logLevel == VerboseLog)
+ std::cerr << qPrintable(tr("Recursively scanning %1 for qt_attribution.json files...").arg(
+ QDir::toNativeSeparators(path))) << std::endl;
+ packages = Scanner::scanDirectory(path, logLevel);
+ } else if (pathInfo.isFile()) {
+ packages = Scanner::readFile(path, logLevel);
+ } else {
+ std::cerr << qPrintable(tr("%1 is not a valid file or directory.").arg(
+ QDir::toNativeSeparators(path))) << std::endl << std::endl;
+ parser.showHelp(7);
+ }
if (parser.isSet(filterOption)) {
PackageFilter filter(parser.value(filterOption));
@@ -124,8 +139,16 @@ int main(int argc, char *argv[])
QString generator = parser.value(generatorOption);
if (generator == QLatin1String("qdoc")) {
- // include top level module name in printed paths
- QString baseDirectory = QDir(directory).absoluteFilePath(QStringLiteral(".."));
+ QString baseDirectory = parser.value(baseDirOption);
+ if (baseDirectory.isEmpty()) {
+ if (pathInfo.isDir()) {
+ // include top level module name in printed paths
+ baseDirectory = pathInfo.dir().absoluteFilePath(QStringLiteral(".."));
+ } else {
+ baseDirectory = pathInfo.absoluteDir().absoluteFilePath(QStringLiteral(".."));
+ }
+ }
+
QDocGenerator::generate(out, packages, baseDirectory, logLevel);
} else if (generator == QLatin1String("json")) {
JsonGenerator::generate(out, packages, logLevel);
diff --git a/src/qtattributionsscanner/scanner.cpp b/src/qtattributionsscanner/scanner.cpp
index 488417e89..d7d958138 100644
--- a/src/qtattributionsscanner/scanner.cpp
+++ b/src/qtattributionsscanner/scanner.cpp
@@ -140,7 +140,7 @@ static Package readPackage(const QJsonObject &object, const QString &filePath, L
return p;
}
-static QVector<Package> readFile(const QString &filePath, LogLevel logLevel)
+QVector<Package> readFile(const QString &filePath, LogLevel logLevel)
{
if (logLevel == VerboseLog) {
std::cerr << qPrintable(tr("Reading file %1...").arg(
diff --git a/src/qtattributionsscanner/scanner.h b/src/qtattributionsscanner/scanner.h
index 5d93cb8ee..f3ae9f0ea 100644
--- a/src/qtattributionsscanner/scanner.h
+++ b/src/qtattributionsscanner/scanner.h
@@ -37,6 +37,7 @@
namespace Scanner {
+QVector<Package> readFile(const QString &filePath, LogLevel logLevel);
QVector<Package> scanDirectory(const QString &directory, LogLevel logLevel);
}
diff --git a/src/windeployqt/main.cpp b/src/windeployqt/main.cpp
index 8ec4a6205..8ed6fffdf 100644
--- a/src/windeployqt/main.cpp
+++ b/src/windeployqt/main.cpp
@@ -817,7 +817,8 @@ static const PluginModuleMapping pluginModuleMappings[] =
{"qtwebengine", QtWebEngineModule | QtWebEngineCoreModule | QtWebEngineWidgetsModule},
{"styles", QtWidgetsModule},
{"sceneparsers", Qt3DRendererModule},
- {"renderplugins", Qt3DRendererModule}
+ {"renderplugins", Qt3DRendererModule},
+ {"geometryloaders", Qt3DRendererModule}
};
static inline quint64 qtModuleForPlugin(const QString &subDirName)
@@ -1048,7 +1049,10 @@ static QString vcRedistDir()
const QFileInfoList subDirs =
QDir(vc2017RedistDirName).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed);
for (const QFileInfo &f : subDirs) {
- const QString path = f.absoluteFilePath();
+ QString path = f.absoluteFilePath();
+ if (QFileInfo(path + slash + vcDebugRedistDir()).isDir())
+ return path;
+ path += QStringLiteral("/onecore");
if (QFileInfo(path + slash + vcDebugRedistDir()).isDir())
return path;
}
@@ -1547,6 +1551,7 @@ static bool deployWebEngineCore(const QMap<QString, QString> &qmakeVariables,
const Options &options, bool isDebug, QString *errorMessage)
{
static const char *installDataFiles[] = {"icudtl.dat",
+ "qtwebengine_devtools_resources.pak",
"qtwebengine_resources.pak",
"qtwebengine_resources_100p.pak",
"qtwebengine_resources_200p.pak"};
diff --git a/src/windeployqt/qmlutils.cpp b/src/windeployqt/qmlutils.cpp
index 9e8bb09e2..52f044068 100644
--- a/src/windeployqt/qmlutils.cpp
+++ b/src/windeployqt/qmlutils.cpp
@@ -39,6 +39,11 @@
QT_BEGIN_NAMESPACE
+bool operator==(const QmlImportScanResult::Module &m1, const QmlImportScanResult::Module &m2)
+{
+ return m1.className.isEmpty() ? m1.name == m2.name : m1.className == m2.className;
+}
+
// Return install path (cp -r semantics)
QString QmlImportScanResult::Module::installPath(const QString &root) const
{
@@ -153,19 +158,10 @@ QmlImportScanResult runQmlImportScanner(const QString &directory, const QString
return result;
}
-static inline bool contains(const QList<QmlImportScanResult::Module> &modules, const QString &className)
-{
- for (const QmlImportScanResult::Module &m : modules) {
- if (m.className == className)
- return true;
- }
- return false;
-}
-
void QmlImportScanResult::append(const QmlImportScanResult &other)
{
for (const QmlImportScanResult::Module &module : other.modules) {
- if (!contains(modules, module.className))
+ if (std::find(modules.cbegin(), modules.cend(), module) == modules.cend())
modules.append(module);
}
for (const QString &plugin : other.plugins) {
diff --git a/src/windeployqt/qmlutils.h b/src/windeployqt/qmlutils.h
index 5e1ddc619..895c7f1de 100644
--- a/src/windeployqt/qmlutils.h
+++ b/src/windeployqt/qmlutils.h
@@ -55,6 +55,8 @@ struct QmlImportScanResult {
QStringList plugins;
};
+bool operator==(const QmlImportScanResult::Module &m1, const QmlImportScanResult::Module &m2);
+
QmlImportScanResult runQmlImportScanner(const QString &directory, const QString &qmlImportPath,
bool usesWidgets, int platform, DebugMatchMode debugMatchMode,
QString *errorMessage);
diff --git a/src/winrtrunner/appxlocalengine.cpp b/src/winrtrunner/appxlocalengine.cpp
index 3c89d715c..d7cf35b31 100644
--- a/src/winrtrunner/appxlocalengine.cpp
+++ b/src/winrtrunner/appxlocalengine.cpp
@@ -412,18 +412,6 @@ bool AppxLocalEngine::installPackage(IAppxManifestReader *reader, const QString
return false;
}
- ComPtr<IAsyncInfo> asyncInfo;
- hr = deploymentOperation.As(&asyncInfo);
- RETURN_FALSE_IF_FAILED("Failed to cast deployment operation to info.");
- AsyncStatus status;
- hr = asyncInfo->get_Status(&status);
- RETURN_FALSE_IF_FAILED("Failed to retrieve deployment operation's status.");
-
- if (status != Completed) {
- qCWarning(lcWinRtRunner) << "Deployment operation did not succeed.";
- return false;
- }
-
ComPtr<IDeploymentResult> results;
hr = deploymentOperation->GetResults(&results);
RETURN_FALSE_IF_FAILED("Failed to retrieve package registration results.");
@@ -433,10 +421,15 @@ bool AppxLocalEngine::installPackage(IAppxManifestReader *reader, const QString
RETURN_FALSE_IF_FAILED("Failed to retrieve extended error code.");
if (FAILED(errorCode)) {
- HString errorText;
- if (SUCCEEDED(results->get_ErrorText(errorText.GetAddressOf()))) {
- qCWarning(lcWinRtRunner) << "Unable to register package:"
- << QString::fromWCharArray(errorText.GetRawBuffer(NULL));
+ if (HRESULT_CODE(errorCode) == ERROR_INSTALL_PREREQUISITE_FAILED) {
+ qCWarning(lcWinRtRunner) << "Unable to register package: A requirement for installation was not met. "
+ "Check that your Windows version matches TargetDeviceFamily's MinVersion set in your AppxManifest.xml.";
+ } else {
+ HString errorText;
+ if (SUCCEEDED(results->get_ErrorText(errorText.GetAddressOf()))) {
+ qCWarning(lcWinRtRunner) << "Unable to register package:"
+ << QString::fromWCharArray(errorText.GetRawBuffer(NULL));
+ }
}
if (HRESULT_CODE(errorCode) == ERROR_INSTALL_POLICY_FAILURE) {
// The user's license has expired. Give them the opportunity to renew it.