Details
-
Technical task
-
Resolution: Unresolved
-
Not Evaluated
-
None
Description
The SystemPallete QML element exposes most QPalette colors but not Link or LinkVisited, which makes it cumbersome to access those colors inside QML, and impossible from a purely QML based application. Most other colors are unnecessary in a QML program, but you often put links in text elements, and not being able to style them against the system theme makes them jarring.
Adding these two to SystemPalette lets you set them on Text through inline CSS on Styled or Rich text, or even the linkColor property.
In documentation, these colors are mentioned not to be used by Qt itself - which is proper, in that users will use the system palette to style elements appropriately. But not exposing them at all is just a headache to deal with, especially when trying to avoid compiled code for, say, a plasmoid. It is the distinction between Label's link color defaulting to the system palette one versus developers just not being able to access that color at all to set it themselves.
Attached is the patch to just add these two to declarative so they show up in the SystemPalette element. From there, one can just set per-text element styling on every text field that uses links in a reusable manner, without infringing on the intent of the original QPalette::Link / Visited behavior.
Attachments
Issue Links
- relates to
-
QTBUG-82540 Make PDF views stylable
- Closed
-
QTBUG-1670 Not possible to set color of visited hyperlink in QTextBrowser
- Closed