From 86fe3045cf2cd92b7bee337cbb6445507772743e Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 14 Jun 2014 18:31:50 +0200 Subject: [PATCH] GUI Editor main window will now send the show/hide events to NelGUIWidget. --- .../src/plugins/gui_editor/gui_editor_window.cpp | 14 ++++++++++++++ .../src/plugins/gui_editor/gui_editor_window.h | 4 ++++ .../src/plugins/gui_editor/nelgui_widget.cpp | 4 ++-- code/studio/src/plugins/gui_editor/nelgui_widget.h | 6 +++--- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/code/studio/src/plugins/gui_editor/gui_editor_window.cpp b/code/studio/src/plugins/gui_editor/gui_editor_window.cpp index 923db1016..1d4050412 100644 --- a/code/studio/src/plugins/gui_editor/gui_editor_window.cpp +++ b/code/studio/src/plugins/gui_editor/gui_editor_window.cpp @@ -340,6 +340,20 @@ namespace GUIEditor addWidgetWidget->setupWidgetInfo( widgetInfoTree ); } + + + void GUIEditorWindow::hideEvent( QHideEvent *evnt ) + { + QWidget::hideEvent( evnt ); + viewPort->hide(); + } + + void GUIEditorWindow::showEvent( QShowEvent *evnt ) + { + QWidget::showEvent( evnt ); + viewPort->show(); + } + void GUIEditorWindow::createMenus() { Core::MenuManager *mm = Core::ICore::instance()->menuManager(); diff --git a/code/studio/src/plugins/gui_editor/gui_editor_window.h b/code/studio/src/plugins/gui_editor/gui_editor_window.h index 1362e4671..6434b07d6 100644 --- a/code/studio/src/plugins/gui_editor/gui_editor_window.h +++ b/code/studio/src/plugins/gui_editor/gui_editor_window.h @@ -66,6 +66,10 @@ private Q_SLOTS: void onAddWidgetClicked(); void onTreeChanged(); +protected: + void hideEvent( QHideEvent *evnt ); + void showEvent( QShowEvent *evnt ); + private: void createMenus(); void removeMenus(); diff --git a/code/studio/src/plugins/gui_editor/nelgui_widget.cpp b/code/studio/src/plugins/gui_editor/nelgui_widget.cpp index f8e34da3b..e6a056390 100644 --- a/code/studio/src/plugins/gui_editor/nelgui_widget.cpp +++ b/code/studio/src/plugins/gui_editor/nelgui_widget.cpp @@ -159,13 +159,13 @@ namespace GUIEditor } } - void NelGUIWidget::showEvent( QShowEvent *evnt ) + void NelGUIWidget::show() { if( timerID == 0 ) timerID = startTimer( 200 ); } - void NelGUIWidget::hideEvent( QHideEvent *evnt ) + void NelGUIWidget::hide() { if( timerID != 0 ) killTimer( timerID ); diff --git a/code/studio/src/plugins/gui_editor/nelgui_widget.h b/code/studio/src/plugins/gui_editor/nelgui_widget.h index a1412257c..dacee1668 100644 --- a/code/studio/src/plugins/gui_editor/nelgui_widget.h +++ b/code/studio/src/plugins/gui_editor/nelgui_widget.h @@ -42,15 +42,15 @@ namespace GUIEditor QWidget* getViewPort(); + void show(); + void hide(); + Q_SIGNALS: void guiLoadComplete(); protected: void paintEvent( QPaintEvent *evnt ); void timerEvent( QTimerEvent *evnt ); - void showEvent( QShowEvent *evnt ); - void hideEvent( QHideEvent *evnt ); - private: int timerID;