[vtkusers] Show vtkQtLineChartView in Qt

Jeff Baumes jeff.baumes at kitware.com
Mon Mar 15 08:50:55 EDT 2010


The following is defined in the superclass, vtkQtChartView:

  // Description:
  // Get the main container of this view (a  QWidget).
  // The application typically places the view with a call
  // to GetWidget(): something like this
  // this->ui->box->layout()->addWidget(this->View->GetWidget());
  virtual QWidget* GetWidget();

You do not need a QVTKWidget because these chart classes are not
rendered with a VTK render window.

That said, there are newer chart classes coming that will scale better
and will use VTK's OpenGL rendering. They are being actively worked on
in CVS head, and there will be limited access to these in the next VTK
release.

Jeff

On Mon, Mar 15, 2010 at 7:52 AM, Martijn Steenwijk
<martijnsteenwijk at gmail.com> wrote:
> Dear all,
>
>
>
> Suppose I have a vtkTable ‘table’ filled with data, which i want to
> visualize in within a linechart in a qt application, then my code is:
>
>
>
> vtkQtLineChartView *ChartView = vtkQtLineChartView::New();
>
> ChartView->SetupDefaultInteractor();
>
> ChartView->SetTitle(“Test”);
>
> ChartView->AddRepresentationFromInput(table);
>
>
>
> If I now call ‘ChartView->Show()’, the data is nicely plotted in a separate
> window. When I try to integrate the view in my Qt application,  like the way
> it’s done with the vtkGraphLayoutView in
> \Examples\InfoVis\Cxx\EasyView\EasyView.cxx, I would expect that I would
> need something like a QVTKWidget or vtkQtchartWidget in order to integrate
> the renderer in my Qt application, but, I’m not getting both options to
> work. Could anyone give me a hint to solve this?
>
>
>
> Best,
>
> Martijn
>
>
>
>
>
> ---
>
> Martijn Steenwijk
>
> T 06 20693913
>
> E martijnsteenwijk at gmail.com



More information about the vtkusers mailing list