Questions tagged [qfontmetrics]

The QFontMetrics class provides font metrics information.

QFontMetrics functions calculate the size of characters and strings for a given font.

Official documentation can be found here.

19 questions
0
votes
1 answer

Can QFontMetrics account for windows dpi scaling?

I was under the impression that if you do this in your application QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication* app = new QApplication(temp, NULL); then Fonts gets automatically scaled up on high resolution display.…
Octo
  • 543
  • 1
  • 5
  • 16
0
votes
1 answer

Qt Printing - QFontMetrics Class

I'm new to Qt and exploring QPrinter / QPainter According to the documentation, in order to print in mm, the coordinates must be translated to the printer's unit, considering it's resolution. So, I wrote the following code: qreal…
MSantos
  • 53
  • 1
  • 7
0
votes
0 answers

resize the font pointSize based on the window height

I have an option to change the text font size on a label, now without layout . how I can change the font pointSize of the text based on the parent window resized height. so how I can calculate the factor of height increased and based on the factor I…
Wagmare
  • 1,354
  • 1
  • 24
  • 58
0
votes
1 answer

QTextEdit display width vs text width

I'm creating a 'scrolling-text' class in Qt, using a QTextEdit (read-only, no scrollbars, moveCursor) and a QTimer - simple and working. My problem is when the text sent to the class is shorter (narrower) than the QTextEdit-box. Silly, I agree, but,…
Rami Rosenbaum
  • 467
  • 5
  • 18
1
2