Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtOpenGL.QGLWidget Class Reference

The QGLWidget class is a widget for rendering OpenGL graphics. More...

Inheritance diagram for QtOpenGL.QGLWidget:
Collaboration diagram for QtOpenGL.QGLWidget:

Public Member Functions

 QGLWidget (QGLContext context, QWidget parent=null, QGLWidget shareWidget=null, Qt.WindowType f=0)
 
 
 QGLWidget (QGLFormat format, QWidget parent=null, QGLWidget shareWidget=null, Qt.WindowType f=0)
 
 
 QGLWidget (QWidget parent=null, QGLWidget shareWidget=null, Qt.WindowType f=0)
 
 
override void CreateProxy ()
 
new uint BindTexture (QImage image)
 
 
new uint BindTexture (QPixmap pixmap)
 
 
new uint BindTexture (QImage image, int target)
 
 
new uint BindTexture (QPixmap pixmap, int target)
 
 
new uint BindTexture (QImage image, int target, int format)
 
 
new uint BindTexture (QPixmap pixmap, int target, int format)
 
 
new uint BindTexture (QImage image, int target, int format, QGLContext.BindOption options)
 
 
new uint BindTexture (QPixmap pixmap, int target, int format, QGLContext.BindOption options)
 
 
new uint BindTexture (string fileName)
 
 
new void DeleteTexture (uint tx_id)
 
 
new void DoneCurrent ()
 
 
new bool DoubleBuffer ()
 
 
new void DrawTexture (QRectF target, uint textureId)
 
 
new void DrawTexture (QPointF point, uint textureId)
 
 
new void DrawTexture (QRectF target, uint textureId, int textureTarget)
 
 
new void DrawTexture (QPointF point, uint textureId, int textureTarget)
 
 
override bool OnEvent (QEvent arg1)
 
 
new QImage GrabFrameBuffer (bool withAlpha=false)
 
 
new bool IsSharing ()
 
 
new bool IsValid ()
 
 
new void MakeCurrent ()
 
 
new void MakeOverlayCurrent ()
 
 
new QGLContext OverlayContext ()
 
 
override QPaintEngine PaintEngine ()
 
 
new void QglClearColor (QColor c)
 
 
new void QglColor (QColor c)
 
 
new QPixmap RenderPixmap (int w=0, int h=0, bool useContext=false)
 
 
new void RenderText (int x, int y, string str)
 
 
new void RenderText (int x, int y, string str, QFont fnt, int listBase=2000)
 
 
new void RenderText (double x, double y, double z, string str)
 
 
new void RenderText (double x, double y, double z, string str, QFont fnt, int listBase=2000)
 
 
new void SetContext (QGLContext context, QGLContext shareContext=null, bool deleteOldContext=true)
 
new void SetMouseTracking (bool enable)
 
 
new void SwapBuffers ()
 
 
virtual void UpdateGL ()
 
 
virtual void UpdateOverlayGL ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QWidget
 QWidget (QWidget parent=null, Qt.WindowType f=0)
 
 
new
System.Collections.Generic.List
< QAction
Actions ()
 
 
new void ActivateWindow ()
 
 
new void AddAction (QAction action)
 
 
new void AddActions (System.Collections.Generic.List< QAction > actions)
 
 
new void AdjustSize ()
 
 
new QWidget ChildAt (QPoint p)
 
 
new QWidget ChildAt (int x, int y)
 
 
new void ClearFocus ()
 
 
new void ClearMask ()
 
 
new bool Close ()
 
 
new QRect ContentsRect ()
 
 
new void CreateWinId ()
 
virtual int DevType ()
 
new NativeULong EffectiveWinId ()
 
 
new void EnsurePolished ()
 
 
new QWidget FocusWidget ()
 
 
new QFont font ()
 
new QFontInfo FontInfo ()
 
 
new QFontMetrics FontMetrics ()
 
 
new QRect geometry ()
 
new void GetContentsMargins (ref int left, ref int top, ref int right, ref int bottom)
 
 
virtual System.IntPtr GetDC ()
 
 
new void GrabGesture (Qt.GestureType type, Qt.GestureFlag flags=0)
 
 
new void GrabKeyboard ()
 
 
new void GrabMouse ()
 
 
new void GrabMouse (QCursor arg1)
 
 
new int GrabShortcut (QKeySequence key, Qt.ShortcutContext context=Qt.ShortcutContext.WindowShortcut)
 
 
new QGraphicsProxyWidget GraphicsProxyWidget ()
 
 
virtual int HeightForWidth (int arg1)
 
 
new void Hide ()
 
 
new Qt.InputMethodHint inputMethodHints ()
 
virtual object InputMethodQuery (Qt.InputMethodQuery arg1)
 
 
new void InsertAction (QAction before, QAction action)
 
 
new void InsertActions (QAction before, System.Collections.Generic.List< QAction > actions)
 
 
new NativeULong InternalWinId ()
 
new bool IsAncestorOf (QWidget child)
 
 
new bool IsEnabledTo (QWidget arg1)
 
 
new bool IsEnabledToTLW ()
 
 
new bool IsHidden ()
 
 
new bool IsLeftToRight ()
 
new bool IsRightToLeft ()
 
new bool IsTopLevel ()
 
 
new bool IsVisibleTo (QWidget arg1)
 
 
new bool IsWindow ()
 
 
new void Lower ()
 
 
new QPoint MapFrom (QWidget arg1, QPoint arg2)
 
 
new QPoint MapFromGlobal (QPoint arg1)
 
 
new QPoint MapFromParent (QPoint arg1)
 
 
new QPoint MapTo (QWidget arg1, QPoint arg2)
 
 
new QPoint MapToGlobal (QPoint arg1)
 
 
new QPoint MapToParent (QPoint arg1)
 
 
virtual QSize MinimumSizeHint ()
 
new void Move (int x, int y)
 
new QWidget NativeParentWidget ()
 
 
new QWidget NextInFocusChain ()
 
 
new void OverrideWindowFlags (Qt.WindowType type)
 
 
new void OverrideWindowState (Qt.WindowState state)
 
new QPalette palette ()
 
new QWidget ParentWidget ()
 
 
new QWidget PreviousInFocusChain ()
 
 
new void Raise ()
 
 
virtual void ReleaseDC (System.IntPtr arg1)
 
 
new void ReleaseKeyboard ()
 
 
new void ReleaseMouse ()
 
 
new void ReleaseShortcut (int id)
 
 
new void RemoveAction (QAction action)
 
 
new void Render (IQPaintDevice target)
 
 
new void Render (QPainter painter)
 
 
new void Render (IQPaintDevice target, QPoint targetOffset)
 
 
new void Render (QPainter painter, QPoint targetOffset)
 
 
new void Render (IQPaintDevice target, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren)
 
 
new void Render (QPainter painter, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren)
 
 
new void Repaint ()
 
 
new void Repaint (QRect arg1)
 
 
new void Repaint (QRegion arg1)
 
 
new void Repaint (int x, int y, int w, int h)
 
 
new void Resize (int w, int h)
 
