MCPcopy Create free account
hub / github.com/KDE/kdevelop / sizeHint

Method sizeHint

kdevplatform/util/expandablelineedit.cpp:34–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34QSize KExpandableLineEdit::sizeHint() const
35{
36 auto idealSize = QLineEdit::sizeHint();
37
38 int idealWidth = fontMetrics().horizontalAdvance(text());
39 if (isClearButtonEnabled()) {
40 idealWidth += 2 * idealSize.height();
41 }
42 idealSize.setWidth(qMax(idealWidth, m_preferredWidth));
43
44 return idealSize;
45}
46
47#include "moc_expandablelineedit.cpp"

Callers

nothing calls this directly

Calls 1

sizeHintFunction · 0.85

Tested by

no test coverage detected