Added static GET_HEADER_FOR_COLUMN(const int column) function.

This commit is contained in:
2026-03-02 16:25:01 +01:00
parent 057bd244bd
commit f392efb54f
2 changed files with 7 additions and 0 deletions

View File

@ -86,4 +86,10 @@ static QList<QString> GET_HEADER_NAMES() {
return result;
}
static QString GET_HEADER_FOR_COLUMN(const int column) {
const UserRoles role = GET_ROLE_FOR_COLUMN(column);
const QString headerName = ROLE_NAMES.value(role);
return headerName;
}
#endif // METADATA_H

View File

@ -304,6 +304,7 @@ QMap<int, QVariant> TableModel::onlyChangedValues(const QModelIndex& index,
// TODO check if role is a editable role?
if (oldValue != newValue) {
bool emptyValueIsEqualToZero = isEmptyValueEqualToZero(role);
// REFACTOR the next if statement is too complex
if (emptyValueIsEqualToZero && oldValue == QVariant() && newValue == 0) {
qDebug() << "oldValue:" << oldValue << "& newValue:" << newValue
<< "mean the same. Ignoring...";