new bool RestoreGeometry (QByteArray geometry)
 
 
new QByteArray SaveGeometry ()
 
 
new void Scroll (int dx, int dy)
 
 
new void Scroll (int dx, int dy, QRect arg3)
 
 
new void SetAttribute (Qt.WidgetAttribute arg1, bool on=true)
 
 
new void SetBaseSize (int basew, int baseh)
 
new void SetContentsMargins (int left, int top, int right, int bottom)
 
 
new void SetDisabled (bool arg1)
 
 
new void SetFixedHeight (int h)
 
 
new void SetFixedSize (QSize arg1)
 
 
new void SetFixedSize (int w, int h)
 
 
new void SetFixedWidth (int w)
 
 
new void SetFocus ()
 
 
new void SetFocus (Qt.FocusReason reason)
 
 
new void SetGeometry (int x, int y, int w, int h)
 
new void SetHidden (bool hidden)
 
 
new void SetInputMethodHints (Qt.InputMethodHint hints)
 
new void SetMask (QBitmap arg1)
 
 
new void SetMaximumSize (int maxw, int maxh)
 
new void SetMinimumSize (int minw, int minh)
 
new void SetParent (QWidget parent)
 
 
new void SetParent (QWidget parent, Qt.WindowType f)
 
 
new void SetShortcutAutoRepeat (int id, bool enable=true)
 
 
new void SetShortcutEnabled (int id, bool enable=true)
 
 
new void SetShown (bool shown)
 
new void SetSizeIncrement (int w, int h)
 
new void SetSizePolicy (QSizePolicy.Policy horizontal, QSizePolicy.Policy vertical)
 
virtual void SetVisible (bool visible)
 
new void Show ()
 
 
new void ShowFullScreen ()
 
 
new void ShowMaximized ()
 
 
new void ShowMinimized ()
 
 
new void ShowNormal ()
 
 
virtual QSize SizeHint ()
 
new void StackUnder (QWidget arg1)
 
 
new bool TestAttribute (Qt.WidgetAttribute arg1)
 
 
new QWidget TopLevelWidget ()
 
 
new bool UnderMouse ()
 
 
new void UngrabGesture (Qt.GestureType type)
 
 
new void UnsetCursor ()
 
new void UnsetLayoutDirection ()
 
new void UnsetLocale ()
 
new void Update ()
 
 
new void Update (QRect arg1)
 
 
new void Update (QRegion arg1)
 
 
new void Update (int x, int y, int w, int h)
 
 
new void UpdateGeometry ()
 
 
new QRegion VisibleRegion ()
 
 
new NativeULong WinId ()
 
 
new QWidget Window ()
 
 
new Qt.WindowType WindowType ()
 
 
new void Dispose ()
 
new int ColorCount ()
 
new int Depth ()
 
new int HeightMM ()
 
new int LogicalDpiX ()
 
new int LogicalDpiY ()
 
new int NumColors ()
 
new bool PaintingActive ()
 
new int PhysicalDpiX ()
 
new int PhysicalDpiY ()
 
new int WidthMM ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
 
 
new bool BlockSignals (bool b)
 
 
new
System.Collections.Generic.List
< QObject
Children ()
 
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
new void DeleteLater ()
 
 
new bool Disconnect (QObject receiver, string member=null)
 
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
 
 
new void DumpObjectInfo ()
 
 
new void DumpObjectTree ()
 
 
new
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames ()
 
 
virtual bool EventFilter (QObject arg1, QEvent arg2)
 
 
new bool Inherits (string classname)
 
 
new void InstallEventFilter (QObject arg1)
 
 
new bool IsWidgetType ()
 
 
new void KillTimer (int id)
 
 
new object Property (string name)
 
 
new void RemoveEventFilter (QObject arg1)
 
 
new bool SetProperty (string name, object value)
 
 
new void SetUserData (uint id, QObjectUserData data)
 
new bool SignalsBlocked ()
 
 
new int StartTimer (int interval)
 
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 
- Public Member Functions inherited from QtGui.IQPaintDevice
new int ColorCount ()
 
new int Depth ()
 
int DevType ()
 
System.IntPtr GetDC ()
 
new int Height ()
 
new int HeightMM ()
 
new int LogicalDpiX ()
 
new int LogicalDpiY ()
 
new int NumColors ()
 
QPaintEngine PaintEngine ()
 
new bool PaintingActive ()
 
new int PhysicalDpiX ()
 
new int PhysicalDpiY ()
 
void ReleaseDC (System.IntPtr hdc)
 
new int Width ()
 
new int WidthMM ()
 

Static Public Member Functions

static QImage ConvertToGLFormat (QImage img)
 
 
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtGui.QWidget
static QWidget Find (NativeULong arg1)
 
 
static QWidget KeyboardGrabber ()
 
 
static QWidget MouseGrabber ()
 
 
static void SetTabOrder (QWidget arg1, QWidget arg2)
 
 
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection)
 
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
 
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
 
 
static uint RegisterUserData ()
 
static string Tr (string s, string c=null)
 
 
static string Tr (string s, string c, int n)
 
 
static string TrUtf8 (string s, string c=null)
 
 
static string TrUtf8 (string s, string c, int n)
 
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream arg1, QSizeF arg2)
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream arg1, QPoint arg2)
 
static QDataStream Write (QDataStream arg1, QLineF arg2)
 
static QDataStream Write (QDataStream arg1, QPointF arg2)
 
static QDataStream Write (QDataStream arg1, QChar arg2)
 
static QDataStream Write (QDataStream arg1, QByteArray arg2)
 
static QDataStream Write (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Write (QDataStream arg1, QRectF arg2)
 
static QDataStream Write (QDataStream arg1, QDateTime arg2)
 
static QDataStream Write (QDataStream arg1, QUrl arg2)
 
static QDataStream Write (QDataStream arg1, QTime arg2)
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream arg1, QBitArray arg2)
 
static QDataStream Write (QDataStream arg1, QUuid arg2)
 
static QDataStream Write (QDataStream arg1, QLine arg2)
 
static QDataStream Write (QDataStream arg1, QDate arg2)
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
 
static QDataStream Write (QDataStream arg1, QRect arg2)
 
static QDataStream Write (QDataStream arg1, QSize arg2)
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
 
static QDataStream Read (QDataStream arg1, QChar arg2)
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream arg1, QRect arg2)
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream arg1, QDate arg2)
 
static QDataStream Read (QDataStream arg1, QUrl arg2)
 
static QDataStream Read (QDataStream arg1, QUuid arg2)
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream arg1, QLineF arg2)
 
static QDataStream Read (QDataStream arg1, QRectF arg2)
 
static QDataStream Read (QDataStream arg1, QPointF arg2)
 
static QDataStream Read (QDataStream arg1, QLine arg2)
 
static QDataStream Read (QDataStream arg1, QBitArray arg2)
 
static QDataStream Read (QDataStream arg1, QSize arg2)
 
static QDataStream Read (QDataStream arg1, QDateTime arg2)
 
