From 2650b86ca81f60ea7942af0b47aecdb5cf256379 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Mon, 15 Aug 2011 17:04:09 +0300 Subject: [PATCH] Changed: #1302 Added empty property dialog. --- .../src/plugins/world_editor/CMakeLists.txt | 16 ++++- .../world_editor/property_editor_widget.cpp | 60 ++++++++++++++++++ .../world_editor/property_editor_widget.h | 63 +++++++++++++++++++ .../world_editor/property_editor_widget.ui | 40 ++++++++++++ 4 files changed, 177 insertions(+), 2 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt index 7b9387c44..694467f42 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt @@ -1,7 +1,9 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LIBXML2_INCLUDE_DIR} - ${QT_INCLUDES}) + ${QT_INCLUDES} + ${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/qtpropertybrowser + ) FILE(GLOB SRC *.cpp *.h) @@ -16,11 +18,13 @@ SET(OVQT_PLUGIN_WORLD_EDITOR_HDR world_editor_plugin.h primitives_model.h primitives_view.h project_settings_dialog.h + property_editor_widget.h world_editor_settings_page.h ) SET(OVQT_PLUGIN_WORLD_EDITOR_UIS world_editor_window.ui project_settings_dialog.ui + property_editor_widget.ui world_editor_settings_page.ui ) @@ -45,7 +49,15 @@ ADD_LIBRARY(ovqt_plugin_world_editor MODULE ${SRC} ${OVQT_PLUGIN_WORLD_EDITOR_UI_HDRS} ${OVQT_PLUGIN_WORLD_EDITOR_RC_SRCS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_world_editor ovqt_plugin_core ovqt_plugin_landscape_editor nelmisc nel3d ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) +TARGET_LINK_LIBRARIES( ovqt_plugin_world_editor + ovqt_plugin_core + ovqt_plugin_landscape_editor + nelmisc + nel3d + qt_property_browser + ${QT_LIBRARIES} + ${QT_QTOPENGL_LIBRARY} +) NL_DEFAULT_PROPS(ovqt_plugin_world_editor "NeL, Tools, 3D: Object Viewer Qt Plugin: World Editor") NL_ADD_RUNTIME_FLAGS(ovqt_plugin_world_editor) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.cpp new file mode 100644 index 000000000..7df0b6d1d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.cpp @@ -0,0 +1,60 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "property_editor_widget.h" + +// NeL includes +#include + +// STL includes +#include +#include + +// Qt includes +#include + +namespace WorldEditor +{ + +PropertyEditorWidget::PropertyEditorWidget(QWidget *parent) + : QWidget(parent) +{ + m_ui.setupUi(this); + + m_variantManager = new QtVariantPropertyManager(this); + + connect(m_variantManager, SIGNAL(valueChanged(QtProperty *, const QVariant &)), + this, SLOT(valueChanged(QtProperty *, const QVariant &))); + + QtVariantEditorFactory *variantFactory = new QtVariantEditorFactory(this); + m_ui.treePropertyBrowser->setFactoryForManager(m_variantManager, variantFactory); +} + +PropertyEditorWidget::~PropertyEditorWidget() +{ +} + +void PropertyEditorWidget::clearProperties() +{ +} + +void PropertyEditorWidget::setCurrentPrimitive(PrimitiveNode *node) +{ +} + +} /* namespace WorldEditor */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.h new file mode 100644 index 000000000..18f72fadc --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.h @@ -0,0 +1,63 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef PROPERTY_EDITOR_WIDGET_H +#define PROPERTY_EDITOR_WIDGET_H + +// Project includes +#include "ui_property_editor_widget.h" +#include "primitives_model.h" +#include "primitive_item.h" + + +// 3rdparty +#include "qtvariantproperty.h" +#include "qtpropertymanager.h" +#include "qteditorfactory.h" + +// NeL includes + +// Qt includes + +namespace WorldEditor +{ +/** +@class PropertyEditorWidget +@brief PropertyEditorWidget +@details +*/ +class PropertyEditorWidget: public QWidget +{ + Q_OBJECT + +public: + PropertyEditorWidget(QWidget *parent = 0); + ~PropertyEditorWidget(); + +public Q_SLOTS: + void clearProperties(); + void setCurrentPrimitive(PrimitiveNode *node); + +private: + + QtVariantPropertyManager *m_variantManager; + Ui::PropertyEditorWidget m_ui; +}; /* PropertyEditorWidget */ + +} /* namespace WorldEditor */ + +#endif // PROPERTY_EDITOR_WIDGET_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.ui new file mode 100644 index 000000000..a703c7aac --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.ui @@ -0,0 +1,40 @@ + + + PropertyEditorWidget + + + + 0 + 0 + 183 + 128 + + + + Form + + + + 3 + + + 3 + + + + + + + + + QtTreePropertyBrowser + QWidget +
qttreepropertybrowser.h
+ 1 +
+
+ + + + +