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.
QStaticTextオブジェクトのベースライン ポジショニングを達成するにはどうすればよいですか?
QStaticText
通常のテキストの場合は簡単です。QPainter::drawText(position, text)では、position.y座標はベースラインを参照します。
QPainter::drawText(position, text)
position.y
返ってくるものを見てくださいQStaticText::size()。
QStaticText::size()
に似ているかもしれませんQTextMetrics::boundingRect()。QFontMetrics のベースラインは、境界四角形の高さの 3/4 にあり、Q、g、p、q、または y のようなベースラインの下の文字部分のためのスペースを予約します。
QTextMetrics::boundingRect()
と似ていると想像できQStaticText::size()ます。ただし、今はテストできません。