[vtkusers] How to get Qt QPushButton to work with VTK

Clinton Stimpson clinton at elemtech.com
Tue Aug 29 13:33:45 EDT 2006


> From: "Richard Haney" <cosmoh2o at hotmail.com>
> Subject: [vtkusers] How to get Qt QPushButton to work with VTK
> To: vtkusers at vtk.org
>
> Hello All,
>
> I am new to Qt and VTK and I finally got the correct installation of the 
> vtk-5.0.1 to work with Qt4.1.4 and have built a simple GUI with QVTKWidget 
> but now have ran into another (probably simple problem) regarding 
> QPushButton and the QVTKWidget.  I am building a GUI that I want to display 
> the "cone" actor from VTK after the user clicks the QPushButton displayed on 
> the GUI.  I know that Qt uses SLOTS and SIGNALS to handle events.
>
> What is the simplest way to get a Qt button (QPushButton) to load a Cone 
> actor to the QVTKWidget (which is displayed in the GUI)?  Initially I would 
> like the GUI to display a Blank canvas which the user will fill with a newly 
> created CONE when he/she pushes the Qt QPushButton Object.
>
> Thanks in advance for any help/hints.

Have a look at the Examples in  VTK/Examples/GUI/Qt
The SimpleView does something very similar to what you want with its 
file open.

Clint




More information about the vtkusers mailing list