Not sure of this can work, but this blog post takes advantage of the Travis Build Matrix, in order to replace one language by another in the .travis.yml
file:
# specify python as the language
language: python
# python versions to be used for testing
python:
- "2.6"
- "2.7"
env:
- JYTHON=true
- JYTHON=false
matrix:
exclude:
- python: 2.6
env: JYTHON=true
before_install:
- export JYTHON_URL='http://downloads.sourceforge.net/project/jython/jython/2.5.2/jython_installer-2.5.2.jar?r=http%3A%2F%2Fwww.jython.org%2Fdownloads.html&ts=1338089844&use_mirror=iweb'
- if [ "$JYTHON" == "true" ]; then wget $JYTHON_URL -O jython_installer.jar; java -jar jython_installer.jar -s -d $HOME/jython; export PATH=$HOME/jython:$PATH; fi
before_script: if [ "$JYTHON" == "true" ]; then export PYTHON_EXE=jython; jython -c "print ''"; else export PYTHON_EXE=python; fi
script: $PYTHON_EXE setup.py test
So maybe you could setup a specific build which, actually, install qt4 and uses it instead of the official language.