tags:

views:

33

answers:

3

I installed the QtSDK, but I can't find any documentation anywhere that specifies whether it uses the Cocoa or Carbon version. Can I find out which got installed? If not, is it safe to install the Cocoa version from the Library only dmg? Qt version is 4.6.3, system version is 10.6.4.

A: 

I don't have a Mac nearby to test put checking the type of QPaintEngine might do the trick. I believe Carbon would return QPaintEngine::QuickDraw and Cocoa QPaintEngine::CoreGraphics but I'm not sure.

Vitor Py
+1  A: 

To quote:

The current binary for Qt is built in two flavors, 32-bit Carbon and full universal Cocoa (32-bit and 64-bit). If you want a different setup for Qt will use, you must build from scratch. Carbon or Cocoa is chosen when configuring the package for building. The configure process selects Carbon by default, to specify Cocoa use the -cocoa flag. configure for a 64-bit architecture using one of the -arch flags

10.4    Tiger           Carbon          32      PPC/Intel   Yes
10.5    Leopard         Carbon          32      PPC/Intel   Yes
10.5    Leopard         Cocoa           32/64   PPC/Intel   Yes
10.6    Snow Leopard    Cocoa/Carbon    32      PPC/Intel   Yes
10.6    Snow Leopard    Cocoa           64      Intel       Yes

More information is available on http://doc.trolltech.com/4.6/developing-on-mac.html#carbon-or-cocoa.

Ashish
This is talking about building from source, not the SDK installation. The binary download is separated into a cocoa and a carbon download. The SDK download, however, is not, and doesn't specify which it is.
TraxusIV
I'll have to check on my Mac then. I don't have it with me right now. I'll revert back to you unless someone helps you out first. :)
Ashish
+1  A: 

When using qmake, the following should work:

There is QT_MAC_USE_COCOA, so a simple test would be:

...
#ifdef QT_MAC_USE_COCOA
    std::cout << "Cocoa!" << std::endl;
#else
    std::cout << "Carbon!" << std::endl;
#endif 
Frank