MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / ButtonDelegate

Method ButtonDelegate

Misc/TableDelegates.cpp:28–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28ButtonDelegate::ButtonDelegate(QObject *parent, QString text)
29 : QItemDelegate(parent)
30{
31 QFont font;
32
33 font.setFamily(font.defaultFamily());
34
35 QFontMetrics fm(font);
36
37 this->text = text;
38#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
39 this->buttonWidth = fm.horizontalAdvance(" " + text + " ");
40#else
41 this->buttonWidth = fm.width(" " + text + " ");
42#endif // QT_VERSION_CHECK
43}
44
45
46void

Callers

nothing calls this directly

Calls 1

widthMethod · 0.80

Tested by

no test coverage detected