From 5d64a01f58f9112e62da13e7bd2d9ddb9d845123 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 23 Dec 2015 15:00:49 +0100 Subject: [PATCH] Fixed: Use Xcb plugin for Qt 5 under Linux --HG-- branch : develop --- .../tools/misc/crash_report/crash_report.cpp | 20 +++++++++---------- code/nel/tools/misc/message_box_qt/main.cpp | 14 +++++++++++++ code/nel/tools/misc/words_dic_qt/main.cpp | 14 +++++++++++++ .../tools/client/client_config_qt/main.cpp | 15 +++++++------- 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/code/nel/tools/misc/crash_report/crash_report.cpp b/code/nel/tools/misc/crash_report/crash_report.cpp index 72cbc26bf..d3caddd3a 100644 --- a/code/nel/tools/misc/crash_report/crash_report.cpp +++ b/code/nel/tools/misc/crash_report/crash_report.cpp @@ -80,16 +80,17 @@ public: #include -#ifdef Q_OS_WIN32 +#if defined(Q_OS_WIN32) Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) -#endif - -#ifdef Q_OS_MAC +#elif defined(Q_OS_MAC) Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) -#endif +#elif defined(Q_OS_UNIX) + Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) #endif -int main( int argc, char **argv ) +#endif + +int main(int argc, char **argv) { #ifndef WIN32 // Workaround to default -style=gtk+ on recent Cinnamon versions @@ -111,14 +112,13 @@ int main( int argc, char **argv ) CCmdLineParser::parse( argc, argv, params ); CCrashReportWidget w; - w.setup( params ); + w.setup(params); w.show(); int ret = app.exec(); - if( ret != EXIT_SUCCESS ) + if(ret != EXIT_SUCCESS) return ret; else return w.getReturnValue(); - -} \ No newline at end of file +} diff --git a/code/nel/tools/misc/message_box_qt/main.cpp b/code/nel/tools/misc/message_box_qt/main.cpp index cab992ef6..22b72ea5a 100644 --- a/code/nel/tools/misc/message_box_qt/main.cpp +++ b/code/nel/tools/misc/message_box_qt/main.cpp @@ -8,6 +8,20 @@ #include #include +#ifdef QT_STATICPLUGIN + +#include + +#if defined(Q_OS_WIN32) + Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) +#elif defined(Q_OS_MAC) + Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) +#elif defined(Q_OS_UNIX) + Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) +#endif + +#endif + int main(int argc, char *argv[]) { QApplication app(argc, argv); diff --git a/code/nel/tools/misc/words_dic_qt/main.cpp b/code/nel/tools/misc/words_dic_qt/main.cpp index 31429289c..ae348c7aa 100644 --- a/code/nel/tools/misc/words_dic_qt/main.cpp +++ b/code/nel/tools/misc/words_dic_qt/main.cpp @@ -12,6 +12,20 @@ #define NL_WORDS_DIC_CFG "." #endif +#ifdef QT_STATICPLUGIN + +#include + +#if defined(Q_OS_WIN32) + Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) +#elif defined(Q_OS_MAC) + Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) +#elif defined(Q_OS_UNIX) + Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) +#endif + +#endif + int main(int argc, char *argv[]) { diff --git a/code/ryzom/tools/client/client_config_qt/main.cpp b/code/ryzom/tools/client/client_config_qt/main.cpp index 33d379068..52d3cf7bb 100644 --- a/code/ryzom/tools/client/client_config_qt/main.cpp +++ b/code/ryzom/tools/client/client_config_qt/main.cpp @@ -25,18 +25,19 @@ #include -#ifdef Q_OS_WIN32 +#if defined(Q_OS_WIN32) Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) -#endif - -#ifdef Q_OS_MAC +#elif defined(Q_OS_MAC) Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) -#endif +#elif defined(Q_OS_UNIX) + Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) #endif -int main( sint32 argc, char **argv ) +#endif + +int main(sint32 argc, char **argv) { - QApplication app( argc, argv ); + QApplication app(argc, argv); QApplication::setWindowIcon(QIcon(":/resources/welcome_icon.png")); QPixmap pixmap(":/resources/splash_screen.png" );