Build with Qt5

At least after my 3(or 2) commits, it compiles well with Qt 5.(Only tested on Mac OS X 10.8.2, with Qt 5.0.2 open source release.)

These changes are not targeted the master branch. I'd like to see the qt5 branch in main repo.