ADDED: #1471 Qt property browser, for browsing and editing the selected widget's properties ( this is an empty shell as well for now )
--HG-- branch : gsoc2012-gui-editorhg/feature/sse2
parent
2d4e1467c2
commit
9415df9a9b
@ -0,0 +1,65 @@
|
|||||||
|
// Object Viewer Qt GUI Editor plugin <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2010 Winch Gate Property Limited
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
#include "property_browser_ctrl.h"
|
||||||
|
#include "../../3rdparty/qtpropertybrowser/QtVariantPropertyManager"
|
||||||
|
#include "../../3rdparty/qtpropertybrowser/QtTreePropertyBrowser"
|
||||||
|
|
||||||
|
namespace GUIEditor
|
||||||
|
{
|
||||||
|
CPropBrowserCtrl::CPropBrowserCtrl()
|
||||||
|
{
|
||||||
|
browser = NULL;
|
||||||
|
propertyMgr = new QtVariantPropertyManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
CPropBrowserCtrl::~CPropBrowserCtrl()
|
||||||
|
{
|
||||||
|
delete propertyMgr;
|
||||||
|
propertyMgr = NULL;
|
||||||
|
browser = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPropBrowserCtrl::setBrowser( QtTreePropertyBrowser *b )
|
||||||
|
{
|
||||||
|
browser = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPropBrowserCtrl::setup()
|
||||||
|
{
|
||||||
|
if( browser == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
QtVariantProperty *p;
|
||||||
|
|
||||||
|
p = propertyMgr->addProperty( QVariant::String, "Id" );
|
||||||
|
p->setValue( "ExampleId" );
|
||||||
|
browser->addProperty( p );
|
||||||
|
|
||||||
|
p = propertyMgr->addProperty( QVariant::Bool, "Active" );
|
||||||
|
p->setValue( true );
|
||||||
|
browser->addProperty( p );
|
||||||
|
|
||||||
|
p = propertyMgr->addProperty( QVariant::String, "on_enter" );
|
||||||
|
p->setValue( "on_enter_handler" );
|
||||||
|
browser->addProperty( p );
|
||||||
|
|
||||||
|
p = propertyMgr->addProperty( QVariant::String, "on_enter_params" );
|
||||||
|
p->setValue( "someparams" );
|
||||||
|
browser->addProperty( p );
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
// Object Viewer Qt GUI Editor plugin <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2010 Winch Gate Property Limited
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef PROP_BROWSER_CTRL
|
||||||
|
#define PROP_BROWSER_CTRL
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class QtTreePropertyBrowser;
|
||||||
|
class QtVariantPropertyManager;
|
||||||
|
|
||||||
|
namespace GUIEditor
|
||||||
|
{
|
||||||
|
|
||||||
|
/// This class controls the Widget property browser widget.
|
||||||
|
/// It receives signals from the widget that draws/manages the Nel GUI widgets, and handles them.
|
||||||
|
class CPropBrowserCtrl : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
CPropBrowserCtrl();
|
||||||
|
~CPropBrowserCtrl();
|
||||||
|
void setBrowser( QtTreePropertyBrowser *b );
|
||||||
|
void setup();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QtTreePropertyBrowser *browser;
|
||||||
|
QtVariantPropertyManager *propertyMgr;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue