- int best_match = _list.count() - 1;
- int64_t best_variance = INT64_MAX;
-
- for (int i = 0; i < _list.count(); i++) {
- const int64_t this_variance = abs(
- (int64_t)value - _list.itemData(i).value<int64_t>());
- if (this_variance < best_variance) {
- best_variance = this_variance;
- best_match = i;
+ if (list_.isEditable()) {
+ char *const s = sr_si_string_u64(value, suffix_);
+ list_.lineEdit()->setText(QString::fromUtf8(s));
+ g_free(s);
+ } else {
+ int best_match = list_.count() - 1;
+ int64_t best_variance = INT64_MAX;
+
+ for (int i = 0; i < list_.count(); i++) {
+ const int64_t this_variance = abs(
+ (int64_t)value - list_.itemData(i).value<int64_t>());
+ if (this_variance < best_variance) {
+ best_variance = this_variance;
+ best_match = i;
+ }