refs #264, QPixmap enable list model base to simplify columns with icons

* new constructor in column class
* removed overridden data method, no longer needed
* added icons for ATC station views
* QPixmap comparison for such columns (free functions)
This commit is contained in:
Klaus Basan
2014-06-10 02:05:44 +02:00
parent 9ea1fd86ef
commit 56430c860a
9 changed files with 59 additions and 34 deletions

View File

@@ -74,11 +74,19 @@ namespace BlackGui
if (role == Qt::DisplayRole)
{
if (this->m_columns.isIcon(index)) return QVariant();
ObjectType obj = this->m_container[index.row()];
int propertyIndex = this->columnToPropertyIndex(index.column());
QString propertyString = obj.propertyByIndexAsString(propertyIndex, true);
return QVariant::fromValue(propertyString);
}
else if (role == Qt::DecorationRole)
{
if (!this->m_columns.isIcon(index)) return QVariant();
ObjectType obj = this->m_container[index.row()];
int propertyIndex = this->columnToPropertyIndex(index.column());
return obj.propertyByIndex(propertyIndex);
}
else if (role == Qt::TextAlignmentRole)
{
return this->m_columns.aligmentAsQVariant(index);