summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-08-11 16:19:24 +0200
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-08-13 09:03:48 +0000
commit247b9999cd389ae5b11a21b535b1c9ff817dc9c6 (patch)
tree803626468370a913e98c0418ff4322b090d1e340
parenteeb8d316f9e7ae2e5d09edecda5dcc6b03bdf9c3 (diff)
downloadqttools-247b9999cd389ae5b11a21b535b1c9ff817dc9c6.tar.gz
macdeployqt: Workaround for QtQuick.PrivateWidgets
Deploy PrivateWidgets if QtWidget.framework and QtQuick.Controls is in use. Task-number: QTBUG-45977 Change-Id: Id2d7af8895be136d84bed92043fc790b156d8dea Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
-rw-r--r--src/macdeployqt/shared/shared.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp
index b85fa0d5a..d6dcfb637 100644
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -1108,6 +1108,8 @@ void deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
return;
}
+ bool qtQuickContolsInUse = false; // condition for QtQuick.PrivateWidgets below
+
// deploy each import
foreach (const QJsonValue &importValue, doc.array()) {
if (!importValue.isObject())
@@ -1118,6 +1120,9 @@ void deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
QString path = import["path"].toString();
QString type = import["type"].toString();
+ if (import["name"] == "QtQuick.Controls")
+ qtQuickContolsInUse = true;
+
LogNormal() << "Deploying QML import" << name;
// Skip imports with missing info - path will be empty if the import is not found.
@@ -1147,6 +1152,21 @@ void deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
deployQmlImport(appBundlePath, deploymentInfo.rpathsUsed, path, name);
LogNormal() << "";
}
+
+ // Special case:
+ // Use of QtQuick.PrivateWidgets is not discoverable at deploy-time.
+ // Recreate the run-time logic here as best as we can - deploy it iff
+ // 1) QtWidgets.framework is used
+ // 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) {
+ LogNormal() << "Deploying QML import QtQuick.PrivateWidgets";
+ QString name = "QtQuick/PrivateWidgets";
+ QString path = qmlImportsPath + QLatin1Char('/') + name;
+ deployQmlImport(appBundlePath, deploymentInfo.rpathsUsed, path, name);
+ LogNormal() << "";
+ }
}
void changeQtFrameworks(const QList<FrameworkInfo> frameworks, const QStringList &binaryPaths, const QString &absoluteQtPath)