[vtkusers] Problem QVTKWidget using vtkCarbonRenderWindow instead of vtkCocoaRenderWindow

Mike Jackson mike.jackson at bluequartz.net
Tue Sep 23 13:27:55 EDT 2008


VTK works VERY well with Cocoa. In fact, Sean McBride and myself created 
the VTKCocoa Tutorial/Example project to show how well it does work. I 
have not looked at the QVTKPlugin but _hopefully_ there are only 
references to vtkRenderWindow in there and NOT specific renderwindow 
implementations like carbon or win32 or xwindows..

Tell you what. Why don't you try downloading Qt 4.5 and compiling it. 
Then download VTK 5.2 release and compile that with Cocoa Support and 
QVTKSupport. You will probably have to tweak the vtk CMakeLists.txt for 
the QVTKPlugin to make sure that vtkCocoa will be used because the 
version of Qt is larger than 4.4.
Then report back and tell us what you found.  I do like your enthusiasm 
for this.. ;-)

Mike

PS: I would but I am currently stuck in XP for a day or so ..

Elvis Dowson wrote:
> Hi Clinton,
>                        Would you happen to know who implemented the 
> Carbon support for vtk on MacOSX? Will it be really difficult to 
> change it? From the vtk side, it appeared to be cleanly partitioned 
> and although I didnt go beyond the QVTK plugin, an implementation for 
> vtkCocoaRenderWindow appeared to be there (didn't check the 
> implementation, through).
>
> So, my first question, will vtk-5.3 work out-of-the-box with Cocoa?
>
> If yes, then I guess it's just a matter of fixing the QVTK 
> implementation, plus finding a way to switch between Carbon and Cocoa 
> implementations.
>
> Best regards,
>
> Elvis Dowson
>
> On Sep 23, 2008, at 8:15 PM, clinton at elemtech.com wrote:
>
>>
>> Nearly all the Mac specific code in there is for Carbon, and works 
>> around
>> Carbon limitations.
>> Its probably going to be more like replacing the
>> #ifdef Q_WS_MAC
>> with a flag that indicates a Mac/Carbon Qt, and only call that code with
>> Carbon.  Ideally, that flag would come from something like 
>> qglobal.h.  If
>> not, we should ask Trolltech to put a #define in there to help people 
>> switch
>> from Carbon to Cocoa.
>> At that point, it should theoretically work with Cocoa.
>>
>> Clint
>>
>>>
>>> Elvis, you are _probably_ in brand new territory at this point. I
>>> certainly have not tried anything with Qt 4.5 (I don't have the time),
>>> let alone with VTk thrown into the mix.
>>>
>>> Theoretically all you should have to do is Build Qt 4.5. Build VTK with
>>> Cocoa support instead of Carbon Support. The rest _should_ work. Let 
>>> the
>>> list know what you find out.
>>>
>>> Mike
>>>
>>> Elvis Dowson wrote:
>>>> Hi Mike,
>>>>                   There is an alpha release of Qt-4.5 on the troll
>>>> tech website. Here is the link:
>>>> http://trolltech.com/company/newsroom/announcements/press.2008-06-09.7117 
>>>>
>>>> 549806/?searchterm=Qt%204.5
>>>>
>>>>
>>>> Could you guide me on what I should do to modify vtk to support Qt-4.5
>>>> using Cocoa? I'm basically trying to get the QVTK plugin to compile
>>>> correctly and use the Cocoa framework.
>>>>
>>>> Best regards,
>>>>
>>>> Elvis Dowson
>>>>
>>>> On Sep 23, 2008, at 5:36 PM, Mike Jackson wrote:
>>>>> Qt 4.5 will be based on Cocoa (That is the current news from TT). Qt
>>>>> 4.4 is CARBON based so you will have to build VTK using Carbon=ON if
>>>>> you want to use Qt. As far as supporting Cocoa/Qt in the future I am
>>>>> not sure if anyone has really looked at it yet. _IF_ TrollTech does
>>>>> deliver Qt/Cocoa for Qt 4.5 then the test is pretty simple. If the Qt
>>>>> Version is less than 4.5 then use Carbon. If it is 4.5 or above use
>>>>> Cocoa. This can be detected in CMake and set accordingly.
>>>>>
>>>>> Q_WS_MAC is defined by Qt in its header files.
>>
>>



More information about the vtkusers mailing list