Add missing Q_INIT_RESOURCE

The library needs to do Q_INIT_RESOURCE for all resources it uses
internally, otherwise static linking will fail, and the user has
no idea how to rectify it as the name of the missing resource is
not known. The Q_INIT_RESOURCE needs to happen outside of any
namespace, hence the use of static initResources() functions.

Change-Id: I8f7d36b440b05809d97dd489cf8789f345633cec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Tor Arne Vestbø 2013-11-04 13:39:11 +01:00 committed by The Qt Project
parent aa9ca5749f
commit 96d74313fe
3 changed files with 18 additions and 0 deletions

View File

@ -53,6 +53,11 @@
#include <QDateTime>
#include <QtEndian>
static void initResources()
{
Q_INIT_RESOURCE(mimetypes);
}
QT_BEGIN_NAMESPACE
static QString fallbackParent(const QString &mimeTypeName)
@ -704,6 +709,7 @@ void QMimeBinaryProvider::loadGenericIcon(QMimeTypePrivate &data)
QMimeXMLProvider::QMimeXMLProvider(QMimeDatabasePrivate *db)
: QMimeProviderBase(db), m_loaded(false)
{
initResources();
}
bool QMimeXMLProvider::isValid()

View File

@ -74,6 +74,11 @@
#include <EGL/egl.h>
static void initResources()
{
Q_INIT_RESOURCE(cursor);
}
QT_BEGIN_NAMESPACE
QEglFSIntegration::QEglFSIntegration()
@ -82,6 +87,7 @@ QEglFSIntegration::QEglFSIntegration()
, mScreen(0)
, mInputContext(0)
{
initResources();
}
QEglFSIntegration::~QEglFSIntegration()

View File

@ -103,6 +103,11 @@ Print dialog class declarations
Layout in qprintpropertieswidget.ui
*/
static void initResources()
{
Q_INIT_RESOURCE(qprintdialog);
}
QT_BEGIN_NAMESPACE
class QOptionTreeItem;
@ -306,6 +311,7 @@ void QPrintPropertiesDialog::showEvent(QShowEvent* event)
QPrintDialogPrivate::QPrintDialogPrivate()
: top(0), bottom(0), buttons(0), collapseButton(0)
{
initResources();
}
QPrintDialogPrivate::~QPrintDialogPrivate()