Expose QFont enums to the meta object system

Qt Quick Controls 2 needs configurable and toolable fonts for the
upcoming image-based style. Exposing these enums to the meta object
system allows the font weights, styles, etc. being specified as
enum value string names.

Change-Id: I024793656dd1af3a47d4edb5e27563a13c3b4c08
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
J-P Nurmi 2017-05-30 13:10:48 +02:00
parent 395ef25353
commit 46b8997b52

View File

@ -68,6 +68,7 @@ public:
Monospace, Monospace,
Fantasy Fantasy
}; };
Q_ENUM(StyleHint)
enum StyleStrategy { enum StyleStrategy {
PreferDefault = 0x0001, PreferDefault = 0x0001,
@ -92,6 +93,7 @@ public:
PreferVerticalHinting = 2, PreferVerticalHinting = 2,
PreferFullHinting = 3 PreferFullHinting = 3
}; };
Q_ENUM(HintingPreference)
// Mapping OpenType weight value. // Mapping OpenType weight value.
enum Weight { enum Weight {
@ -105,12 +107,14 @@ public:
ExtraBold = 81, // 800 ExtraBold = 81, // 800
Black = 87 // 900 Black = 87 // 900
}; };
Q_ENUM(Weight)
enum Style { enum Style {
StyleNormal, StyleNormal,
StyleItalic, StyleItalic,
StyleOblique StyleOblique
}; };
Q_ENUM(Style)
enum Stretch { enum Stretch {
AnyStretch = 0, AnyStretch = 0,
@ -124,6 +128,7 @@ public:
ExtraExpanded = 150, ExtraExpanded = 150,
UltraExpanded = 200 UltraExpanded = 200
}; };
Q_ENUM(Stretch)
enum Capitalization { enum Capitalization {
MixedCase, MixedCase,
@ -132,11 +137,13 @@ public:
SmallCaps, SmallCaps,
Capitalize Capitalize
}; };
Q_ENUM(Capitalization)
enum SpacingType { enum SpacingType {
PercentageSpacing, PercentageSpacing,
AbsoluteSpacing AbsoluteSpacing
}; };
Q_ENUM(SpacingType)
enum ResolveProperties { enum ResolveProperties {
FamilyResolved = 0x0001, FamilyResolved = 0x0001,