MCPcopy Create free account
hub / github.com/MultiMC/Launcher / viewItemTextLayout

Function viewItemTextLayout

launcher/ui/instanceview/InstanceDelegate.cpp:31–51  ·  view source on GitHub ↗

Origin: Qt

Source from the content-addressed store, hash-verified

29
30// Origin: Qt
31static void viewItemTextLayout(QTextLayout &textLayout, int lineWidth, qreal &height,
32 qreal &widthUsed)
33{
34 height = 0;
35 widthUsed = 0;
36 textLayout.beginLayout();
37 QString str = textLayout.text();
38 while (true)
39 {
40 QTextLine line = textLayout.createLine();
41 if (!line.isValid())
42 break;
43 if (line.textLength() == 0)
44 break;
45 line.setLineWidth(lineWidth);
46 line.setPosition(QPointF(0, height));
47 height += line.height();
48 widthUsed = qMax(widthUsed, line.naturalTextWidth());
49 }
50 textLayout.endLayout();
51}
52
53ListViewDelegate::ListViewDelegate(QObject *parent) : QStyledItemDelegate(parent)
54{

Callers 2

viewItemTextSizeFunction · 0.70
paintMethod · 0.70

Calls 2

textMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected