Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.1.0
-
None
-
Mac OS X AMD 64 - latest code from GIT
Description
Hi,
Calling the print dialog when statically linking the QT libraries leads to a crash, because of some failed NULL pointer checks. The reason is that the cocoa printing support plugin does not get loaded correctly. The following hack makes it work again:
diff --git a/src/printsupport/kernel/qplatformprintplugin.cpp b/src/printsupport/kernel/qplatformprintplugin.cpp
index ce6d7a0..cbcd228 100644
— a/src/printsupport/kernel/qplatformprintplugin.cpp
+++ b/src/printsupport/kernel/qplatformprintplugin.cpp
@@ -45,9 +45,11 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_LIBRARY
+#if 0
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformPrinterSupportFactoryInterface_iid, QLatin1String("/printsupport"), Qt::CaseInsensitive))
#endif
+#endif
QPlatformPrinterSupportPlugin::QPlatformPrinterSupportPlugin(QObject *parent)
: QObject(parent)
@@ -66,13 +68,19 @@ QPlatformPrinterSupportPlugin::~QPlatformPrinterSupportPlugin()
application exit, i.e. you can expect this pointer to always be valid and
multiple calls to this function will always return the same pointer.
*/
+
+#include <../plugins/platforms/cocoa/qcocoaprintersupport.h>
QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get()
{
static QPlatformPrinterSupport *singleton = 0;
if (!singleton)
return singleton;
}
Thank you!
--HPS