Skip to content

Commit 85626c9

Browse files
Added Q_INIT_RESOURCE(ads) for static builds
1 parent 8bf8309 commit 85626c9

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

demo/MainWindow.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,6 @@ CMainWindow::CMainWindow(QWidget *parent) :
566566
// Now create the dock manager and its content
567567
d->DockManager = new CDockManager(this);
568568

569-
// uncomment the following line to have the old style where the dock
570-
// area close button closes the active tab
571-
// CDockManager::setConfigFlags({CDockManager::DockAreaHasCloseButton
572-
// | CDockManager::DockAreaCloseButtonClosesTab});
573569
connect(d->PerspectiveComboBox, SIGNAL(activated(const QString&)),
574570
d->DockManager, SLOT(openPerspective(const QString&)));
575571

src/DockManager.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,20 @@
5555
#include "DockingStateReader.h"
5656

5757

58+
/**
59+
* Initializes the resources specified by the .qrc file with the specified base
60+
* name. Normally, when resources are built as part of the application, the
61+
* resources are loaded automatically at startup. The Q_INIT_RESOURCE() macro
62+
* is necessary on some platforms for resources stored in a static library.
63+
* Because GCC caues a linker error if we put Q_INIT_RESOURCE into the
64+
* loadStyleSheet() function, we place it into a function outside of the ads
65+
* namespace
66+
*/
67+
static void initResource()
68+
{
69+
Q_INIT_RESOURCE(ads);
70+
}
71+
5872

5973
namespace ads
6074
{
@@ -148,6 +162,7 @@ DockManagerPrivate::DockManagerPrivate(CDockManager* _public) :
148162
//============================================================================
149163
void DockManagerPrivate::loadStylesheet()
150164
{
165+
initResource();
151166
QString Result;
152167
#ifdef Q_OS_LINUX
153168
QFile StyleSheetFile(":ads/stylesheets/default_linux.css");

0 commit comments

Comments
 (0)