Fix Qt build on Linux.
Merge pull request #3168 from xyzz/linux_qt_build_fixes

Fix Qt build on Linux.