From f79b66ca8295cbd24fa8aed8c6fdc26a59661f6b Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 18 Sep 2014 20:52:09 +0200 Subject: [PATCH] Qt5 build fixes (plugins/core) --HG-- branch : qt5 --- code/studio/src/CMakeLists.txt | 2 +- code/studio/src/extension_system/iplugin.h | 9 ++--- .../src/extension_system/iplugin_manager.h | 8 ++--- .../src/extension_system/iplugin_spec.h | 2 +- code/studio/src/plugins/CMakeLists.txt | 34 +++++++++---------- code/studio/src/plugins/core/CMakeLists.txt | 23 ++++++++++--- .../plugins/core/Nel3DWidget/nel3d_widget.cpp | 2 +- .../src/plugins/core/context_manager.cpp | 4 +-- .../studio/src/plugins/core/context_manager.h | 2 +- code/studio/src/plugins/core/core_global.h | 2 +- code/studio/src/plugins/core/core_plugin.cpp | 14 ++++---- code/studio/src/plugins/core/core_plugin.h | 3 +- .../plugins/core/general_settings_page.cpp | 12 +++---- .../src/plugins/core/general_settings_page.h | 2 +- code/studio/src/plugins/core/icontext.h | 6 ++-- code/studio/src/plugins/core/icore.h | 2 +- code/studio/src/plugins/core/icore_listener.h | 2 +- code/studio/src/plugins/core/ioptions_page.h | 2 +- code/studio/src/plugins/core/main_window.cpp | 11 ++++-- code/studio/src/plugins/core/main_window.h | 6 ++-- code/studio/src/plugins/core/menu_manager.h | 12 +++---- .../src/plugins/core/plugin_view_dialog.cpp | 8 ++--- .../src/plugins/core/plugin_view_dialog.h | 4 +-- .../core/search_paths_settings_page.cpp | 6 ++-- .../plugins/core/search_paths_settings_page.h | 2 +- .../src/plugins/core/settings_dialog.cpp | 4 +-- .../studio/src/plugins/core/settings_dialog.h | 2 +- 27 files changed, 104 insertions(+), 82 deletions(-) diff --git a/code/studio/src/CMakeLists.txt b/code/studio/src/CMakeLists.txt index 8f922eeba..d6b8e6710 100644 --- a/code/studio/src/CMakeLists.txt +++ b/code/studio/src/CMakeLists.txt @@ -81,6 +81,6 @@ NL_DEFAULT_PROPS(studio "Tools: Studio") NL_ADD_RUNTIME_FLAGS(studio) ADD_SUBDIRECTORY(3rdparty) -#ADD_SUBDIRECTORY(plugins) +ADD_SUBDIRECTORY(plugins) INSTALL(TARGETS studio RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT runtime BUNDLE DESTINATION /Applications) diff --git a/code/studio/src/extension_system/iplugin.h b/code/studio/src/extension_system/iplugin.h index 973f80e14..6b3e9d7d7 100644 --- a/code/studio/src/extension_system/iplugin.h +++ b/code/studio/src/extension_system/iplugin.h @@ -19,9 +19,9 @@ #ifndef IPLUGIN_H #define IPLUGIN_H -#include -#include -#include +#include +#include +#include #include "iplugin_manager.h" @@ -99,6 +99,7 @@ public: }; //namespace ExtensionSystem -Q_DECLARE_INTERFACE(ExtensionSystem::IPlugin, "dev.ryzom.com.ObjectViewerQt.IPlugin/0.9.2") +#define NL_STUDIO_IPLUGIN_IID "org.ryzomcore.Studio.IPlugin/0.10.0" +Q_DECLARE_INTERFACE(ExtensionSystem::IPlugin, NL_STUDIO_IPLUGIN_IID) #endif // IPLUGIN_H diff --git a/code/studio/src/extension_system/iplugin_manager.h b/code/studio/src/extension_system/iplugin_manager.h index f60f45890..5abb3da91 100644 --- a/code/studio/src/extension_system/iplugin_manager.h +++ b/code/studio/src/extension_system/iplugin_manager.h @@ -21,10 +21,10 @@ #include "iplugin_spec.h" -#include -#include -#include -#include +#include +#include +#include +#include namespace ExtensionSystem { diff --git a/code/studio/src/extension_system/iplugin_spec.h b/code/studio/src/extension_system/iplugin_spec.h index 2aefbb894..4e1569562 100644 --- a/code/studio/src/extension_system/iplugin_spec.h +++ b/code/studio/src/extension_system/iplugin_spec.h @@ -19,7 +19,7 @@ #ifndef IPLUGINSPEC_H #define IPLUGINSPEC_H -#include +#include namespace ExtensionSystem { diff --git a/code/studio/src/plugins/CMakeLists.txt b/code/studio/src/plugins/CMakeLists.txt index 5916be455..0a8a5176e 100644 --- a/code/studio/src/plugins/CMakeLists.txt +++ b/code/studio/src/plugins/CMakeLists.txt @@ -1,24 +1,24 @@ ADD_SUBDIRECTORY(core) -ADD_SUBDIRECTORY(example) -ADD_SUBDIRECTORY(ovqt_sheet_builder) -ADD_SUBDIRECTORY(landscape_editor) -ADD_SUBDIRECTORY(log) -ADD_SUBDIRECTORY(disp_sheet_id) -ADD_SUBDIRECTORY(object_viewer) -ADD_SUBDIRECTORY(georges_editor) +#ADD_SUBDIRECTORY(example) +#ADD_SUBDIRECTORY(ovqt_sheet_builder) +#ADD_SUBDIRECTORY(landscape_editor) +#ADD_SUBDIRECTORY(log) +#ADD_SUBDIRECTORY(disp_sheet_id) +#ADD_SUBDIRECTORY(object_viewer) +#ADD_SUBDIRECTORY(georges_editor) -ADD_SUBDIRECTORY(world_editor) -IF(WITH_GUI) - ADD_SUBDIRECTORY(gui_editor) -ENDIF(WITH_GUI) +#ADD_SUBDIRECTORY(world_editor) +#IF(WITH_GUI) +# ADD_SUBDIRECTORY(gui_editor) +#ENDIF(WITH_GUI) -ADD_SUBDIRECTORY(translation_manager) -ADD_SUBDIRECTORY(tile_editor) -ADD_SUBDIRECTORY(bnp_manager) +#ADD_SUBDIRECTORY(translation_manager) +#ADD_SUBDIRECTORY(tile_editor) +#ADD_SUBDIRECTORY(bnp_manager) # Note: Temporarily disabled until development continues. #ADD_SUBDIRECTORY(zone_painter) # Ryzom Specific Plugins -IF(WITH_RYZOM AND WITH_RYZOM_TOOLS) - ADD_SUBDIRECTORY(mission_compiler) -ENDIF(WITH_RYZOM AND WITH_RYZOM_TOOLS) +#IF(WITH_RYZOM AND WITH_RYZOM_TOOLS) +# ADD_SUBDIRECTORY(mission_compiler) +#ENDIF(WITH_RYZOM AND WITH_RYZOM_TOOLS) diff --git a/code/studio/src/plugins/core/CMakeLists.txt b/code/studio/src/plugins/core/CMakeLists.txt index 2c21c9b58..3869d3826 100644 --- a/code/studio/src/plugins/core/CMakeLists.txt +++ b/code/studio/src/plugins/core/CMakeLists.txt @@ -41,9 +41,16 @@ SET(OVQT_CORE_PLUGIN_RCS core.qrc) SET(QT_USE_QTGUI TRUE) SET(QT_USE_QTOPENGL TRUE) -QT4_ADD_RESOURCES(OVQT_CORE_PLUGIN_RC_SRCS ${OVQT_CORE_PLUGIN_RCS}) -QT4_WRAP_CPP(OVQT_CORE_PLUGIN_MOC_SRC ${OVQT_CORE_PLUGIN_HDR}) -QT4_WRAP_UI(OVQT_CORE_PLUGIN_UI_HDRS ${OVQT_CORE_PLUGIN_UIS}) +IF(WITH_QT5) + SET(CMAKE_AUTOMOC OFF) + QT5_ADD_RESOURCES(OVQT_CORE_PLUGIN_RC_SRCS ${OVQT_CORE_PLUGIN_RCS}) + QT5_WRAP_CPP(OVQT_CORE_PLUGIN_MOC_SRC ${OVQT_CORE_PLUGIN_HDR}) + QT5_WRAP_UI(OVQT_CORE_PLUGIN_UI_HDRS ${OVQT_CORE_PLUGIN_UIS}) +ELSE(WITH_QT5) + QT4_ADD_RESOURCES(OVQT_CORE_PLUGIN_RC_SRCS ${OVQT_CORE_PLUGIN_RCS}) + QT4_WRAP_CPP(OVQT_CORE_PLUGIN_MOC_SRC ${OVQT_CORE_PLUGIN_HDR}) + QT4_WRAP_UI(OVQT_CORE_PLUGIN_UI_HDRS ${OVQT_CORE_PLUGIN_UIS}) +ENDIF(WITH_QT5) SOURCE_GROUP(QtResources FILES ${OVQT_CORE_PLUGIN_UIS} ${OVQT_CORE_PLUGIN_RCS}) SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_CORE_PLUGIN_UI_HDRS}) @@ -53,7 +60,15 @@ SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) ADD_LIBRARY(studio_plugin_core SHARED ${SRC} ${OVQT_CORE_PLUGIN_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_CORE_PLUGIN_RC_SRCS} ${OVQT_CORE_PLUGIN_UI_HDRS}) -TARGET_LINK_LIBRARIES(studio_plugin_core nelmisc nel3d ${QT_LIBRARIES}) +TARGET_LINK_LIBRARIES(studio_plugin_core nelmisc nel3d) + +IF(WITH_QT5) + TARGET_LINK_LIBRARIES(studio_plugin_core + Qt5::Widgets) +ELSE(WITH_QT5) + TARGET_LINK_LIBRARIES(studio_plugin_core + ${QT_LIBRARIES}) +ENDIF(WITH_QT5) NL_DEFAULT_PROPS(studio_plugin_core "Tools: Studio Plugin: Core") NL_ADD_RUNTIME_FLAGS(studio_plugin_core) diff --git a/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp b/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp index dc0bb858b..376c97170 100644 --- a/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp +++ b/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp @@ -63,7 +63,7 @@ void Nel3DWidget::init() nlassert( driver == NULL ); driver = NL3D::UDriver::createDriver( 0, false, 0 ); - driver->setDisplay( winId(), NL3D::UDriver::CMode( width(), height(), 32, true ) ); + driver->setDisplay( (nlWindow)winId(), NL3D::UDriver::CMode( width(), height(), 32, true ) ); } void Nel3DWidget::createTextContext( std::string fontFile ) diff --git a/code/studio/src/plugins/core/context_manager.cpp b/code/studio/src/plugins/core/context_manager.cpp index 3b02b411c..02513b050 100644 --- a/code/studio/src/plugins/core/context_manager.cpp +++ b/code/studio/src/plugins/core/context_manager.cpp @@ -24,8 +24,8 @@ #include // Qt includes -#include -#include +#include +#include namespace Core { diff --git a/code/studio/src/plugins/core/context_manager.h b/code/studio/src/plugins/core/context_manager.h index 9b0a62c7e..4f17f4748 100644 --- a/code/studio/src/plugins/core/context_manager.h +++ b/code/studio/src/plugins/core/context_manager.h @@ -22,7 +22,7 @@ #include "core_global.h" // Qt includes -#include +#include QT_BEGIN_NAMESPACE class QTabWidget; diff --git a/code/studio/src/plugins/core/core_global.h b/code/studio/src/plugins/core/core_global.h index 48fe0ece9..550151961 100644 --- a/code/studio/src/plugins/core/core_global.h +++ b/code/studio/src/plugins/core/core_global.h @@ -19,7 +19,7 @@ #ifndef CORE_GLOBAL_H #define CORE_GLOBAL_H -#include +#include #if defined(CORE_LIBRARY) # define CORE_EXPORT Q_DECL_EXPORT diff --git a/code/studio/src/plugins/core/core_plugin.cpp b/code/studio/src/plugins/core/core_plugin.cpp index a72a68ccc..8ec5cbb7c 100644 --- a/code/studio/src/plugins/core/core_plugin.cpp +++ b/code/studio/src/plugins/core/core_plugin.cpp @@ -27,12 +27,12 @@ #include "nel/misc/debug.h" // Qt includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include using namespace Core; @@ -101,4 +101,4 @@ void CorePlugin::addAutoReleasedObject(QObject *obj) m_autoReleaseObjects.prepend(obj); } -Q_EXPORT_PLUGIN(CorePlugin) +// Q_EXPORT_PLUGIN(CorePlugin) diff --git a/code/studio/src/plugins/core/core_plugin.h b/code/studio/src/plugins/core/core_plugin.h index 5062227e3..08719e91b 100644 --- a/code/studio/src/plugins/core/core_plugin.h +++ b/code/studio/src/plugins/core/core_plugin.h @@ -23,7 +23,7 @@ #include "nel/misc/app_context.h" -#include +#include namespace NLMISC { @@ -41,6 +41,7 @@ namespace Core class CorePlugin : public QObject, public ExtensionSystem::IPlugin { Q_OBJECT + Q_PLUGIN_METADATA(IID NL_STUDIO_IPLUGIN_IID) Q_INTERFACES(ExtensionSystem::IPlugin) public: diff --git a/code/studio/src/plugins/core/general_settings_page.cpp b/code/studio/src/plugins/core/general_settings_page.cpp index bfbb06d66..ac321fae7 100644 --- a/code/studio/src/plugins/core/general_settings_page.cpp +++ b/code/studio/src/plugins/core/general_settings_page.cpp @@ -24,12 +24,12 @@ #include // Qt includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/code/studio/src/plugins/core/general_settings_page.h b/code/studio/src/plugins/core/general_settings_page.h index 66eacd189..7dbe8d21d 100644 --- a/code/studio/src/plugins/core/general_settings_page.h +++ b/code/studio/src/plugins/core/general_settings_page.h @@ -19,7 +19,7 @@ #ifndef GENERAL_SETTINGS_PAGE_H #define GENERAL_SETTINGS_PAGE_H -#include +#include #include "ioptions_page.h" diff --git a/code/studio/src/plugins/core/icontext.h b/code/studio/src/plugins/core/icontext.h index d2cbb412c..2b98137ed 100644 --- a/code/studio/src/plugins/core/icontext.h +++ b/code/studio/src/plugins/core/icontext.h @@ -22,9 +22,9 @@ #include "core_global.h" // Qt includes -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE class QWidget; diff --git a/code/studio/src/plugins/core/icore.h b/code/studio/src/plugins/core/icore.h index 4f1ee474f..eabe6e6fa 100644 --- a/code/studio/src/plugins/core/icore.h +++ b/code/studio/src/plugins/core/icore.h @@ -21,7 +21,7 @@ #include "core_global.h" -#include +#include QT_BEGIN_NAMESPACE class QMainWindow; diff --git a/code/studio/src/plugins/core/icore_listener.h b/code/studio/src/plugins/core/icore_listener.h index c27e40242..1fffaef0e 100644 --- a/code/studio/src/plugins/core/icore_listener.h +++ b/code/studio/src/plugins/core/icore_listener.h @@ -23,7 +23,7 @@ #include "core_global.h" // Qt includes -#include +#include QT_BEGIN_NAMESPACE class QWidget; diff --git a/code/studio/src/plugins/core/ioptions_page.h b/code/studio/src/plugins/core/ioptions_page.h index 4d9ed6fda..303e932f9 100644 --- a/code/studio/src/plugins/core/ioptions_page.h +++ b/code/studio/src/plugins/core/ioptions_page.h @@ -23,7 +23,7 @@ #include "core_global.h" // Qt includes -#include +#include QT_BEGIN_NAMESPACE class QWidget; diff --git a/code/studio/src/plugins/core/main_window.cpp b/code/studio/src/plugins/core/main_window.cpp index 4ccd32564..b8cdb10f4 100644 --- a/code/studio/src/plugins/core/main_window.cpp +++ b/code/studio/src/plugins/core/main_window.cpp @@ -29,9 +29,14 @@ #include // Qt includes -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include namespace Core { diff --git a/code/studio/src/plugins/core/main_window.h b/code/studio/src/plugins/core/main_window.h index d258a5eba..df139fed3 100644 --- a/code/studio/src/plugins/core/main_window.h +++ b/code/studio/src/plugins/core/main_window.h @@ -25,9 +25,9 @@ // STL includes // Qt includes -#include -#include -#include +#include +#include +#include namespace Core { diff --git a/code/studio/src/plugins/core/menu_manager.h b/code/studio/src/plugins/core/menu_manager.h index fd6af8f3a..3336d6476 100644 --- a/code/studio/src/plugins/core/menu_manager.h +++ b/code/studio/src/plugins/core/menu_manager.h @@ -22,12 +22,12 @@ #include "core_global.h" // Qt includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace Core { diff --git a/code/studio/src/plugins/core/plugin_view_dialog.cpp b/code/studio/src/plugins/core/plugin_view_dialog.cpp index cccc98509..7ef960606 100644 --- a/code/studio/src/plugins/core/plugin_view_dialog.cpp +++ b/code/studio/src/plugins/core/plugin_view_dialog.cpp @@ -21,10 +21,10 @@ #include "nel/misc/debug.h" // Qt includes -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/code/studio/src/plugins/core/plugin_view_dialog.h b/code/studio/src/plugins/core/plugin_view_dialog.h index e7c1123c1..4db2ec214 100644 --- a/code/studio/src/plugins/core/plugin_view_dialog.h +++ b/code/studio/src/plugins/core/plugin_view_dialog.h @@ -20,8 +20,8 @@ #include "ui_plugin_view_dialog.h" -#include -#include +#include +#include namespace ExtensionSystem { diff --git a/code/studio/src/plugins/core/search_paths_settings_page.cpp b/code/studio/src/plugins/core/search_paths_settings_page.cpp index e76d6c796..b3b4e907f 100644 --- a/code/studio/src/plugins/core/search_paths_settings_page.cpp +++ b/code/studio/src/plugins/core/search_paths_settings_page.cpp @@ -24,9 +24,9 @@ #include // Qt includes -#include -#include -#include +#include +#include +#include namespace Core { diff --git a/code/studio/src/plugins/core/search_paths_settings_page.h b/code/studio/src/plugins/core/search_paths_settings_page.h index c45b29571..1e860e957 100644 --- a/code/studio/src/plugins/core/search_paths_settings_page.h +++ b/code/studio/src/plugins/core/search_paths_settings_page.h @@ -19,7 +19,7 @@ #ifndef SEARCH_PATHS_SETTINGS_PAGE_H #define SEARCH_PATHS_SETTINGS_PAGE_H -#include +#include #include "ioptions_page.h" diff --git a/code/studio/src/plugins/core/settings_dialog.cpp b/code/studio/src/plugins/core/settings_dialog.cpp index 0b38e4e80..74e81e3c8 100644 --- a/code/studio/src/plugins/core/settings_dialog.cpp +++ b/code/studio/src/plugins/core/settings_dialog.cpp @@ -21,8 +21,8 @@ #include "ioptions_page.h" // Qt includes -#include -#include +#include +#include struct PageData { diff --git a/code/studio/src/plugins/core/settings_dialog.h b/code/studio/src/plugins/core/settings_dialog.h index a90f88b18..d0059c4b3 100644 --- a/code/studio/src/plugins/core/settings_dialog.h +++ b/code/studio/src/plugins/core/settings_dialog.h @@ -22,7 +22,7 @@ #include "../core/ui_settings_dialog.h" // Qt includes -#include +#include // Project includes #include "../../extension_system/iplugin_manager.h"