[Ctk-developers] Object::connect: No such slot ctkVTKSliceView::setImageData((vtkImageData*))
Sergio Vera
sergio.vera at alma3d.com
Tue Oct 30 14:23:42 UTC 2012
Thanks Julien,
That was an easy one, Now it works.
Too bad I did not catch it before bothering into the list.
Thanks
On Tue, Oct 30, 2012 at 1:52 PM, Julien Finet <julien.finet at kitware.com>wrote:
> Hi Sergio,
> It seems that you have 1 pair of parenthesis too many in your SLOT
> signature:
> SLOT(setImageData(vtkImageData*))
> instead of
> SLOT(setImageData((vtkImageData*)))
> Hth,
> Julien.
>
> On Tue, Oct 30, 2012 at 7:45 AM, Sergio Vera <sergio.vera at alma3d.com>wrote:
>
>> 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
>>
>> _______________________________________________
>> Ctk-developers mailing list
>> Ctk-developers at commontk.org
>> http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
>>
>>
>
--
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/4c1015bc/attachment.htm>
More information about the Ctk-developers
mailing list