14 #ifndef OSGVIEWER_GRAPHICSWINDOWQT
15 #define OSGVIEWER_GRAPHICSWINDOWQT
19 #include <osgViewer/GraphicsWindow>
20 #include <osgQt/Export>
21 #include <osgQt/Version>
40 class GraphicsWindowQt;
57 typedef QGLWidget inherited;
61 GLWidget( QWidget* parent =
NULL,
const QGLWidget* shareWidget =
NULL, Qt::WindowFlags f = 0,
bool forwardKeyEvents =
false );
62 GLWidget( QGLContext* context, QWidget* parent =
NULL,
const QGLWidget* shareWidget =
NULL, Qt::WindowFlags f = 0,
bool forwardKeyEvents =
false );
63 GLWidget(
const QGLFormat&
format, QWidget* parent =
NULL,
const QGLWidget* shareWidget =
NULL, Qt::WindowFlags f = 0,
bool forwardKeyEvents =
false );
74 void setTouchEventsEnabled(
bool e );
76 void setKeyboardModifiers( QInputEvent* event );
78 virtual void keyPressEvent( QKeyEvent* event );
79 virtual void keyReleaseEvent( QKeyEvent* event );
80 virtual void mousePressEvent( QMouseEvent* event );
81 virtual void mouseReleaseEvent( QMouseEvent* event );
82 virtual void mouseDoubleClickEvent( QMouseEvent* event );
83 virtual void mouseMoveEvent( QMouseEvent* event );
84 virtual void wheelEvent( QWheelEvent* event );
85 virtual bool gestureEvent( QGestureEvent* event );
91 QMutexLocker lock(&_deferredEventQueueMutex);
92 return _deferredEventQueue.count();
96 QMutexLocker lock(&_deferredEventQueueMutex);
98 if (removeEventType != QEvent::None)
100 if (_deferredEventQueue.removeOne(removeEventType))
101 _eventCompressor.remove(eventType);
104 if (_eventCompressor.find(eventType) == _eventCompressor.end())
106 _deferredEventQueue.enqueue(eventType);
107 _eventCompressor.insert(eventType);
110 void processDeferredEvents();
124 virtual void resizeEvent( QResizeEvent* event );
125 virtual void moveEvent( QMoveEvent* event );
126 virtual void glDraw();
127 virtual bool event( QEvent* event );
152 bool init( QWidget* parent,
const QGLWidget* shareWidget, Qt::WindowFlags f );
158 virtual bool setWindowRectangleImplementation(
int x,
int y,
int width,
int height );
159 virtual void getWindowRectangle(
int& x,
int& y,
int&
width,
int&
height );
160 virtual bool setWindowDecorationImplementation(
bool windowDecoration );
161 virtual bool getWindowDecoration()
const;
162 virtual void grabFocus();
163 virtual void grabFocusIfPointerInWindow();
164 virtual void raiseWindow();
165 virtual void setWindowName(
const std::string& name );
166 virtual std::string getWindowName();
167 virtual void useCursor(
bool cursorOn );
173 virtual bool valid()
const;
174 virtual bool realizeImplementation();
175 virtual bool isRealizedImplementation()
const;
176 virtual void closeImplementation();
177 virtual bool makeCurrentImplementation();
178 virtual bool releaseContextImplementation();
179 virtual void swapBuffersImplementation();
180 virtual void runOperations();
182 virtual void requestWarpPointer(
float x,
float y );
void OSGQT_EXPORT initQtWindowingSystem()
The function sets the WindowingSystem to Qt.
void OSGQT_EXPORT setViewer(osgViewer::ViewerBase *viewer)
const GLWidget * getGraphWidget() const
deprecated
GLint GLenum GLsizei width
GLWidget * getGraphWidget()
deprecated
WindowData(GLWidget *widget=NULL, QWidget *parent=NULL)
const GLWidget * getGLWidget() const
GLint GLenum GLsizei GLsizei height
virtual void setTouchEventsEnabled(bool e)
bool getTouchEventsEnabled() const
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format