interacción qvtkwidget con un control deslizante

I have a problem with qvtkwidget. I have a cube with the vtkimageplanewidget and i already made the connection between the sliders and them, but I want the slider to change also when I change the planes with the mouse in the qvtkwidget.

¿Cómo puedo hacer eso?

Here's how I connected the slider eith the planes.

RANURA:

void planevolume::SplaneXpixel()
{
    double xvalue=ui->Slider->value();
    planeX->SetSliceIndex(xvalue);
    ui->qvtkWidget->update();
}

y entonces:

  connect(ui->Slider, SIGNAL(valueChanged(double)), this, SLOT(SplaneXpixel()));

What about the opposite? I tried:

RANURA:

void planevolume::planeXSpixel()
{
    double xvalue=planeX->GetSliceIndex();
    ui->Slider->setValue(xvalue);
    ui->qvtkWidget->update();
}

y entonces:

connect(ui->qvtkWidget, SIGNAL(mouseEvent(QMouseEvent*)), SLOT(planeXSpixel()));

but it won't work, can anyone help me?

preguntado el 28 de agosto de 12 a las 10:08

What won't work? I'd suggest posting a fully compilable example, and explaining what is going wrong. -

2 Respuestas

I believe you are looking for vtkEventQtSlotConnect. Here is an example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/EventQtSlotConnect

respondido 14 nov., 12:00

If you work with the UI form, right click the slider, choose "Go to slot..." and select the sliderMoved(int) slot. Inside the automated slot created by Qt, it should be on_slider_sliderMoved(int position). just insert your code there. maybe this implementation should help you further:

Displaying DICOM Series using the Qt sliderbar

respondido 11 mar '13, 05:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.