upgrade to qt 6 compliance

This commit is contained in:
itsmattkc
2022-10-28 19:42:14 -07:00
parent 2a595cb4c7
commit 4d80044d6d
69 changed files with 152 additions and 130 deletions
+14 -2
View File
@@ -103,14 +103,26 @@ void SliderBase::changeEvent(QEvent *e)
super::changeEvent(e);
}
bool SliderBase::GetLabelSubstitution(const QVariant &v, QString *out) const
{
for (auto it=label_substitutions_.constBegin(); it!=label_substitutions_.constEnd(); it++) {
if (it->first == v) {
*out = it->second;
return true;
}
}
return false;
}
void SliderBase::UpdateLabel()
{
QString s;
if (tristate_) {
s = tr("---");
} else if (label_substitutions_.contains(GetValueInternal())) {
s = label_substitutions_.value(GetValueInternal());
} else if (GetLabelSubstitution(GetValueInternal(), &s)) {
// String will already be set, just pass through
} else {
s = GetFormattedValueToString();
}