public void third() { // ! [3] QGraphicsScene scene = new QGraphicsScene(); QGraphicsView view = new QGraphicsView(scene); view.show(); // a blue background scene.setBackgroundBrush(new QBrush(QColor.blue)); // a gradient background QRadialGradient gradient = new QRadialGradient(0, 0, 10); gradient.setSpread(QGradient.Spread.RepeatSpread); scene.setBackgroundBrush(new QBrush(gradient)); // ! [3] }