Files
pilotclient/src/blackmisc/icon.cpp
Mathew Sutcliffe 31c33b4b8d refs #356 Removed CValueObject and expanded CValueObjectStdTuple to compensate.
* Involves rearranging some header includes to break cyclic include dependencies,
* Adding a new, simple base class CEmpty,
* Removing any remaining polymorphic uses of CValueObject with templates,
* Adding a new trait for use with enable_if to restrict templates to work only with value objects,
* Replacing the polymorphic/runtime multimethod-based compare functions with static/compile-time compare functions.
2015-03-27 19:08:51 +00:00

51 lines
1.2 KiB
C++

/* Copyright (C) 2013
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "icon.h"
#include "pqangle.h"
namespace BlackMisc
{
/*
* Pixmap
*/
QPixmap CIcon::toPixmap() const
{
return CIcons::pixmapByIndex(getIndex(), this->m_rotateDegrees);
}
/*
* Icon
*/
QIcon CIcon::toQIcon() const
{
return QIcon(toPixmap());
}
/*
* Rotate
*/
void CIcon::setRotation(const PhysicalQuantities::CAngle &rotate)
{
this->m_rotateDegrees = rotate.valueRounded(PhysicalQuantities::CAngleUnit::deg(), 0);
}
/*
* String
*/
QString CIcon::convertToQString(bool i18n) const
{
Q_UNUSED(i18n);
QString s = QString(this->m_descriptiveText).append(" ").append(this->m_index);
return s;
}
} // namespace