diff options
author | Eike Hein <hein@kde.org> | 2015-06-04 21:25:32 +0200 |
---|---|---|
committer | Kai Uwe Broulik <kde@privat.broulik.de> | 2016-08-09 07:05:27 +0000 |
commit | 31ca52cee47f189ee1c80245f7b114c29ac7c675 (patch) | |
tree | 8f2c299baf322c4d132ba1e24cda31bc7cb70c04 /src/quick/items | |
parent | 13a427475d3638de843f33145378587037841a86 (diff) |
Don't accept left clicks when text format is plain.
Text elements may contain rich text with embedded links, and
need to accept left clicks to open them. However, setting the
textFormat to PlainText can disable mouse handling entirely,
as it is not required.
Accepting left clicks if there can be nothing to interact with
is unexpected and surprising, and can cause bugs in code that
performs child event filtering and doesn't expect Text elements
to produce child events.
Change-Id: Ibd5b9cf8d06fd30ea26f78b5393cc43e94646e73
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquicktext.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index e67e2cee9c..ea2d2f3133 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -2013,6 +2013,7 @@ void QQuickText::setTextFormat(TextFormat format) } d->updateLayout(); setAcceptHoverEvents(d->richText || d->styledText); + setAcceptedMouseButtons(d->richText || d->styledText ? Qt::LeftButton : Qt::NoButton); emit textFormatChanged(d->format); } |