Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes

vlQt4::Qt4Widget Class Reference

The Qt4Widget class implements an OpenGLContext using the Trolltech's Qt4 API. More...

#include <Qt4Widget.hpp>

Inheritance diagram for vlQt4::Qt4Widget:
vl::OpenGLContext vl::Object

List of all members.

Public Member Functions

 Qt4Widget (QWidget *parent=NULL, const QGLWidget *shareWidget=NULL, Qt::WindowFlags f=0)
void dragEnterEvent (QDragEnterEvent *ev)
void dropEvent (QDropEvent *ev)
bool initQt4Widget (const vl::String &title, const vl::OpenGLContextFormat &info, const QGLContext *shareContext=0, int x=0, int y=0, int width=640, int height=480)
virtual void setContinuousUpdate (bool continuous)
 If the OpenGL context is a widget this function sets whether its area is continuously updated at each frame.
void initializeGL ()
void resizeGL (int width, int height)
void paintGL ()
void update ()
 If the OpenGLContext is a widget this function requests a redraw.
virtual void setWindowTitle (const vl::String &title)
 If the OpenGL context is a top window this function sets its title.
virtual bool setFullscreen (bool fullscreen)
 If the OpenGL context is a widget this function requests a maximization to fullscreen.
virtual void quitApplication ()
 Asks to the windowing system that is managing the OpenGLContext to quit the application.
virtual void destroy ()
 This function should be appropriately reimplemented in all the subclasses of OpenGLContext.
virtual void show ()
 If the OpenGL context is a widget this function makes it visible to the user.
virtual void hide ()
 If the OpenGL context is a widget this function makes it invisible to the user.
virtual void setPosition (int x, int y)
 If the OpenGL context is a widget this function sets its position.
virtual vl::ivec2 position () const
 If the OpenGL context is a widget this function returns its position.
virtual void setSize (int w, int h)
 If the OpenGL context is a widget this function sets its size.
virtual vl::ivec2 size () const
void swapBuffers ()
 Swaps the back and front buffers to present the last rendering.
void makeCurrent ()
 Sets the OpenGL context as current for the calling thread.
void setMousePosition (int x, int y)
 If the OpenGL context is a widget this function sets the mouse position.
void mouseMoveEvent (QMouseEvent *ev)
void mousePressEvent (QMouseEvent *ev)
void mouseReleaseEvent (QMouseEvent *ev)
void wheelEvent (QWheelEvent *ev)
void keyPressEvent (QKeyEvent *ev)
void keyReleaseEvent (QKeyEvent *ev)
virtual void setMouseVisible (bool visible)
 If the OpenGL context is a widget this function sets whether the mouse is visible over it or not.
virtual void getFocus ()
 If the OpenGL context is a widget this function requests the mouse focus on it.

Protected Member Functions

void translateKeyEvent (QKeyEvent *ev, unsigned short &unicode_out, vl::EKey &key_out)

Protected Attributes

QTimer mUpdateTimer

Detailed Description

The Qt4Widget class implements an OpenGLContext using the Trolltech's Qt4 API.


Constructor & Destructor Documentation

vlQt4::Qt4Widget::Qt4Widget ( QWidget *  parent = NULL,
const QGLWidget *  shareWidget = NULL,
Qt::WindowFlags  f = 0 
) [inline]

Member Function Documentation

void vlQt4::Qt4Widget::dragEnterEvent ( QDragEnterEvent *  ev ) [inline]
void vlQt4::Qt4Widget::dropEvent ( QDropEvent *  ev ) [inline]
bool vlQt4::Qt4Widget::initQt4Widget ( const vl::String title,
const vl::OpenGLContextFormat info,
const QGLContext *  shareContext = 0,
int  x = 0,
int  y = 0,
int  width = 640,
int  height = 480 
) [inline]
virtual void vlQt4::Qt4Widget::setContinuousUpdate ( bool  continuous ) [inline, virtual]

