QmlDesigner: Add missing font and text properties for Qt 5.10

Task-number: QTPM-862
Change-Id: I12813cf429f4f4a5a85c4e3c6d74eb7ac1a45bd2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Thomas Hartmann
2018-01-09 09:48:39 +01:00
parent 699dd2c426
commit 50ca0de846
4 changed files with 56 additions and 6 deletions

View File

@@ -673,6 +673,8 @@ Module {
Property { name: "capitalization"; type: "Capitalization" }
Property { name: "letterSpacing"; type: "qreal" }
Property { name: "wordSpacing"; type: "qreal" }
Property { name: "kerning"; type: "bool" }
Property { name: "preferShaping"; type: "bool" }
}
Component {
name: "QDeclarativeGradient"

View File

@@ -191,11 +191,13 @@ Section {
width: 42
}
SpinBox {
maximumValue: 9999999
minimumValue: -9999999
decimals: 0
maximumValue: 500
minimumValue: -500
decimals: 2
backendValue: backendValues.font_wordSpacing
Layout.fillWidth: true
Layout.minimumWidth: 60
stepSize: 0.1
}
Item {
width: 4
@@ -208,11 +210,39 @@ Section {
width: 42
}
SpinBox {
maximumValue: 9999999
minimumValue: -9999999
decimals: 0
maximumValue: 500
minimumValue: -500
decimals: 2
backendValue: backendValues.font_letterSpacing
Layout.fillWidth: true
Layout.minimumWidth: 60
stepSize: 0.1
}
}
Label {
visible: minorQtQuickVersion > 9
text: qsTr("Performance")
}
SecondColumnLayout {
visible: minorQtQuickVersion > 9
CheckBox {
text: qsTr("Kerning")
Layout.fillWidth: true
backendValue: (backendValues.font_kerning === undefined) ? dummyBackendValue : backendValues.font_kerning
tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. This may " +
"improve performance when creating or changing the text, at the expense of some cosmetic features. The default value is true.")
}
CheckBox {
text: qsTr("Prefer Shaping")
Layout.fillWidth: true
backendValue: (backendValues.font_preferShaping === undefined) ? dummyBackendValue : backendValues.font_preferShaping
tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" +
"In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, but in e.g." +
"Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.")
}
}
}

View File

@@ -128,5 +128,21 @@ Section {
backendValue: backendValues.fontSizeMode
Layout.fillWidth: true
}
Label {
text: qsTr("Line Height")
tooltip: qsTr("Sets the line height for the text.")
}
SpinBox {
Layout.fillWidth: true
backendValue: (backendValues.lineHeight === undefined) ? dummyBackendValue : backendValues.lineHeight
maximumValue: 500
minimumValue: 0
decimals: 2
stepSize: 0.1
}
}
}

View File

@@ -493,6 +493,8 @@ SharedValueOwner::SharedValueOwner(SharedValueOwnerKind kind)
_qmlFontObject->setMember(QLatin1String("letterSpacing"), realValue());
_qmlFontObject->setMember(QLatin1String("wordSpacing"), realValue());
_qmlFontObject->setMember(QLatin1String("hintingPreference"), unknownValue());
_qmlFontObject->setMember(QLatin1String("kerning"), booleanValue());
_qmlFontObject->setMember(QLatin1String("preferShaping"), booleanValue());
_qmlPointObject = newObject(/*prototype =*/ 0);
_qmlPointObject->setClassName(QLatin1String("Point"));