static QDataStream Read (QDataStream arg1, QTime arg2)
 
static QDataStream Read (QDataStream arg1, QPoint arg2)
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream arg1, QByteArray arg2)
 
static QDataStream Read (QDataStream arg1, QSizeF arg2)
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
 
static double qAcos (double v)
 
static void qAddPostRoutine (System.Action arg1)
 
static string qAppName ()
 
static double qAsin (double v)
 
static double qAtan (double v)
 
static double qAtan2 (double x, double y)
 
static void qBadAlloc ()
 
static int qCeil (double v)
 
static ushort qChecksum (string s, uint len)
 
static QByteArray qCompress (QByteArray data)
 
static QByteArray qCompress (QByteArray data, int compressionLevel=-1)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
 
static double qCos (double v)
 
static double qExp (double v)
 
static double qFabs (double v)
 
static double qFastCos (double x)
 
static double qFastSin (double x)
 
static string qFlagLocation (string method)
 
static int qFloor (double v)
 
static bool qFuzzyCompare (double p1, double p2)
 
static bool qFuzzyCompare (float p1, float p2)
 
static bool qFuzzyIsNull (double d)
 
static bool qFuzzyIsNull (float f)
 
static uint qHash (QBitArray key)
 
static uint qHash (QChar key)
 
static uint qHash (QStringRef key)
 
static uint qHash (QUrl url)
 
static uint qHash (QPersistentModelIndex index)
 
static uint qHash (QByteArray key)
 
static uint qHash (QModelIndex index)
 
static uint qHash (uint key)
 
static uint qHash (sbyte key)
 
static uint qHash (byte key)
 
static uint qHash (short key)
 
static uint qHash (NativeLong key)
 
static uint qHash (ushort key)
 
static uint qHash (long key)
 
static uint qHash (ulong key)
 
static uint qHash (int key)
 
static uint qHash (string key)
 
static uint qHash (NativeULong key)
 
static double qInf ()
 
static Qt.ActionQtMsgTypeString qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1)
 
static int qIntCast (float f)
 
static int qIntCast (double f)
 
static bool qIsFinite (double d)
 
static bool qIsFinite (float f)
 
static bool qIsInf (float f)
 
static bool qIsInf (double d)
 
static bool qIsNaN (float f)
 
static bool qIsNaN (double d)
 
static bool qIsNull (float f)
 
static bool qIsNull (double d)
 
static double qLn (double v)
 
static double qPow (double x, double y)
 
static double qQNaN ()
 
static void qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
 
static void qRemovePostRoutine (System.Action arg1)
 
static int qRound (double d)
 
static long qRound64 (double d)
 
static double qSNaN ()
 
static bool qSharedBuild ()
 
static double qSin (double v)
 
static double qSqrt (double v)
 
static bool qStringComparisonHelper (QStringRef s1, string s2)
 
static double qTan (double v)
 
static QByteArray qUncompress (QByteArray data)
 
static QByteArray qUncompress (Pointer< byte > data, int nbytes)
 
static string qVersion ()
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
 
static bool Qputenv (string varName, QByteArray value)
 
static int Qrand ()
 
static void Qsrand (uint seed)
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
 
static Pointer< sbyte > Qstrdup (string arg1)
 
static int Qstricmp (string arg1, string arg2)
 
static uint Qstrlen (string str)
 
static int Qstrncmp (string str1, string str2, uint len)
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
 
static int Qstrnicmp (string arg1, string arg2, uint len)
 
static uint Qstrnlen (string str, uint maxlen)
 
static string QtTrId (string id, int n=-1)
 

Protected Member Functions

 QGLWidget (System.Type dummy)
 
new int FontDisplayListBase (QFont fnt, int listBase=2000)
 
 
virtual void GlDraw ()
 
 
virtual void GlInit ()
 
 
virtual void InitializeGL ()
 
 
virtual void InitializeOverlayGL ()
 
 
override void OnPaintEvent (QPaintEvent arg1)
 
 
virtual void PaintGL ()
 
 
virtual void PaintOverlayGL ()
 
 
override void OnResizeEvent (QResizeEvent arg1)
 
 
virtual void ResizeGL (int w, int h)
 
 
virtual void ResizeOverlayGL (int w, int h)
 
 
- Protected Member Functions inherited from QtGui.QWidget
 QWidget (System.Type dummy)
 
virtual void OnActionEvent (QActionEvent arg1)
 
 
virtual void OnChangeEvent (QEvent arg1)
 
 
virtual void OnCloseEvent (QCloseEvent arg1)
 
 
virtual void OnContextMenuEvent (QContextMenuEvent arg1)
 
 
new void Create ()
 
 
new void Create (NativeULong arg1, bool initializeWindow=true, bool destroyOldWindow=true)
 
 
new void OnCustomContextMenuRequested (QPoint pos)
 
 
new void Destroy (bool destroyWindow=true, bool destroySubWindows=true)
 
 
virtual void OnDragEnterEvent (QDragEnterEvent arg1)
 
 
virtual void OnDragLeaveEvent (QDragLeaveEvent arg1)
 
 
virtual void OnDragMoveEvent (QDragMoveEvent arg1)
 
 
virtual void OnDropEvent (QDropEvent arg1)
 
 
virtual void EnabledChange (bool arg1)
 
virtual void OnEnterEvent (QEvent arg1)
 
 
virtual void OnFocusInEvent (QFocusEvent arg1)
 
 
new bool FocusNextChild ()
 
 
virtual bool FocusNextPrevChild (bool next)
 
 
virtual void OnFocusOutEvent (QFocusEvent arg1)
 
 
new bool FocusPreviousChild ()
 
 
virtual void FontChange (QFont arg1)
 
virtual void OnHideEvent (QHideEvent arg1)
 
 
virtual void OnInputMethodEvent (QInputMethodEvent arg1)
 
 
virtual void OnKeyPressEvent (QKeyEvent arg1)
 
 
virtual void OnKeyReleaseEvent (QKeyEvent arg1)
 
 
virtual void LanguageChange ()
 
 
virtual void OnLeaveEvent (QEvent arg1)
 
 
virtual int Metric (QPaintDevice.PaintDeviceMetric arg1)
 
 
virtual void OnMouseDoubleClickEvent (QMouseEvent arg1)
 
 
virtual void OnMouseMoveEvent (QMouseEvent arg1)
 
 
virtual void OnMousePressEvent (QMouseEvent arg1)
 
 
virtual void OnMouseReleaseEvent (QMouseEvent arg1)
 
 
virtual void OnMoveEvent (QMoveEvent arg1)
 
 
virtual void PaletteChange (QPalette arg1)
 
new void ResetInputContext ()
 
 
virtual void OnShowEvent (QShowEvent arg1)
 
 
virtual void StyleChange (QStyle arg1)
 
