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

vlQt5::Qt5Widget Class Reference

The Qt5Widget class implements an OpenGLContext using the Qt5 API. More...

#include <Qt5Widget.hpp>

Inheritance diagram for vlQt5::Qt5Widget:
vl::OpenGLContext vl::Object

List of all members.

Public Member Functions

 Qt5Widget (QWidget *parent=NULL, const QGLWidget *shareWidget=NULL, Qt::WindowFlags f=0)
 ~Qt5Widget ()
void dragEnterEvent (QDragEnterEvent *ev)
void dropEvent (QDropEvent *ev)
bool initQt5Widget (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

Detailed Description

The Qt5Widget class implements an OpenGLContext using the Qt5 API.

Definition at line 54 of file Qt5Widget.hpp.


Constructor & Destructor Documentation

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

Definition at line 62 of file Qt5Widget.hpp.

References vl::Object::setAutomaticDelete().

vlQt5::Qt5Widget::~Qt5Widget ( ) [inline]

Definition at line 74 of file Qt5Widget.hpp.


Member Function Documentation

void vlQt5::Qt5Widget::dragEnterEvent ( QDragEnterEvent *  ev) [inline]

Definition at line 79 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::dropEvent ( QDropEvent *  ev) [inline]

Definition at line 85 of file Qt5Widget.hpp.

bool vlQt5::Qt5Widget::initQt5Widget ( 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 vlQt5::Qt5Widget::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 210 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::setRefreshRate ( int  msec) [inline]

Definition at line 228 of file Qt5Widget.hpp.

int vlQt5::Qt5Widget::refreshRate ( ) [inline]

Definition at line 234 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::initializeGL ( ) [inline]

Definition at line 239 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::resizeGL ( int  width,
int  height 
) [inline]

Definition at line 245 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::paintGL ( ) [inline]

Definition at line 250 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::update ( ) [inline, virtual]

If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent().

Implements vl::OpenGLContext.

Definition at line 255 of file Qt5Widget.hpp.

virtual void vlQt5::Qt5Widget::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 261 of file Qt5Widget.hpp.

References vl::String::toStdString().

virtual bool vlQt5::Qt5Widget::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 266 of file Qt5Widget.hpp.

virtual void vlQt5::Qt5Widget::quitApplication ( ) [inline, virtual]

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

Reimplemented from vl::OpenGLContext.

Definition at line 276 of file Qt5Widget.hpp.

virtual void vlQt5::Qt5Widget::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 282 of file Qt5Widget.hpp.

virtual void vlQt5::Qt5Widget::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 287 of file Qt5Widget.hpp.

virtual void vlQt5::Qt5Widget::setPosition ( int  ,
int   
) [inline, virtual]

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

Reimplemented from vl::OpenGLContext.

Definition at line 292 of file Qt5Widget.hpp.

virtual vl::ivec2 vlQt5::Qt5Widget::position ( ) const [inline, virtual]

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

Reimplemented from vl::OpenGLContext.

Definition at line 297 of file Qt5Widget.hpp.

virtual void vlQt5::Qt5Widget::setSize ( int  ,
int   
) [inline, virtual]

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

Reimplemented from vl::OpenGLContext.

Definition at line 302 of file Qt5Widget.hpp.

virtual vl::ivec2 vlQt5::Qt5Widget::size ( ) const [inline, virtual]

Definition at line 308 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::swapBuffers ( ) [inline, virtual]

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

Implements vl::OpenGLContext.

Definition at line 314 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::makeCurrent ( ) [inline, virtual]

Sets the OpenGL context as current for the calling thread.

Implements vl::OpenGLContext.

Definition at line 319 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::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 324 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::mouseMoveEvent ( QMouseEvent *  ev) [inline]

Definition at line 329 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::mousePressEvent ( QMouseEvent *  ev) [inline]
void vlQt5::Qt5Widget::mouseReleaseEvent ( QMouseEvent *  ev) [inline]
void vlQt5::Qt5Widget::wheelEvent ( QWheelEvent *  ev) [inline]

Definition at line 364 of file Qt5Widget.hpp.

void vlQt5::Qt5Widget::keyPressEvent ( QKeyEvent *  ev) [inline]

Definition at line 369 of file Qt5Widget.hpp.

References vl::Key_None, and vlEGL::translateKeyEvent().

void vlQt5::Qt5Widget::keyReleaseEvent ( QKeyEvent *  ev) [inline]

Definition at line 377 of file Qt5Widget.hpp.

References vl::Key_None, and vlEGL::translateKeyEvent().

virtual void vlQt5::Qt5Widget::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 385 of file Qt5Widget.hpp.

virtual void vlQt5::Qt5Widget::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 394 of file Qt5Widget.hpp.

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

Member Data Documentation

int vlQt5::Qt5Widget::mRefresh [protected]

Definition at line 403 of file Qt5Widget.hpp.

QTimer vlQt5::Qt5Widget::mUpdateTimer [protected]

Definition at line 404 of file Qt5Widget.hpp.


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

Visualization Library 2011.09.1160 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 2 2013 13:41:46.
Permission is granted to use this page to write and publish articles regarding Visualization Library.