View Full Version : Help please!

5th December 2007, 14:07
I created a GLWidget and I want to get its handle to use it, can any body tell me how to get its handle?!!!

5th December 2007, 14:16
What do you mean by "its handle" ?

5th December 2007, 15:18
I want vtk to draw on this widget, so i need a handle to give it

5th December 2007, 15:51
Again: What is this handle? datatype-wise. Are you talking about the win32 window handle ....
Some more detailed information please. Otherwiese we cannot help.

5th December 2007, 16:07
Yes, I mean win32 handle for the GLWidget, so that i can pass it to the VTK library to draw on

5th December 2007, 16:21
#if defined(Q_WS_WIN)
HDC getDC() const;
void releaseDC(HDC) const;

You can get the device context from a QWidget using the functions above.

Note on the side: You don't need a QGLWidget. QWidget will be enough if you let vtk handle the painting.

5th December 2007, 16:29
So HDC will be the handle of the window?
thanks for your help

5th December 2007, 16:38
This is the handle to the device context = the thing to paint on.
The handle to the window is not exposed as far as I did see.

Good luck