From 508850e810e5b5fe01dae5db54091d66c907947b Mon Sep 17 00:00:00 2001 From: Bastian Rieck Date: Sun, 28 Dec 2014 14:13:12 +0100 Subject: [PATCH] Using Qt5 instead of Qt4 --- CMakeLists.txt | 11 +++++++---- OSGWidget.cpp | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d7d1e2..049f1ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED( VERSION 2.8.9 ) +CMAKE_MINIMUM_REQUIRED( VERSION 2.8.11 ) PROJECT( QtOSG ) SET( CMAKE_CXX_FLAGS "-std=c++11 -Wall -pedantic -Wno-long-long" ) @@ -6,10 +6,11 @@ SET( CMAKE_CXX_FLAGS "-std=c++11 -Wall -pedantic -Wno-long-long" ) SET( CMAKE_INCLUDE_CURRENT_DIR ON ) SET( CMAKE_AUTOMOC ON ) -FIND_PACKAGE( Qt4 REQUIRED QtCore QtGui QtOpenGL) +FIND_PACKAGE( Qt5Core ) +FIND_PACKAGE( Qt5Gui ) +FIND_PACKAGE( Qt5OpenGL ) FIND_PACKAGE( OpenSceneGraph REQUIRED COMPONENTS osgGA osgUtil osgViewer ) -INCLUDE( ${QT_USE_FILE} ) INCLUDE_DIRECTORIES( ${OPENSCENEGRAPH_INCLUDE_DIRS} ) SET( WITH_PICK_HANDLER ON CACHE BOOL "Build with pick handler support" ) @@ -44,5 +45,7 @@ ENDIF() TARGET_LINK_LIBRARIES( qtosg ${OPENSCENEGRAPH_LIBRARIES} - ${QT_LIBRARIES} + Qt5::Core + Qt5::Gui + Qt5::OpenGL ) diff --git a/OSGWidget.cpp b/OSGWidget.cpp index 401cacc..131f7a4 100644 --- a/OSGWidget.cpp +++ b/OSGWidget.cpp @@ -189,7 +189,7 @@ void OSGWidget::resizeGL( int width, int height ) void OSGWidget::keyPressEvent( QKeyEvent* event ) { QString keyString = event->text(); - const char* keyData = keyString.toAscii().data(); + const char* keyData = keyString.toLocal8Bit().data(); if( event->key() == Qt::Key_S ) { @@ -206,7 +206,7 @@ void OSGWidget::keyPressEvent( QKeyEvent* event ) void OSGWidget::keyReleaseEvent( QKeyEvent* event ) { QString keyString = event->text(); - const char* keyData = keyString.toAscii().data(); + const char* keyData = keyString.toLocal8Bit().data(); this->getEventQueue()->keyRelease( osgGA::GUIEventAdapter::KeySymbol( *keyData ) ); }