# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# 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:

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)
void | initializeGL ()
void | resizeGL (int width, int height)
void | paintGL ()
void | update ()
virtual void | setWindowTitle (const vl::String &title)
virtual bool | setFullscreen (bool fullscreen)
virtual void | quitApplication ()
| Asks to the windowing system that is managing the OpenGLContext to quit the application.
virtual void | destroy ()
virtual void | show ()
virtual void | hide ()
virtual void | setPosition (int x, int y)
virtual vl::ivec2 | position () const
virtual void | setSize (int w, int h)
virtual vl::ivec2 | size () const
void | swapBuffers ()
void | makeCurrent ()
void | setMousePosition (int x, int y)
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)
virtual void | getFocus ()
## 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]`

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]`

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::setWindowTitle | ( | const vl::String & | title | ) | `[inline, virtual]`

Reimplemented from vl::OpenGLContext.

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

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]`

Reimplemented from vl::OpenGLContext.

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

Reimplemented from vl::OpenGLContext.

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

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::setPosition | ( | int | x,
|  | int | y |
| ) |  |  | `[inline, virtual]`

Reimplemented from vl::OpenGLContext.

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

Reimplemented from vl::OpenGLContext.

virtual void vlQt4::Qt4Widget::setSize | ( | int | w,
|  | int | h |
| ) |  |  | `[inline, virtual]`

Reimplemented from vl::OpenGLContext.

virtual vl::ivec2 vlQt4::Qt4Widget::size | ( |  | ) | const`[inline, virtual]`

Reimplemented from vl::OpenGLContext.

void vlQt4::Qt4Widget::swapBuffers | ( |  | ) | `[inline, virtual]`

Reimplemented from vl::OpenGLContext.

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

Reimplemented from vl::OpenGLContext.

void vlQt4::Qt4Widget::setMousePosition | ( | int | x,
|  | int | y |
| ) |  |  | `[inline, virtual]`

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 | visible | ) | `[inline, virtual]`

Reimplemented from vl::OpenGLContext.

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

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:

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlQt4/Qt4Widget.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlQt4/Qt4Widget.cpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 29 11:12:00 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.