aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2014-10-22 12:43:42 +0200
committerMitch Curtis <mitch.curtis@digia.com>2014-10-28 10:08:24 +0100
commitdf7f3141bddfd84590091612b271521a5d721a37 (patch)
tree50d009cf0d476706f19a88b62a7fe554e02d2495
parent327d0886c3d9e9854849f5bebda4d6825e94a62e (diff)
Don't document Context2D's TextMetrics as its own QML type.
It can't be instantiated like a QML type, so it's actually better to just document measureText() (which is the only way to construct objects of this type) as returning an object containing some metrics for the current font. This should have no effect on user code. This solves the issue of the new TextMetrics type's documentation not showing up. TextMetrics is a type that *can* be instantiated and is more feature complete. It provides a declarative API for the functions that take arguments in QFontMetrics. Change-Id: I46251e6f3aa7179ab569f5131307181f71043df4 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index d9ac3abdc3..b1af6f10dd 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -2801,28 +2801,10 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_strokeText(QV4::CallContex
}
/*!
- \qmltype TextMetrics
- \inqmlmodule QtQuick
- \since 5.0
- \ingroup qtquick-canvas
- \brief Provides a Context2D TextMetrics interface
-
- The TextMetrics object can be created by QtQuick::Context2D::measureText method.
- See \l{http://www.w3.org/TR/2dcontext/#textmetrics}{W3C 2d context TextMetrics} for more details.
-
- \sa Context2D::measureText
- \sa width
- */
+ \qmlmethod object QtQuick::Context2D::measureText(text)
-/*!
- \qmlproperty int QtQuick::TextMetrics::width
- Holds the advance width of the text that was passed to the QtQuick::Context2D::measureText() method.
- This property is read only.
- */
-
-/*!
- \qmlmethod variant QtQuick::Context2D::measureText(text)
- Returns a TextMetrics object with the metrics of the given text in the current font.
+ Returns an object with a \c width property, whose value is equivalent to
+ calling \l {QFontMetrics::width()} with the given \a text in the current font.
*/
QV4::ReturnedValue QQuickJSContext2DPrototype::method_measureText(QV4::CallContext *ctx)
{