public void fourth() { // ! [4] QGraphicsScene scene = new QGraphicsScene(); QGraphicsView view = new QGraphicsView(scene); view.show(); // a white semi-transparent foreground scene.setForegroundBrush(new QBrush(new QColor(255, 255, 255, 127))); // a grid foreground scene.setForegroundBrush(new QBrush(QColor.lightGray, Qt.BrushStyle.CrossPattern)); // ! [4] }