0

I'm creating a QT GUI with VTK. I'm creating a sphere in VTK and I want to change the color of the sphere when a button clicks (QPushButton).

So I connected the Signals and Slots like this,

QObject::connect( btn, SIGNAL(clicked()), this, SLOT(changeColor()) );

But this wont change the color of the sphere even though I click the button. Can someone explain what's the error here.

I just want to change the color of the sphere when I click the button. This is the slot I wrote,

void BorderWidgetQt::changeColor(){
  vtkSmartPointer<vtkNamedColors> colors = vtkSmartPointer<vtkNamedColors>::New();
  sphereActor->GetProperty()->SetColor(colors->GetColor3d("Red").GetData());
  }
Rajitha
  • 211
  • 2
  • 12

0 Answers0