Fallback when aircraft description is missing.
- avoids corrupted delegate display caused by asking for bounds of empty string.
This commit is contained in:
parent
a39df48772
commit
ceebd59001
1 changed files with 4 additions and 0 deletions
|
@ -528,6 +528,10 @@ QVariant AircraftItemModel::dataFromItem(AircraftItemPtr item, quint32 variantIn
|
||||||
}
|
}
|
||||||
|
|
||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
|
if (item->description.isEmpty()) {
|
||||||
|
return tr("Missing description for: %1").arg(item->baseName());
|
||||||
|
}
|
||||||
|
|
||||||
return item->description;
|
return item->description;
|
||||||
} else if (role == Qt::DecorationRole) {
|
} else if (role == Qt::DecorationRole) {
|
||||||
return item->thumbnail();
|
return item->thumbnail();
|
||||||
|
|
Loading…
Add table
Reference in a new issue