Build with Qt5

At least after my 3(or 2) commits(based on a5092bddf4c8760e164a661b2232f8f62d409c9c), 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.