https://bugs.kde.org/show_bug.cgi?id=474297

            Bug ID: 474297
           Summary: CheckBox and other types can't handle hypertext links
                    in styled text
    Classification: Frameworks and Libraries
           Product: frameworks-qqc2-desktop-style
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kdelibs-b...@kde.org
          Reporter: m...@ratijas.tk
                CC: ahiems...@heimr.nl, k...@davidedmundson.co.uk,
                    noaha...@gmail.com, notm...@gmail.com
  Target Milestone: ---

SUMMARY

We've all registered on web sites, and we've had to click this kind of thing:

[✔] I have read and agreed with the _terms_and_conditions_  and 
_cookies_policy_.

where the the "underscored" (for the lack of better markup in Bugzilla) words
are links taking you to the relevant pages.

In QtQuick.Controls it is possible to make them appear as links, thanks to the
default Text.AutoText format used in Label inside
qqc2-desktop-style/CheckBox.qml and similar types. However, those Labels rely
on explicit handling of linkActivated() signal which those controls do not
provide. There is no public API in QQC2 to expose / passthrough such signal
from higher level components without vendor-locking to a specific theme
implementation. Binding linkActivated to Qt.openUrlExternally() is not an
option, as it would not cooperate with custom handlers, and there is no public
facing QML API to determine whether something else has subscribed to said
signal (however, there is a thing for that in C++).

STEPS TO REPRODUCE
1. Run the following snippet with qml tool:

QQC2.CheckBox {
    text: `I have read and agreed to our \
    <a href="https://example.com/policy.html";>Terms and Conditions</a> and \
    <a href="https://example.com/cookies.html";>Cookies Policy</a>.`
}

OBSERVED RESULT
Links are blue+underlines, but not clickable.

EXPECTED RESULT
Links should work.

SOFTWARE/OS VERSIONS
KDE Frameworks Version: KF6
Qt Version: 6.5

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to