From 6ec8ebab4b1ea64842305594ffe5d48b32f02c58 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Sun, 6 Mar 2011 14:43:42 +0200 Subject: [PATCH] Changed: #1193 Update PCH. Example plugins correct works under Linux. --- code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt | 4 ---- .../src/plugins/disp_sheet_id/sheet_id_view.cpp | 4 +--- .../src/plugins/example/CMakeLists.txt | 2 +- .../src/plugins/example/qnel_widget.cpp | 5 ++++- .../src/plugins/example/qnel_widget.h | 11 ++++++++++- .../src/plugins/object_viewer/CMakeLists.txt | 5 +++++ 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt index c1095c544..344417e3f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt @@ -41,10 +41,6 @@ ADD_DEFINITIONS(-DQT_NO_KEYWORDS ${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) NL_DEFAULT_PROPS(object_viewer_qt "NeL, Tools, 3D: Object Viewer Qt") NL_ADD_RUNTIME_FLAGS(object_viewer_qt) -IF(WITH_PCH) - ADD_NATIVE_PRECOMPILED_HEADER(object_viewer_qt ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) -ENDIF(WITH_PCH) - ADD_SUBDIRECTORY(plugins) INSTALL(TARGETS object_viewer_qt RUNTIME DESTINATION bin COMPONENT runtime BUNDLE DESTINATION /Applications) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.cpp index bdd93ad41..64fb05701 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.cpp @@ -15,7 +15,6 @@ // along with this program. If not, see . #include "sheet_id_view.h" -#include "ui_dialog.h" #include "nel/misc/path.h" @@ -58,7 +57,7 @@ void SheetIdView::pushToTable() NLMISC::CSheetId::init(false); NLMISC::CSheetId::buildIdVector(m_sheetList); CPred Pred; - sort(m_sheetList.begin(), m_sheetList.end(), Pred); + std::sort(m_sheetList.begin(), m_sheetList.end(), Pred); // Fill table m_ui.table->clear(); @@ -66,7 +65,6 @@ void SheetIdView::pushToTable() m_ui.table->setColumnCount(2); for (size_t i = 0; i < m_sheetList.size(); i++) { - QApplication::processEvents(); QTableWidgetItem* item1 = new QTableWidgetItem(QString(m_sheetList[i].toString().c_str())); QTableWidgetItem* item2 = new QTableWidgetItem(QString("%1").arg(m_sheetList[i].asInt())); m_ui.table->setItem(i,1,item1); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt index ee46fcd3d..41d22804c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt @@ -30,7 +30,7 @@ SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) ADD_LIBRARY(ovqt_plugin_example MODULE ${SRC} ${OVQT_PLUG_EXAMPLE_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_EXAMPLE_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_example ovqt_plugin_core nelmisc nel3d ${QT_LIBRARIES}) +TARGET_LINK_LIBRARIES(ovqt_plugin_example ovqt_plugin_core nelmisc nel3d ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) NL_DEFAULT_PROPS(ovqt_plugin_example "NeL, Tools, 3D: Object Viewer Qt Plugin: Example") NL_ADD_RUNTIME_FLAGS(ovqt_plugin_example) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp index 88d42c7b6..03afb29a7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp @@ -33,7 +33,7 @@ namespace NLQT { QNLWidget::QNLWidget(QWidget *parent) - : QWidget(parent), + : QNeLWidget(parent), m_driver(NULL), m_initialized(false), m_interval(25) @@ -42,6 +42,9 @@ QNLWidget::QNLWidget(QWidget *parent) setFocusPolicy(Qt::StrongFocus); init(); +#ifdef Q_OS_LINUX + makeCurrent(); +#endif m_mainTimer = new QTimer(this); connect(m_mainTimer, SIGNAL(timeout()), this, SLOT(updateRender())); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h index 25f8fa651..c85f742f1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h @@ -29,6 +29,15 @@ class QAction; +/* TODO every platform should use QWidget */ +#if defined(NL_OS_WINDOWS) +typedef QWidget QNeLWidget; +#elif defined(NL_OS_MAC) +typedef QWidget QNeLWidget; +#elif defined(NL_OS_UNIX) +typedef QGLWidget QNeLWidget; +#endif // NL_OS_UNIX + namespace NL3D { class UDriver; @@ -44,7 +53,7 @@ namespace NLQT @details Automatically begins to update the render if the widget is visible or suspends the updating of render if the widget is hidden. */ -class QNLWidget : public QWidget +class QNLWidget : public QNeLWidget { Q_OBJECT diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt index 841a0ff95..b4bd4e0ad 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt @@ -146,6 +146,11 @@ TARGET_LINK_LIBRARIES(ovqt_plugin_object_viewer ${QT_QTOPENGL_LIBRARY}) NL_DEFAULT_PROPS(ovqt_plugin_object_viewer "NeL, Tools, 3D: Object Viewer Qt Plugin: Object Viewer") + +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(ovqt_plugin_object_viewer ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + NL_ADD_RUNTIME_FLAGS(ovqt_plugin_object_viewer) NL_ADD_LIB_SUFFIX(ovqt_plugin_object_viewer)