6 #ifndef SWIFT_GUI_MODELS_COLUMNFORMATTERS_H
7 #define SWIFT_GUI_MODELS_COLUMNFORMATTERS_H
34 const QList<int> &supportedRoles = { Qt::DisplayRole })
35 : m_supportedRoles(supportedRoles), m_alignment(alignment), m_useI18n(i18n)
48 virtual Qt::ItemFlags flags(Qt::ItemFlags flags,
bool editable)
const;
77 bool supportsRole(
int role)
const;
84 static int alignDefault();
93 static int alignCentered() {
return Qt::AlignVCenter | Qt::AlignHCenter; }
101 static const QList<int> r({ Qt::DisplayRole });
108 static const QList<int> r({ Qt::DisplayRole, Qt::EditRole });
115 static const QList<int> r({ Qt::DecorationRole, Qt::ToolTipRole });
122 static const QList<int> r({ Qt::CheckStateRole });
129 static const QList<int> r;
144 QList<int> m_supportedRoles = roleDisplay();
145 int m_alignment = -1;
146 bool m_useI18n =
true;
177 int m_maxHeight = -1;
224 virtual Qt::ItemFlags
flags(Qt::ItemFlags
flags,
bool editable)
const override;
233 const QString &falseName =
"false",
const QList<int> &supportedRoles =
roleDisplay())
243 virtual Qt::ItemFlags
flags(Qt::ItemFlags
flags,
bool editable)
const override;
280 return new CLedWidget(
false, CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Rounded);
300 const QString &onName,
const QString &offName,
int alignment =
alignCentered());
346 static const QString f =
"yyyy-MM-dd";
353 static const QString f =
"yyyy-MM-dd HH:mm";
360 static const QString f =
"HH:mm";
367 static const QString f =
"HH:mm:ss";
374 static const QString f =
"HH:mm:ss.zzz";
379 const QString m_formatString =
"yyyy-MM-dd HH:mm";
416 const bool m_flightLevel =
false;
437 template <
class MU,
class PQ>
443 bool withUnit =
true,
bool i18n =
true,
454 const PQ pq = physicalQuantity.
value<PQ>();
459 Q_ASSERT_X(
false,
"CPhysiqalQuantiyFormatter::displayRole",
"No CPhysicalQuantity class");
493 swift::misc::physical_quantities::CFrequency>
509 swift::misc::physical_quantities::CAngle>
530 swift::misc::physical_quantities::CLength>
546 swift::misc::physical_quantities::CSpeed>
Bool value, format as text.
const swift::misc::CVariant m_trueNameVariant
displayed when true
const swift::misc::CVariant m_falseNameVariant
displayed when false
virtual Qt::ItemFlags flags(Qt::ItemFlags flags, bool editable) const
Flags.
CBoolTextFormatter(int alignment=alignDefault(), const QString &trueName="true", const QString &falseName="false", const QList< int > &supportedRoles=roleDisplay())
Constructor.
virtual swift::misc::CVariant displayRole(const swift::misc::CVariant &dataCVariant) const
Value provided as CVariant, formatter converts to standard types or string. Used with Qt::DisplayRole...
Value object for icons. An icon is stored in the global icon repository and identified by its index....
IconIndex
Index for each icon, allows to send them via DBus, efficiently store them, etc.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
T value() const
Return the value converted to the type T.
bool canConvert(int typeId) const
True if this variant can be converted to the type with the given metatype ID.
Specialized class for distance units (meter, foot, nautical miles).
static CLengthUnit ft()
Foot ft.
Models to be used with views, mainly QTableView.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.