virtual void OnTabletEvent (QTabletEvent arg1)
 
 
new void UpdateMicroFocus ()
 
 
virtual void OnWheelEvent (QWheelEvent arg1)
 
 
virtual void WindowActivationChange (bool arg1)
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent arg1)
 
 
virtual void ConnectNotify (string signal)
 
 
virtual void OnCustomEvent (QEvent arg1)
 
 
new void OnDestroyed (QObject arg1=null)
 
 
virtual void DisconnectNotify (string signal)
 
 
new int Receivers (string signal)
 
 
new QObject Sender ()
 
 
new int SenderSignalIndex ()
 
 
virtual void OnTimerEvent (QTimerEvent arg1)
 
 

Properties

new bool AutoBufferSwap [get, set]
 
 
new QGLColormap Colormap [get, set]
 
 
new QGLFormat Format [get, set]
 
 
new QGLContext Context [get]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQGLWidgetSignals Emit [get]
 
- Properties inherited from QtGui.QWidget
virtual EventHandler
< QEventArgs< QActionEvent > > 
ActionEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
ChangeEvent
 
 
virtual EventHandler
< QEventArgs< QCloseEvent > > 
CloseEvent
 
 
virtual EventHandler
< QEventArgs
< QContextMenuEvent > > 
ContextMenuEvent
 
 
virtual EventHandler
< QEventArgs< QDragEnterEvent > > 
DragEnterEvent
 
 
virtual EventHandler
< QEventArgs< QDragLeaveEvent > > 
DragLeaveEvent
 
 
virtual EventHandler
< QEventArgs< QDragMoveEvent > > 
DragMoveEvent
 
 
virtual EventHandler
< QEventArgs< QDropEvent > > 
DropEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
EnterEvent
 
 
virtual EventHandler
< QEventArgs< QFocusEvent > > 
FocusInEvent
 
 
virtual EventHandler
< QEventArgs< QFocusEvent > > 
FocusOutEvent
 
 
virtual EventHandler
< QEventArgs< QHideEvent > > 
HideEvent
 
 
virtual EventHandler
< QEventArgs
< QInputMethodEvent > > 
InputMethodEvent
 
 
virtual EventHandler
< QEventArgs< QKeyEvent > > 
KeyPressEvent
 
 
virtual EventHandler
< QEventArgs< QKeyEvent > > 
KeyReleaseEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
LeaveEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseDoubleClickEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseMoveEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MousePressEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseReleaseEvent
 
 
virtual EventHandler
< QEventArgs< QMoveEvent > > 
MoveEvent
 
 
virtual EventHandler
< QEventArgs< QPaintEvent > > 
PaintEvent
 
 
virtual EventHandler
< QEventArgs< QResizeEvent > > 
ResizeEvent
 
 
virtual EventHandler
< QEventArgs< QShowEvent > > 
ShowEvent
 
 
virtual EventHandler
< QEventArgs< QTabletEvent > > 
TabletEvent
 
 
virtual EventHandler
< QEventArgs< QWheelEvent > > 
WheelEvent
 
 
Slot< QPointCustomContextMenuRequested
 
 
new QPalette.ColorRole BackgroundRole [get, set]
 
 
new QMargins ContentsMargins [get, set]
 
 
new QWidget FocusProxy [get, set]
 
 
new QPalette.ColorRole ForegroundRole [get, set]
 
 
new QGraphicsEffect GraphicsEffect [get, set]
 
 
new QInputContext InputContext [get, set]
 
 
new QLayout Layout [get, set]
 
 
new QRegion Mask [get, set]
 
 
new QStyle Style [get, set]
 
 
new Qt.WindowType WindowFlags [get, set]
 
