Commit 0243758e authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'remove-qt4'

0b27fbc2

 qt4: remove support
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !3592
parents 77ebbaa9 0b27fbc2
set(VTK_QT_VERSION "5" CACHE STRING "Expected Qt version")
set_property(CACHE VTK_QT_VERSION PROPERTY STRINGS 4 5)
set_property(CACHE VTK_QT_VERSION PROPERTY STRINGS 5)
if(NOT (VTK_QT_VERSION VERSION_EQUAL "4" OR VTK_QT_VERSION VERSION_EQUAL "5"))
message(FATAL_ERROR "Expected value for VTK_QT_VERSION is either '4' or '5'")
endif()
if(VTK_QT_VERSION VERSION_EQUAL "4" AND NOT VTK_LEGACY_SILENT)
message(WARNING "VTK_QT_VERSION is set to 4. "
"VTK use of Qt 4 is deprecated for version 8.1 and will not be be available "
"in future versions. Please switch to using Qt 5 instead.")
endif()
if(VTK_QT_VERSION VERSION_EQUAL "4" AND VTK_LEGACY_REMOVE)
message(FATAL_ERROR "We cannot have both VTK_QT_VERSION=4 (legacy feature) "
"and VTK_LEGACY_REMOVE. Either switch to Qt 5 or unset VTK_LEGACY_REMOVE")
if(NOT (VTK_QT_VERSION VERSION_EQUAL "5"))
message(FATAL_ERROR "Expected value for VTK_QT_VERSION is '5'")
endif()
......@@ -27,19 +27,17 @@ IF(vtkViewsContext2D_LOADED)
ENDIF()
IF(vtkGUISupportQt_LOADED)
if(VTK_QT_VERSION VERSION_GREATER "4")
ADD_EXECUTABLE(QChartTable QChartTable.cxx)
set_property(TARGET QChartTable APPEND
PROPERTY COMPILE_DEFINITIONS "${VTK_DEFINITIONS}")
set_property(TARGET QChartTable APPEND
PROPERTY INCLUDE_DIRECTORIES ${VTK_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(QChartTable ${VTK_LIBRARIES})
ADD_EXECUTABLE(QChartTable QChartTable.cxx)
set_property(TARGET QChartTable APPEND
PROPERTY COMPILE_DEFINITIONS "${VTK_DEFINITIONS}")
set_property(TARGET QChartTable APPEND
PROPERTY INCLUDE_DIRECTORIES ${VTK_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(QChartTable ${VTK_LIBRARIES})
ADD_EXECUTABLE(QScalarsToColors QScalarsToColors.cxx)
set_property(TARGET QScalarsToColors APPEND
PROPERTY COMPILE_DEFINITIONS "${VTK_DEFINITIONS}")
set_property(TARGET QScalarsToColors APPEND
PROPERTY INCLUDE_DIRECTORIES ${VTK_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(QScalarsToColors ${VTK_LIBRARIES})
endif()
ADD_EXECUTABLE(QScalarsToColors QScalarsToColors.cxx)
set_property(TARGET QScalarsToColors APPEND
PROPERTY COMPILE_DEFINITIONS "${VTK_DEFINITIONS}")
set_property(TARGET QScalarsToColors APPEND
PROPERTY INCLUDE_DIRECTORIES ${VTK_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(QScalarsToColors ${VTK_LIBRARIES})
ENDIF()
......@@ -3,19 +3,13 @@ if(NOT VTK_LEGACY_REMOVE)
add_subdirectory(Events)
endif()
if(VTK_QT_VERSION VERSION_GREATER "4")
add_subdirectory(FourPaneViewer)
add_subdirectory(ImageViewer)
add_subdirectory(SimpleView)
endif()
add_subdirectory(FourPaneViewer)
add_subdirectory(ImageViewer)
add_subdirectory(SimpleView)
if(TARGET vtkGUISupportQtOpenGL)
if(VTK_QT_VERSION VERSION_GREATER "4")
find_package(Qt5 COMPONENTS WebKitWidgets QUIET)
if(Qt5WebKitWidgets_FOUND)
add_subdirectory(GraphicsView)
endif()
else()
find_package(Qt5 COMPONENTS WebKitWidgets QUIET)
if(Qt5WebKitWidgets_FOUND)
add_subdirectory(GraphicsView)
endif()
endif()
......
......@@ -37,26 +37,10 @@ include_directories(
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
if(VTK_QT_VERSION VERSION_GREATER "4")
find_package(Qt5 COMPONENTS Widgets)
qt5_wrap_ui(UI_Srcs ${UIs})
add_executable(qtevents
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs})
qt5_use_modules(qtevents Core Gui Widgets)
target_link_libraries(qtevents ${VTK_LIBRARIES})
else()
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
# Use what VTK built with
set(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH "")
set(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH "")
set(QT_UIC_EXECUTABLE ${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH "")
qt4_wrap_ui(UI_Srcs ${UIs})
add_executable(qtevents MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs})
target_link_libraries(qtevents
${QT_LIBRARIES}
${VTK_LIBRARIES}
)
endif()
find_package(Qt5 COMPONENTS Widgets)
qt5_wrap_ui(UI_Srcs ${UIs})
add_executable(qtevents
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs})
qt5_use_modules(qtevents Core Gui Widgets)
target_link_libraries(qtevents ${VTK_LIBRARIES})
......@@ -40,23 +40,10 @@ include_directories(
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
if(VTK_QT_VERSION VERSION_GREATER "4")
find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
qt5_wrap_ui(UI_Srcs ${UIs})
# CMAKE_AUTOMOC in ON so the MocHdrs will be automatically wrapped.
add_executable(QtVTKRenderWindows ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs})
qt5_use_modules(QtVTKRenderWindows Core Gui Widgets)
target_link_libraries(QtVTKRenderWindows ${VTK_LIBRARIES})
else()
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
# Use what VTK built with
set(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH "")
set(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH "")
set(QT_UIC_EXECUTABLE ${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH "")
qt4_wrap_ui(UI_Srcs ${UIs})
add_executable(QtVTKRenderWindows ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs})
target_link_libraries(QtVTKRenderWindows ${QT_LIBRARIES} ${VTK_LIBRARIES})
endif()
find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
qt5_wrap_ui(UI_Srcs ${UIs})
# CMAKE_AUTOMOC in ON so the MocHdrs will be automatically wrapped.
add_executable(QtVTKRenderWindows ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs})
qt5_use_modules(QtVTKRenderWindows Core Gui Widgets)
target_link_libraries(QtVTKRenderWindows ${VTK_LIBRARIES})
......@@ -54,28 +54,12 @@ set( QRCs
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
if(VTK_QT_VERSION VERSION_GREATER "4")
find_package(Qt5 COMPONENTS WebKitWidgets REQUIRED QUIET)
find_package(Qt5 COMPONENTS WebKitWidgets REQUIRED QUIET)
qt5_add_resources(QRC_Srcs ${QRCs} )
qt5_add_resources(QRC_Srcs ${QRCs} )
add_executable(qtgraphicsview MACOSX_BUNDLE
${Srcs} ${Hdrs} ${MOC_Hdrs} ${QRC_Srcs})
qt5_use_modules(qtgraphicsview Core Gui Widgets
WebKit WebKitWidgets OpenGL OpenGLExtensions)
target_link_libraries(qtgraphicsview ${VTK_LIBRARIES})
else()
find_package(Qt4 REQUIRED)
set(QT_USE_QTOPENGL 1)
set(QT_USE_QTWEBKIT 1)
include(${QT_USE_FILE})
if (NOT QT_QTWEBKIT_FOUND OR QT_VERSION_MINOR LESS 6)
message(STATUS "VTK isn't configured to use QtOpenGL, QtWebKit wasn't found, or Qt 4.6 wasn't found. GraphicsView example is disabled.")
else()
qt4_add_resources(QRC_Srcs ${QRCs})
qt4_wrap_cpp(MOC_Srcs ${MOC_Hdrs})
add_executable(qtgraphicsview ${Srcs} ${Hdrs} ${MOC_Hdrs} ${QRC_Srcs})
target_link_libraries(qtgraphicsview ${QT_LIBRARIES} ${VTK_LIBRARIES})
endif()
endif()
add_executable(qtgraphicsview MACOSX_BUNDLE
${Srcs} ${Hdrs} ${MOC_Hdrs} ${QRC_Srcs})
qt5_use_modules(qtgraphicsview Core Gui Widgets
WebKit WebKitWidgets OpenGL OpenGLExtensions)
target_link_libraries(qtgraphicsview ${VTK_LIBRARIES})
......@@ -40,16 +40,12 @@ class GraphicsView : public QGraphicsView
void drawBackground(QPainter* p, const QRectF& vtkNotUsed(r))
{
#if QT_VERSION >= 0x040600
p->beginNativePainting();
#endif
mWidget->GetRenderWindow()->PushState();
mWidget->GetRenderWindow()->OpenGLInitState();
mWidget->GetRenderWindow()->Render();
mWidget->GetRenderWindow()->PopState();
#if QT_VERSION >= 0x040600
p->endNativePainting();
#endif
}
void resizeEvent(QResizeEvent *event)
......
......@@ -127,12 +127,8 @@ void OpenGLScene::mousePressEvent(QGraphicsSceneMouseEvent* e)
QGraphicsScene::mousePressEvent(e);
// See if its under one our our deactivated items.
#if QT_VERSION >= 0x050000
// The transform is just the identity matrix.
QGraphicsItem* item = itemAt(e->scenePos(),QTransform());
#else
QGraphicsItem* item = itemAt(e->scenePos());
#endif
// The transform is just the identity matrix.
QGraphicsItem* item = itemAt(e->scenePos(),QTransform());
if(item == mGraphLayoutView && CurrentState != 0)
{
......
......@@ -17,10 +17,8 @@ endif()
set( Srcs main.cxx )
if(VTK_QT_VERSION VERSION_GREATER "4")
find_package(Qt5 COMPONENTS Core REQUIRED QUIET)
find_package(Qt5 COMPONENTS Core REQUIRED QUIET)
add_executable(qtimageviewer ${Srcs})
qt5_use_modules(qtimageviewer Core Gui Widgets)
target_link_libraries(qtimageviewer ${VTK_LIBRARIES})
endif()
add_executable(qtimageviewer ${Srcs})
qt5_use_modules(qtimageviewer Core Gui Widgets)
target_link_libraries(qtimageviewer ${VTK_LIBRARIES})
......@@ -44,57 +44,24 @@ set( QRCs Icons/icons.qrc )
set(CMAKE_AUTOMOC ON)
# The rest should just work (sure...)
if(VTK_QT_VERSION VERSION_GREATER "4")
# We have ui files, this will bring in the macro: qt5_wrap_ui
find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
qt5_wrap_ui(UI_Srcs ${UIs})
qt5_add_resources(QRC_Srcs ${QRCs} )
source_group("Resources" FILES
${UIs}
${QRCs}
${EXE_ICON} # Not present
)
source_group("Generated" FILES
${UI_Srcs}
${MOC_Srcs}
${QRC_Srcs}
)
add_executable(SimpleView MACOSX_BUNDLE
${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${QRC_Srcs})
qt5_use_modules(SimpleView Core Gui Widgets)
target_link_libraries(SimpleView ${VTK_LIBRARIES})
else()
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
# Use what VTK built with
set(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH "")
set(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH "")
set(QT_UIC_EXECUTABLE ${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH "")
qt4_wrap_ui(UI_Srcs ${UIs})
qt4_wrap_cpp(MOC_Srcs ${MOC_Hdrs} )
qt4_add_resources(QRC_Srcs ${QRCs})
source_group("Resources" FILES
${UIs}
${QRCs}
${EXE_ICON} # Not present
)
source_group("Generated" FILES
${UI_Srcs}
${QRC_Srcs}
${QRC_Srcs}
)
# We have ui files, this will bring in the macro: qt5_wrap_ui
find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
qt5_wrap_ui(UI_Srcs ${UIs})
qt5_add_resources(QRC_Srcs ${QRCs} )
source_group("Resources" FILES
${UIs}
${QRCs}
${EXE_ICON} # Not present
)
add_definitions(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT)
source_group("Generated" FILES
${UI_Srcs}
${MOC_Srcs}
${QRC_Srcs}
)
add_executable(SimpleView MACOSX_BUNDLE
${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${QRC_Srcs})
target_link_libraries(SimpleView
${QT_LIBRARIES}
${VTK_LIBRARIES}
)
endif()
add_executable(SimpleView MACOSX_BUNDLE
${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${QRC_Srcs})
qt5_use_modules(SimpleView Core Gui Widgets)
target_link_libraries(SimpleView ${VTK_LIBRARIES})
......@@ -47,10 +47,8 @@ endif()
# If Qt is enabled include the QT based examples
if(vtkGUISupportQt_LOADED AND vtkViewsQt_LOADED)
if(VTK_QT_VERSION VERSION_GREATER "4")
add_subdirectory(EasyView)
add_subdirectory(CustomLinkView)
endif()
add_subdirectory(EasyView)
add_subdirectory(CustomLinkView)
if(vtkIOSQL_LOADED)
add_subdirectory(StatsView)
endif()
......
......@@ -52,50 +52,17 @@ if(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
set(Srcs ${Srcs} ${UIs})
endif(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
if(VTK_QT_VERSION VERSION_GREATER "4")
find_package(Qt5 COMPONENTS Widgets)
find_package(Qt5 COMPONENTS Widgets)
qt5_wrap_ui(UI_Srcs ${UIs})
qt5_add_resources(Rcs_Srcs ${Rcs})
qt5_wrap_ui(UI_Srcs ${UIs})
qt5_add_resources(Rcs_Srcs ${Rcs})
set_source_files_PROPERTIES(${Srcs} PROPERTIES
OBJECT_DEPENDS "${UI_Srcs}")
set_source_files_PROPERTIES(${Srcs} PROPERTIES
OBJECT_DEPENDS "${UI_Srcs}")
add_executable(CustomLinkView
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs})
add_executable(CustomLinkView
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs})
qt5_use_modules(CustomLinkView Core Gui Widgets)
qt5_use_modules(CustomLinkView Core Gui Widgets)
target_link_libraries(CustomLinkView ${VTK_LIBRARIES})
else()
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
# Use what VTK built with
set(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH "")
set(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH "")
set(QT_UIC_EXECUTABLE ${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH "")
qt4_wrap_ui(UI_Srcs ${UIs})
# Use the include path and library for Qt that is used by VTK.
include_directories(
${QT_INCLUDE_DIR}
)
qt4_wrap_ui(UI_Srcs ${UIs})
qt4_add_resources(Rcs_Srcs ${Rcs})
add_definitions(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT)
set_source_files_PROPERTIES(${Srcs} PROPERTIES
OBJECT_DEPENDS "${UI_Srcs}")
add_executable(CustomLinkView
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs})
target_link_libraries(CustomLinkView
${QT_LIBRARIES}
${VTK_LIBRARIES}
)
endif()
target_link_libraries(CustomLinkView ${VTK_LIBRARIES})
......@@ -50,61 +50,29 @@ if(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
set(Srcs ${Srcs} ${UIs})
endif(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
if(VTK_QT_VERSION VERSION_GREATER "4")
# We have ui files, this will bring in the macro: qt5_wrap_ui
find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
qt5_wrap_ui(UI_Srcs ${UIs})
qt5_add_resources(Rcs_Srcs ${Rcs})
source_group("Resources" FILES
${UIs}
${Rcs}
${EXE_ICON} # Not present
)
source_group("Generated" FILES
${UI_Srcs}
${MOC_Srcs}
${Rcs_Srcs}
)
# set_source_files_PROPERTIES(${Srcs} PROPERTIES
# OBJECT_DEPENDS "${UI_Srcs}")
add_executable(EasyView
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs})
qt5_use_modules(EasyView Core Gui Widgets)
target_link_libraries(EasyView ${VTK_LIBRARIES})
else()
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
# Use what VTK built with
set(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH "")
set(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH "")
set(QT_UIC_EXECUTABLE ${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH "")
qt4_wrap_ui(UI_Srcs ${UIs})
# We have ui files, this will bring in the macro: qt5_wrap_ui
find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
qt5_wrap_ui(UI_Srcs ${UIs})
qt5_add_resources(Rcs_Srcs ${Rcs})
source_group("Resources" FILES
${UIs}
${Rcs}
${EXE_ICON} # Not present
)
# Use the include path and library for Qt that is used by VTK.
include_directories(
${QT_INCLUDE_DIR}
)
source_group("Generated" FILES
${UI_Srcs}
${MOC_Srcs}
${Rcs_Srcs}
)
qt4_wrap_ui(UI_Srcs ${UIs})
qt4_add_resources(Rcs_Srcs ${Rcs})
# set_source_files_PROPERTIES(${Srcs} PROPERTIES
# OBJECT_DEPENDS "${UI_Srcs}")
add_definitions(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT)
set_source_files_PROPERTIES(${Srcs} PROPERTIES
OBJECT_DEPENDS "${UI_Srcs}")
add_executable(EasyView
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs})
add_executable(EasyView
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs})
qt5_use_modules(EasyView Core Gui Widgets)
target_link_libraries(EasyView
${QT_LIBRARIES}
${VTK_LIBRARIES}
)
endif()
target_link_libraries(EasyView ${VTK_LIBRARIES})
......@@ -49,50 +49,17 @@ if(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
set(Srcs ${Srcs} ${UIs})
endif(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
if(VTK_QT_VERSION VERSION_GREATER "4")
find_package(Qt5 COMPONENTS Widgets)
find_package(Qt5 COMPONENTS Widgets)
qt5_wrap_ui(UI_Srcs ${UIs})
qt5_add_resources(Rcs_Srcs ${Rcs})
qt5_wrap_ui(UI_Srcs ${UIs})
qt5_add_resources(Rcs_Srcs ${Rcs})
set_source_files_PROPERTIES(${Srcs} PROPERTIES
OBJECT_DEPENDS "${UI_Srcs}")
set_source_files_PROPERTIES(${Srcs} PROPERTIES
OBJECT_DEPENDS "${UI_Srcs}")
add_executable(StatsView
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs})
add_executable(StatsView
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs})
qt5_use_modules(StatsView Core Gui Widgets)
qt5_use_modules(StatsView Core Gui Widgets)
target_link_libraries(StatsView ${VTK_LIBRARIES})
else()
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
# Use what VTK built with
set(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH "")
set(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH "")
set(QT_UIC_EXECUTABLE ${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH "")
qt4_wrap_ui(UI_Srcs ${UIs})
# Use the include path and library for Qt that is used by VTK.
include_directories(
${QT_INCLUDE_DIR}
)
qt4_wrap_ui(UI_Srcs ${UIs})
qt4_add_resources(Rcs_Srcs ${Rcs})
add_definitions(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT)
set_source_files_PROPERTIES(${Srcs} PROPERTIES
OBJECT_DEPENDS "${UI_Srcs}")
add_executable(StatsView
MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs})
target_link_libraries(StatsView
${QT_LIBRARIES}
${VTK_LIBRARIES}
)
endif()
target_link_libraries(StatsView ${VTK_LIBRARIES})
......@@ -8,9 +8,6 @@
*/
// QT includes
#include <QApplication>
#if QT_VERSION < 0x050000
#include <QCleanlooksStyle>
#endif
#include "StatsView.h"
extern int qInitResources_icons();
......@@ -21,11 +18,7 @@ int main( int argc, char** argv )
// QT Stuff
QApplication app( argc, argv );
#if QT_VERSION >= 0x050000
QApplication::setStyle("fusion");
#else
QApplication::setStyle(new QCleanlooksStyle);
#endif
qInitResources_icons();
......
......@@ -30,8 +30,7 @@ set(QVTKMocHeaders
vtkQtTreeModelAdapter.h
)
if(VTK_QT_VERSION VERSION_GREATER "4" AND
VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
if(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
list(APPEND QVTKLibSrcs QVTKOpenGLWidget.cxx)
list(APPEND QVTKMocHeaders QVTKOpenGLWidget.h)
endif()
......@@ -63,43 +62,27 @@ set(QVTKNonMocHeaders
QVTKInteractor.h
)
if(VTK_QT_VERSION VERSION_GREATER "4")
set(qt_component_x11extras)
if(VTK_USE_X)
set(qt_component_x11extras X11Extras)
endif()
find_package(Qt5 COMPONENTS Widgets ${qt_component_x11extras} REQUIRED QUIET)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_definitions(${Qt5Widgets_DEFINITIONS})
if(qt_component_x11extras)
include_directories(${Qt5X11Extras_INCLUDE_DIRS})
add_definitions(${Qt5X11Extras_DEFINITIONS})
endif()
qt5_wrap_cpp(QVTKLibMocSrcs ${QVTKMocHeaders})
set(qt_component_x11extras)
if(VTK_USE_X)
set(qt_component_x11extras X11Extras)
endif()
set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
set(QT_LIBRARIES_PRIVATE ${Qt5X11Extras_LIBRARIES})
find_package(Qt5 COMPONENTS Widgets ${qt_component_x11extras} REQUIRED QUIET)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_definitions(${Qt5Widgets_DEFINITIONS})
# When this module is loaded by an app, load Qt too.
vtk_module_export_code_find_package(Qt5 COMPONENTS Widgets)
else()
# import Qt4 build settings
find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED QUIET)
mark_as_advanced(QT_QMAKE_EXECUTABLE)