Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The Qt4Widget class implements an OpenGLContext using the Qt4 API. More...
#include <Qt4Widget.hpp>
Public Member Functions | |
Qt4Widget (QWidget *parent=NULL, const QGLWidget *shareWidget=NULL, Qt::WindowFlags f=0) | |
~Qt4Widget () | |
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 | setRefreshRate (int msec) |
int | refreshRate () |
void | initializeGL () |
void | resizeGL (int width, int height) |
void | paintGL () |
void | update () |
If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent(). | |
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 | 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 | |
int | mRefresh |
QTimer | mUpdateTimer |
The Qt4Widget class implements an OpenGLContext using the Qt4 API.
Definition at line 53 of file Qt4Widget.hpp.
vlQt4::Qt4Widget::Qt4Widget | ( | QWidget * | parent = NULL , |
const QGLWidget * | shareWidget = NULL , |
||
Qt::WindowFlags | f = 0 |
||
) | [inline] |
Definition at line 61 of file Qt4Widget.hpp.
References vl::Object::setAutomaticDelete().
vlQt4::Qt4Widget::~Qt4Widget | ( | ) | [inline] |
Definition at line 73 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::dragEnterEvent | ( | QDragEnterEvent * | ev ) | [inline] |
Definition at line 78 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::dropEvent | ( | QDropEvent * | ev ) | [inline] |
Definition at line 84 of file Qt4Widget.hpp.
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] |
Definition at line 107 of file Qt4Widget.hpp.
References vl::OpenGLContextFormat::accumRGBABits(), vl::OpenGLContextFormat::depthBufferBits(), vl::OpenGLContextFormat::doubleBuffer(), vl::OpenGLContextFormat::fullscreen(), vl::max(), vl::OpenGLContextFormat::multisample(), vl::OpenGLContextFormat::multisampleSamples(), vl::OpenGLContextFormat::rgbaBits(), vl::OpenGLContextFormat::stencilBufferBits(), vl::OpenGLContextFormat::stereo(), and vl::OpenGLContextFormat::vSync().
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.
Definition at line 209 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::setRefreshRate | ( | int | msec ) | [inline] |
Definition at line 227 of file Qt4Widget.hpp.
int vlQt4::Qt4Widget::refreshRate | ( | ) | [inline] |
Definition at line 233 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::initializeGL | ( | ) | [inline] |
Definition at line 238 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::resizeGL | ( | int | width, |
int | height | ||
) | [inline] |
Definition at line 244 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::paintGL | ( | ) | [inline] |
Definition at line 249 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::update | ( | ) | [inline, virtual] |
If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent().
Implements vl::OpenGLContext.
Definition at line 254 of file Qt4Widget.hpp.
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.
Definition at line 260 of file Qt4Widget.hpp.
References vl::String::toStdString().
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.
Definition at line 265 of file Qt4Widget.hpp.
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.
Definition at line 275 of file Qt4Widget.hpp.
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.
Definition at line 281 of file Qt4Widget.hpp.
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.
Definition at line 286 of file Qt4Widget.hpp.
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.
Definition at line 291 of file Qt4Widget.hpp.
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.
Definition at line 296 of file Qt4Widget.hpp.
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.
Definition at line 301 of file Qt4Widget.hpp.
virtual vl::ivec2 vlQt4::Qt4Widget::size | ( | ) | const [inline, virtual] |
Definition at line 307 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::swapBuffers | ( | ) | [inline, virtual] |
Swaps the back and front buffers to present the last rendering.
Implements vl::OpenGLContext.
Definition at line 313 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::makeCurrent | ( | ) | [inline, virtual] |
Sets the OpenGL context as current for the calling thread.
Implements vl::OpenGLContext.
Definition at line 318 of file Qt4Widget.hpp.
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.
Definition at line 323 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::mouseMoveEvent | ( | QMouseEvent * | ev ) | [inline] |
Definition at line 328 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::mousePressEvent | ( | QMouseEvent * | ev ) | [inline] |
Definition at line 335 of file Qt4Widget.hpp.
References vl::LeftButton, vl::MiddleButton, vl::NoButton, vl::RightButton, and vl::UnknownButton.
void vlQt4::Qt4Widget::mouseReleaseEvent | ( | QMouseEvent * | ev ) | [inline] |
Definition at line 349 of file Qt4Widget.hpp.
References vl::LeftButton, vl::MiddleButton, vl::NoButton, vl::RightButton, and vl::UnknownButton.
void vlQt4::Qt4Widget::wheelEvent | ( | QWheelEvent * | ev ) | [inline] |
Definition at line 363 of file Qt4Widget.hpp.
void vlQt4::Qt4Widget::keyPressEvent | ( | QKeyEvent * | ev ) | [inline] |
Definition at line 368 of file Qt4Widget.hpp.
References vl::Key_None, and vlEGL::translateKeyEvent().
void vlQt4::Qt4Widget::keyReleaseEvent | ( | QKeyEvent * | ev ) | [inline] |
Definition at line 376 of file Qt4Widget.hpp.
References vl::Key_None, and vlEGL::translateKeyEvent().
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.
Definition at line 384 of file Qt4Widget.hpp.
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.
Definition at line 393 of file Qt4Widget.hpp.
void Qt4Widget::translateKeyEvent | ( | QKeyEvent * | ev, |
unsigned short & | unicode_out, | ||
vl::EKey & | key_out | ||
) | [protected] |
Definition at line 38 of file Qt4Widget.cpp.
References vl::Key_0, vl::Key_1, vl::Key_2, vl::Key_3, vl::Key_4, vl::Key_5, vl::Key_6, vl::Key_7, vl::Key_8, vl::Key_9, vl::Key_A, vl::Key_Alt, vl::Key_Ampersand, vl::Key_Asterisk, vl::Key_At, vl::Key_B, vl::Key_BackSlash, vl::Key_BackSpace, vl::Key_C, vl::Key_Caret, vl::Key_Clear, vl::Key_Colon, vl::Key_Comma, vl::Key_Ctrl, vl::Key_D, vl::Key_Delete, vl::Key_Dollar, vl::Key_Down, vl::Key_E, vl::Key_End, vl::Key_Equal, vl::Key_Escape, vl::Key_Exclam, vl::Key_F, vl::Key_F1, vl::Key_F10, vl::Key_F11, vl::Key_F12, vl::Key_F2, vl::Key_F3, vl::Key_F4, vl::Key_F5, vl::Key_F6, vl::Key_F7, vl::Key_F8, vl::Key_F9, vl::Key_G, vl::Key_Greater, vl::Key_H, vl::Key_Hash, vl::Key_Home, vl::Key_I, vl::Key_Insert, vl::Key_J, vl::Key_K, vl::Key_L, vl::Key_Left, vl::Key_LeftBracket, vl::Key_LeftParen, vl::Key_Less, vl::Key_M, vl::Key_Minus, vl::Key_N, vl::Key_None, vl::Key_O, vl::Key_P, vl::Key_PageDown, vl::Key_PageUp, vl::Key_Pause, vl::Key_Period, vl::Key_Plus, vl::Key_Print, vl::Key_Q, vl::Key_Question, vl::Key_Quote, vl::Key_QuoteDbl, vl::Key_QuoteLeft, vl::Key_R, vl::Key_Return, vl::Key_Right, vl::Key_RightBracket, vl::Key_RightParen, vl::Key_S, vl::Key_Semicolon, vl::Key_Shift, vl::Key_Slash, vl::Key_Space, vl::Key_T, vl::Key_Tab, vl::Key_U, vl::Key_Underscore, vl::Key_Up, vl::Key_V, vl::Key_W, vl::Key_X, vl::Key_Y, and vl::Key_Z.
int vlQt4::Qt4Widget::mRefresh [protected] |
Definition at line 402 of file Qt4Widget.hpp.
QTimer vlQt4::Qt4Widget::mUpdateTimer [protected] |
Definition at line 403 of file Qt4Widget.hpp.