Would you upload your shader programs in a different way. Add vertext.sh and fragment.sh to your src. Then try linking them this way as below:

Qt Code:
  1. //#version 130
  2.  
  3. precision mediump float;
  4.  
  5. uniform mat4 mvpMatrix;
  6.  
  7. attribute vec4 vertex;
  8. attribute float color;
  9.  
  10. varying float varyingColor;
  11.  
  12. void main(void)
  13. {
  14. varyingColor = color;
  15. gl_Position = mvpMatrix * vertex;
  16. }
To copy to clipboard, switch view to plain text mode 
fragment shader has the same format, you know it. Then do this in the code:

Qt Code:
  1. initCommon();
  2.  
  3. shaderProgram.addShaderFromSourceFile(QGLShader::Vertex, ":/vertexShader.vsh");
  4.  
  5. shaderProgram.addShaderFromSourceFile(QGLShader::Fragment, ":/fragmentShader.fsh");
  6.  
  7. if(!shaderProgram.link())
  8. {
  9. exit(1);
  10. }
To copy to clipboard, switch view to plain text mode 

initCommon() is:
Qt Code:
  1. void GlWidget::initCommon()
  2. {
  3. //qglClearColor(QColor(Qt::black));
  4. glEnable(GL_DEPTH_TEST);
  5. glEnable(GL_CULL_FACE);
  6.  
  7. glEnable(GL_BLEND);
  8. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  9. }
To copy to clipboard, switch view to plain text mode 

check this method and let us know about the result.

PS: don't forget to upload your shaders to your resources.