new string WindowRole [get, set]
 
 
new Qt.WindowState WindowState [get, set]
 
 
new bool Modal [get]
 
 
new Qt.WindowModality WindowModality [get, set]
 
 
new bool Enabled [get, set]
 
 
new QRect Geometry [get, set]
 
 
new QRect FrameGeometry [get]
 
 
new QRect NormalGeometry [get]
 
 
new int X [get]
 
 
new int Y [get]
 
 
new QPoint Pos [get, set]
 
 
new QSize FrameSize [get]
 
 
new QSize Size [get, set]
 
 
new int Width [get]
 
 
new int Height [get]
 
 
new QRect Rect [get]
 
 
new QRect ChildrenRect [get]
 
 
new QRegion ChildrenRegion [get]
 
 
new QSizePolicy SizePolicy [get, set]
 
 
new QSize MinimumSize [get, set]
 
 
new QSize MaximumSize [get, set]
 
 
new int MinimumWidth [get, set]
 
 
new int MinimumHeight [get, set]
 
 
new int MaximumWidth [get, set]
 
 
new int MaximumHeight [get, set]
 
 
new QSize SizeIncrement [get, set]
 
 
new QSize BaseSize [get, set]
 
 
new QPalette Palette [get, set]
 
 
new QFont Font [get, set]
 
 
new QCursor Cursor [get, set]
 
 
new bool MouseTracking [get, set]
 
 
new bool IsActiveWindow [get]
 
 
new Qt.FocusPolicy FocusPolicy [get, set]
 
 
new bool Focus [get]
 
 
new Qt.ContextMenuPolicy ContextMenuPolicy [get, set]
 
 
new bool UpdatesEnabled [get, set]
 
 
new bool Visible [get, set]
 
 
new bool Minimized [get]
 
 
new bool Maximized [get]
 
 
new bool FullScreen [get]
 
 
new bool AcceptDrops [get, set]
 
 
new string WindowTitle [get, set]
 
 
new QIcon WindowIcon [get, set]
 
 
new string WindowIconText [get, set]
 
 
new double WindowOpacity [get, set]
 
 
new bool WindowModified [get, set]
 
 
new string ToolTip [get, set]
 
 
new string StatusTip [get, set]
 
 
new string WhatsThis [get, set]
 
 
new string AccessibleName [get, set]
 
 
new string AccessibleDescription [get, set]
 
 
new Qt.LayoutDirection LayoutDirection [get, set]
 
 
new bool AutoFillBackground [get, set]
 
 
new string StyleSheet [get, set]
 
 
new QLocale Locale [get, set]
 
 
new string WindowFilePath [get, set]
 
 
new Qt.InputMethodHint InputMethodHints [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new ushort Painters [get, set]
 
new IQWidgetSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
 
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
 
 
Slot< QObjectDestroyedQObject
 
Slot Destroyed
 
 
new QObject Parent [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 

Additional Inherited Members

- Public Types inherited from QtGui.QWidget
enum  RenderFlag { DrawChildren = 2, DrawWindowBackground = 1, IgnoreMask = 4 }
  More...
 
- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QGLWidget class is a widget for rendering OpenGL graphics.

QGLWidget provides functionality for displaying OpenGL graphics integrated into a Qt application. It is very simple to use. You inherit from it and use the subclass like any other QWidget, except that you have the choice between using QPainter and standard OpenGL rendering commands.

QGLWidget provides three convenient virtual functions that you can reimplement in your subclass to perform the typical OpenGL tasks:

paintGL() - Renders the OpenGL scene. Gets called whenever the widget needs to be updated.

resizeGL() - Sets up the OpenGL viewport, projection, etc. Gets called whenever the widget has been resized (and also when it is shown for the first time because all newly created widgets get a resize event automatically).

initializeGL() - Sets up the OpenGL rendering context, defines display lists, etc. Gets called once before the first time resizeGL() or paintGL() is called.

Here is a rough outline of how a QGLWidget subclass might look:

class MyGLDrawer : public QGLWidget

{

Q_OBJECT // must include this if you use Qt signals/slots

public:

MyGLDrawer(QWidget *parent)

: QGLWidget(parent) {}

protected:

void initializeGL()

{

// Set up the rendering context, define display lists etc.:

...

glClearColor(0.0, 0.0, 0.0, 0.0);

glEnable(GL_DEPTH_TEST);

...

}

void resizeGL(int w, int h)

{

// setup viewport, projection etc.:

glViewport(0, 0, (GLint)w, (GLint)h);

...

glFrustum(...);

...

}

void paintGL()

{

// draw the scene:

...

glRotatef(...);

glMaterialfv(...);

glBegin(GL_QUADS);

glVertex3f(...);

glVertex3f(...);

...

glEnd();

...

}

};

If you need to trigger a repaint from places other than paintGL() (a typical example is when using timers to animate scenes), you should call the widget's updateGL() function.

Your widget's OpenGL rendering context is made current when paintGL(), resizeGL(), or initializeGL() is called. If you need to call the standard OpenGL API functions from other places (e.g. in your widget's constructor or in your own paint functions), you must call makeCurrent() first.

QGLWidget provides functions for requesting a new display format and you can also create widgets with customized rendering contexts.

You can also share OpenGL display lists between QGLWidget objects (see the documentation of the QGLWidget constructors for details).

Note that under Windows, the QGLContext belonging to a QGLWidget has to be recreated when the QGLWidget is reparented. This is necessary due to limitations on the Windows platform. This will most likely cause problems for users that have subclassed and installed their own QGLContext on a QGLWidget. It is possible to work around this issue by putting the QGLWidget inside a dummy widget and then reparenting the dummy widget, instead of the QGLWidget. This will side-step the issue altogether, and is what we recommend for users that need this kind of functionality.

On Mac OS X, when Qt is built with Cocoa support, a QGLWidget can't have any sibling widgets placed ontop of itself. This is due to limitations in the Cocoa API and is not supported by Apple.

Overlays

The QGLWidget creates a GL overlay context in addition to the normal context if overlays are supported by the underlying system.

If you want to use overlays, you specify it in the format. (Note: Overlay must be requested in the format passed to the QGLWidget constructor.) Your GL widget should also implement some or all of these virtual methods:

paintOverlayGL()

resizeOverlayGL()

initializeOverlayGL()

These methods work in the same way as the normal paintGL() etc. functions, except that they will be called when the overlay context is made current. You can explicitly make the overlay context current by using makeOverlayCurrent(), and you can access the overlay context directly (e.g. to ask for its transparent color) by calling overlayContext().

On X servers in which the default visual is in an overlay plane, non-GL Qt windows can also be used for overlays.

Painting Techniques

As described above, subclass QGLWidget to render pure 3D content in the following way:

Reimplement the QGLWidget::initializeGL() and QGLWidget::resizeGL() to set up the OpenGL state and provide a perspective transformation.

Reimplement QGLWidget::paintGL() to paint the 3D scene, calling only OpenGL functions to draw on the widget.

It is also possible to draw 2D graphics onto a QGLWidget subclass, it is necessary to reimplement QGLWidget::paintEvent() and do the following:

Construct a QPainter object.

Initialize it for use on the widget with the QPainter::begin() function.

Draw primitives using QPainter's member functions.

Call QPainter::end() to finish painting.

Overpainting 2D content on top of 3D content takes a little more effort. One approach to doing this is shown in the Overpainting example.

Threading

As of Qt version 4.8, support for doing threaded GL rendering has been improved. There are three scenarios that we currently support:

1. Buffer swapping in a thread.Swapping buffers in a double buffered context may be a synchronous, locking call that may be a costly operation in some GL implementations. Especially so on embedded devices. It's not optimal to have the CPU idling while the GPU is doing a buffer swap. In those cases it is possible to do the rendering in the main thread and do the actual buffer swap in a separate thread. This can be done with the following steps:

1. Call doneCurrent() in the main thread when the rendering is finished.

2. Notify the swapping thread that it can grab the context.

3. Make the rendering context current in the swapping thread with makeCurrent() and then call swapBuffers().

4. Call doneCurrent() in the swapping thread and notify the main thread that swapping is done.

Doing this will free up the main thread so that it can continue with, for example, handling UI events or network requests. Even if there is a context swap involved, it may be preferable compared to having the main thread wait while the GPU finishes the swap operation. Note that this is highly implementation dependent.

2. Texture uploading in a thread.Doing texture uploads in a thread may be very useful for applications handling large amounts of images that needs to be displayed, like for instance a photo gallery application. This is supported in Qt through the existing bindTexture() API. A simple way of doing this is to create two sharing QGLWidgets. One is made current in the main GUI thread, while the other is made current in the texture upload thread. The widget in the uploading thread is never shown, it is only used for sharing textures with the main thread. For each texture that is bound via bindTexture(), notify the main thread so that it can start using the texture.

3. Using QPainter to draw into a QGLWidget in a thread.In Qt 4.8, it is possible to draw into a QGLWidget using a QPainter in a separate thread. Note that this is also possible for QGLPixelBuffers and QGLFramebufferObjects. Since this is only supported in the GL 2 paint engine, OpenGL 2.0 or OpenGL ES 2.0 is required.

QGLWidgets can only be created in the main GUI thread. This means a call to doneCurrent() is necessary to release the GL context from the main thread, before the widget can be drawn into by another thread. Also, the main GUI thread will dispatch resize and paint events to a QGLWidget when the widget is resized, or parts of it becomes exposed or needs redrawing. It is therefore necessary to handle those events because the default implementations inside QGLWidget will try to make the QGLWidget's context current, which again will interfere with any threads rendering into the widget. Reimplement QGLWidget::paintEvent() and QGLWidget::resizeEvent() to notify the rendering thread that a resize or update is necessary, and be careful not to call the base class implementation. If you are rendering an animation, it might not be necessary to handle the paint event at all since the rendering thread is doing regular updates. Then it would be enough to reimplement QGLWidget::paintEvent() to do nothing.

As a general rule when doing threaded rendering: be aware that binding and releasing contexts in different threads have to be synchronized by the user. A GL rendering context can only be current in one thread at any time. If you try to open a QPainter on a QGLWidget and the widget's rendering context is current in another thread, it will fail.

Note that under X11 it is necessary to set the Qt::AA_X11InitThreads application attribute to make the X11 library and GLX calls thread safe, otherwise the above scenarios will fail.

In addition to this, rendering using raw GL calls in a separate thread is supported.

OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.

See also QGLPixelBuffer, Hello GL Example, 2D Painting Example, Overpainting Example, and Grabber Example.

Constructor & Destructor Documentation

QtOpenGL.QGLWidget.QGLWidget ( System.Type  dummy)
protected
QtOpenGL.QGLWidget.QGLWidget ( QGLContext  context,
QWidget  parent = null,
QGLWidget  shareWidget = null,
Qt.WindowType  f = 0 
)

Constructs an OpenGL widget with a parent widget.

The default format is used. The widget will be invalid if the system has no OpenGL support.

The parent and widget flag, f, arguments are passed to the QWidget constructor.

If shareWidget is a valid QGLWidget, this widget will share OpenGL display lists and texture objects with shareWidget. But if shareWidget and this widget have different formats, sharing might not be possible. You can check whether sharing is in effect by calling isSharing().

The initialization of OpenGL rendering state, etc. should be done by overriding the initializeGL() function, rather than in the constructor of your QGLWidget subclass.

See also QGLFormat::defaultFormat() and Textures Example.

QtOpenGL.QGLWidget.QGLWidget ( QGLFormat  format,
QWidget  parent = null,
QGLWidget  shareWidget = null,
Qt.WindowType  f = 0 
)

Constructs an OpenGL widget with a parent widget.

The default format is used. The widget will be invalid if the system has no OpenGL support.

The parent and widget flag, f, arguments are passed to the QWidget constructor.

If shareWidget is a valid QGLWidget, this widget will share OpenGL display lists and texture objects with shareWidget. But if shareWidget and this widget have different formats, sharing might not be possible. You can check whether sharing is in effect by calling isSharing().

The initialization of OpenGL rendering state, etc. should be done by overriding the initializeGL() function, rather than in the constructor of your QGLWidget subclass.

See also QGLFormat::defaultFormat() and Textures Example.

QtOpenGL.QGLWidget.QGLWidget ( QWidget  parent = null,
QGLWidget  shareWidget = null,
Qt.WindowType  f = 0 
)

Constructs an OpenGL widget with a parent widget.

The default format is used. The widget will be invalid if the system has no OpenGL support.

The parent and widget flag, f, arguments are passed to the QWidget constructor.

If shareWidget is a valid QGLWidget, this widget will share OpenGL display lists and texture objects with shareWidget. But if shareWidget and this widget have different formats, sharing might not be possible. You can check whether sharing is in effect by calling isSharing().

The initialization of OpenGL rendering state, etc. should be done by overriding the initializeGL() function, rather than in the constructor of your QGLWidget subclass.

See also QGLFormat::defaultFormat() and Textures Example.

Member Function Documentation

new uint QtOpenGL.QGLWidget.BindTexture ( QImage  image)

Calls QGLContext:::bindTexture(image, target, format) on the currently set context.

See also deleteTexture().

new uint QtOpenGL.QGLWidget.BindTexture ( QPixmap  pixmap)

Calls QGLContext:::bindTexture(image, target, format) on the currently set context.

See also deleteTexture().

new uint QtOpenGL.QGLWidget.BindTexture ( QImage  image,
int  target 
)

Calls QGLContext:::bindTexture(image, target, format) on the currently set context.

See also deleteTexture().

new uint QtOpenGL.QGLWidget.BindTexture ( QPixmap  pixmap,
int  target 
)

Calls QGLContext:::bindTexture(image, target, format) on the currently set context.

See also deleteTexture().

new uint QtOpenGL.QGLWidget.BindTexture ( QImage  image,
int  target,
int  format 
)

Calls QGLContext:::bindTexture(image, target, format) on the currently set context.

See also deleteTexture().

new uint QtOpenGL.QGLWidget.BindTexture ( QPixmap  pixmap,
int  target,
int  format 
)

Calls QGLContext:::bindTexture(pixmap, target, format) on the currently set context.

See also deleteTexture().

new uint QtOpenGL.QGLWidget.BindTexture ( QImage  image,
int  target,
int  format,
QGLContext.BindOption  options 
)

Calls QGLContext:::bindTexture(image, target, format) on the currently set context.

See also deleteTexture().

new uint QtOpenGL.QGLWidget.BindTexture ( QPixmap  pixmap,
int  target,
int  format,
QGLContext.BindOption  options 
)

Calls QGLContext:::bindTexture(image, target, format) on the currently set context.

See also deleteTexture().

new uint QtOpenGL.QGLWidget.BindTexture ( string  fileName)

This is an overloaded function.

Calls QGLContext::bindTexture(fileName) on the currently set context.

See also deleteTexture().

static QImage QtOpenGL.QGLWidget.ConvertToGLFormat ( QImage  img)
static

Converts the image img into the unnamed format expected by OpenGL functions such as glTexImage2D(). The returned image is not usable as a QImage, but QImage::width(), QImage::height() and QImage::bits() may be used with OpenGL. The GL format used is GL_RGBA.

override void QtOpenGL.QGLWidget.CreateProxy ( )
virtual

Reimplemented from QtGui.QWidget.

new void QtOpenGL.QGLWidget.DeleteTexture ( uint  tx_id)

Calls QGLContext::deleteTexture(id) on the currently set context.

See also bindTexture().

new void QtOpenGL.QGLWidget.Dispose ( )
new void QtOpenGL.QGLWidget.DoneCurrent ( )

Makes no GL context the current context. Normally, you do not need to call this function; QGLContext calls it as necessary. However, it may be useful in multithreaded environments.

new bool QtOpenGL.QGLWidget.DoubleBuffer ( )

Returns true if the contained GL rendering context has double buffering; otherwise returns false.

See also QGLFormat::doubleBuffer().

new void QtOpenGL.QGLWidget.DrawTexture ( QRectF  target,
uint  textureId 
)

Calls the corresponding QGLContext::drawTexture() with target, textureId, and textureTarget for this widget's context.

This function was introduced in Qt 4.4.

new void QtOpenGL.QGLWidget.DrawTexture ( QPointF  point,
uint  textureId 
)

Calls the corresponding QGLContext::drawTexture() with target, textureId, and textureTarget for this widget's context.

This function was introduced in Qt 4.4.

new void QtOpenGL.QGLWidget.DrawTexture ( QRectF  target,
uint  textureId,
int  textureTarget 
)

Calls the corresponding QGLContext::drawTexture() with target, textureId, and textureTarget for this widget's context.

This function was introduced in Qt 4.4.

new void QtOpenGL.QGLWidget.DrawTexture ( QPointF  point,
uint  textureId,
int  textureTarget 
)

Calls the corresponding QGLContext::drawTexture() with point, textureId, and textureTarget for this widget's context.

This function was introduced in Qt 4.4.

new int QtOpenGL.QGLWidget.FontDisplayListBase ( QFont  fnt,
int  listBase = 2000 
)
protected

Returns the value of the first display list that is generated for the characters in the given font. listBase indicates the base value used when generating the display lists for the font. The default value is 2000.

Note: This function is not supported on OpenGL/ES systems.

virtual void QtOpenGL.QGLWidget.GlDraw ( )
protectedvirtual

Executes the virtual function paintGL().

The widget's rendering context will become the current context and initializeGL() will be called if it hasn't already been called.

virtual void QtOpenGL.QGLWidget.GlInit ( )
protectedvirtual

Initializes OpenGL for this widget's context. Calls the virtual function initializeGL().

new QImage QtOpenGL.QGLWidget.GrabFrameBuffer ( bool  withAlpha = false)

Returns an image of the frame buffer. If withAlpha is true the alpha channel is included.

Depending on your hardware, you can explicitly select which color buffer to grab with a glReadBuffer() call before calling this function.

virtual void QtOpenGL.QGLWidget.InitializeGL ( )
protectedvirtual

This virtual function is called once before the first call to paintGL() or resizeGL(), and then once whenever the widget has been assigned a new QGLContext. Reimplement it in a subclass.

This function should set up any required OpenGL context rendering flags, defining display lists, etc.

There is no need to call makeCurrent() because this has already been done when this function is called.

virtual void QtOpenGL.QGLWidget.InitializeOverlayGL ( )
protectedvirtual

This virtual function is used in the same manner as initializeGL() except that it operates on the widget's overlay context instead of the widget's main context. This means that initializeOverlayGL() is called once before the first call to paintOverlayGL() or resizeOverlayGL(). Reimplement it in a subclass.

This function should set up any required OpenGL context rendering flags, defining display lists, etc. for the overlay context.

There is no need to call makeOverlayCurrent() because this has already been done when this function is called.

new bool QtOpenGL.QGLWidget.IsSharing ( )

Returns true if this widget's GL context is shared with another GL context, otherwise false is returned. Context sharing might not be possible if the widgets use different formats.

See also format().

new bool QtOpenGL.QGLWidget.IsValid ( )

Returns true if the widget has a valid GL rendering context; otherwise returns false. A widget will be invalid if the system has no OpenGL support.

new void QtOpenGL.QGLWidget.MakeCurrent ( )

Makes this widget the current widget for OpenGL operations, i.e. makes the widget's rendering context the current OpenGL rendering context.

new void QtOpenGL.QGLWidget.MakeOverlayCurrent ( )

Makes the overlay context of this widget current. Use this if you need to issue OpenGL commands to the overlay context outside of initializeOverlayGL(), resizeOverlayGL(), and paintOverlayGL().

Does nothing if this widget has no overlay.

See also makeCurrent().

override bool QtOpenGL.QGLWidget.OnEvent ( QEvent  arg1)
virtual

Reimplemented from QObject::event().

Reimplemented from QtGui.QWidget.

override void QtOpenGL.QGLWidget.OnPaintEvent ( QPaintEvent  arg1)
protectedvirtual

Reimplemented from QWidget::paintEvent().

Handles paint events passed in the event parameter. Will cause the virtual paintGL() function to be called.

The widget's rendering context will become the current context and initializeGL() will be called if it hasn't already been called.

Reimplemented from QtGui.QWidget.

override void QtOpenGL.QGLWidget.OnResizeEvent ( QResizeEvent  arg1)
protectedvirtual

Reimplemented from QWidget::resizeEvent().

Handles resize events that are passed in the event parameter. Calls the virtual function resizeGL().

Reimplemented from QtGui.QWidget.

new QGLContext QtOpenGL.QGLWidget.OverlayContext ( )

Returns the overlay context of this widget, or 0 if this widget has no overlay.

See also context().

override QPaintEngine QtOpenGL.QGLWidget.PaintEngine ( )
virtual

Reimplemented from QPaintDevice::paintEngine().

Returns the widget's paint engine.

Note that this function should not be called explicitly by the user, since it's meant for reimplementation purposes only. The function is called by Qt internally, and the default implementation may not always return a valid pointer.

Reimplemented from QtGui.QWidget.

virtual void QtOpenGL.QGLWidget.PaintGL ( )
protectedvirtual

This virtual function is called whenever the widget needs to be painted. Reimplement it in a subclass.

There is no need to call makeCurrent() because this has already been done when this function is called.

virtual void QtOpenGL.QGLWidget.PaintOverlayGL ( )
protectedvirtual

This virtual function is used in the same manner as paintGL() except that it operates on the widget's overlay context instead of the widget's main context. This means that paintOverlayGL() is called whenever the widget's overlay needs to be painted. Reimplement it in a subclass.

There is no need to call makeOverlayCurrent() because this has already been done when this function is called.

new void QtOpenGL.QGLWidget.QglClearColor ( QColor  c)

Convenience function for specifying the clearing color to OpenGL. Calls glClearColor (in RGBA mode) or glClearIndex (in color-index mode) with the color c. Applies to this widgets GL context.

See also qglColor(), QGLContext::currentContext(), and QColor.

new void QtOpenGL.QGLWidget.QglColor ( QColor  c)

Convenience function for specifying a drawing color to OpenGL. Calls glColor4 (in RGBA mode) or glIndex (in color-index mode) with the color c. Applies to this widgets GL context.

Note: This function is not supported on OpenGL/ES 2.0 systems.

See also qglClearColor(), QGLContext::currentContext(), and QColor.

new QPixmap QtOpenGL.QGLWidget.RenderPixmap ( int  w = 0,
int  h = 0,
bool  useContext = false 
)

Renders the current scene on a pixmap and returns the pixmap.

You can use this method on both visible and invisible QGLWidget objects.

This method will create a pixmap and a temporary QGLContext to render on the pixmap. It will then call initializeGL(), resizeGL(), and paintGL() on this context. Finally, the widget's original GL context is restored.

The size of the pixmap will be w pixels wide and h pixels high unless one of these parameters is 0 (the default), in which case the pixmap will have the same size as the widget.

If useContext is true, this method will try to be more efficient by using the existing GL context to render the pixmap. The default is false. Only use true if you understand the risks. Note that under Windows a temporary context has to be created and usage of the useContext parameter is not supported.

Overlays are not rendered onto the pixmap.

If the GL rendering context and the desktop have different bit depths, the result will most likely look surprising.

Note that the creation of display lists, modifications of the view frustum etc. should be done from within initializeGL(). If this is not done, the temporary QGLContext will not be initialized properly, and the rendered pixmap may be incomplete/corrupted.

new void QtOpenGL.QGLWidget.RenderText ( int  x,
int  y,
string  str 
)

Renders the string str into the GL context of this widget.

x and y are specified in window coordinates, with the origin in the upper left-hand corner of the window. If font is not specified, the currently set application font will be used to render the string. To change the color of the rendered text you can use the glColor() call (or the qglColor() convenience function), just before the renderText() call.

The listBase parameter is obsolete and will be removed in a future version of Qt.

Note: This function clears the stencil buffer.

Note: This function is not supported on OpenGL/ES systems.

Note: This function temporarily disables depth-testing when the text is drawn.

Note: This function can only be used inside a QPainter::beginNativePainting()/QPainter::endNativePainting() block if the default OpenGL paint engine is QPaintEngine::OpenGL. To make QPaintEngine::OpenGL the default GL engine, call QGL::setPreferredPaintEngine(QPaintEngine::OpenGL) before the QApplication constructor.

Overpaint with QPainter::drawText() instead.

new void QtOpenGL.QGLWidget.RenderText ( int  x,
int  y,
string  str,
QFont  fnt,
int  listBase = 2000 
)

Renders the string str into the GL context of this widget.

x and y are specified in window coordinates, with the origin in the upper left-hand corner of the window. If font is not specified, the currently set application font will be used to render the string. To change the color of the rendered text you can use the glColor() call (or the qglColor() convenience function), just before the renderText() call.

The listBase parameter is obsolete and will be removed in a future version of Qt.

Note: This function clears the stencil buffer.

Note: This function is not supported on OpenGL/ES systems.

Note: This function temporarily disables depth-testing when the text is drawn.

Note: This function can only be used inside a QPainter::beginNativePainting()/QPainter::endNativePainting() block if the default OpenGL paint engine is QPaintEngine::OpenGL. To make QPaintEngine::OpenGL the default GL engine, call QGL::setPreferredPaintEngine(QPaintEngine::OpenGL) before the QApplication constructor.

Overpaint with QPainter::drawText() instead.

new void QtOpenGL.QGLWidget.RenderText ( double  x,
double  y,
double  z,
string  str 
)

Renders the string str into the GL context of this widget.

x and y are specified in window coordinates, with the origin in the upper left-hand corner of the window. If font is not specified, the currently set application font will be used to render the string. To change the color of the rendered text you can use the glColor() call (or the qglColor() convenience function), just before the renderText() call.

The listBase parameter is obsolete and will be removed in a future version of Qt.

Note: This function clears the stencil buffer.

Note: This function is not supported on OpenGL/ES systems.

Note: This function temporarily disables depth-testing when the text is drawn.

Note: This function can only be used inside a QPainter::beginNativePainting()/QPainter::endNativePainting() block if the default OpenGL paint engine is QPaintEngine::OpenGL. To make QPaintEngine::OpenGL the default GL engine, call QGL::setPreferredPaintEngine(QPaintEngine::OpenGL) before the QApplication constructor.

Overpaint with QPainter::drawText() instead.

new void QtOpenGL.QGLWidget.RenderText ( double  x,
double  y,
double  z,
string  str,
QFont  fnt,
int  listBase = 2000 
)

Renders the string str into the GL context of this widget.

x and y are specified in window coordinates, with the origin in the upper left-hand corner of the window. If font is not specified, the currently set application font will be used to render the string. To change the color of the rendered text you can use the glColor() call (or the qglColor() convenience function), just before the renderText() call.

The listBase parameter is obsolete and will be removed in a future version of Qt.

Note: This function clears the stencil buffer.

Note: This function is not supported on OpenGL/ES systems.

Note: This function temporarily disables depth-testing when the text is drawn.

Note: This function can only be used inside a QPainter::beginNativePainting()/QPainter::endNativePainting() block if the default OpenGL paint engine is QPaintEngine::OpenGL. To make QPaintEngine::OpenGL the default GL engine, call QGL::setPreferredPaintEngine(QPaintEngine::OpenGL) before the QApplication constructor.

Overpaint with QPainter::drawText() instead.

virtual void QtOpenGL.QGLWidget.ResizeGL ( int  w,
int  h 
)
protectedvirtual

This virtual function is called whenever the widget has been resized. The new size is passed in width and height. Reimplement it in a subclass.

There is no need to call makeCurrent() because this has already been done when this function is called.

virtual void QtOpenGL.QGLWidget.ResizeOverlayGL ( int  w,
int  h 
)
protectedvirtual

This virtual function is used in the same manner as paintGL() except that it operates on the widget's overlay context instead of the widget's main context. This means that resizeOverlayGL() is called whenever the widget has been resized. The new size is passed in width and height. Reimplement it in a subclass.

There is no need to call makeOverlayCurrent() because this has already been done when this function is called.

new void QtOpenGL.QGLWidget.SetContext ( QGLContext  context,
QGLContext  shareContext = null,
bool  deleteOldContext = true 
)
new void QtOpenGL.QGLWidget.SetMouseTracking ( bool  enable)

If enable is true then mouse tracking is enabled; otherwise it is disabled.

new void QtOpenGL.QGLWidget.SwapBuffers ( )

Swaps the screen contents with an off-screen buffer. This only works if the widget's format specifies double buffer mode.

Normally, there is no need to explicitly call this function because it is done automatically after each widget repaint, i.e. each time after paintGL() has been executed.

See also doubleBuffer(), setAutoBufferSwap(), and QGLFormat::setDoubleBuffer().

static string QtOpenGL.QGLWidget.Tr ( string  s,
string  c = null 
)
static
static string QtOpenGL.QGLWidget.Tr ( string  s,
string  c,
int  n 
)
static
static string QtOpenGL.QGLWidget.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtOpenGL.QGLWidget.TrUtf8 ( string  s,
string  c,
int  n 
)
static
virtual void QtOpenGL.QGLWidget.UpdateGL ( )
virtual

Updates the widget by calling glDraw().

virtual void QtOpenGL.QGLWidget.UpdateOverlayGL ( )
virtual

Updates the widget's overlay (if any). Will cause the virtual function paintOverlayGL() to be executed.

The widget's rendering context will become the current context and initializeGL() will be called if it hasn't already been called.

Property Documentation

new bool QtOpenGL.QGLWidget.AutoBufferSwap
getsetprotected

Returns true if the widget is doing automatic GL buffer swapping; otherwise returns false.

If on is true automatic GL buffer swapping is switched on; otherwise it is switched off.

If on is true and the widget is using a double-buffered format, the background and foreground GL buffers will automatically be swapped after each paintGL() call.

The buffer auto-swapping is on by default.

new QGLColormap QtOpenGL.QGLWidget.Colormap
getset

Returns the colormap for this widget.

Usually it is only top-level widgets that can have different colormaps installed. Asking for the colormap of a child widget will return the colormap for the child's top-level widget.

If no colormap has been set for this widget, the QGLColormap returned will be empty.

Set the colormap for this widget to cmap. Usually it is only top-level widgets that can have colormaps installed.

new QGLContext QtOpenGL.QGLWidget.Context
get

Returns the context of this widget.

It is possible that the context is not valid (see isValid()), for example, if the underlying hardware does not support the format attributes that were requested.

new IQGLWidgetSignals QtOpenGL.QGLWidget.Emit
getprotected
new QGLFormat QtOpenGL.QGLWidget.Format
getset

Returns the format of the contained GL rendering context.

Sets a new format for this widget.

If the underlying OpenGL/Window system cannot satisfy all the features requested in format, the nearest subset of features will be used. After creation, the format() method will return the actual rendering context format obtained.

The widget will be assigned a new QGLContext, and the initializeGL() function will be executed for this new context before the first resizeGL() or paintGL().

This method will try to keep display list and texture object sharing in effect with other QGLWidget objects, but changing the format might make sharing impossible. Use isSharing() to see if sharing is still in effect.

new QMetaObject QtOpenGL.QGLWidget.StaticMetaObject
staticget