summaryrefslogtreecommitdiff
path: root/src/GudhUI
diff options
context:
space:
mode:
authorglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-10-16 20:31:18 +0000
committerglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-10-16 20:31:18 +0000
commitbb3b9da181c3fc4f6de53c6503ab92d732b6190e (patch)
treecee1eb7b0047b3046ce1257ab398e53f4064cef0 /src/GudhUI
parent13762827c4f0a2f3a968e6c208d801eea6c556b8 (diff)
Initial Qt5 support.
- Clicking OK in dialog windows does not close them, only cancel does, was that already the case with Qt4? - It does not complain that I have a version of CGAL that does not have a Qt5 component, so the tests are probably not sufficient. However, it still compiles, links and runs. What is the CGAL Qt component used for? git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/qt5@861 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 1affa98623366ac6b74f08e115b33f3f1094e94b
Diffstat (limited to 'src/GudhUI')
-rw-r--r--src/GudhUI/CMakeLists.txt49
-rw-r--r--src/GudhUI/gui/MainWindow.h3
-rw-r--r--src/GudhUI/gui/Menu_edge_contraction.h5
-rw-r--r--src/GudhUI/gui/Menu_k_nearest_neighbors.h2
-rw-r--r--src/GudhUI/gui/Menu_persistence.h2
-rw-r--r--src/GudhUI/gui/Menu_uniform_neighbors.h2
-rw-r--r--src/GudhUI/view/Viewer.h3
-rw-r--r--src/GudhUI/view/Viewer_instructor.h3
8 files changed, 15 insertions, 54 deletions
diff --git a/src/GudhUI/CMakeLists.txt b/src/GudhUI/CMakeLists.txt
index 71f4fd1a..a398d74c 100644
--- a/src/GudhUI/CMakeLists.txt
+++ b/src/GudhUI/CMakeLists.txt
@@ -1,24 +1,22 @@
cmake_minimum_required(VERSION 2.8)
project(GudhUI)
-find_package(CGAL COMPONENTS Qt4)
-find_package(Qt4)
+find_package(CGAL COMPONENTS Qt5)
+find_package(Qt5 COMPONENTS Widgets Xml OpenGL)
find_package(QGLViewer)
find_package(OpenGL)
-if ( CGAL_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND )
- set( QT_USE_QTXML TRUE )
- set( QT_USE_QTMAIN TRUE )
- set( QT_USE_QTSCRIPT TRUE )
- set( QT_USE_QTOPENGL TRUE )
+if ( CGAL_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND )
+
+ set(CMAKE_AUTOMOC ON)
+ set(CMAKE_AUTOUIC ON)
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
SET(Boost_USE_STATIC_LIBS ON)
SET(Boost_USE_MULTITHREAD OFF)
-
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
- include(${QT_USE_FILE})
-
include(${CGAL_USE_FILE})
# In CMakeLists.txt, when include(${CGAL_USE_FILE}), CXX_FLAGS are overwritten.
# cf. http://doc.cgal.org/latest/Manual/installation.html#title40
@@ -36,31 +34,7 @@ if ( CGAL_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND )
# - End of workaround
include_directories (${QGLVIEWER_INCLUDE_DIR})
- include_directories(.)
- # qt : ui file, created wih Qt Designer ###############
- set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gui")
- qt4_wrap_ui( uis
- gui/main_window.ui
- gui/MenuEdgeContraction.ui
- gui/KNearestNeighborsMenu.ui
- gui/UniformNeighborsMenu.ui
- gui/PersistenceMenu.ui
- )
-
- set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gui")
- qt4_automoc(
- gui/MainWindow.cpp
- gui/Menu_k_nearest_neighbors.cpp
- gui/Menu_uniform_neighbors.cpp
- gui/Menu_edge_contraction.cpp
- gui/Menu_persistence.cpp
- )
-
- set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/view")
- qt4_automoc(view/Viewer_instructor.cpp
- view/Viewer.cpp
- )
#####################################################################
add_executable ( GudhUI
@@ -72,12 +46,11 @@ if ( CGAL_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND )
gui/Menu_persistence.cpp
view/Viewer_instructor.cpp
view/Viewer.cpp
- ${uis}
)
-
- target_link_libraries( GudhUI ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} )
+ target_link_libraries( GudhUI Qt5::Widgets Qt5::Xml Qt5::OpenGL )
+ target_link_libraries( GudhUI ${QGLVIEWER_LIBRARIES} )
target_link_libraries( GudhUI ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} )
else()
- message(STATUS "NOTICE: GudhUI requires CGAL, the QGLViewer, OpenGL and Qt4, and will not be compiled.")
+ message(STATUS "NOTICE: GudhUI requires CGAL, the QGLViewer, OpenGL and Qt5, and will not be compiled.")
endif()
diff --git a/src/GudhUI/gui/MainWindow.h b/src/GudhUI/gui/MainWindow.h
index c8c3fcf6..7e11ddd6 100644
--- a/src/GudhUI/gui/MainWindow.h
+++ b/src/GudhUI/gui/MainWindow.h
@@ -23,9 +23,6 @@
#ifndef GUI_MAINWINDOW_H_
#define GUI_MAINWINDOW_H_
-// Workaround for moc-qt4 not parsing boost headers
-#include <CGAL/config.h>
-
#include <QMainWindow>
#include "ui_main_window.h"
#include "model/Model.h"
diff --git a/src/GudhUI/gui/Menu_edge_contraction.h b/src/GudhUI/gui/Menu_edge_contraction.h
index 08f0bf67..2d5640e8 100644
--- a/src/GudhUI/gui/Menu_edge_contraction.h
+++ b/src/GudhUI/gui/Menu_edge_contraction.h
@@ -23,11 +23,8 @@
#ifndef GUI_MENU_EDGE_CONTRACTION_H_
#define GUI_MENU_EDGE_CONTRACTION_H_
-// Workaround for moc-qt4 not parsing boost headers
-#include <CGAL/config.h>
-
#include "gui/MainWindow.h"
-#include "gui/ui_MenuEdgeContraction.h"
+#include "ui_MenuEdgeContraction.h"
#include "model/Model.h"
diff --git a/src/GudhUI/gui/Menu_k_nearest_neighbors.h b/src/GudhUI/gui/Menu_k_nearest_neighbors.h
index 8088b768..77303b67 100644
--- a/src/GudhUI/gui/Menu_k_nearest_neighbors.h
+++ b/src/GudhUI/gui/Menu_k_nearest_neighbors.h
@@ -24,7 +24,7 @@
#define GUI_MENU_K_NEAREST_NEIGHBORS_H_
#include <QMainWindow>
-#include "gui/ui_KNearestNeighborsMenu.h"
+#include "ui_KNearestNeighborsMenu.h"
class QWidget;
diff --git a/src/GudhUI/gui/Menu_persistence.h b/src/GudhUI/gui/Menu_persistence.h
index 8c4df158..1a2a2408 100644
--- a/src/GudhUI/gui/Menu_persistence.h
+++ b/src/GudhUI/gui/Menu_persistence.h
@@ -25,7 +25,7 @@
#define GUI_MENU_PERSISTENCE_H_
#include <QMainWindow>
-#include "gui/ui_PersistenceMenu.h"
+#include "ui_PersistenceMenu.h"
class QWidget;
diff --git a/src/GudhUI/gui/Menu_uniform_neighbors.h b/src/GudhUI/gui/Menu_uniform_neighbors.h
index 0b6f65fe..61316966 100644
--- a/src/GudhUI/gui/Menu_uniform_neighbors.h
+++ b/src/GudhUI/gui/Menu_uniform_neighbors.h
@@ -25,7 +25,7 @@
#define GUI_MENU_UNIFORM_NEIGHBORS_H_
#include <QMainWindow>
-#include "gui/ui_UniformNeighborsMenu.h"
+#include "ui_UniformNeighborsMenu.h"
class Menu_uniform_neighbors : public QDialog, public Ui::UniformMenu {
Q_OBJECT
diff --git a/src/GudhUI/view/Viewer.h b/src/GudhUI/view/Viewer.h
index 276ccd3c..48427099 100644
--- a/src/GudhUI/view/Viewer.h
+++ b/src/GudhUI/view/Viewer.h
@@ -24,9 +24,6 @@
#ifndef VIEW_VIEWER_H_
#define VIEW_VIEWER_H_
-// Workaround for moc-qt4 not parsing boost headers
-#include <CGAL/config.h>
-
#include <QGLViewer/qglviewer.h>
#include <vector>
diff --git a/src/GudhUI/view/Viewer_instructor.h b/src/GudhUI/view/Viewer_instructor.h
index 31a1d273..96b25c77 100644
--- a/src/GudhUI/view/Viewer_instructor.h
+++ b/src/GudhUI/view/Viewer_instructor.h
@@ -26,9 +26,6 @@
// todo do a viewer instructor that have directely a pointer to a QGLviewer and buffer ot not triangles
-// Workaround for moc-qt4 not parsing boost headers
-#include <CGAL/config.h>
-
#include <QFileDialog>
#include <QKeyEvent>
#include <QGLViewer/camera.h>