[vtk-developers] QVTKWidget
Wylie, Brian
bnwylie at sandia.gov
Tue Dec 14 09:57:40 EST 2004
All,
There are several QT/VTK widgets out there and I've tried them all...
We have a guy working with us.. Clinton Stimpson from ElemTech and he
has put together a very nice implementation that IMHO is superior to
other implementations....blah...blah...blah...
Anyway I would like to add the class to VTK, and will do so in a couple
days unless I here otherwise.
Here's a description from Clint...
QVTKWidget is a package which allows putting a vtkRenderWindow in a Qt
GUI. I know there are already a bunch out there, but I didn't like any
of them. I thought they were too complicated and awkward for such a
simple problem. And also, VTK doesn't have any examples of using a Qt
GUI with VTK as it does with MFC and others.
To be consistent with the other GUI/VTK integration packages/examples.
I'd probably recommend putting QVTKWidget in VTK/Examples/GUI/Qt along
with a few examples of using it.
On the otherhand, it is more than just an example as it is usable in
several projects as-is without any changes.
So, perhaps it goes under Utilities with an option to build it.
It's design is more Qt-ish design than other Qt/VTK packages. As a
result, better Qt integration is possible.
The design philosophy is to let VTK do what it does best and let Qt do
what it does best. The class name starts with 'Q' to emphasize the
Qt-ishness of it.
The design allows the following features:
1. Has a designer plugin for rapid development of GUI's using VTK.
2. Significantly less code than other Qt/VTK packages.
3. Can even use the same widget class with image viewer classes in VTK.
4. Instead of using Qt's opengl extension, it uses VTK to initialize the
windows. As a result, QVTKWidget is "device independent". For example,
on Unix, one can use Mangled Mesa or OpenGL without rebuilding
QVTKWidget and use them concurrently in the same application.
Other features include
1. Works with all of VTK such as, 3d widgets, interactor styles, scroll
wheel events, etc..
2. Works and tested on Windows, Linux, MacOSX, HP-UX, IRIX, SunOS.
3. Supports reparenting (either at the Qt level, or by swapping
instances of vtkRenderWindow).
4. Works with Qt3 and Qt4 (preview 2).
There are also some examples in using it.
*Note: For the MacOSX, there are some exceptions. I made some AppleGL
calls to make up for deficiencies in VTK and Qt3. With Qt4, HIViews can
be used, but VTK isn't ready for that yet. Once VTK's deficiencies are
removed, then most of the MacOSX specific code goes away.
Brian Wylie
Sandia National Laboratories
MS 0822 - Org 9227 - Building 880/A1-J
(505) 844-2238 FAX (505) 845-0833
More information about the vtk-developers
mailing list