From 7a441a458480146e45f989e9e44cb3ce5ce134c7 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Sun, 16 Jan 2011 14:28:22 +0200 Subject: [PATCH] Changed: #1206 Correct works new settings dialog. --- .../3d/object_viewer_qt/src/plugins/core/CMakeLists.txt | 2 +- .../3d/object_viewer_qt/src/plugins/core/ioptions_page.h | 7 +++---- .../src/plugins/core/search_paths_settings_page.cpp | 2 +- .../src/plugins/core/search_paths_settings_page.h | 3 ++- .../object_viewer_qt/src/plugins/core/settings_dialog.cpp | 3 ++- .../src/plugins/example/example_settings_page.cpp | 2 +- .../src/plugins/example/example_settings_page.h | 3 ++- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt index 36a5e3d30..98c5a1a4f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt @@ -8,7 +8,7 @@ SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin. ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) -SET(OVQT_CORE_PLUGIN_HDR +SET(OVQT_CORE_PLUGIN_HDR ioptions_page.h core_plugin.h core_constants.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h index b5bf4ef24..b0ec43ea2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h @@ -31,12 +31,9 @@ namespace Core @details You need to subclass this interface and put an instance of your subclass into the plugin manager object pool. */ -class IOptionsPage : public QObject +class IOptionsPage { - Q_OBJECT public: - IOptionsPage(QObject *parent = 0) : QObject(parent) {} - virtual ~IOptionsPage() {} /// id() is a unique identifier for referencing this page virtual QString id() const = 0; @@ -63,4 +60,6 @@ public: } // namespace Core +Q_DECLARE_INTERFACE(Core::IOptionsPage, "dev.ryzom.com.IOptionsPage/1.0") + #endif // IOPTIONSPAGE_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp index 21a9aa12c..81719ee59 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp @@ -28,7 +28,7 @@ namespace Core { CSearchPathsSettingsPage::CSearchPathsSettingsPage(QObject *parent) - : IOptionsPage(parent), + : QObject(parent), _currentPage(NULL) { } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h index b2f2398a0..07e3c4f6e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h @@ -32,9 +32,10 @@ namespace Core /** @class CSearchPathsSettingsPage */ -class CSearchPathsSettingsPage : public IOptionsPage +class CSearchPathsSettingsPage : public QObject, public IOptionsPage { Q_OBJECT + Q_INTERFACES(IOptionsPage) public: CSearchPathsSettingsPage(QObject *parent = 0); virtual ~CSearchPathsSettingsPage() {} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp index 558b492c6..41ac34988 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp @@ -18,6 +18,7 @@ #include "settings_dialog.h" +#include "nel/misc/debug.h" // Qt includes #include #include @@ -64,7 +65,7 @@ CSettingsDialog::CSettingsDialog(ExtensionSystem::IPluginManager *pluginManager, QList all = _plugMan->allObjects(); Q_FOREACH(QObject *obj, all) { - IOptionsPage *page = dynamic_cast(obj); + IOptionsPage *page = qobject_cast(obj); if (page) pages.append(page); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp index 0cb885163..40576ab60 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp @@ -28,7 +28,7 @@ namespace Plugin { CExampleSettingsPage::CExampleSettingsPage(QObject *parent) - : IOptionsPage(parent), + : QObject(parent), _currentPage(NULL) { } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h index 64dd940f8..e6baa85df 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h @@ -32,9 +32,10 @@ namespace Plugin /** @class CExampleSettingsPage */ -class CExampleSettingsPage : public Core::IOptionsPage +class CExampleSettingsPage : public QObject, public Core::IOptionsPage { Q_OBJECT + Q_INTERFACES(Core::IOptionsPage) public: CExampleSettingsPage(QObject *parent = 0); virtual ~CExampleSettingsPage() {}