From 5b7bc8cc549b6996a5893a24316e52fe5229607f Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 20 Sep 2014 20:51:08 +0200 Subject: [PATCH] GUI Editor should no longer crash on Linux --HG-- branch : dfighter-tools --- .../plugins/core/Nel3DWidget/nel3d_widget.cpp | 3 +-- .../src/plugins/core/Nel3DWidget/nel3d_widget.h | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp b/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp index dc0bb858b..bc83b5d78 100644 --- a/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp +++ b/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp @@ -14,7 +14,6 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - #include "nel3d_widget.h" #include "nel/3d/u_driver.h" #include "nel/3d/text_context.h" @@ -29,7 +28,7 @@ #include Nel3DWidget::Nel3DWidget( QWidget *parent ) : -QWidget( parent ) +NEL3DWIDGET( parent ) { driver = NULL; textContext = NULL; diff --git a/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.h b/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.h index 059e1b738..afed4cf65 100644 --- a/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.h +++ b/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.h @@ -18,10 +18,22 @@ #ifndef NEL3D_WIDGET_H #define NEL3D_WIDGET_H -#include #include "nel/misc/types_nl.h" #include +#ifdef NEL3DWIDGET +#undef NEL3DWIDGET +#endif + +#ifdef NL_OS_WINDOWS +#include +#define NEL3DWIDGET QWidget +#else +#include +#define NEL3DWIDGET QGLWidget +#endif + + #include "../core_global.h" namespace NL3D @@ -31,7 +43,7 @@ namespace NL3D } /// Nel 3D interface to Qt -class CORE_EXPORT Nel3DWidget : public QWidget +class CORE_EXPORT Nel3DWidget : public QGLWidget { Q_OBJECT public: