summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-09-29 21:54:35 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-10-18 06:36:23 +0000
commitd65631daa48c82cfa1edc636ee10069b1a77fb6d (patch)
treeb09c1b4b39e030214636b00d2ab934706e57367b /src/widgets/doc
parent4afd9234c2f16536a360370a5b302f943bae727d (diff)
Qt Style Sheets: add support for hsl(a) colors
The Qt stylesheets color property did not support hsl or hsla although CSS 2.1 does support it. Since QColor natively supports this color model only the color parsing needed to be adjusted. This also adds some stricter checks for a valid css color definition and prints a warning about the issue. [ChangeLog][QtGui][CSS] Added support for hsl/hsla colors Fixes: QTBUG-58804 Change-Id: Ief65a36a7e0ed0d705dc1fe5a8658e8d07fe9a13 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/widgets/doc')
-rw-r--r--src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc16
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc18
2 files changed, 21 insertions, 13 deletions
diff --git a/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc b/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc
index bf727dd380..48d8954e60 100644
--- a/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc
+++ b/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc
@@ -514,13 +514,15 @@ QLabel { border-width: 1px 2px 3px 4px } /* 1px 2px 3px 4px */
//! [84]
-QLabel { border-color: red } /* opaque red */
-QLabel { border-color: #FF0000 } /* opaque red */
-QLabel { border-color: rgba(255, 0, 0, 75%) } /* 75% opaque red */
-QLabel { border-color: rgb(255, 0, 0) } /* opaque red */
-QLabel { border-color: rgb(100%, 0%, 0%) } /* opaque red */
-QLabel { border-color: hsv(60, 255, 255) } /* opaque yellow */
-QLabel { border-color: hsva(240, 255, 255, 75%) } /* 75% blue */
+QLabel { border-color: red } /* opaque red */
+QLabel { border-color: #FF0000 } /* opaque red */
+QLabel { border-color: rgba(255, 0, 0, 75%) } /* 75% opaque red */
+QLabel { border-color: rgb(255, 0, 0) } /* opaque red */
+QLabel { border-color: rgb(100%, 0%, 0%) } /* opaque red */
+QLabel { border-color: hsv(60, 100%, 100%) } /* opaque yellow */
+QLabel { border-color: hsva(240, 255, 255, 75%) } /* 75% blue */
+QLabel { border-color: hsl(60, 100%, 50%) } /* opaque yellow */
+QLabel { border-color: hsla(240, 255, 50%, 75%) } /* 75% blue */
//! [84]
diff --git a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
index be6a068d65..623d770f2f 100644
--- a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
@@ -2881,14 +2881,20 @@
| \tt{rgba(\e{r}, \e{g}, \e{b}, \e{a})} \br
| \tt{hsv(\e{h}, \e{s}, \e{v})} \br
| \tt{hsva(\e{h}, \e{s}, \e{v}, \e{a})} \br
+ | \tt{hsl(\e{h}, \e{s}, \e{l})} \br
+ | \tt{hsla(\e{h}, \e{s}, \e{l}, \e{a})} \br
| \tt{#\e{rrggbb}} \br
| \l{QColor::setNamedColor()}{Color Name} \br
- \li Specifies a color as RGB (red, green, blue) or RGBA
- (red, green, blue, alpha) or HSV (hue, saturation, value) or HSVA
- (hue, saturation, value, alpha) or a named color. The \c rgb() or \c rgba()
- syntax can be used with integer values between 0 and 255, or with
- percentages. The value of s, v, and a in \c hsv() or \c hsva() must all
- be in the range 0-255; the value of h must be in the range 0-359.
+ \li Specifies a color as RGB (red, green, blue), RGBA (red,
+ green, blue, alpha), HSV (hue, saturation, value), HSVA
+ (hue, saturation, value, alpha), HSL (hue, saturation,
+ lightness), HSLA (hue, saturation, lightness, alpha) or a
+ named color. The \c rgb() or \c rgba() syntax can be used
+ with integer values between 0 and 255, or with percentages.
+ The value of s, v, l and a in \c hsv(), \c hsva() \c hsl()
+ or \c hsla() must all be in the range 0-255 or with
+ percentages, the value of h must be in the range 0-359.
+ The support for HSL(A) is available since 5.13.
Examples: