Commit 8c2ff34a authored by Matthias Möller's avatar Matthias Möller
Browse files

- fix contextmenu crash under win32 with qt5 using replacing in qt5 deprecated class

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17182 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 2dd05407
...@@ -100,7 +100,6 @@ class QSplitter; ...@@ -100,7 +100,6 @@ class QSplitter;
class QTimer; class QTimer;
class QImage; class QImage;
class QSocketNotifier; class QSocketNotifier;
class QGLFramebufferObject;
//== NAMESPACES =============================================================== //== NAMESPACES ===============================================================
...@@ -116,6 +115,11 @@ class QGraphicsScene; ...@@ -116,6 +115,11 @@ class QGraphicsScene;
class QtGLViewerLayout; class QtGLViewerLayout;
class QtShiftPopupMenu; class QtShiftPopupMenu;
class CursorPainter; class CursorPainter;
#if QT_VERSION < 0x050000
class QGLFramebufferObject;
#else
class QOpenGLFramebufferObject;
#endif
//== CLASS DEFINITION ========================================================= //== CLASS DEFINITION =========================================================
...@@ -805,8 +809,14 @@ private: ...@@ -805,8 +809,14 @@ private:
private: private:
#if QT_VERSION < 0x050000
typedef QGLFramebufferObject QFrameBufferObject;
#else
typedef QOpenGLFramebufferObject QFrameBufferObject;
#endif
/// Framebuffer object that holds the pick cache /// Framebuffer object that holds the pick cache
QGLFramebufferObject *pickCache_; QFrameBufferObject* pickCache_;
/// Should the pick cache be updated /// Should the pick cache be updated
bool updatePickCache_; bool updatePickCache_;
......
...@@ -56,7 +56,13 @@ ...@@ -56,7 +56,13 @@
#include "QtGLGraphicsScene.hh" #include "QtGLGraphicsScene.hh"
#include "QtGLGraphicsView.hh" #include "QtGLGraphicsView.hh"
#include <QGLFramebufferObject> #if QT_VERSION < 0x050000
#include <QGLFrameBufferObject>
#else // QT_VERSION > 0x050000
#undef QT_NO_OPENGL
#include <QOpenGLFramebufferObject>
#define QT_NO_OPENGL
#endif //QT_VERSION < 0x050000
//== NAMESPACES =============================================================== //== NAMESPACES ===============================================================
...@@ -136,7 +142,7 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget, ...@@ -136,7 +142,7 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget,
// create a new pick cache frambuffer object // create a new pick cache frambuffer object
if (!pickCache_) if (!pickCache_)
{ {
pickCache_ = new QGLFramebufferObject (glWidth (), glHeight (), QGLFramebufferObject::Depth); pickCache_ = new QFrameBufferObject (glWidth (), glHeight (), QFrameBufferObject::Depth);
if (!pickCache_->isValid ()) if (!pickCache_->isValid ())
{ {
pickCacheSupported_ = false; pickCacheSupported_ = false;
...@@ -535,7 +541,7 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg ...@@ -535,7 +541,7 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
// create a new pick cache frambuffer object // create a new pick cache frambuffer object
if (!pickCache_) if (!pickCache_)
{ {
pickCache_ = new QGLFramebufferObject (glWidth (), glHeight (), QGLFramebufferObject::Depth); pickCache_ = new QFrameBufferObject (glWidth (), glHeight (), QFrameBufferObject::Depth);
if (!pickCache_->isValid ()) if (!pickCache_->isValid ())
{ {
pickCacheSupported_ = false; pickCacheSupported_ = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment