mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +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:
@@ -10,11 +10,18 @@
|
||||
namespace BlackGui
|
||||
{
|
||||
CColumn::CColumn(const QString &headerName, int propertyIndex, int alignment, bool editable) :
|
||||
m_columnName(headerName), m_alignment(alignment), m_propertyIndex(propertyIndex), m_editable(editable)
|
||||
m_columnName(headerName), m_alignment(alignment), m_propertyIndex(propertyIndex),
|
||||
m_editable(editable), m_icon(false)
|
||||
{}
|
||||
|
||||
CColumn::CColumn(const QString &headerName, int propertyIndex, bool editable) :
|
||||
m_columnName(headerName), m_alignment(-1), m_propertyIndex(propertyIndex), m_editable(editable)
|
||||
m_columnName(headerName), m_alignment(-1), m_propertyIndex(propertyIndex),
|
||||
m_editable(editable), m_icon(false)
|
||||
{}
|
||||
|
||||
CColumn::CColumn(int propertyIndex, bool isIcon) :
|
||||
m_alignment(-1), m_propertyIndex(propertyIndex),
|
||||
m_editable(false), m_icon(isIcon)
|
||||
{}
|
||||
|
||||
const char *CColumn::getTranslationContextChar() const
|
||||
@@ -137,6 +144,15 @@ namespace BlackGui
|
||||
return this->m_columns.at(index.column()).isEditable();
|
||||
}
|
||||
|
||||
/*
|
||||
* Is icon?
|
||||
*/
|
||||
bool CColumns::isIcon(const QModelIndex &index) const
|
||||
{
|
||||
if (index.column() < 0 || index.column() >= this->m_columns.size()) return false;
|
||||
return this->m_columns.at(index.column()).isIcon();
|
||||
}
|
||||
|
||||
/*
|
||||
* Aligment as QVariant
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user