Added Q_INIT_RESOURCE(ads) for static builds

This commit is contained in:
Uwe Kindler
2020-04-22 06:25:01 +02:00
parent 8bf8309949
commit 85626c9a21
2 changed files with 15 additions and 4 deletions

View File

@@ -55,6 +55,20 @@
#include "DockingStateReader.h"
/**
* Initializes the resources specified by the .qrc file with the specified base
* name. Normally, when resources are built as part of the application, the
* resources are loaded automatically at startup. The Q_INIT_RESOURCE() macro
* is necessary on some platforms for resources stored in a static library.
* Because GCC caues a linker error if we put Q_INIT_RESOURCE into the
* loadStyleSheet() function, we place it into a function outside of the ads
* namespace
*/
static void initResource()
{
Q_INIT_RESOURCE(ads);
}
namespace ads
{
@@ -148,6 +162,7 @@ DockManagerPrivate::DockManagerPrivate(CDockManager* _public) :
//============================================================================
void DockManagerPrivate::loadStylesheet()
{
initResource();
QString Result;
#ifdef Q_OS_LINUX
QFile StyleSheetFile(":ads/stylesheets/default_linux.css");