mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user