mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-26 17:16:20 +00:00
Renamed NelGUIWidget to NelGUICtrl, and changed it's base class from QWidget to QObject.
--HG-- branch : gsoc2014-dfighter
This commit is contained in:
parent
1457469dfe
commit
676587559b
4 changed files with 33 additions and 38 deletions
|
@ -65,8 +65,8 @@ namespace GUIEditor
|
|||
projectWindow = new ProjectWindow;
|
||||
addWidgetWidget = new AddWidgetWidget;
|
||||
connect( projectWindow, SIGNAL( projectFilesChanged() ), this, SLOT( onProjectFilesChanged() ) );
|
||||
viewPort = new NelGUIWidget;
|
||||
setCentralWidget( viewPort->getViewPort() );
|
||||
GUICtrl = new NelGUICtrl();
|
||||
setCentralWidget( GUICtrl->getViewPort() );
|
||||
|
||||
widgetInfoTree = new CWidgetInfoTree;
|
||||
|
||||
|
@ -97,9 +97,9 @@ namespace GUIEditor
|
|||
dock->setWidget( propBrowser );
|
||||
addDockWidget( Qt::RightDockWidgetArea, dock );
|
||||
|
||||
viewPort->init();
|
||||
GUICtrl->init();
|
||||
|
||||
connect( viewPort, SIGNAL( guiLoadComplete() ), this, SLOT( onGUILoaded() ) );
|
||||
connect( GUICtrl, SIGNAL( guiLoadComplete() ), this, SLOT( onGUILoaded() ) );
|
||||
connect( widgetProps, SIGNAL( treeChanged() ), this, SLOT( onTreeChanged() ) );
|
||||
connect(
|
||||
addWidgetWidget,
|
||||
|
@ -130,8 +130,8 @@ namespace GUIEditor
|
|||
delete projectWindow;
|
||||
projectWindow = NULL;
|
||||
|
||||
delete viewPort;
|
||||
viewPort = NULL;
|
||||
delete GUICtrl;
|
||||
GUICtrl = NULL;
|
||||
|
||||
delete addWidgetWidget;
|
||||
addWidgetWidget = NULL;
|
||||
|
@ -181,7 +181,7 @@ namespace GUIEditor
|
|||
currentProject = projectFiles.projectName.c_str();
|
||||
currentProjectFile = fileName;
|
||||
projectWindow->setupFiles( projectFiles );
|
||||
if( viewPort->parse( projectFiles ) )
|
||||
if( GUICtrl->parse( projectFiles ) )
|
||||
{
|
||||
hierarchyView->buildHierarchy( projectFiles.masterGroup );
|
||||
}
|
||||
|
@ -282,14 +282,14 @@ namespace GUIEditor
|
|||
return false;
|
||||
|
||||
|
||||
CEditorSelectionWatcher *w = viewPort->getWatcher();
|
||||
CEditorSelectionWatcher *w = GUICtrl->getWatcher();
|
||||
disconnect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), hierarchyView, SLOT( onSelectionChanged( std::string& ) ) );
|
||||
disconnect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), &browserCtrl, SLOT( onSelectionChanged( std::string& ) ) );
|
||||
|
||||
projectFiles.clearAll();
|
||||
projectWindow->clear();
|
||||
hierarchyView->clearHierarchy();
|
||||
viewPort->reset();
|
||||
GUICtrl->reset();
|
||||
browserCtrl.clear();
|
||||
linkList->clear();
|
||||
procList->clear();
|
||||
|
@ -305,7 +305,7 @@ namespace GUIEditor
|
|||
setCursor( Qt::WaitCursor );
|
||||
|
||||
projectWindow->updateFiles( projectFiles );
|
||||
if( !viewPort->parse( projectFiles ) )
|
||||
if( !GUICtrl->parse( projectFiles ) )
|
||||
{
|
||||
QMessageBox::critical( this,
|
||||
tr( "Error parsing GUI XML files" ),
|
||||
|
@ -321,7 +321,7 @@ namespace GUIEditor
|
|||
procList->onGUILoaded();
|
||||
linkList->onGUILoaded();
|
||||
|
||||
CEditorSelectionWatcher *w = viewPort->getWatcher();
|
||||
CEditorSelectionWatcher *w = GUICtrl->getWatcher();
|
||||
connect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), hierarchyView, SLOT( onSelectionChanged( std::string& ) ) );
|
||||
connect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), &browserCtrl, SLOT( onSelectionChanged( std::string& ) ) );
|
||||
}
|
||||
|
@ -345,13 +345,13 @@ namespace GUIEditor
|
|||
void GUIEditorWindow::hideEvent( QHideEvent *evnt )
|
||||
{
|
||||
QWidget::hideEvent( evnt );
|
||||
viewPort->hide();
|
||||
GUICtrl->hide();
|
||||
}
|
||||
|
||||
void GUIEditorWindow::showEvent( QShowEvent *evnt )
|
||||
{
|
||||
QWidget::showEvent( evnt );
|
||||
viewPort->show();
|
||||
GUICtrl->show();
|
||||
}
|
||||
|
||||
void GUIEditorWindow::createMenus()
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace GUIEditor
|
|||
class LinkList;
|
||||
class ProcList;
|
||||
class ProjectWindow;
|
||||
class NelGUIWidget;
|
||||
class NelGUICtrl;
|
||||
class CWidgetInfoTree;
|
||||
class CEditorMessageProcessor;
|
||||
class AddWidgetWidget;
|
||||
|
@ -87,7 +87,7 @@ private:
|
|||
LinkList *linkList;
|
||||
ProcList *procList;
|
||||
ProjectWindow *projectWindow;
|
||||
NelGUIWidget *viewPort;
|
||||
NelGUICtrl *GUICtrl;
|
||||
CWidgetInfoTree *widgetInfoTree;
|
||||
CEditorMessageProcessor *messageProcessor;
|
||||
AddWidgetWidget *addWidgetWidget;
|
||||
|
|
|
@ -35,8 +35,8 @@ namespace GUIEditor
|
|||
{
|
||||
std::set< std::string > hwCursors;
|
||||
|
||||
NelGUIWidget::NelGUIWidget( QWidget *parent ) :
|
||||
QWidget( parent )
|
||||
NelGUICtrl::NelGUICtrl( QObject *parent ) :
|
||||
QObject( parent )
|
||||
{
|
||||
timerID = 0;
|
||||
guiLoaded = false;
|
||||
|
@ -44,7 +44,7 @@ namespace GUIEditor
|
|||
w = new Nel3DWidget();
|
||||
}
|
||||
|
||||
NelGUIWidget::~NelGUIWidget()
|
||||
NelGUICtrl::~NelGUICtrl()
|
||||
{
|
||||
guiLoaded = false;
|
||||
if( timerID != 0 )
|
||||
|
@ -57,7 +57,7 @@ namespace GUIEditor
|
|||
w = NULL;
|
||||
}
|
||||
|
||||
void NelGUIWidget::init()
|
||||
void NelGUICtrl::init()
|
||||
{
|
||||
NLMISC::CI18N::setNoResolution( true );
|
||||
NLMISC::CPath::remapExtension( "dds", "tga", true );
|
||||
|
@ -81,7 +81,7 @@ namespace GUIEditor
|
|||
watcher = new CEditorSelectionWatcher();
|
||||
}
|
||||
|
||||
bool NelGUIWidget::parse( SProjectFiles &files )
|
||||
bool NelGUICtrl::parse( SProjectFiles &files )
|
||||
{
|
||||
reset();
|
||||
IParser *parser = CWidgetManager::getInstance()->getParser();
|
||||
|
@ -120,7 +120,7 @@ namespace GUIEditor
|
|||
return true;
|
||||
}
|
||||
|
||||
void NelGUIWidget::reset()
|
||||
void NelGUICtrl::reset()
|
||||
{
|
||||
guiLoaded = false;
|
||||
if( timerID != 0 )
|
||||
|
@ -133,7 +133,7 @@ namespace GUIEditor
|
|||
w->clear();
|
||||
}
|
||||
|
||||
void NelGUIWidget::draw()
|
||||
void NelGUICtrl::draw()
|
||||
{
|
||||
w->getDriver()->clearBuffers( NLMISC::CRGBA::Black );
|
||||
CWidgetManager::getInstance()->checkCoords();
|
||||
|
@ -141,13 +141,7 @@ namespace GUIEditor
|
|||
w->getDriver()->swapBuffers();
|
||||
}
|
||||
|
||||
void NelGUIWidget::paintEvent( QPaintEvent *evnt )
|
||||
{
|
||||
if( !guiLoaded )
|
||||
w->clear();
|
||||
}
|
||||
|
||||
void NelGUIWidget::timerEvent( QTimerEvent *evnt )
|
||||
void NelGUICtrl::timerEvent( QTimerEvent *evnt )
|
||||
{
|
||||
if( evnt->timerId() == timerID )
|
||||
{
|
||||
|
@ -159,13 +153,13 @@ namespace GUIEditor
|
|||
}
|
||||
}
|
||||
|
||||
void NelGUIWidget::show()
|
||||
void NelGUICtrl::show()
|
||||
{
|
||||
if( timerID == 0 )
|
||||
timerID = startTimer( 200 );
|
||||
}
|
||||
|
||||
void NelGUIWidget::hide()
|
||||
void NelGUICtrl::hide()
|
||||
{
|
||||
if( timerID != 0 )
|
||||
{
|
||||
|
@ -174,7 +168,7 @@ namespace GUIEditor
|
|||
}
|
||||
}
|
||||
|
||||
QWidget* NelGUIWidget::getViewPort()
|
||||
QWidget* NelGUICtrl::getViewPort()
|
||||
{
|
||||
return w;
|
||||
}
|
||||
|
|
|
@ -18,21 +18,23 @@
|
|||
#ifndef NELGUI_WIDGET_H
|
||||
#define NELGUI_WIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QObject>
|
||||
#include "project_files.h"
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace GUIEditor
|
||||
{
|
||||
class CEditorSelectionWatcher;
|
||||
class Nel3DWidget;
|
||||
|
||||
/// Qt viewport for the Nel GUI library
|
||||
class NelGUIWidget : public QWidget
|
||||
/// Qt viewport controller for the Nel GUI library
|
||||
class NelGUICtrl : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NelGUIWidget( QWidget *parent = NULL );
|
||||
~NelGUIWidget();
|
||||
NelGUICtrl( QObject *parent = NULL );
|
||||
~NelGUICtrl();
|
||||
|
||||
void init();
|
||||
bool parse( SProjectFiles &files );
|
||||
|
@ -49,7 +51,6 @@ Q_SIGNALS:
|
|||
void guiLoadComplete();
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent *evnt );
|
||||
void timerEvent( QTimerEvent *evnt );
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue