[Ctk-developers] Object::connect: No such slot ctkVTKSliceView::setImageData((vtkImageData*))

Sergio Vera sergio.vera at alma3d.com
Tue Oct 30 07:45:21 EDT 2012


Dear list,

I'm trying to connect my image reading code to ctkVTKSliceView's
setImageData slot. At run time when the code tries to perform the
connection,
the following error message appears in the console: Object::connect: No
such slot ctkVTKSliceView::setImageData((vtkImageData*))

My code looks like this:


class ThreadedLoadImage : public QObject
{
Q_OBJECT
public:
signals:
       * void imageLoaded(vtkImageData*); *
public slots:
bool loadImage(const QString&);
protected:
double progress;
};

The signal is launched once the image is loaded succesfully
(...)
imageReader->SetFileName(a_fileName.toLatin1());
imageReader->Update();
vtkSmartPointer<vtkImageData> image = imageReader->GetOutput();
if (!image) {
std::cerr << "Unsuccessfully read: " << qPrintable(a_fileName) << std::endl;
return EXIT_FAILURE;
} else {
std::cout << "Successfully read: " << qPrintable(a_fileName) << std::endl;
}
emit imageLoaded(image);
(...)


ThreadedLoadImage* loader = new ThreadedLoadImage();
(...)
ctkVTKSliceView* sliceView = new ctkVTKSliceView();
QObject::connect(loader,SIGNAL(imageLoaded(vtkImageData*)),sliceView,
SLOT(setImageData((vtkImageData*))));

I've read that this might be caused by  wrong moc files in the build path,
but it seems that my moc file
(C:\work\bin\CTK\VC9-W32-Release\CTK-build\Libs\Visualization\VTK\Widgets\moc_ctkVTKSliceView.cxx
) is correct (although my understandings of moc files is null),
and I've moved it tho the first position in Visual Studio include paths to
no avail.

Any more hints about this lost slot in ctkVTKSliceView?

Thanks in advance
-- 
Sergio Vera

 Alma IT Systems
 C/ Vilana, 4B, 4º 1ª
 08022 Barcelona
 T. (+34) 932 380 592
 www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20121030/a00c57a0/attachment.html>


More information about the Ctk-developers mailing list