PDA

View Full Version : Help please!



Mysterious
5th December 2007, 13: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?!!!

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

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

DeepDiver
5th December 2007, 14: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.

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

DeepDiver
5th December 2007, 15: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.

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

DeepDiver
5th December 2007, 15: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