I know this is quite old now but it might still help other.
So basicaly the trick here is to have 2 gradiants in your QGraphicsView one set as the background for the colors(left to right), one set as the foreground (top to bottom).
// a colored background based on hue
QLinearGradient colorGradient = QLinearGradient(0, 0, width(), 0);
colorGradient.setSpread(QGradient::RepeatSpread);
colorGradient.setColorAt(0, QColor(255,255,255));
colorGradient.setColorAt(1, currentHue);
QLinearGradient blackGradient = QLinearGradient(0, 0, 0, height());
blackGradient.setSpread(QGradient::RepeatSpread);
blackGradient.setColorAt(0, QColor(0,0,0,0));
blackGradient.setColorAt(1, QColor(0,0,0,255));
QBrush colorGradiantBrush = QBrush(colorGradient);
QBrush blackGradiantBrush = QBrush(blackGradient);
scene.setBackgroundBrush(colorGradiantBrush);
scene.setForegroundBrush(blackGradiantBrush);
The code above give you a palette with one color like this :
For the foreground I used a transparent to black - you will need a white to transparent to black. and for the background I used a white to a specific color - you can use your spectrum that you already have.