From Kristofer Tingdahl, with additions from Riccardo Corsi and Robert Milharcic, support for Qt5 build
This commit is contained in:
@@ -536,10 +536,13 @@ OPTION(OSG_USE_QT "Enable to use Qt (build Qt-dependent libraries, plugins and e
|
||||
|
||||
IF(OSG_USE_QT AND NOT ANDROID)
|
||||
# To select a specific version of QT define DESIRED_QT_VERSION
|
||||
# via cmake -DDESIRED_QT_VERSION=4
|
||||
IF (DESIRED_QT_VERSION)
|
||||
# via cmake -DDESIRED_QT_VERSION=5
|
||||
# QUIET option disables messages if the package cannot be found.
|
||||
|
||||
IF (DESIRED_QT_VERSION MATCHES 4)
|
||||
IF (DESIRED_QT_VERSION)
|
||||
IF (DESIRED_QT_VERSION MATCHES 5)
|
||||
FIND_PACKAGE(Qt5Widgets)
|
||||
ELSEIF (DESIRED_QT_VERSION MATCHES 4)
|
||||
FIND_PACKAGE(Qt4)
|
||||
ELSE()
|
||||
FIND_PACKAGE(Qt3)
|
||||
@@ -547,13 +550,35 @@ IF(OSG_USE_QT AND NOT ANDROID)
|
||||
|
||||
ELSE()
|
||||
|
||||
FIND_PACKAGE(Qt4)
|
||||
FIND_PACKAGE(Qt5Widgets QUIET)
|
||||
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
# CMake 2.8.8 or greater required
|
||||
BUILDER_VERSION_GREATER(2 8 7)
|
||||
IF(NOT VALID_BUILDER_VERSION)
|
||||
MESSAGE(
|
||||
SEND_ERROR
|
||||
"Qt5 requires CMake version 2.8.8 or greater!\n"
|
||||
"Update CMake or set DESIRED_QT_VERSION to less than 5
|
||||
or disable OSG_USE_QT."
|
||||
)
|
||||
ENDIF( )
|
||||
ENDIF( )
|
||||
|
||||
IF (NOT QT4_FOUND)
|
||||
FIND_PACKAGE(Qt3)
|
||||
IF ( NOT Qt5Widgets_FOUND )
|
||||
FIND_PACKAGE(Qt4)
|
||||
|
||||
IF (NOT QT4_FOUND)
|
||||
FIND_PACKAGE(Qt3)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ENDIF()
|
||||
|
||||
#If we have found Qt5, let's try to top off by getting the webkit as well
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
FIND_PACKAGE(Qt5WebKitWidgets)
|
||||
ENDIF()
|
||||
|
||||
ENDIF()
|
||||
|
||||
#optional example related dependencies
|
||||
@@ -1029,9 +1054,9 @@ SET(PKGCONFIG_FILES
|
||||
openscenegraph-osgVolume
|
||||
)
|
||||
|
||||
IF(QT4_FOUND)
|
||||
IF(QT4_FOUND OR Qt5Widgets_FOUND )
|
||||
SET(PKGCONFIG_FILES ${PKGCONFIG_FILES} openscenegraph-osgQt)
|
||||
ENDIF(QT4_FOUND)
|
||||
ENDIF()
|
||||
|
||||
FOREACH(PKGCONFIG_FILE ${PKGCONFIG_FILES})
|
||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/pkgconfig/${PKGCONFIG_FILE}.pc.in
|
||||
|
||||
@@ -206,14 +206,14 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF (QT_FOUND AND NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE)
|
||||
IF ( (QT4_FOUND OR Qt5Widgets_FOUND) AND NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE)
|
||||
|
||||
IF (QT_QTOPENGL_LIBRARY)
|
||||
IF ( QT4_FOUND OR Qt5Widgets_FOUND)
|
||||
ADD_SUBDIRECTORY(osgviewerQt)
|
||||
ADD_SUBDIRECTORY(osgqfont)
|
||||
ENDIF()
|
||||
|
||||
IF (QT4_FOUND AND QT_QTWEBKIT_FOUND)
|
||||
IF ( (QT4_FOUND AND QT_QTWEBKIT_FOUND) OR Qt5WebKitWidgets_FOUND )
|
||||
ADD_SUBDIRECTORY(osgQtWidgets)
|
||||
ADD_SUBDIRECTORY(osgQtBrowser)
|
||||
ENDIF()
|
||||
|
||||
@@ -7,10 +7,19 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
ENDIF()
|
||||
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
|
||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
|
||||
if ( QT4_FOUND )
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
|
||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTWEBKIT_INCLUDE_DIR} )
|
||||
endif( QT4_FOUND )
|
||||
|
||||
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_EXAMPLE(osgQtBrowser)
|
||||
SET ( EXAMPLE_NAME osgQtBrowser )
|
||||
SETUP_EXAMPLE(${EXAMPLE_NAME})
|
||||
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
qt5_use_modules( example_${EXAMPLE_NAME} Widgets OpenGL WebKitWidgets )
|
||||
ENDIF( Qt5Widgets_FOUND )
|
||||
|
||||
|
||||
|
||||
@@ -29,14 +29,20 @@
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
#include <osgWidget/Browser>
|
||||
|
||||
#include <QtGlobal>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtWebKitWidgets>
|
||||
#else
|
||||
# include <QtWebKit>
|
||||
#endif
|
||||
|
||||
#include <QtWebKit/QWebSettings>
|
||||
#include <QtWebKit/QtWebKit>
|
||||
#include <QtGui/QGraphicsScene>
|
||||
#include <QtGui/QGraphicsView>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QtEvents>
|
||||
#include <QWebSettings>
|
||||
|
||||
#include <QGraphicsScene>
|
||||
#include <QGraphicsView>
|
||||
#include <QApplication>
|
||||
#include <QPainter>
|
||||
#include <QtEvents>
|
||||
|
||||
#include <osgQt/QGraphicsViewAdapter>
|
||||
#include <osgQt/QWebViewImage>
|
||||
|
||||
@@ -7,10 +7,17 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
ENDIF()
|
||||
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
|
||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
|
||||
if ( QT4_FOUND )
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
|
||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTWEBKIT_INCLUDE_DIR} )
|
||||
endif( QT4_FOUND )
|
||||
|
||||
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_EXAMPLE(osgQtWidgets)
|
||||
SET ( EXAMPLE_NAME osgQtWidgets )
|
||||
SETUP_EXAMPLE(${EXAMPLE_NAME})
|
||||
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
qt5_use_modules( example_${EXAMPLE_NAME} OpenGL WebKitWidgets )
|
||||
ENDIF( Qt5Widgets_FOUND )
|
||||
|
||||
@@ -36,17 +36,16 @@
|
||||
#include <osgWidget/Browser>
|
||||
|
||||
|
||||
//#include <QtWebKit/QWebSettings>
|
||||
//#include <QtWebKit/QtWebKit>
|
||||
#include <QtGui/QGraphicsScene>
|
||||
#include <QtGui/QGraphicsView>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QtEvents>
|
||||
#include <QtGui/QDialog>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtOpenGL/QtOpenGL>
|
||||
//#include <QWebSettings>
|
||||
#include <QGraphicsScene>
|
||||
#include <QGraphicsView>
|
||||
#include <QApplication>
|
||||
#include <QPainter>
|
||||
#include <QtEvents>
|
||||
#include <QDialog>
|
||||
#include <QVBoxLayout>
|
||||
#include <QMainWindow>
|
||||
#include <QtOpenGL>
|
||||
|
||||
#include <osgQt/QGraphicsViewAdapter>
|
||||
#include <osgQt/QWebViewImage>
|
||||
@@ -98,7 +97,11 @@ protected:
|
||||
virtual void mousePressEvent(QMouseEvent* e)
|
||||
{
|
||||
bool ok = false;
|
||||
#if QT_VERSION >= 0x040500
|
||||
int val = QInputDialog::getInt(this, "Get integer", "Please enter an integer between 0 and pi", 0, 0, 3, 1, &ok);
|
||||
#else
|
||||
int val = QInputDialog::getInteger(this, "Get integer", "Please enter an integer between 0 and pi", 0, 0, 3, 1, &ok);
|
||||
#endif
|
||||
std::cout << "Ok was " << (ok ? "" : "not") << " pressed, val is " << val << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
#this file is automatically generated
|
||||
|
||||
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS(-DUSE_QT4)
|
||||
|
||||
SET(TARGET_SRC osgqfont.cpp )
|
||||
SET(TARGET_ADDED_LIBRARIES osgQt osgText)
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE} ${QT_QTGUI_LIBRARY_RELEASE} ${QT_QTOPENGL_LIBRARY_RELEASE} )
|
||||
IF ( NOT Qt5Widgets_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} )
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE} ${QT_QTGUI_LIBRARY_RELEASE} ${QT_QTOPENGL_LIBRARY_RELEASE} )
|
||||
ENDIF()
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_EXAMPLE(osgqfont)
|
||||
SET ( EXAMPLE_NAME osgqfont )
|
||||
SETUP_EXAMPLE(${EXAMPLE_NAME})
|
||||
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
qt5_use_modules( example_${EXAMPLE_NAME} Widgets OpenGL )
|
||||
ENDIF( Qt5Widgets_FOUND )
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QGridLayout>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QApplication>
|
||||
#include <QGridLayout>
|
||||
#include <QWidget>
|
||||
|
||||
#include <osgQt/GraphicsWindowQt>
|
||||
#include <osgQt/QFontImplementation>
|
||||
|
||||
@@ -2,15 +2,26 @@ SET( TARGET_SRC
|
||||
osgviewerQt.cpp
|
||||
)
|
||||
|
||||
IF( QT4_FOUND )
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE} ${QT_QTGUI_LIBRARY_RELEASE} ${QT_QTOPENGL_LIBRARY_RELEASE} )
|
||||
IF ( NOT Qt5Widgets_FOUND )
|
||||
IF( QT4_FOUND )
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE} ${QT_QTGUI_LIBRARY_RELEASE}
|
||||
${QT_QTOPENGL_LIBRARY_RELEASE} )
|
||||
ADD_DEFINITIONS(-DUSE_QT4)
|
||||
ELSE( QT4_FOUND )
|
||||
ELSE( QT4_FOUND )
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_LIBRARIES} )
|
||||
ENDIF( QT4_FOUND )
|
||||
ENDIF( QT4_FOUND )
|
||||
|
||||
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )
|
||||
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}
|
||||
${QT_QTOPENGL_INCLUDE_DIR} )
|
||||
ENDIF()
|
||||
|
||||
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
|
||||
|
||||
SETUP_EXAMPLE( osgviewerQt )
|
||||
SET( EXAMPLE_NAME osgviewerQt )
|
||||
|
||||
SETUP_EXAMPLE( ${EXAMPLE_NAME} )
|
||||
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
qt5_use_modules( example_${EXAMPLE_NAME} Widgets OpenGL )
|
||||
ENDIF( Qt5Widgets_FOUND )
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QGridLayout>
|
||||
#include <QTimer>
|
||||
#include <QApplication>
|
||||
#include <QGridLayout>
|
||||
|
||||
#include <osgViewer/CompositeViewer>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
@@ -19,6 +19,9 @@ public:
|
||||
ViewerWidget(osgViewer::ViewerBase::ThreadingModel threadingModel=osgViewer::CompositeViewer::SingleThreaded) : QWidget()
|
||||
{
|
||||
setThreadingModel(threadingModel);
|
||||
|
||||
// disable the default setting of viewer.done() by pressing Escape.
|
||||
setKeyEventSetsDone(0);
|
||||
|
||||
QWidget* widget1 = addViewWidget( createCamera(0,0,100,100), osgDB::readNodeFile("cow.osgt") );
|
||||
QWidget* widget2 = addViewWidget( createCamera(0,0,100,100), osgDB::readNodeFile("glider.osgt") );
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
#ifndef OSGVIEWER_GRAPHICSWINDOWQT
|
||||
#define OSGVIEWER_GRAPHICSWINDOWQT
|
||||
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QEvent>
|
||||
#include <QtCore/QQueue>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtOpenGL/QGLWidget>
|
||||
#include <QMutex>
|
||||
#include <QEvent>
|
||||
#include <QQueue>
|
||||
#include <QSet>
|
||||
#include <QGLWidget>
|
||||
|
||||
#include <osgViewer/GraphicsWindow>
|
||||
#include <osgQt/Export>
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
#include <osg/observer_ptr>
|
||||
#include <osgQt/Export>
|
||||
|
||||
#include <QtCore/QPointer>
|
||||
#include <QtGui/QGraphicsScene>
|
||||
#include <QtGui/QGraphicsView>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QtEvents>
|
||||
#include <QPointer>
|
||||
#include <QGraphicsScene>
|
||||
#include <QGraphicsView>
|
||||
#include <QApplication>
|
||||
#include <QPainter>
|
||||
#include <QtEvents>
|
||||
|
||||
namespace osgQt
|
||||
{
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
// make sure this header isn't built as par of osgQt, leaving it to applications to build
|
||||
#if !defined(OSGQT_LIBRARY) && !defined(OSG_LIBRARY_STATIC)
|
||||
|
||||
#include <QtWebKit/QtWebKit>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtWebKitWidgets>
|
||||
#else
|
||||
# include <QtWebKit>
|
||||
#endif
|
||||
|
||||
|
||||
#include <osgWidget/Browser>
|
||||
#include <osgQt/QGraphicsViewAdapter>
|
||||
|
||||
@@ -34,7 +34,7 @@ FOREACH( mylibfolder
|
||||
|
||||
ENDFOREACH()
|
||||
|
||||
IF (QT4_FOUND AND NOT ANDROID)
|
||||
IF ((QT4_FOUND OR Qt5Widgets_FOUND) AND NOT ANDROID)
|
||||
ADD_SUBDIRECTORY(osgQt)
|
||||
ENDIF()
|
||||
|
||||
|
||||
@@ -81,14 +81,14 @@ IF(CMAKE_SYSTEM MATCHES IRIX)
|
||||
ENDIF(CMAKE_SYSTEM MATCHES IRIX)
|
||||
|
||||
# Add support for using Qt threads
|
||||
IF(QT4_FOUND)
|
||||
IF(QT4_FOUND OR Qt5Widgets_FOUND)
|
||||
OPTION(BUILD_OPENTHREADS_WITH_QT "Build OpenThreads with Qt threading support." OFF)
|
||||
ENDIF()
|
||||
|
||||
# Maybe we should be using the FindThreads.cmake module?
|
||||
IF(ANDROID)
|
||||
SUBDIRS(pthreads)
|
||||
ELSEIF(QT4_FOUND AND BUILD_OPENTHREADS_WITH_QT)
|
||||
ELSEIF((QT4_FOUND OR Qt5Widgets_FOUND) AND BUILD_OPENTHREADS_WITH_QT)
|
||||
SUBDIRS(qt)
|
||||
ELSEIF(WIN32)
|
||||
# So I think Cygwin wants to use pthreads
|
||||
|
||||
@@ -39,8 +39,15 @@ IF(OPENTHREADS_SONAMES)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${OPENTHREADS_VERSION} SOVERSION ${OPENTHREADS_SOVERSION})
|
||||
ENDIF()
|
||||
|
||||
TARGET_LINK_LIBRARIES(${LIB_NAME} ${QT_QTCORE_LIBRARY})
|
||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
|
||||
if ( QT4_FOUND )
|
||||
TARGET_LINK_LIBRARIES(${LIB_NAME} ${QT_QTCORE_LIBRARY})
|
||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
|
||||
else( QT4_FOUND )
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
qt5_use_modules( ${LIB_NAME} Core )
|
||||
ENDIF ( Qt5Widgets_FOUND )
|
||||
|
||||
endif( QT4_FOUND )
|
||||
|
||||
# Since we're building different platforms binaries in
|
||||
# their respective directories, we need to set the
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#define _QTCONDITIONPRIVATEDATA_H_
|
||||
|
||||
#include <OpenThreads/Condition>
|
||||
#include <QtCore/QWaitCondition>
|
||||
#include <QWaitCondition>
|
||||
|
||||
class QtConditionPrivateData : public QWaitCondition
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#define _QTMUTEXPRIVATEDATA_H_
|
||||
|
||||
#include <OpenThreads/Mutex>
|
||||
#include <QtCore/QMutex>
|
||||
#include <QMutex>
|
||||
|
||||
class QtMutexPrivateData : public QMutex
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// ~~~~~~~~~~~
|
||||
|
||||
#include "QtThreadPrivateData.h"
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QCoreApplication>
|
||||
#include <iostream>
|
||||
|
||||
using namespace OpenThreads;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <OpenThreads/Thread>
|
||||
#include <OpenThreads/Block>
|
||||
#include <QtCore/QThread>
|
||||
#include <QThread>
|
||||
|
||||
struct QtThreadCanceled {};
|
||||
|
||||
|
||||
@@ -12,7 +12,11 @@ SET(SOURCES_H
|
||||
${HEADER_PATH}/QGraphicsViewAdapter
|
||||
)
|
||||
|
||||
QT4_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" )
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
QT5_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" )
|
||||
ELSE()
|
||||
QT4_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" )
|
||||
ENDIF()
|
||||
|
||||
SET(TARGET_H
|
||||
${HEADER_PATH}/Export
|
||||
@@ -47,20 +51,27 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
ENDIF()
|
||||
|
||||
SET(TARGET_LIBRARIES
|
||||
${TARGET_LIBRARIES}
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${QT_QTOPENGL_LIBRARY}
|
||||
)
|
||||
|
||||
# FIXME: This should work but something with the LINK_WITH_VARIABLES macro is not working
|
||||
#SET(TARGET_LIBRARIES_VARS
|
||||
# QT_QTCORE_LIBRARY
|
||||
# QT_QTGUI_LIBRARY
|
||||
# QT_QTOPENGL_LIBRARY
|
||||
#)
|
||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
|
||||
|
||||
IF( QT4_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}
|
||||
${QT_QTOPENGL_INCLUDE_DIR} )
|
||||
SET(TARGET_LIBRARIES
|
||||
${TARGET_LIBRARIES}
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${QT_QTOPENGL_LIBRARY}
|
||||
)
|
||||
|
||||
ENDIF( QT4_FOUND )
|
||||
|
||||
SETUP_LIBRARY(${LIB_NAME})
|
||||
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
qt5_use_modules( ${LIB_NAME} Widgets OpenGL )
|
||||
ENDIF ( Qt5Widgets_FOUND )
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <osg/DeleteHandler>
|
||||
#include <osgQt/GraphicsWindowQt>
|
||||
#include <osgViewer/ViewerBase>
|
||||
#include <QtGui/QInputEvent>
|
||||
#include <QInputEvent>
|
||||
|
||||
using namespace osgQt;
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
KeyMap::iterator itr = mKeyMap.find(event->key());
|
||||
if (itr == mKeyMap.end())
|
||||
{
|
||||
return int(*(event->text().toAscii().data()));
|
||||
return int(*(event->text().toLatin1().data()));
|
||||
}
|
||||
else
|
||||
return itr->second;
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
#include <osgDB/Registry>
|
||||
#include <osgText/Font>
|
||||
|
||||
#include <QtGui/QFont>
|
||||
#include <QtGui/QFontMetrics>
|
||||
#include <QtGui/QImage>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QFont>
|
||||
#include <QFontMetrics>
|
||||
#include <QImage>
|
||||
#include <QPainter>
|
||||
|
||||
namespace osgQt {
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
|
||||
#include <osg/NodeVisitor>
|
||||
#include <osg/io_utils>
|
||||
#include <QtGui/QGraphicsItem>
|
||||
#include <QtGui/QGraphicsProxyWidget>
|
||||
#include <QGraphicsItem>
|
||||
#include <QGraphicsProxyWidget>
|
||||
|
||||
#define MYQKEYEVENT 2000
|
||||
#define MYQPOINTEREVENT 2001
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <osgQt/QWidgetImage>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QLayout>
|
||||
|
||||
namespace osgQt
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user