Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
今日Qtを始めたばかりで、すでに問題が発生しています。の中にテキストを入れたいのですが、機能QGraphicsEllipseItemがないようです。楕円の真ん中にある1つの単語である必要があります。楕円は移動可能であるため、楕円が移動するとテキストも移動する必要があります。これを行う簡単な方法はありますか?または、楕円を移動した後、別のテキストを作成してその位置を更新する必要がありますか?もっと簡単な方法があるといいのですが。setText()setLabel()
QGraphicsEllipseItem
setText()
setLabel()
QGraphicsEllipseItemに配置できる要素ですQGraphicsScene。QGraphicsTextItemにテキストを表示するための -an 要素もありますQGraphicsScene。
QGraphicsScene
QGraphicsTextItem
したがって、テキストを表示するには、サブクラスQGraphicsEllipseItem化して追加する必要があると思います。QGraphicsTextItem