Allows to display callsign / user / statusmessage as icon in views. refs #122

* Icons
* update of resource file
* update in CValueObject classes callsign / user / statusmessage
* update in list models, data method for returning Pixmap
This commit is contained in:
Klaus Basan
2014-02-05 21:47:36 +00:00
committed by Mathew Sutcliffe
parent 431b347cfd
commit 7a63768c83
19 changed files with 87 additions and 4 deletions

View File

@@ -41,6 +41,38 @@ namespace BlackMisc
return unified;
}
/*
* Iconify
*/
const QPixmap &CCallsign::convertToIcon(const CCallsign &callsign)
{
static const QPixmap app(QPixmap(":/blackmisc/icons/question.png").scaledToWidth(16, Qt::SmoothTransformation));
static const QPixmap gnd(QPixmap(":/blackmisc/icons/question.png").scaledToWidth(16, Qt::SmoothTransformation));
static const QPixmap del(QPixmap(":/blackmisc/icons/question.png").scaledToWidth(16, Qt::SmoothTransformation));
static const QPixmap twr(QPixmap(":/blackmisc/icons/question.png").scaledToWidth(16, Qt::SmoothTransformation));
static const QPixmap pilot(QPixmap(":/blackmisc/icons/aeropuerto.png").scaledToWidth(16, Qt::SmoothTransformation));
static const QPixmap sup(":/blackmisc/icons/SUP.png");
static const QPixmap unknown(QPixmap(":/blackmisc/icons/question.png").scaledToWidth(16, Qt::SmoothTransformation));
QString t = callsign.asString().toUpper();
if (t.length() < 3) return unknown;
t = t.right(3);
if (callsign.getStringAsSet().contains("_"))
{
if ("APP" == t) return app;
if ("GND" == t) return gnd;
if ("TWR" == t) return twr;
if ("DEL" == t) return del;
if ("SUP" == t) return sup;
return unknown;
}
else
{
return pilot;
}
}
/*
* Callsign as Observer
*/