Setting up Qt4 and Qt Cryptography Architecture developer environment on Mac OSX Lion and Snow Leopard.
I’ve chosen OSX as my main developer platform for one reason an it is not Apple’s continuous marketshare growth. Having Apple hardware allows me to develop software for any platform. I’m able to use one machine with or without virtual machine software to test all my application code on Linux, Windows, or OSX. The cost of having 1 Mac was much less than having the hardware to test everything, plus at the time I was financially able. Qt4 expands on this reasoning and lets me develop one codebase for all platforms, leaving me open to focus on more on the product and worry less about where and how.
Qt Cryptography Architecture (QCA) adds cross-platform cryptography support for Qt4. QCA has been the focus of my recent topics because of its use in encrypting and decrypting MailArchiva archives (Read: PBEWithMD5AndTripleDES in Qt4/C++). Qt4 and QCA are easily installable via MacPorts or Fink. However, I did not want to dirty up my system by having all this software compiled and installed again when I already have the Nokia Qt4 SDK 1.1.3 installed. So, lets dive right in.

The Qt4 SDK Install
Prerequisites:
Link: Apple OSX Lion Xcode 4.x (Mac App Store copies the installer to Applications where you manually start the install).
Head on over to http://qt.nokia.com/downloads and grab the latest Mac OS X 10.6 or later 64-bit installer. I choose the Off-line installer because I tend to have to reinstall Qt4SDK quite often. After several plugin builds or failing to add libraries into the QtSDK directory (like my first go with QCA) I like to clean up the directory and reinstall to make sure I’m in a good state and that other issues don’t creep up on me later. After finished downloading, go ahead and open up the DMG file and start the Qt SDK Installer.
The first screen of the installer asks where to install the QtSDK. I almost always choose /Developer/. This guide will be written using /Developer as the base directory. If you choose somewhere else, just replace /Developer/ with your installation directory.
Choose Default for the installation type and Always select Remove old Qt Creator settings. If you don’t, you’ll be in for all sorts of strange problems. Go ahead and accept the licenses. On the next screen click on install. Installation takes 5-10 minutes sometimes.
Tools and Applications
Now that Qt4SDK is installed we can explore around a bit and find all the tools that are available. Most of the Graphical tools can be found in /Developer/QtSDK/. I typically add the Developer folder to my Dock for easy access. In /Developer/QtSDK we see Qt Creator (an excellent tool for writing Qt4 applications, Qt Assistant (which isn’t correctly configured yet), and the very important Qt4 Designer for building GUI interfaces. Also worthy of note is the new SDK Maintenance Tool. This tool is to install additional features, upgrade your Qt4SDK to the latest release, or to remove the SDK completely from your machine.
The rest of the development goodies are on the command line and can be accessed via the Terminal App (Applications -> Utilities -> Terminal). Most important is the location of qmake:
/Developer/QtSDK/Desktop/Qt/474/gcc/bin/qmake
You’ll want to make a note of this location, it is required for all Qt4 Application development, especially in the Part Two, Installing QCA.
Qt4 Help & Documentation Setup
Qt Creator’s help system is all ready for you to use when you fire up Qt Creator. For some reason though, Nokia has decided to not pre-configure Qt Assistant. I find Qt Assistant much easier to use along side Qt Creator, rather than using Qt Creator’s built in help. This is because I have a large enough screen its much more effective to have the Documentation open in a Window while I’m coding in Qt Creator.
To configure Qt Assistant open it up from Developer -> QtSDK -> Assistant. Once Assistant is open, modify the application preferences and click on the Documentation Tab. You should notice it is empty as pictured. Click on Add and Navigate to /Developer/QtSDK/Documentation.
Select all of the .qch files and hit Open.
The Docs should appear in the Documentation tab, Press OK and the indexes will begin to rebuild.
Installing Qt Cryptography Architecture (QCA)
Continue on to Part 2 ! Here
http://www.naveoss.com/site/399/apple-2/qt4-and-qca-developer-environment-on-osx-lion-pt-2







