mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Issue #77 Break dependency of icon on angle
This commit is contained in:
@@ -13,10 +13,8 @@
|
||||
#include <QtGlobal>
|
||||
#include <tuple>
|
||||
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
|
||||
#include "blackmisc/icon.h"
|
||||
#include "blackmisc/iconlist.h"
|
||||
#include "blackmisc/pq/angle.h"
|
||||
#include "blackmisc/pq/units.h"
|
||||
#include "blackmisc/sequence.h"
|
||||
|
||||
#include <QStringBuilder>
|
||||
#include <QtGlobal>
|
||||
@@ -77,11 +74,6 @@ namespace BlackMisc
|
||||
return QIcon(toPixmap());
|
||||
}
|
||||
|
||||
void CIcon::setRotation(const PhysicalQuantities::CAngle &rotate)
|
||||
{
|
||||
m_rotateDegrees = static_cast<int>(rotate.valueRounded(PhysicalQuantities::CAngleUnit::deg(), 0));
|
||||
}
|
||||
|
||||
QString CIcon::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace PhysicalQuantities { class CAngle; }
|
||||
|
||||
//! Value object for icons. An icon is stored in the global icon repository and
|
||||
//! identified by its index. It contains no(!) pyhsical data for the icon itself.
|
||||
class BLACKMISC_EXPORT CIcon :
|
||||
@@ -95,9 +93,6 @@ namespace BlackMisc
|
||||
//! Rotate by n degrees
|
||||
void setRotation(int degrees) { m_rotateDegrees = degrees; }
|
||||
|
||||
//! Rotate by given degrees
|
||||
void setRotation(const BlackMisc::PhysicalQuantities::CAngle &rotate);
|
||||
|
||||
//! Set descriptive text
|
||||
void setDescriptiveText(const QString &text) { m_descriptiveText = text; }
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "blackmisc/icon.h"
|
||||
#include "blackmisc/icons.h"
|
||||
#include "blackmisc/sequence.h"
|
||||
#include "blackmisc/variant.h" // removing this line causes a clang undefined symbol error
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QMetaType>
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace BlackMisc
|
||||
CIcon CAngle::toIcon() const
|
||||
{
|
||||
CIcon i = CIcon::iconByIndex(CIcons::StandardIconArrowMediumNorth16);
|
||||
i.setRotation(*this);
|
||||
i.setRotation(value(CAngleUnit::deg()));
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace BlackMisc
|
||||
{
|
||||
namespace PhysicalQuantities
|
||||
{
|
||||
class CAngle;
|
||||
class CLength;
|
||||
class CPressure;
|
||||
class CFrequency;
|
||||
|
||||
Reference in New Issue
Block a user