aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-12 08:53:00 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-12 16:18:28 +0000
commit8784a2778063cf928b27a908f6580ed37cb4035d (patch)
tree5a0871bc6fdd795d7971bc43c3811ee467d4ff38 /src
parent0e92e0bd6e7209ad491472b3928840ad78c5371a (diff)
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 <fabian.kosmale@qt.io> (cherry picked from commit 4cc91a6a0e4f9063233a4d6554ae64855cf99c14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/qml/doc/snippets/qml/events.qml6
-rw-r--r--src/qml/doc/src/cppintegration/exposecppattributes.qdoc2
-rw-r--r--src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc4
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc6
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/signals.qdoc2
-rw-r--r--src/qml/types/qqmlconnections.cpp2
-rw-r--r--src/qmlworkerscript/doc/snippets/qml/workerscript/workerscript.qml4
-rw-r--r--src/quick/doc/snippets/pointerHandlers/tapHandlerOnTapped.qml6
-rw-r--r--src/quick/doc/snippets/pointerHandlers/wheelHandler.qml5
-rw-r--r--src/quick/doc/snippets/qml/focus/MyClickableWidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/MyWidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/basicwidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/rectangle.qml2
-rw-r--r--src/quick/doc/snippets/qml/keys/keys-pressed.qml2
-rw-r--r--src/quick/doc/snippets/qml/loader/KeyReader.qml2
-rw-r--r--src/quick/doc/snippets/qml/loader/connections.qml2
-rw-r--r--src/quick/doc/snippets/qml/loader/focus.qml2
-rw-r--r--src/quick/doc/snippets/qml/mousearea/mousearea.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml2
-rw-r--r--src/quick/doc/snippets/qml/springanimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/text/onLinkActivated.qml2
-rw-r--r--src/quick/items/qquickevents.cpp15
-rw-r--r--src/quick/items/qquickitem.cpp4
-rw-r--r--src/quick/items/qquickmousearea.cpp2
-rw-r--r--src/quick/items/qquicktext.cpp4
27 files changed, 46 insertions, 44 deletions
diff --git a/src/qml/doc/snippets/qml/events.qml b/src/qml/doc/snippets/qml/events.qml
index f437e32890..d29be5ebd2 100644
--- a/src/qml/doc/snippets/qml/events.qml
+++ b/src/qml/doc/snippets/qml/events.qml
@@ -66,7 +66,7 @@ Rectangle {
//! [signal handler declaration]
onTrigger: console.log("trigger signal emitted")
-onSend: {
+onSend: (notice)=> {
console.log("send signal emitted with notice: " + notice)
}
@@ -90,7 +90,7 @@ Rectangle {
signal send(person: string, notice: string)
- onSend: {
+ onSend: (person, notice)=> {
console.log("For " + person + ", the notice is: " + notice)
}
@@ -103,7 +103,7 @@ Rectangle {
id: relay
signal send(person: string, notice: string)
- onSend: console.log("Send signal to: " + person + ", " + notice)
+ onSend: (person, notice)=> console.log("Send signal to: " + person + ", " + notice)
Component.onCompleted: {
relay.send.connect(sendToPost)
diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
index 5c53989cbb..618ed1e334 100644
--- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
+++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
@@ -498,7 +498,7 @@ value:
\qml
MessageBoard {
- onNewMessagePosted: console.log("New message received:", subject)
+ onNewMessagePosted: (subject)=> console.log("New message received:", subject)
}
\endqml
diff --git a/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc b/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc
index a4119ff793..718b0c25ac 100644
--- a/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc
+++ b/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc
@@ -208,7 +208,7 @@ Rectangle {
MouseArea {
id: mouseArea
anchors.fill: parent
- onClicked: root.buttonClicked(mouse.x, mouse.y)
+ onClicked: (mouse)=> root.buttonClicked(mouse.x, mouse.y)
}
}
\endqml
@@ -224,7 +224,7 @@ import QtQuick 2.0
SquareButton {
id: squareButton
- onButtonClicked: {
+ onButtonClicked: (xPos, yPos)=> {
console.log("Clicked", xPos, yPos)
randomizeColor()
}
diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
index ecfef2e04f..787e7b920b 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
@@ -852,8 +852,8 @@ Rectangle {
MouseArea {
anchors.fill: parent
- onPressed: root.activated(mouse.x, mouse.y)
onReleased: root.deactivated()
+ onPressed: (mouse)=> root.activated(mouse.x, mouse.y)
}
}
\endqml
@@ -865,8 +865,8 @@ provided by the client:
\qml
// myapplication.qml
SquareButton {
- onActivated: console.log("Activated at " + xPosition + "," + yPosition)
onDeactivated: console.log("Deactivated!")
+ onActivated: (xPosition, yPosition)=> console.log("Activated at " + xPosition + "," + yPosition)
}
\endqml
@@ -954,7 +954,7 @@ Item {
MouseArea {
anchors.fill: parent
- onClicked: label.moveTo(mouse.x, mouse.y)
+ onClicked: (mouse)=> label.moveTo(mouse.x, mouse.y)
}
Text {
diff --git a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
index dd71347b2a..1c13636689 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
@@ -220,7 +220,7 @@ Now any objects of the \c SquareButton can connect to the \c activated signal us
\qml
// myapplication.qml
SquareButton {
- onActivated: console.log("Activated at " + xPosition + "," + yPosition)
+ onActivated: (xPosition, yPosition)=> console.log("Activated at " + xPosition + "," + yPosition)
}
\endqml
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp
index 676c15e01f..7767909169 100644
--- a/src/qml/types/qqmlconnections.cpp
+++ b/src/qml/types/qqmlconnections.cpp
@@ -88,7 +88,7 @@ public:
\qml
MouseArea {
- onClicked: { foo(parameters) }
+ onClicked: (mouse)=> { foo(mouse) }
}
\endqml
diff --git a/src/qmlworkerscript/doc/snippets/qml/workerscript/workerscript.qml b/src/qmlworkerscript/doc/snippets/qml/workerscript/workerscript.qml
index cc637d34cf..cc4d941ff6 100644
--- a/src/qmlworkerscript/doc/snippets/qml/workerscript/workerscript.qml
+++ b/src/qmlworkerscript/doc/snippets/qml/workerscript/workerscript.qml
@@ -63,12 +63,12 @@ Rectangle {
id: myWorker
source: "script.mjs"
- onMessage: myText.text = messageObject.reply
+ onMessage: (messageObject)=> myText.text = messageObject.reply
}
MouseArea {
anchors.fill: parent
- onClicked: myWorker.sendMessage({ 'x': mouse.x, 'y': mouse.y })
+ onClicked: (mouse)=> myWorker.sendMessage({ 'x': mouse.x, 'y': mouse.y })
}
}
//![0]
diff --git a/src/quick/doc/snippets/pointerHandlers/tapHandlerOnTapped.qml b/src/quick/doc/snippets/pointerHandlers/tapHandlerOnTapped.qml
index f556c238da..deff59d034 100644
--- a/src/quick/doc/snippets/pointerHandlers/tapHandlerOnTapped.qml
+++ b/src/quick/doc/snippets/pointerHandlers/tapHandlerOnTapped.qml
@@ -56,9 +56,9 @@ Rectangle {
TapHandler {
acceptedButtons: Qt.LeftButton | Qt.RightButton
- onTapped: console.log("tapped", eventPoint.event.device.name,
- "button", eventPoint.event.button,
- "@", eventPoint.scenePosition)
+ onTapped: (eventPoint)=> console.log("tapped", eventPoint.event.device.name,
+ "button", eventPoint.event.button,
+ "@", eventPoint.scenePosition)
}
}
//![0]
diff --git a/src/quick/doc/snippets/pointerHandlers/wheelHandler.qml b/src/quick/doc/snippets/pointerHandlers/wheelHandler.qml
index 2c9913ac97..b3d659b4e5 100644
--- a/src/quick/doc/snippets/pointerHandlers/wheelHandler.qml
+++ b/src/quick/doc/snippets/pointerHandlers/wheelHandler.qml
@@ -56,8 +56,9 @@ Rectangle {
WheelHandler {
property: "rotation"
- onWheel: console.log("rotation", event.angleDelta.y,
- "scaled", rotation, "@", point.position, "=>", parent.rotation)
+ onWheel: (event)=> console.log("rotation", event.angleDelta.y,
+ "scaled", rotation, "@", point.position,
+ "=>", parent.rotation)
}
}
//![0]
diff --git a/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml b/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml
index a5a4eae0ab..43d5defad4 100644
--- a/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml
+++ b/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml
@@ -65,7 +65,7 @@ FocusScope {
color: "lightsteelblue"; width: 175; height: 25; radius: 10; antialiasing: true
Text { id: label; anchors.centerIn: parent }
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
if (event.key == Qt.Key_A)
label.text = 'Key A was pressed'
else if (event.key == Qt.Key_B)
diff --git a/src/quick/doc/snippets/qml/focus/MyWidget.qml b/src/quick/doc/snippets/qml/focus/MyWidget.qml
index 82d7ee35b4..d446489813 100644
--- a/src/quick/doc/snippets/qml/focus/MyWidget.qml
+++ b/src/quick/doc/snippets/qml/focus/MyWidget.qml
@@ -56,7 +56,7 @@ Rectangle {
color: "lightsteelblue"; width: 175; height: 25; radius: 10; antialiasing: true
Text { id: label; anchors.centerIn: parent}
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
if (event.key == Qt.Key_A)
label.text = 'Key A was pressed'
else if (event.key == Qt.Key_B)
diff --git a/src/quick/doc/snippets/qml/focus/basicwidget.qml b/src/quick/doc/snippets/qml/focus/basicwidget.qml
index ddcf95b69a..3fd9fab748 100644
--- a/src/quick/doc/snippets/qml/focus/basicwidget.qml
+++ b/src/quick/doc/snippets/qml/focus/basicwidget.qml
@@ -56,7 +56,7 @@ Rectangle {
Item {
id: keyHandler
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
if (event.key == Qt.Key_A)
myText.text = 'Key A was pressed'
else if (event.key == Qt.Key_B)
diff --git a/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml b/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml
index 3283bcfcbf..6dd892f37d 100644
--- a/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml
+++ b/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml
@@ -64,7 +64,7 @@ FocusScope {
color: "lightsteelblue"; width: 175; height: 25; radius: 10; antialiasing: true
Text { id: label; anchors.centerIn: parent }
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
if (event.key == Qt.Key_A)
label.text = 'Key A was pressed'
else if (event.key == Qt.Key_B)
diff --git a/src/quick/doc/snippets/qml/focus/rectangle.qml b/src/quick/doc/snippets/qml/focus/rectangle.qml
index 5675ae44b2..d49bf1d0d6 100644
--- a/src/quick/doc/snippets/qml/focus/rectangle.qml
+++ b/src/quick/doc/snippets/qml/focus/rectangle.qml
@@ -53,7 +53,7 @@ import QtQuick 2.0
Rectangle {
width: 100; height: 100
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
if (event.key == Qt.Key_A) {
console.log('Key A was pressed');
event.accepted = true;
diff --git a/src/quick/doc/snippets/qml/keys/keys-pressed.qml b/src/quick/doc/snippets/qml/keys/keys-pressed.qml
index 418691dc9a..592d83b525 100644
--- a/src/quick/doc/snippets/qml/keys/keys-pressed.qml
+++ b/src/quick/doc/snippets/qml/keys/keys-pressed.qml
@@ -57,7 +57,7 @@ Item {
Item {
anchors.fill: parent
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Left) {
console.log("move left");
event.accepted = true;
diff --git a/src/quick/doc/snippets/qml/loader/KeyReader.qml b/src/quick/doc/snippets/qml/loader/KeyReader.qml
index 56604319e0..c68ebf4f1a 100644
--- a/src/quick/doc/snippets/qml/loader/KeyReader.qml
+++ b/src/quick/doc/snippets/qml/loader/KeyReader.qml
@@ -42,7 +42,7 @@ import QtQuick 2.0
Item {
Item {
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
console.log("KeyReader captured:",
event.text);
event.accepted = true;
diff --git a/src/quick/doc/snippets/qml/loader/connections.qml b/src/quick/doc/snippets/qml/loader/connections.qml
index 5ff57a1d38..5b2126a8fd 100644
--- a/src/quick/doc/snippets/qml/loader/connections.qml
+++ b/src/quick/doc/snippets/qml/loader/connections.qml
@@ -49,7 +49,7 @@ Item {
Connections {
target: myLoader.item
- onMessage: console.log(msg)
+ function onMessage(msg) { console.log(msg) }
}
}
//![0]
diff --git a/src/quick/doc/snippets/qml/loader/focus.qml b/src/quick/doc/snippets/qml/loader/focus.qml
index f3509021f1..b59f72c729 100644
--- a/src/quick/doc/snippets/qml/loader/focus.qml
+++ b/src/quick/doc/snippets/qml/loader/focus.qml
@@ -54,7 +54,7 @@ Rectangle {
}
}
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
console.log("Captured:",
event.text);
}
diff --git a/src/quick/doc/snippets/qml/mousearea/mousearea.qml b/src/quick/doc/snippets/qml/mousearea/mousearea.qml
index fd47752bb7..d3f307c0f2 100644
--- a/src/quick/doc/snippets/qml/mousearea/mousearea.qml
+++ b/src/quick/doc/snippets/qml/mousearea/mousearea.qml
@@ -77,7 +77,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
- onClicked: {
+ onClicked: (mouse)=> {
if (mouse.button == Qt.RightButton)
parent.color = 'blue';
else
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
index 96f7fc1c7c..709582986d 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
@@ -59,7 +59,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
- onClicked: rect.buttonClicked(mouse.x, mouse.y)
+ onClicked: (mouse)=> rect.buttonClicked(mouse.x, mouse.y)
}
}
//![0]
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
index 8c9c5a09ab..2de2e9bbc7 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
@@ -52,7 +52,7 @@ import QtQuick 2.0
// application.qml
Button {
width: 100; height: 100
- onButtonClicked: {
+ onButtonClicked: (xPos, yPos)=> {
console.log("Mouse clicked at " + xPos + "," + yPos)
}
}
diff --git a/src/quick/doc/snippets/qml/springanimation.qml b/src/quick/doc/snippets/qml/springanimation.qml
index 658bcfb7d7..c18d662abc 100644
--- a/src/quick/doc/snippets/qml/springanimation.qml
+++ b/src/quick/doc/snippets/qml/springanimation.qml
@@ -65,7 +65,7 @@ Item {
MouseArea {
anchors.fill: parent
- onClicked: {
+ onClicked: (mouse)=> {
rect.x = mouse.x - rect.width/2
rect.y = mouse.y - rect.height/2
}
diff --git a/src/quick/doc/snippets/qml/text/onLinkActivated.qml b/src/quick/doc/snippets/qml/text/onLinkActivated.qml
index 07bae61089..b6c876f3d7 100644
--- a/src/quick/doc/snippets/qml/text/onLinkActivated.qml
+++ b/src/quick/doc/snippets/qml/text/onLinkActivated.qml
@@ -56,7 +56,7 @@ Rectangle {
Text {
textFormat: Text.RichText
text: "See the <a href=\"http://qt-project.org\">Qt Project website</a>."
- onLinkActivated: console.log(link + " link activated")
+ onLinkActivated: (link)=> console.log(link + " link activated")
}
//![0]
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp
index 8df3c1b7dd..ba9082cc2a 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -65,7 +65,7 @@ Q_LOGGING_CATEGORY(lcPointerEvents, "qt.quick.pointer.events")
\qml
Item {
focus: true
- Keys.onPressed: { if (event.key == Qt.Key_Enter) state = 'ShowDetails'; }
+ Keys.onPressed: (event)=> { if (event.key == Qt.Key_Enter) state = 'ShowDetails'; }
}
\endqml
*/
@@ -148,7 +148,7 @@ Item {
\qml
Item {
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
if ((event.key == Qt.Key_Enter) && (event.modifiers & Qt.ShiftModifier))
doSomething();
}
@@ -165,7 +165,7 @@ Item {
\qml
Item {
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
if (event.matches(StandardKey.Undo))
myModel.undo();
else if (event.matches(StandardKey.Redo))
@@ -278,7 +278,7 @@ bool QQuickKeyEvent::matches(QKeySequence::StandardKey matchKey) const
For example, to react to a Shift key + Left mouse button click:
\qml
MouseArea {
- onClicked: {
+ onClicked: (mouse)=> {
if ((mouse.button == Qt.LeftButton) && (mouse.modifiers & Qt.ShiftModifier))
doSomething();
}
@@ -322,8 +322,9 @@ bool QQuickKeyEvent::matches(QKeySequence::StandardKey matchKey) const
For example, to react only to events which come from an actual mouse:
\qml
MouseArea {
- onPressed: if (mouse.source !== Qt.MouseEventNotSynthesized) {
- mouse.accepted = false
+ onPressed: (mouse)=> {
+ if (mouse.source !== Qt.MouseEventNotSynthesized)
+ mouse.accepted = false
}
onClicked: doSomething()
@@ -449,7 +450,7 @@ bool QQuickKeyEvent::matches(QKeySequence::StandardKey matchKey) const
For example, to react to a Control key pressed during the wheel event:
\qml
MouseArea {
- onWheel: {
+ onWheel: (wheel)=> {
if (wheel.modifiers & Qt.ControlModifier) {
adjustZoom(wheel.angleDelta.y / 120);
}
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 38e83e08ff..d9733309b1 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -968,7 +968,7 @@ bool QQuickKeysAttached::isConnected(const char *signalName) const
focus: true
// Ensure that we get escape key press events first.
- Keys.onShortcutOverride: event.accepted = (event.key === Qt.Key_Escape)
+ Keys.onShortcutOverride: (event)=> event.accepted = (event.key === Qt.Key_Escape)
Keys.onEscapePressed: {
console.log("escapeItem is handling escape");
@@ -1922,7 +1922,7 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus)
Item {
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Left) {
console.log("move left");
event.accepted = true;
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index 1a406dbbc2..ac7c23f7a2 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -597,7 +597,7 @@ void QQuickMouseArea::setPreventStealing(bool prevent)
MouseArea {
anchors.fill: parent
propagateComposedEvents: true
- onClicked: {
+ onClicked: (mouse)=> {
console.log("clicked blue")
mouse.accepted = false
}
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