グラフィックフレームワークのクラスで画面に1桁を描画したい。「1」の塗りつぶしアプローチを次のようにしたい
(出典: qt-project.org )
しかし、私の描いた「1」のブラシは、以下のコードによる黄色の SolidBrush のようなものです (醜い太字の黄色の「1」)。何が問題なのか教えていただけますか?
QGraphicsSimpleTextItem digit_1 = new QGraphicsSimpleTextItem;
digit_1->setText(QString::number(1));
digit_1->setPen(QPen(QColor("black")));
QLinearGradient gradient(digit_1->boundingRect().topLeft(),
digit_1->boundingRect().bottomRight());
gradient.setColorAt(0, Qt::white);
gradient.setColorAt(1, Qt::yellow); // yellow is for example
QBrush brush(gradient);
brush.setStyle(Qt::BrushStyle::LinearGradientPattern);
digit_1->setBrush(brush);
digit_1->setFont(QFont("courier", 35, QFont::Black));
ありがとうございます。