mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
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:
committed by
Mathew Sutcliffe
parent
431b347cfd
commit
7a63768c83
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user