From Kristofer Tingdahl, with additions from Riccardo Corsi and Robert Milharcic, support for Qt5 build
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user