diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-11-16 16:37:35 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-11-19 18:40:59 +0000 |
commit | 9b8fb32f3970c56fe57aa2cf067928327f1162c7 (patch) | |
tree | 9ecdbf78f68bcacc374afb7c0ef0fdbdba7704cf /src/printsupport | |
parent | 9dc4dde129d34230a500c901d92ef1e330de7045 (diff) |
Link printer plugins into user projects when using a static Qt
When building a user project against a static Qt on Windows or macOS the
static printer support plugins were not linked. Move the
Q_IMPORT_PLUGIN statements to qplatformprintplugin.cpp, which is a
translation unit that is guaranteed to be linked into the user project.
Fixes: QTBUG-97490
Change-Id: Ic35c6483a664a06461304c7e8a2b7b06ce651ed6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 68600869cd3a1b5f118d9a69200f1a6453e0c8ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/printsupport')
-rw-r--r-- | src/printsupport/kernel/qplatformprintplugin.cpp | 6 | ||||
-rw-r--r-- | src/printsupport/platform/macos/qcocoaprintersupport.mm | 2 | ||||
-rw-r--r-- | src/printsupport/platform/windows/qwindowsprintersupport.cpp | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/printsupport/kernel/qplatformprintplugin.cpp b/src/printsupport/kernel/qplatformprintplugin.cpp index 9a7656f7d6..6f470b835c 100644 --- a/src/printsupport/kernel/qplatformprintplugin.cpp +++ b/src/printsupport/kernel/qplatformprintplugin.cpp @@ -48,6 +48,12 @@ QT_BEGIN_NAMESPACE +#if defined(Q_OS_MACOS) +Q_IMPORT_PLUGIN(QCocoaPrinterSupportPlugin) +#elif defined(Q_OS_WIN) +Q_IMPORT_PLUGIN(QWindowsPrinterSupportPlugin) +#endif + Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QPlatformPrinterSupportFactoryInterface_iid, QLatin1String("/printsupport"), Qt::CaseInsensitive)) diff --git a/src/printsupport/platform/macos/qcocoaprintersupport.mm b/src/printsupport/platform/macos/qcocoaprintersupport.mm index 64a63241e7..a9c536964d 100644 --- a/src/printsupport/platform/macos/qcocoaprintersupport.mm +++ b/src/printsupport/platform/macos/qcocoaprintersupport.mm @@ -128,8 +128,6 @@ QPlatformPrinterSupport *QCocoaPrinterSupportPlugin::create(const QString &key) return new QCocoaPrinterSupport(); } -Q_IMPORT_PLUGIN(QCocoaPrinterSupportPlugin) - #include "qcocoaprintersupport.moc" QT_END_NAMESPACE diff --git a/src/printsupport/platform/windows/qwindowsprintersupport.cpp b/src/printsupport/platform/windows/qwindowsprintersupport.cpp index fbf11fe93e..8d8322dca9 100644 --- a/src/printsupport/platform/windows/qwindowsprintersupport.cpp +++ b/src/printsupport/platform/windows/qwindowsprintersupport.cpp @@ -103,8 +103,6 @@ QPlatformPrinterSupport *QWindowsPrinterSupportPlugin::create(const QString &key return nullptr; } -Q_IMPORT_PLUGIN(QWindowsPrinterSupportPlugin) - #include "qwindowsprintersupport.moc" QT_END_NAMESPACE |