MCPcopy Create free account
hub / github.com/NetHack/NetHack / setLabel

Method setLabel

win/Qt/qt_icon.cpp:80–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void NetHackQtLabelledIcon::setLabel(const QString &t, bool lower)
81{
82 if (!label) {
83 label=new QLabel(this);
84 label->setFont(font());
85 }
86 if (label->text() != t) {
87 label->setText(t);
88 ForceResize();
89 if (comp_mode != NoCompare) {
90 highlight((comp_mode == NeitherIsBetter) ? hl_changd
91 : (comp_mode == (lower ? SmallerIsBetter
92 : BiggerIsBetter)) ? hl_better
93 : hl_worse);
94 } else if (turn_count) {
95 // if we don't want to highlight this status field but it is
96 // currently highlighted (perhaps optional Score recently went
97 // up and has just been toggled off), remove the highlight
98 unhighlight();
99 }
100 }
101}
102
103void NetHackQtLabelledIcon::setLabel(const QString& t, long v, long cv,
104 const QString& tail)

Callers 1

updateStatsMethod · 0.45

Calls 2

nh_qsprintfFunction · 0.85
setFontMethod · 0.45

Tested by

no test coverage detected