diff options
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qquickglobal.cpp | 8 | ||||
-rw-r--r-- | src/quick/util/qquickimageprovider.cpp | 6 | ||||
-rw-r--r-- | src/quick/util/qquickpath.cpp | 3 | ||||
-rw-r--r-- | src/quick/util/qquickpropertychanges.cpp | 4 | ||||
-rw-r--r-- | src/quick/util/qquickvaluetypes.cpp | 13 | ||||
-rw-r--r-- | src/quick/util/qquickvaluetypes_p.h | 4 |
6 files changed, 33 insertions, 5 deletions
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index 6df23cdff5..14ead56740 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -303,6 +303,7 @@ public: QV4::ScopedValue vwspac(scope, obj->get((s = v4->newString(QStringLiteral("wordSpacing"))))); QV4::ScopedValue vhint(scope, obj->get((s = v4->newString(QStringLiteral("hintingPreference"))))); QV4::ScopedValue vkerning(scope, obj->get((s = v4->newString(QStringLiteral("kerning"))))); + QV4::ScopedValue vshaping(scope, obj->get((s = v4->newString(QStringLiteral("preferShaping"))))); // pull out the values, set ok to true if at least one valid field is given. if (vbold->isBoolean()) { @@ -361,6 +362,13 @@ public: retn.setKerning(vkerning->booleanValue()); if (ok) *ok = true; } + if (vshaping->isBoolean()) { + bool enable = vshaping->booleanValue(); + if (enable) + retn.setStyleStrategy(static_cast<QFont::StyleStrategy>(retn.styleStrategy() & ~QFont::PreferNoShaping)); + else + retn.setStyleStrategy(static_cast<QFont::StyleStrategy>(retn.styleStrategy() | QFont::PreferNoShaping)); + } return retn; } diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp index b4a6b9e1f6..6ee5b95dc7 100644 --- a/src/quick/util/qquickimageprovider.cpp +++ b/src/quick/util/qquickimageprovider.cpp @@ -255,7 +255,7 @@ void QQuickImageResponse::cancel() If you want the rest of the URL to be case insensitive, you will have to take care of that yourself inside your image provider. - \section2 An example + \section2 An Example Here are two images. Their \c source values indicate they should be loaded by an image provider named "colors", and the images to be loaded are "yellow" @@ -301,7 +301,7 @@ void QQuickImageResponse::cancel() instead of registering it in the application \c main() function as shown above. - \section2 Asynchronous image loading + \section2 Asynchronous Image Loading Image providers that support QImage or Texture loading automatically include support for asychronous loading of images. To enable asynchronous loading for an @@ -330,7 +330,7 @@ void QQuickImageResponse::cancel() See the \l {imageresponseprovider}{Image Response Provider Example} for a complete implementation. - \section2 Image caching + \section2 Image Caching Images returned by a QQuickImageProvider are automatically cached, similar to any image loaded by the QML engine. When an image with a diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp index 15defdc01b..b19eec6fb3 100644 --- a/src/quick/util/qquickpath.cpp +++ b/src/quick/util/qquickpath.cpp @@ -146,6 +146,9 @@ QT_BEGIN_NAMESPACE \li No \endtable + \note Path is a non-visual type; it does not display anything on its own. + To draw a path, use \l Shape. + \sa PathView, Shape, PathAttribute, PathPercent, PathLine, PathMove, PathQuad, PathCubic, PathArc, PathCurve, PathSvg */ QQuickPath::QQuickPath(QObject *parent) diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp index 8d76bd986f..61380b3ea0 100644 --- a/src/quick/util/qquickpropertychanges.cpp +++ b/src/quick/util/qquickpropertychanges.cpp @@ -101,7 +101,7 @@ QT_BEGIN_NAMESPACE \l {Item::}{parent} value, use ParentChange instead. - \section2 Resetting property values + \section2 Resetting Property Values The \c undefined value can be used to reset the property value for a state. In the following example, when \c myText changes to the \e widerText @@ -111,7 +111,7 @@ QT_BEGIN_NAMESPACE \snippet qml/propertychanges.qml reset - \section2 Immediate property changes in transitions + \section2 Immediate Property Changes in Transitions When \l{Animation and Transitions in Qt Quick}{Transitions} are used to animate state changes, they animate properties from their values in the current diff --git a/src/quick/util/qquickvaluetypes.cpp b/src/quick/util/qquickvaluetypes.cpp index bc4a72b6ea..e4a03f3b52 100644 --- a/src/quick/util/qquickvaluetypes.cpp +++ b/src/quick/util/qquickvaluetypes.cpp @@ -767,6 +767,19 @@ void QQuickFontValueType::setKerning(bool b) v.setKerning(b); } +bool QQuickFontValueType::preferShaping() const +{ + return (v.styleStrategy() & QFont::PreferNoShaping) == 0; +} + +void QQuickFontValueType::setPreferShaping(bool enable) +{ + if (enable) + v.setStyleStrategy(static_cast<QFont::StyleStrategy>(v.styleStrategy() & ~QFont::PreferNoShaping)); + else + v.setStyleStrategy(static_cast<QFont::StyleStrategy>(v.styleStrategy() | QFont::PreferNoShaping)); +} + QT_END_NAMESPACE #include "moc_qquickvaluetypes_p.cpp" diff --git a/src/quick/util/qquickvaluetypes_p.h b/src/quick/util/qquickvaluetypes_p.h index a3f35a84ec..5a9af970e8 100644 --- a/src/quick/util/qquickvaluetypes_p.h +++ b/src/quick/util/qquickvaluetypes_p.h @@ -324,6 +324,7 @@ class QQuickFontValueType Q_PROPERTY(qreal wordSpacing READ wordSpacing WRITE setWordSpacing FINAL) Q_PROPERTY(HintingPreference hintingPreference READ hintingPreference WRITE setHintingPreference FINAL) Q_PROPERTY(bool kerning READ kerning WRITE setKerning FINAL) + Q_PROPERTY(bool preferShaping READ preferShaping WRITE setPreferShaping FINAL) public: enum FontWeight { Thin = QFont::Thin, @@ -397,6 +398,9 @@ public: bool kerning() const; void setKerning(bool b); + + bool preferShaping() const; + void setPreferShaping(bool b); }; QT_END_NAMESPACE |