你应该用这个吧!
QString QCoreApplication::applicationDirPath () [static]
Returns the directory that contains the application executable.
For example, if you have installed Qt in the C:\Trolltech\Qt directory, and you run the regexp example, this function will return "C:/Trolltech/Qt/examples/tools/regexp".
On Mac OS X this will point to the directory actually containing the executable, which may be inside of an application bundle (if the application is bundled).
Warning: On Linux, this function will try to get the path from the /proc file system. If that fails, it assumes that argv[0] contains the absolute file name of the executable. The function also assumes that the current directory has not been changed by the application.
See also applicationFilePath().