If the OpenGL context is a widget this function sets whether its area is continuously updated at each frame.

Reimplemented from vl::OpenGLContext.

void vlQt4::Qt4Widget::initializeGL (  ) [inline]
void vlQt4::Qt4Widget::resizeGL ( int  width,
int  height 
) [inline]
void vlQt4::Qt4Widget::paintGL (  ) [inline]
void vlQt4::Qt4Widget::update (  ) [inline, virtual]

If the OpenGLContext is a widget this function requests a redraw.

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::setWindowTitle ( const vl::String  ) [inline, virtual]

If the OpenGL context is a top window this function sets its title.

Reimplemented from vl::OpenGLContext.

virtual bool vlQt4::Qt4Widget::setFullscreen ( bool   ) [inline, virtual]

If the OpenGL context is a widget this function requests a maximization to fullscreen.

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::quitApplication (  ) [inline, virtual]

Asks to the windowing system that is managing the OpenGLContext to quit the application.

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::destroy (  ) [inline, virtual]

This function should be appropriately reimplemented in all the subclasses of OpenGLContext.

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::show (  ) [inline, virtual]

If the OpenGL context is a widget this function makes it visible to the user.

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::hide (  ) [inline, virtual]

If the OpenGL context is a widget this function makes it invisible to the user.

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::setPosition ( int  ,
int   
) [inline, virtual]

If the OpenGL context is a widget this function sets its position.

Reimplemented from vl::OpenGLContext.

virtual vl::ivec2 vlQt4::Qt4Widget::position (  ) const [inline, virtual]

If the OpenGL context is a widget this function returns its position.

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::setSize ( int  ,
int   
) [inline, virtual]

If the OpenGL context is a widget this function sets its size.

Reimplemented from vl::OpenGLContext.

virtual vl::ivec2 vlQt4::Qt4Widget::size (  ) const [inline, virtual]
void vlQt4::Qt4Widget::swapBuffers (  ) [inline, virtual]

Swaps the back and front buffers to present the last rendering.

Implements vl::OpenGLContext.

void vlQt4::Qt4Widget::makeCurrent (  ) [inline, virtual]

Sets the OpenGL context as current for the calling thread.

Implements vl::OpenGLContext.

void vlQt4::Qt4Widget::setMousePosition ( int  ,
int   
) [inline, virtual]

If the OpenGL context is a widget this function sets the mouse position.

Reimplemented from vl::OpenGLContext.

void vlQt4::Qt4Widget::mouseMoveEvent ( QMouseEvent *  ev ) [inline]
void vlQt4::Qt4Widget::mousePressEvent ( QMouseEvent *  ev ) [inline]
void vlQt4::Qt4Widget::mouseReleaseEvent ( QMouseEvent *  ev ) [inline]
void vlQt4::Qt4Widget::wheelEvent ( QWheelEvent *  ev ) [inline]
void vlQt4::Qt4Widget::keyPressEvent ( QKeyEvent *  ev ) [inline]
void vlQt4::Qt4Widget::keyReleaseEvent ( QKeyEvent *  ev ) [inline]
virtual void vlQt4::Qt4Widget::setMouseVisible ( bool   ) [inline, virtual]

If the OpenGL context is a widget this function sets whether the mouse is visible over it or not.

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::getFocus (  ) [inline, virtual]

If the OpenGL context is a widget this function requests the mouse focus on it.

Reimplemented from vl::OpenGLContext.

void Qt4Widget::translateKeyEvent ( QKeyEvent *  ev,
unsigned short &  unicode_out,
vl::EKey key_out 
) [protected]

Member Data Documentation

QTimer vlQt4::Qt4Widget::mUpdateTimer [protected]

The documentation for this class was generated from the following files:

Visualization Library v2010.11.1125 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Fri Nov 26 2010 10:33:55.
Permission is granted to use this page to write and publish articles regarding Visualization Library.