On my Fedora 13 system, KDevelop 4.0.0's Documentation docker doesn't show the Qt documentation, despite Fedora's qt-doc package being installed. The Documentation docker shows a "QtHelp" item with a question mark icon, and the listview is empty for it. IRC discussion with apaku suggesta that the problem is that KDevelop is hard-coded to run "qmake -query QT_INSTALL_DOCS" to discover the installation path for Qt's documentation, but Fedora uses "qmake-qt4" for Qt 4's qmake, for co-installability next to Qt 3.
Yeah, calling Qt 4 tools without the -qt4 suffix is not going to work reliably, if at all, in most real-world distributions. (Of course, to complicate things more, some distros set things up differently. :-/ )
I just pushed http://gitorious.org/kdevelop/kdevelop/commit/72f01b85ac3a5178e2322e5449940e3dda92e3e0 to the stable branch, which should at least fix it for many distros, even if not all. Ultimately we'd like to have a gui to simply add qch doc files manually, but thats already tracked in a separate bugreport.
While this is going to work, it'd be more efficient to check qmake-qt4 first. At least on Fedora, qmake is the Qt 3 one, so your code is going to try running the Qt 3 qmake first, and only once it sees there are no Qt 4 docs there, it'll try qmake-qt4.