Added static GET_HEADER_FOR_COLUMN(const int column) function.
This commit is contained in:
@ -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
|
||||
|
||||
@ -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...";
|
||||
|
||||
Reference in New Issue
Block a user