[Interest] Fwd: Is the order of styles within a Qt stylesheet significant?

Bo Elmgreen bo.elmgreen at gmail.com
Thu Aug 23 17:00:03 CEST 2012


Hi Atlant,

The rules regarding this are explained in the Qt reference documentation,
in the section called "Conflict Resolution" in the page called "The Style
Sheet Syntax" (http://qt-project.org/doc/qt-5.0/stylesheet-syntax.html) -
but in short, if the specificity of two rules is the same, then it is the
last one (that appears in the style sheet) that takes precedence.

Cheers,
Bo

On Thu, Aug 23, 2012 at 3:28 PM, Atlant Schmidt
<aschmidt at dekaresearch.com>wrote:

>  Folks:****
>
> ** **
>
>   Is the order of styles and sub-styles within a Qt stylesheet ever
>   significant?****
>
> ** **
>
>   For example (see below), if I had a variety of paragraphs describing
>   the various types, sub-controls, and states of a widget class, does it
>  ever make any difference in which order those paragraphs appear?****
>
> ****
>
>   Or does Qt sort-out all of the more- and less-specific paragraphs,
>   doing all of the correct inheritance (“cascading”)?****
>
> ** **
>
>                                  Atlant****
>
> ** **
>  ------------------------------
>
> ** **
>
> QPushButton[type="Checkable"]:checked****
>
> {****
>
>     image: url(:/icons/checkmark_green_small.png);****
>
>     image-position: left;****
>
> }****
>
> ** **
>
> QCheckBox[type="YesNoConfirm"]::indicator:checked****
>
> {****
>
>     image: url(:/icons/checkmark_green.png);****
>
> }****
>
> ** **
>
> QCheckBox[type="YesNoConfirm"]::indicator:unchecked****
>
> {****
>
>     image: none;****
>
> }****
>
> ** **
>
> QCheckBox[type="YesNoConfirm"]:checked****
>
> {****
>
>     border-image: url(:/buttons/button_down.png) 30px 36px 31px 34px
> stretch;****
>
>     padding-top: 3px;****
>
> }****
>
> ** **
>
> QCheckBox[type="YesNoConfirm"]:pressed****
>
> {****
>
>     border-image: url(:/buttons/button_down.png) 30px 36px 31px 34px
> stretch;****
>
>     padding-top: 3px;****
>
> }****
>
> ** **
>
> QCheckBox[type="YesNoConfirm"]:unchecked****
>
> {****
>
>     padding-left: 27px;****
>
> }****
>
> ** **
>
> QPushButton****
>
> {****
>
>     border-image: url(:/buttons/button_up.png)  30px 36px 31px 34px
> stretch;****
>
>     border-top-width:    30px;****
>
>     border-right-width:  36px;****
>
>     border-bottom-width: 31px;****
>
>     border-left-width:   34px;****
>
>     padding-top:    -30px;****
>
>     padding-bottom: -31px;****
>
>     padding-left:     0px;****
>
>     font: bold 32px;****
>
>     color: white;****
>
> }****
>
> ** **
>
> QPushButton:checked****
>
> {****
>
>     border-image: url(:/buttons/button_down.png) 30px 36px 31px 34px
> stretch;****
>
>     padding-top: -28px;****
>
>     padding-left:  2px;****
>
> }****
>
> ** **
>
> QPushButton:pressed****
>
> {****
>
>     border-image: url(:/buttons/button_down.png) 30px 36px 31px 34px
> stretch;****
>
>     padding-top: -28px;****
>
>     padding-left:  2px;****
>
> }****
>
> ** **
>
> QPushButton:disabled****
>
> {****
>
>     border-image: url(:/buttons/button_disabled.png) 30px 36px 31px 34px
> stretch;****
>
> }****
>
> ** **
>
> ** **
>
> ------------------------------
> This e-mail and the information, including any attachments, it contains
> are intended to be a confidential communication only to the person or
> entity to whom it is addressed and may contain information that is
> privileged. If the reader of this message is not the intended recipient,
> you are hereby notified that any dissemination, distribution or copying of
> this communication is strictly prohibited. If you have received this
> communication in error, please immediately notify the sender and destroy
> the original message.
>
> Thank you.
>
> Please consider the environment before printing this email.
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120823/c398d3c0/attachment.html>


More information about the Interest mailing list