Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qfontmetrics.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qfont.h"
5#include "qpaintdevice.h"
6#include "qfontmetrics.h"
7
8#include "qfont_p.h"
9#include "qfontengine_p.h"
10
12
13
14extern void qt_format_text(const QFont& font, const QRectF &_r,
15 int tf, const QString &text, QRectF *brect,
16 int tabStops, int *tabArray, int tabArrayLen,
18
19/*****************************************************************************
20 QFontMetrics member functions
21 *****************************************************************************/
22
126 : d(font.d)
127{
128}
129
146{
147 const int dpi = paintdevice ? paintdevice->logicalDpiY() : qt_defaultDpi();
148 if (font.d->dpi != dpi) {
149 d = new QFontPrivate(*font.d);
150 d->dpi = dpi;
151 } else {
152 d = font.d;
153 }
154
155}
156
161 : d(fm.d)
162{
163}
164
172
177{
178 d = fm.d;
179 return *this;
180}
181
214{
215 return d == other.d;
216}
217
242{
243 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
244 Q_ASSERT(engine != nullptr);
245 return qRound(engine->ascent());
246}
247
261{
262 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
263 Q_ASSERT(engine != nullptr);
264 return qRound(engine->capHeight());
265}
266
278{
279 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
280 Q_ASSERT(engine != nullptr);
281 return qRound(engine->descent());
282}
283
292{
293 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
294 Q_ASSERT(engine != nullptr);
295 return qRound(engine->ascent()) + qRound(engine->descent());
296}
297
306{
307 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
308 Q_ASSERT(engine != nullptr);
309 return qRound(engine->leading());
310}
311
320{
321 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
322 Q_ASSERT(engine != nullptr);
323 return qRound(engine->leading()) + qRound(engine->ascent()) + qRound(engine->descent());
324}
325
337{
338 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
339 Q_ASSERT(engine != nullptr);
340 return qRound(engine->minLeftBearing());
341}
342
354{
355 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
356 Q_ASSERT(engine != nullptr);
357 return qRound(engine->minRightBearing());
358}
359
364{
365 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
366 Q_ASSERT(engine != nullptr);
367 return qRound(engine->maxCharWidth());
368}
369
375{
376 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
377 Q_ASSERT(engine != nullptr);
378 if (d->capital == QFont::SmallCaps)
379 return qRound(d->smallCapsFontPrivate()->engineForScript(QChar::Script_Common)->ascent());
380 return qRound(engine->xHeight());
381}
382
389{
390 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
391 Q_ASSERT(engine != nullptr);
392 return qRound(engine->averageCharWidth());
393}
394
400{
401 return inFontUcs4(ch.unicode());
402}
403
409{
410 const int script = QChar::script(ucs4);
411 QFontEngine *engine = d->engineForScript(script);
412 Q_ASSERT(engine != nullptr);
413 if (engine->type() == QFontEngine::Box)
414 return false;
415 return engine->canRender(ucs4);
416}
417
431{
432 const int script = ch.script();
434 if (d->capital == QFont::SmallCaps && ch.isLower())
436 else
437 engine = d->engineForScript(script);
438 Q_ASSERT(engine != nullptr);
439 if (engine->type() == QFontEngine::Box)
440 return 0;
441
443
444 glyph_t glyph = engine->glyphIndex(ch.unicode());
445
446 qreal lb;
447 engine->getGlyphBearings(glyph, &lb);
448 return qRound(lb);
449}
450
464{
465 const int script = ch.script();
467 if (d->capital == QFont::SmallCaps && ch.isLower())
469 else
470 engine = d->engineForScript(script);
471 Q_ASSERT(engine != nullptr);
472 if (engine->type() == QFontEngine::Box)
473 return 0;
474
476
477 glyph_t glyph = engine->glyphIndex(ch.unicode());
478
479 qreal rb;
480 engine->getGlyphBearings(glyph, nullptr, &rb);
481 return qRound(rb);
482}
483
485
500{
501 int pos = (len >= 0)
504 if (pos != -1) {
505 len = pos;
506 } else if (len < 0) {
507 len = text.size();
508 }
509 if (len == 0)
510 return 0;
511
513 return qRound(layout.width(0, len));
514}
515
527{
529 int len = -1;
530 if (pos != -1) {
531 len = pos;
532 } else {
533 len = text.size();
534 }
535 if (len == 0)
536 return 0;
537
539 layout.option = option;
540 return qRound(layout.width(0, len));
541}
542
570{
571 if (QChar::category(ch.unicode()) == QChar::Mark_NonSpacing)
572 return 0;
573
574 const int script = ch.script();
576 if (d->capital == QFont::SmallCaps && ch.isLower())
578 else
579 engine = d->engineForScript(script);
580 Q_ASSERT(engine != nullptr);
581
583
584 glyph_t glyph = engine->glyphIndex(ch.unicode());
585 QFixed advance;
586
587 QGlyphLayout glyphs;
588 glyphs.numGlyphs = 1;
589 glyphs.glyphs = &glyph;
590 glyphs.advances = &advance;
591 engine->recalcAdvances(&glyphs, { });
592
593 return qRound(advance);
594}
595
619{
620 if (text.size() == 0)
621 return QRect();
622
624 layout.itemize();
625 glyph_metrics_t gm = layout.boundingBox(0, text.size());
626 return QRect(qRound(gm.x), qRound(gm.y), qRound(gm.width), qRound(gm.height));
627}
628
654{
655 if (text.size() == 0)
656 return QRect();
657
659 layout.option = option;
660 layout.itemize();
661 glyph_metrics_t gm = layout.boundingBox(0, text.size());
662 return QRect(qRound(gm.x), qRound(gm.y), qRound(gm.width), qRound(gm.height));
663}
664
683{
684 const int script = ch.script();
686 if (d->capital == QFont::SmallCaps && ch.isLower())
688 else
689 engine = d->engineForScript(script);
690 Q_ASSERT(engine != nullptr);
691
693
694 glyph_t glyph = engine->glyphIndex(ch.unicode());
695
696 glyph_metrics_t gm = engine->boundingBox(glyph);
697 return QRect(qRound(gm.x), qRound(gm.y), qRound(gm.width), qRound(gm.height));
698}
699
756QRect QFontMetrics::boundingRect(const QRect &rect, int flags, const QString &text, int tabStops,
757 int *tabArray) const
758{
759 int tabArrayLen = 0;
760 if (tabArray)
761 while (tabArray[tabArrayLen])
762 tabArrayLen++;
763
764 QRectF rb;
765 QRectF rr(rect);
766 qt_format_text(QFont(d.data()), rr, flags | Qt::TextDontPrint, text, &rb, tabStops, tabArray,
767 tabArrayLen, nullptr);
768
769 return rb.toAlignedRect();
770}
771
795QSize QFontMetrics::size(int flags, const QString &text, int tabStops, int *tabArray) const
796{
797 return boundingRect(QRect(0,0,0,0), flags | Qt::TextLongestVariant, text, tabStops, tabArray).size();
798}
799
822{
823 if (text.size() == 0)
824 return QRect();
825
827 layout.itemize();
828 glyph_metrics_t gm = layout.tightBoundingBox(0, text.size());
829 return QRect(qRound(gm.x), qRound(gm.y), qRound(gm.width), qRound(gm.height));
830}
831
854{
855 if (text.size() == 0)
856 return QRect();
857
859 layout.option = option;
860 layout.itemize();
861 glyph_metrics_t gm = layout.tightBoundingBox(0, text.size());
862 return QRect(qRound(gm.x), qRound(gm.y), qRound(gm.width), qRound(gm.height));
863}
864
888{
889 QString _text = text;
890 if (!(flags & Qt::TextLongestVariant)) {
891 int posA = 0;
893 while (posB >= 0) {
894 QString portion = _text.mid(posA, posB - posA);
895 if (size(flags, portion).width() <= width)
896 return portion;
897 posA = posB + 1;
898 posB = _text.indexOf(s_variableLengthStringSeparator, posA);
899 }
900 _text = _text.mid(posA);
901 }
902 QStackTextEngine engine(_text, QFont(d.data()));
903 return engine.elidedText(mode, width, flags);
904}
905
913{
914 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
915 Q_ASSERT(engine != nullptr);
916 return qRound(engine->underlinePosition());
917}
918
926{
927 return ascent() + 1;
928}
929
937{
938 int pos = ascent() / 3;
939 return pos > 0 ? pos : 1;
940}
941
949{
950 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
951 Q_ASSERT(engine != nullptr);
952 return qRound(engine->lineThickness());
953}
954
961{
962 return d->dpi;
963}
964
965/*****************************************************************************
966 QFontMetricsF member functions
967 *****************************************************************************/
968
1026
1033{
1034 d = other.d;
1035 return *this;
1036}
1037
1062 : d(font.d)
1063{
1064}
1065
1082{
1083 int dpi = paintdevice ? paintdevice->logicalDpiY() : qt_defaultDpi();
1084 if (font.d->dpi != dpi) {
1085 d = new QFontPrivate(*font.d);
1086 d->dpi = dpi;
1087 } else {
1088 d = font.d;
1089 }
1090
1091}
1092
1097 : d(fm.d)
1098{
1099}
1100
1108
1113{
1114 d = fm.d;
1115 return *this;
1116}
1117
1127{
1128 return d == other.d;
1129}
1130
1153{
1154 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1155 Q_ASSERT(engine != nullptr);
1156 return engine->ascent().toReal();
1157}
1158
1172{
1173 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1174 Q_ASSERT(engine != nullptr);
1175 return engine->capHeight().toReal();
1176}
1177
1190{
1191 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1192 Q_ASSERT(engine != nullptr);
1193 return engine->descent().toReal();
1194}
1195
1204{
1205 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1206 Q_ASSERT(engine != nullptr);
1207
1208 return (engine->ascent() + engine->descent()).toReal();
1209}
1210
1219{
1220 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1221 Q_ASSERT(engine != nullptr);
1222 return engine->leading().toReal();
1223}
1224
1233{
1234 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1235 Q_ASSERT(engine != nullptr);
1236 return (engine->leading() + engine->ascent() + engine->descent()).toReal();
1237}
1238
1250{
1251 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1252 Q_ASSERT(engine != nullptr);
1253 return engine->minLeftBearing();
1254}
1255
1267{
1268 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1269 Q_ASSERT(engine != nullptr);
1270 return engine->minRightBearing();
1271}
1272
1277{
1278 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1279 Q_ASSERT(engine != nullptr);
1280 return engine->maxCharWidth();
1281}
1282
1288{
1289 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1290 Q_ASSERT(engine != nullptr);
1291 if (d->capital == QFont::SmallCaps)
1292 return d->smallCapsFontPrivate()->engineForScript(QChar::Script_Common)->ascent().toReal();
1293 return engine->xHeight().toReal();
1294}
1295
1302{
1303 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1304 Q_ASSERT(engine != nullptr);
1305 return engine->averageCharWidth().toReal();
1306}
1307
1313{
1314 return inFontUcs4(ch.unicode());
1315}
1316
1324{
1325 const int script = QChar::script(ucs4);
1326 QFontEngine *engine = d->engineForScript(script);
1327 Q_ASSERT(engine != nullptr);
1328 if (engine->type() == QFontEngine::Box)
1329 return false;
1330 return engine->canRender(ucs4);
1331}
1332
1346{
1347 const int script = ch.script();
1349 if (d->capital == QFont::SmallCaps && ch.isLower())
1351 else
1352 engine = d->engineForScript(script);
1353 Q_ASSERT(engine != nullptr);
1354 if (engine->type() == QFontEngine::Box)
1355 return 0;
1356
1358
1359 glyph_t glyph = engine->glyphIndex(ch.unicode());
1360
1361 qreal lb;
1362 engine->getGlyphBearings(glyph, &lb);
1363 return lb;
1364}
1365
1379{
1380 const int script = ch.script();
1382 if (d->capital == QFont::SmallCaps && ch.isLower())
1384 else
1385 engine = d->engineForScript(script);
1386 Q_ASSERT(engine != nullptr);
1387 if (engine->type() == QFontEngine::Box)
1388 return 0;
1389
1391
1392 glyph_t glyph = engine->glyphIndex(ch.unicode());
1393
1394 qreal rb;
1395 engine->getGlyphBearings(glyph, nullptr, &rb);
1396 return rb;
1397
1398}
1399
1414{
1415 int pos = (length >= 0)
1418 if (pos != -1)
1419 length = pos;
1420 else if (length < 0)
1421 length = text.size();
1422
1423 if (length == 0)
1424 return 0;
1425
1427 layout.itemize();
1428 return layout.width(0, length).toReal();
1429}
1430
1442{
1444 int length = -1;
1445 if (pos != -1)
1446 length = pos;
1447 else
1448 length = text.size();
1449
1450 if (length == 0)
1451 return 0;
1452
1454 layout.option = option;
1455 layout.itemize();
1456 return layout.width(0, length).toReal();
1457}
1458
1486{
1487 if (ch.category() == QChar::Mark_NonSpacing)
1488 return 0.;
1489
1490 const int script = ch.script();
1492 if (d->capital == QFont::SmallCaps && ch.isLower())
1494 else
1495 engine = d->engineForScript(script);
1496 Q_ASSERT(engine != nullptr);
1497
1499
1500 glyph_t glyph = engine->glyphIndex(ch.unicode());
1501 QFixed advance;
1502
1503 QGlyphLayout glyphs;
1504 glyphs.numGlyphs = 1;
1505 glyphs.glyphs = &glyph;
1506 glyphs.advances = &advance;
1507 engine->recalcAdvances(&glyphs, { });
1508
1509 return advance.toReal();
1510}
1511
1512
1534{
1535 int len = text.size();
1536 if (len == 0)
1537 return QRectF();
1538
1540 layout.itemize();
1541 glyph_metrics_t gm = layout.boundingBox(0, len);
1542 return QRectF(gm.x.toReal(), gm.y.toReal(),
1543 gm.width.toReal(), gm.height.toReal());
1544}
1545
1569{
1570 if (text.size() == 0)
1571 return QRectF();
1572
1574 layout.option = option;
1575 layout.itemize();
1576 glyph_metrics_t gm = layout.boundingBox(0, text.size());
1577 return QRectF(gm.x.toReal(), gm.y.toReal(),
1578 gm.width.toReal(), gm.height.toReal());
1579}
1580
1581
1596{
1597 const int script = ch.script();
1599 if (d->capital == QFont::SmallCaps && ch.isLower())
1601 else
1602 engine = d->engineForScript(script);
1603 Q_ASSERT(engine != nullptr);
1604
1606
1607 glyph_t glyph = engine->glyphIndex(ch.unicode());
1608
1609 glyph_metrics_t gm = engine->boundingBox(glyph);
1610 return QRectF(gm.x.toReal(), gm.y.toReal(), gm.width.toReal(), gm.height.toReal());
1611}
1612
1675 int tabStops, int *tabArray) const
1676{
1677 int tabArrayLen = 0;
1678 if (tabArray)
1679 while (tabArray[tabArrayLen])
1680 tabArrayLen++;
1681
1682 QRectF rb;
1683 qt_format_text(QFont(d.data()), rect, flags | Qt::TextDontPrint, text, &rb, tabStops, tabArray,
1684 tabArrayLen, nullptr);
1685 return rb;
1686}
1687
1716QSizeF QFontMetricsF::size(int flags, const QString &text, int tabStops, int *tabArray) const
1717{
1718 return boundingRect(QRectF(), flags | Qt::TextLongestVariant, text, tabStops, tabArray).size();
1719}
1720
1743{
1744 if (text.size() == 0)
1745 return QRectF();
1746
1748 layout.itemize();
1749 glyph_metrics_t gm = layout.tightBoundingBox(0, text.size());
1750 return QRectF(gm.x.toReal(), gm.y.toReal(), gm.width.toReal(), gm.height.toReal());
1751}
1752
1775{
1776 if (text.size() == 0)
1777 return QRectF();
1778
1780 layout.option = option;
1781 layout.itemize();
1782 glyph_metrics_t gm = layout.tightBoundingBox(0, text.size());
1783 return QRectF(gm.x.toReal(), gm.y.toReal(), gm.width.toReal(), gm.height.toReal());
1784}
1785
1808{
1809 QString _text = text;
1810 if (!(flags & Qt::TextLongestVariant)) {
1811 int posA = 0;
1812 int posB = _text.indexOf(s_variableLengthStringSeparator);
1813 while (posB >= 0) {
1814 QString portion = _text.mid(posA, posB - posA);
1815 if (size(flags, portion).width() <= width)
1816 return portion;
1817 posA = posB + 1;
1818 posB = _text.indexOf(s_variableLengthStringSeparator, posA);
1819 }
1820 _text = _text.mid(posA);
1821 }
1822 QStackTextEngine engine(_text, QFont(d.data()));
1823 return engine.elidedText(mode, QFixed::fromReal(width), flags);
1824}
1825
1833{
1834 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1835 Q_ASSERT(engine != nullptr);
1836 return engine->underlinePosition().toReal();
1837}
1838
1846{
1847 return ascent() + 1;
1848}
1849
1857{
1858 return ascent() / 3.;
1859}
1860
1868{
1869 QFontEngine *engine = d->engineForScript(QChar::Script_Common);
1870 Q_ASSERT(engine != nullptr);
1871 return engine->lineThickness().toReal();
1872}
1873
1880{
1881 return d->dpi;
1882}
1883
\inmodule QtCore
T * data() const noexcept
Returns a pointer to the shared data object.
virtual QFixed ascent() const
\reentrant \inmodule QtGui
qreal height() const
Returns the height of the font.
~QFontMetricsF()
Destroys the font metrics object and frees all allocated resources.
qreal leading() const
Returns the leading of the font.
qreal ascent() const
Returns the ascent of the font.
QRectF boundingRect(const QString &string) const
Returns the bounding rectangle of the characters in the string specified by text.
qreal strikeOutPos() const
Returns the distance from the base line to where the strikeout line should be drawn.
qreal horizontalAdvance(const QString &string, int length=-1) const
Returns the horizontal advance in pixels of the first length characters of text.
qreal lineSpacing() const
Returns the distance from one base line to the next.
bool inFont(QChar) const
Returns true if character ch is a valid character in the font; otherwise returns false.
bool inFontUcs4(uint ucs4) const
Returns true if the character given by ch, encoded in UCS-4/UTF-32, is a valid character in the font;...
qreal averageCharWidth() const
QFontMetricsF & operator=(const QFontMetricsF &)
Assigns the font metrics fm to this font metrics object.
qreal descent() const
Returns the descent of the font.
qreal xHeight() const
Returns the 'x' height of the font.
qreal lineWidth() const
Returns the width of the underline and strikeout lines, adjusted for the point size of the font.
qreal capHeight() const
Returns the cap height of the font.
QSizeF size(int flags, const QString &str, int tabstops=0, int *tabarray=nullptr) const
Returns the size in pixels of the characters in the given text.
bool operator==(const QFontMetricsF &other) const
Returns true if the font metrics are equal to the other font metrics; otherwise returns false.
qreal underlinePos() const
Returns the distance from the base line to where an underscore should be drawn.
QRectF tightBoundingRect(const QString &text) const
qreal minRightBearing() const
Returns the minimum right bearing of the font.
qreal overlinePos() const
Returns the distance from the base line to where an overline should be drawn.
qreal leftBearing(QChar) const
Returns the left bearing of character ch in the font.
QString elidedText(const QString &text, Qt::TextElideMode mode, qreal width, int flags=0) const
qreal minLeftBearing() const
Returns the minimum left bearing of the font.
QFontMetricsF(const QFont &font)
Constructs a font metrics object for font.
qreal rightBearing(QChar) const
Returns the right bearing of character ch in the font.
qreal maxWidth() const
Returns the width of the widest character in the font.
qreal fontDpi() const
\reentrant \inmodule QtGui
int height() const
Returns the height of the font.
QRect boundingRect(QChar) const
Returns the rectangle that is covered by ink if character ch were to be drawn at the origin of the co...
QSize size(int flags, const QString &str, int tabstops=0, int *tabarray=nullptr) const
Returns the size in pixels of text.
int descent() const
Returns the descent of the font.
int minLeftBearing() const
Returns the minimum left bearing of the font.
qreal fontDpi() const
int rightBearing(QChar) const
Returns the right bearing of character ch in the font.
bool operator==(const QFontMetrics &other) const
Returns true if other is equal to this object; otherwise returns false.
int strikeOutPos() const
Returns the distance from the base line to where the strikeout line should be drawn.
int lineSpacing() const
Returns the distance from one base line to the next.
int capHeight() const
Returns the cap height of the font.
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags=0) const
int maxWidth() const
Returns the width of the widest character in the font.
int underlinePos() const
Returns the distance from the base line to where an underscore should be drawn.
bool inFont(QChar) const
Returns true if character ch is a valid character in the font; otherwise returns false.
int lineWidth() const
Returns the width of the underline and strikeout lines, adjusted for the point size of the font.
bool inFontUcs4(uint ucs4) const
Returns true if the character ucs4 encoded in UCS-4/UTF-32 is a valid character in the font; otherwis...
QRect tightBoundingRect(const QString &text) const
Returns a tight bounding rectangle around the characters in the string specified by text.
int horizontalAdvance(const QString &, int len=-1) const
Returns the horizontal advance in pixels of the first len characters of text.
int ascent() const
Returns the ascent of the font.
int averageCharWidth() const
QFontMetrics & operator=(const QFontMetrics &)
Assigns the font metrics fm.
int minRightBearing() const
Returns the minimum right bearing of the font.
int leading() const
Returns the leading of the font.
int xHeight() const
Returns the 'x' height of the font.
QFontMetrics(const QFont &)
Constructs a font metrics object for font.
int leftBearing(QChar) const
Returns the left bearing of character ch in the font.
int overlinePos() const
Returns the distance from the base line to where an overline should be drawn.
~QFontMetrics()
Destroys the font metrics object and frees all allocated resources.
QFontPrivate * smallCapsFontPrivate() const
Definition qfont.cpp:271
QFontEngine * engineForScript(int script) const
Definition qfont.cpp:241
uint capital
Definition qfont_p.h:182
void alterCharForCapitalization(QChar &c) const
Definition qfont.cpp:257
\reentrant
Definition qfont.h:22
@ SmallCaps
Definition qfont.h:101
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtCore\reentrant
Definition qrect.h:484
QRect toAlignedRect() const noexcept
Definition qrect.cpp:2338
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
Definition qrect.h:735
\inmodule QtCore\reentrant
Definition qrect.h:30
constexpr QSize size() const noexcept
Returns the size of the rectangle.
Definition qrect.h:242
\inmodule QtCore
Definition qsize.h:208
\inmodule QtCore
Definition qsize.h:25
\inmodule QtCore
Definition qstringview.h:78
constexpr QStringView left(qsizetype n) const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
qsizetype indexOf(QLatin1StringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition qstring.cpp:4517
QString mid(qsizetype position, qsizetype n=-1) const &
Definition qstring.cpp:5300
qsizetype size() const noexcept
Returns the number of characters in this string.
Definition qstring.h:186
\reentrant
Definition qtextoption.h:18
QString text
rect
[4]
fontMetrics
Combined button and popup list for selecting options.
@ TextLongestVariant
Definition qnamespace.h:184
@ TextDontPrint
Definition qnamespace.h:176
TextElideMode
Definition qnamespace.h:188
int qRound(qfloat16 d) noexcept
Definition qfloat16.h:327
Q_GUI_EXPORT int qt_defaultDpi()
Definition qfont.cpp:140
QT_BEGIN_NAMESPACE void qt_format_text(const QFont &font, const QRectF &_r, int tf, const QString &text, QRectF *brect, int tabStops, int *tabArray, int tabArrayLen, QPainter *painter)
static constexpr QLatin1Char s_variableLengthStringSeparator('\x9c')
GLenum mode
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLint GLsizei width
GLbitfield flags
GLuint GLenum option
GLenum GLsizei len
GLenum portion
QT_BEGIN_NAMESPACE void qt_format_text(const QFont &fnt, const QRectF &_r, int tf, const QTextOption *opt, const QString &str, QRectF *brect, int tabstops, int *, int tabarraylen, QPainter *painter)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
unsigned int glyph_t
unsigned int uint
Definition qtypes.h:34
double qreal
Definition qtypes.h:187
QVBoxLayout * layout
QSharedPointer< T > other(t)
[5]
QPainter painter(this)
[7]
QJSEngine engine
[0]
static constexpr QFixed fromReal(qreal r)
Definition qfixed_p.h:35
constexpr qreal toReal() const
Definition qfixed_p.h:42
glyph_t * glyphs
QFixed * advances
\inmodule QtCore \reentrant
Definition qchar.h:18