From 8784a2778063cf928b27a908f6580ed37cb4035d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 12 Feb 2021 08:53:00 +0100 Subject: Use functions as signal handlers when accessing parameters Injected signal handlers are bad practice because they aren't declared. Task-number: QTBUG-89943 Change-Id: I3a691f68342a199bd63034637aa7ed438e3a037b Reviewed-by: Fabian Kosmale (cherry picked from commit 4cc91a6a0e4f9063233a4d6554ae64855cf99c14) Reviewed-by: Qt Cherry-pick Bot --- src/quick/items/qquicktext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/quick/items/qquicktext.cpp') diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index de8c9d5297..9e56bd45e9 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -1412,7 +1412,7 @@ QQuickText::~QQuickText() For example, this will move the first 5 lines of a Text item by 100 pixels to the right: \code - onLineLaidOut: { + onLineLaidOut: (line)=> { if (line.number < 5) { line.x = line.x + 100 line.width = line.width - 100 @@ -1422,7 +1422,7 @@ QQuickText::~QQuickText() The following example will allow you to position an item at the end of the last line: \code - onLineLaidOut: { + onLineLaidOut: (line)=> { if (line.isLast) { lastLineMarker.x = line.x + line.implicitWidth lastLineMarker.y = line.y + (line.height - lastLineMarker.height) / 2 -- cgit v1.2.3