/*!
    \page stylesheet.html
    \startpage index.html QtReference Documentation
    \nextpage The Style Sheet Syntax
    \title Qt Style Sheets
    \ingroup architecture
    \brief How to use style sheets to customize the appearance of widgets.

    \keyword style sheet
    \keyword stylesheet

    Qt Style Sheets are a powerful mechanism that allows you to
    customize the appearance of widgets, in addition to what is
    already possible by subclassing QStyle. The concepts,
    terminology, and syntax of Qt Style Sheets are heavily inspired
    by HTML \l{http://www.w3.org/Style/CSS/}{Cascading Style Sheets
    (CSS)} but adapted to the world of widgets.

    Topics:

    \list
    \i \l{Overview}
    \tableofcontents{1 Overview}
    \i \l{The Style Sheet Syntax}
     \tableofcontents{1 The Style Sheet Syntax}
    \i \l{Qt Designer Integration}
     \tableofcontents{1 Qt Designer Integration}
    \i \l{Customizing Qt Widgets Using Style Sheets}
     \tableofcontents{1 Customizing Qt Widgets Using Style Sheets}
    \i \l{Qt Style Sheets Reference}
     \tableofcontents{1 Qt Style Sheets Reference}
    \i \l{Qt Style Sheets Examples}
     \tableofcontents{1 Qt Style Sheets Examples}
    \endlist

    \target overview
    \section1 Overview

    Styles sheets are textual specifications that can be set on the
    whole application using QApplication::setStyleSheet() or on a
    specific widget (and its children) using
    QWidget::setStyleSheet(). If several style sheets are set at
    different levels, Qt derives the effective style sheet from all
    of those that are set. This is called cascading.

    For example, the following style sheet specifies that all
    \l{QLineEdit}s should use yellow as their background color, and
    all \l{QCheckBox}es should use red as the text color:

    \code
        QLineEdit { background: yellow }
        QCheckBox { color: red }
    \endcode

    For this kind of customization, style sheets are much more
    powerful than QPalette. For example, it might be tempting to set
    the QPalette::Button role to red for a QPushButton to obtain a
    red push button. However, this wasn't guaranteed to work for all
    styles, because style authors are restricted by the different
    platforms' guidelines and (on Windows XP and Mac OS X) by the
    native theme engine.

    Style sheets let you perform all kinds of customizations that are
    difficult or impossible to perform using QPalette alone. If you
    want yellow backgrounds for mandatory fields, red text for
    potentially destructive push buttons, or fancy check boxes, style
    sheets are the answer.

    Style sheets are applied on top of the current \l{QStyle}{widget
    style}, meaning that your applications will still look native,
    but any style sheet constraints will be taken into consideration.
    Unlike palette fiddling, style sheets offer guarantees: If you
    set the background color of a QPushButton to be red, you can be
    assured that the button will have a red background in all styles,
    on all platforms. \l{Qt Designer} provides style sheet
    integration, making it easy to view the effects of a style sheet
    in different \l{QStyle}{widget styles}.

    In addition, style sheets can be used to provide a distinctive
    look and feel for your application, without having to subclass
    QStyle. For example, you can specify arbitrary images for radio
    buttons and check boxes to make them stand out. Using this
    technique, you can also achieve minor customizations that would
    normally require subclassing several style classes, such as
    specifying a \l{QStyle::styleHint()}{style hint}. The
    \l{widgets/stylesheet}{Style Sheet} example depicted below defines
    two distinctive style sheets that you can try out and modify at
    will.

    \table
    \row \o \inlineimage stylesheet-coffee-xp.png
         \o \inlineimage stylesheet-pagefold.png
    \endtable

    When a style sheet is active, the QStyle returned by
    QWidget::style() is a wrapper "style sheet" style, \e not the
    platform-specific style. The wrapper style ensures that any
    active style sheet is respected and otherwise forwards the
    drawing operations to the underlying, platform-specific style
    (e.g., QWindowsXPStyle on Windows XP).

    \warning Qt style sheets are currently not supported for
    QMacStyle (the default style on Mac OS X) and custom QStyle subclasses.
    We plan to address this in some future release.
    */

    /*!
    \page stylesheet-syntax.html
    \contentspage {Qt Style Sheet}{Contents}
    \previouspage Qt Style Sheet
    \nextpage Qt Designer Integration
    \title The Style Sheet Syntax

    Qt Style Sheet terminology and syntactic rules are almost
    identical to those of HTML CSS. If you already know CSS, you can
    probably skim quickly through this section.

    \section1 Style Rules

    Style sheets consist of a sequence of style rules. A \e{style
    rule} is made up of a selector and a declaration. The
    \e{selector} specifies which widgets are affected by the rule;
    the \e{declaration} specifies which properties should be set on
    the widget. For example:

    \code
        QPushButton { color: red }
    \endcode

    In the above style rule, \c QPushButton is the selector and \c{{
    color: red }} is the declaration. The rule specifies that
    QPushButton and its subclasses (e.g., \c MyPushButton) should use
    red as their foreground color.

    Qt Style Sheet is generally case insensitive (i.e., \c color, 
    \c Color, \c COLOR, and \c cOloR refer to the same property). 
    The only exceptions are class names,
    \l{QObject::setObjectName()}{object names}, and Qt property
    names, which are case sensitive.

    Several selectors can be specified for the same declaration,
    using commas (\c{,}) to separate the selectors. For example,
    the rule

    \code
        QPushButton, QLineEdit, QComboBox { color: red }
    \endcode

    is equivalent to this sequence of three rules:

    \code
        QPushButton { color: red }
        QLineEdit { color: red }
        QComboBox { color: red }
    \endcode

    The declaration part of a style rule is a list of
    \tt{\e{property}: \e{value}} pairs, enclosed in braces (\c{{}})
    and separated with semicolons. For example:

    \code
        QPushButton { color: red; background-color: white }
    \endcode

    See the \l{List of Properties} section below for the list of
    properties provided by Qt widgets.

    \section1 Selector Types

    All the examples so far used the simplest type of selector, the
    Type Selector. Qt Style Sheets support all the
    \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{selectors
    defined in CSS2}. The table below summarizes the most useful
    types of selectors.

    \table 100%
    \header
        \o Selector
        \o Example
        \o Explanation

    \row
        \o Universal Selector
        \o \c *
        \o Matches all widgets.

    \row
        \o Type Selector
        \o \c QPushButton
        \o Matches instances of QPushButton and of its subclasses.

    \row
        \o Property Selector
        \o \c{QPushButton[flat="false"]}
        \o Matches instances of QPushButton that are not
           \l{QPushButton::}{flat}. You may use this selector to test
           for any Qt property specified using Q_PROPERTY(). In
           addition, the special \c class property is supported, for
           the name of the class.

           Instead of \c =, you can also use \c ~= to test whether a
           Qt property of type QStringList contains a given QString.

           \warning If the value of the Qt property changes after the
           style sheet has been set, it might be necessary to force a
           style sheet recomputation. One way to achieve this is to
           unset the style sheet and set it again.

    \row
        \o Class Selector
        \o \c .QPushButton
        \o Matches instances of QPushButton, but not of its subclasses.

           This is equivalent to \c{*[class~="QPushButton"]}.

    \row
        \o ID \target ID Selector
           Selector
        \o \c{QPushButton#okButton}
        \o Matches all QPushButton instances whose
           \l{QObject::objectName}{object name} is \c okButton.

    \row
        \o Descendant Selector
        \o \c{QDialog QPushButton}
        \o Matches all instances of QPushButton that are descendants
           (children, grandchildren, etc.) of a QDialog.

    \row
        \o Child Selector
        \o \c{QDialog > QPushButton}
        \o Matches all instances of QPushButton that are direct
           children of a QDialog.
    \endtable

    \section1 Sub-Controls

    For styling complex widgets, it is necessary to access
    subcontrols of the widget, such as the drop-down button of a
    QComboBox or the up and down arrows of a QSpinBox. Selectors may
    contain \e{subcontrols} that make it possible to restrict the
    application of a rule to specific widget subcontrols. For
    example:

    \code
        QComboBox::drop-down { image: url(dropdown.png) }
    \endcode

    The above rule styles the drop-down button of all
    \l{QComboBox}es. Although the double-colon (\c{::}) syntax is
    reminiscent of CSS3 Pseudo-Elements, Qt Sub-Controls differ
    conceptually from these and have different cascading semantics.
   
    Sub-controls are always positioned with respect to another element
    (a reference element). This reference element could be the widget
    or another Sub-control. For example, the
    \l{Qt Style Sheets Reference#drop-down-sub}{::drop-down} of a QComboBox is
    placed, by default, in the top right corner of the Padding rectangle
    of the QComboBox. The \l{Qt Style Sheets Reference#drop-down-sub}{::drop-down}
    is placed, by default, in the Center of the Contents rectangle of the
    \l{Qt Style Sheets Reference#drop-down-sub}{::drop-down} Sub-control. See the
    \l{List of Stylable Widgets} below for the Sub-controls to use to style a
    widget and their default positions.

    The origin rectangle to be used is changed using 
    the \l{Qt Style Sheets Reference#subcontrol-origin-prop}
    {subcontrol-origin} property. For example, if we want to place the drop-down
    in the margin rectangle of the QComboBox instead of the default Padding
    rectangle, we can specify:
    
    \code
        QComboBox {
            margin-right: 20px;
        }
        QComboBox::drop-down {
            subcontrol-origin: margin;
        }
    \endcode
    
    The alignment of the drop-down within the Margin rectangle is changed 
    using \l{Qt Style Sheets Reference#subcontrol-position-prop}
    {subcontrol-position} property.

    The \l{Qt Style Sheets Reference#width-prop}{width} and
    \l{Qt Style Sheets Reference#height-prop}{height} properties can be used to
    control the size of the Sub-control. Note that setting a
    \l{Qt Style Sheets Reference#image-prop}{image} implicitly sets the size of a
    Sub-control.

    The relative positioning scheme (\l{Qt Style Sheets Reference#position-prop}
    {position} : relative), allows the position of the Sub-Control to be offset
    from its initial position. For example, when the QComboBox's drop-down
    button is pressed, we may desire the arrow inside to be offset to give a
    "pressed" effect. To achieve this, we can specify:

    \code
        QComboBox::down-arrow {
            image: url(down_arrow.png);
        }
        QComboBox::down-arrow:pressed {
            position: relative;
            top: 1px; left: 1px;
        }
    \endcode

    The absolute positioning scheme (\l{Qt Style Sheets Reference#position-prop}
    {position} : absolute), allows the position and size of the Sub-control
    to be changed with respect to the reference element.

    Once positioned, they are treated the same as widgets and can be styled
    using the the \l{box model}.

    See the \l{List of Sub-Controls} below for a list of supported
    subcontrols, and \l{Customizing the QPushButton's Menu Indicator
    Sub-Control} for a realistic example.

    \section1 Pseudo-States

    Selectors may contain \e{pseudo-states} that denote that restrict
    the application of the rule based on the widget's state.
    Pseudo-states appear at the end of the selector, with a colon
    (\c{:}) in between. For example, the following rule applies when
    the mouse hovers over a QPushButton:

    \code
        QPushButton:hover { color: white }
    \endcode

    Pseudo-states can be negated using the exclamation operator. For
    example, the following rule applies when the mouse does not hover
    over a QRadioButton:

    \code
        QRadioButton:!hover { color: red }
    \endcode

    Pseudo-states can be chained, in which case a logical AND is
    implied. For example, the following rule applies to when the
    mouse hovers over a checked QCheckBox:

    \code
        QCheckBox:hover:checked { color: white }
    \endcode

    Negated Pseudo-states may appear in Pseudo-state chains. For example,
    the following rule applies when the mouse hovers over a QPushButton
    that is not pressed:

    \code
        QPushButton:hover:!pressed { color: blue; }
    \endcode

    If needed, logical OR can be expressed using the comma operator:

    \code
        QCheckBox:hover, QCheckBox:checked { color: white }
    \endcode

    Pseudo-states can appear in combination with subcontrols. For
    example:

    \code
        QComboBox::drop-down:hover { image: url(dropdown_bright.png) }
    \endcode

    See the \l{List of Pseudo-States} section below for the list of
    pseudo-states provided by Qt widgets.

    \section1 Conflict Resolution

    Conflicts arise when several style rules specify the same
    properties with different values. Consider the following style
    sheet:

    \code
        QPushButton#okButton { color: gray }
        QPushButton { color: red }
    \endcode

    Both rules match QPushButton instances called \c okButton and
    there is a conflict for the \c color property. To resolve this
    conflict, we must take into account the \e specificity of the
    selectors. In the above example, \c{QPushButton#okButton} is
    considered more specific than \c QPushButton, because it
    (usually) refers to a single object, not to all instances of a
    class.

    Similarly, selectors with pseudo-states are more specific that
    ones that do not specify pseudo-states. Thus, the following style
    sheet specifies that a \l{QPushButton} should have white text
    when the mouse is hovering over it, otherwise red text:

    \code
        QPushButton:hover { color: white }
        QPushButton { color: red }
    \endcode

    Here's a tricky one:

    \code
        QPushButton:hover { color: white }
        QPushButton:enabled { color: red }
    \endcode

    Here, both selectors have the same specificity, so if the mouse
    hovers over the button while it is enabled, the second rule takes
    precedence. If we want the text to be white in that case, we can
    reorder the rules like this:

    \code
        QPushButton:enabled { color: red }
        QPushButton:hover { color: white }
    \endcode

    Alternatively, we can make the first rule more specific:

    \code
        QPushButton:hover:enabled { color: white }
        QPushButton:enabled { color: red }
    \endcode

    A similar issue arises in conjunction with Type Selectors.
    Consider the following example:

    \code
        QPushButton { color: red }
        QAbstractButton { color: gray }
    \endcode

    Both rules apply to QPushButton instances (since QPushButton
    inherits QAbstractButton) and there is a conflict for the
    \l{Qt Style Sheets Reference#color-prop}{color} property. Because QPushButton
    inherits QAbstractButton, it might be tempting to assume that
    \c QPushButton is more specific than \c QAbstractButton. However,
    for style sheet computations, all Type Selectors have the same
    specificity, and the rule that appears last takes precedence. In
    other words, \l{Qt Style Sheets Reference#color-prop}{color} is set to \c gray
    for all \l{QAbstractButton}s, including \l{QPushButton}s. If we really
    want \l{QPushButton}s to have red text, we can always reorder the
    rules.

    For determining the specificity of a rule, Qt Style Sheets follow
    the
    \l{http://www.w3.org/TR/REC-CSS2/cascade.html#specificity}{CSS2
    Specification}:

    \quotation
    \e{A selector's specificity is calculated as follows:}

    \list
    \o \e{count the number of ID attributes in the selector (= a)}
    \o \e{count the number of other attributes and pseudo-classes in the selector (= b)}
    \o \e{count the number of element names in the selector (= c)}
    \o \e{ignore pseudo-elements [i.e., \l{subcontrols}].}
    \endlist

    \e{Concatenating the three numbers a-b-c (in a number system with a
    large base) gives the specificity.}

    \e{Some examples:}

    \code
        *             {}  / * a=0 b=0 c=0 -> specificity =   0 * /
        LI            {}  / * a=0 b=0 c=1 -> specificity =   1 * /
        UL LI         {}  / * a=0 b=0 c=2 -> specificity =   2 * /
        UL OL+LI      {}  / * a=0 b=0 c=3 -> specificity =   3 * /
        H1 + *[REL=up]{}  / * a=0 b=1 c=1 -> specificity =  11 * /
        UL OL LI.red  {}  / * a=0 b=1 c=3 -> specificity =  13 * / 
        LI.red.level  {}  / * a=0 b=2 c=1 -> specificity =  21 * /
        #x34y         {}  / * a=1 b=0 c=0 -> specificity = 100 * /
    \endcode
    \endquotation

    \section1 Cascading

    Style sheets can be set on the QApplication, on parent widgets,
    and on child widgets. An arbitrary widget's effective style sheet
    is obtained by merging the style sheets set on the widget's
    ancestors (parent, grandparent, etc.), as well as any style sheet
    set on the QApplication.

    When conflicts arise, the widget's own style sheet is always
    preferred to any inherited style sheet, irrespective of the
    specificity of the conflicting rules. Likewise, the parent
    widget's style sheet is preferred to the grandparent's, etc.

    One consequence of this is that setting a style rule on a widget
    automatically gives it precedence over other rules specified in
    the ancestor widgets' style sheets or the QApplication style
    sheet. Consider the following example. First, we set a style
    sheet on the QApplication:

    \code
        qApp->setStyleSheet("QPushButton { color: white }");
    \endcode

    Then we set a style sheet on a QPushButton object:

    \code
        myPushButton->setStyleSheet("* { color: blue }");
    \endcode

    The style sheet on the QPushButton forces the QPushButton (and
    any child widget) to have blue text, in spite of the more
    specific rule set provided by the application-wide style sheet.

    The result would have been the same if we had written

    \code
        myPushButton->setStyleSheet("color: blue");
    \endcode

    except that if the QPushButton had children (which is unlikely),
    the style sheet would have no impact on them.

    Style sheet cascading is a complex topic. Refer to the
    \l{http://www.w3.org/TR/CSS2/cascade.html#cascade}{CSS2
    Specification} for the gory details. Be aware that Qt currently
    doesn't implement \c{!important}.

    \section1 Inheritance

    In classic CSS, when font and color of an item is not explicitly set,
    it gets automatically inherited from the parent. When using Qt Style Sheets,
    a widget does \bold{not} automatically inherit its font and color setting
    from its parent widget.

    For example, consider a QPushButton inside a QGroupBox:

    \code
        qApp->setStyleSheet("QGroupBox { color: red; } ");
    \endcode

    The QPushButton does not have an explicit color set. Hence, instead
    of inheriting color of its parent QGroupBox, it has the sytem color.
    If we want to set the color on a QGroupBox and its children, 
    we can write:

    \code
        qApp->setStyleSheet("QGroupBox, QGroupBox * { color: red; }");
    \endcode

    In contrast, setting a font and propagate using QWidget::setFont() and
    QWidget::setPalette() propagates to child widgets.

    \section1 Widgets inside C++ namespaces
    
    The Type Selector can be used to style widgets of a particular type. For
    example,

    \code
        class MyPushButton : public QPushButton {
            // ...
        }

        // ...
        qApp->setStyleSheet("MyPushButton { background: yellow; }");
    \endcode

    Qt Style Sheet uses QObject::className() of the widget to determine
    when to apply the Type Selector. When custom widgets are inside namespaces, 
    the QObject::className() returns <namespace>::<classname>. This conflicts
    with the syntax for \l{Sub-Controls}. To overcome this problem, 
    when using the Type Selector for widgets inside namespaces, we must
    replace the "::" with "--". For example,

    \code
        namespace ns {
            class MyPushButton : public QPushButton {
                // ...
            }
        }

        // ...
        qApp->setSytleSheet("ns--MyPushButton { background: yellow; }");
    \endcode

    \section1 Setting QObject properties
    
    From 4.3 and above, any designable Q_PROPERTY 
    can be set using the qproperty-<property name> syntax.
    
    For example,
    \code
        MyLabel { qproperty-pixmap: url(pixmap.png); }
        MyGroupBox { qproperty-titleColor: rgb(100, 200, 100); }
        QPushButton { qproperty-iconSize: 20px 20px; }
    \endcode

    */

    /*!
    \page stylesheet-designer.html
    \contentspage {Qt Style Sheet}{Contents}
    \previouspage The Style Sheet Syntax
    \nextpage Customizing Qt Widgets Using Style Sheets
    \title Qt Designer Integration

    \l{Qt Designer}{Qt Designer} is an excellent tool
    to preview style sheets. You can right-click on any widget in Designer
    and select \bold{Change styleSheet...} to set the style sheet.

    \image stylesheet-designer-options.png

    In Qt 4.3 and later, \l{Qt Designer}{Qt Designer} also includes a
    style sheet syntax highlighter and validator. The validator indicates
    if the syntax is valid or invalid, at the bottom left of the Edit
    Style Sheet dialog.

    \image designer-validator-highlighter.png
    */

    /*!
    \page stylesheet-customizing.html
    \contentspage {Qt Style Sheet}{Contents}
    \previouspage Qt Designer Integration
    \nextpage Qt Style Sheets Reference
    \title Customizing Qt Widgets Using Style Sheets

    When using style sheets, every widget is treated as a box with four
    concentric rectangles: the margin rectangle, the border rectangle, the
    padding rectangle, and the content rectangle. The box model describes
    this in further detail.

    \target box model
    \section1 The Box Model

    The four concentric rectangles appear conceptually as below:

    \image stylesheet-boxmodel.png

    \list
    \o The margin falls outside the border.
    \o The border is drawn between the margin and the padding.
    \o The padding falls inside the border, between the border and
       the actual contents.
    \o The content is what is left from the original widget or
       subcontrol once we have removed the margin, the border, and
       the padding.
    \endlist

    The \l{Qt Style Sheets Reference#margin-prop}{margin},
    \l{Qt Style Sheets Reference#border-width-prop}
    {border-width}, and
    \l{Qt Style Sheets Reference#padding-prop}{padding}
    properties all default to zero. In that case, all four rectangles
    (\c margin, \c border, \c padding, and \c content) coincide exactly.

    You can specify a background for the widget using the 
    \l{Qt Style Sheets Reference#background-image-prop}{background-image} 
    property. By default, the background-image is drawn only for the area 
    inside the border. This can be changed using the 
    \l{Qt Style Sheets Reference#background-clip-prop}{background-clip}
    property. You can use 
    \l{Qt Style Sheets Reference#background-repeat-prop}{background-repeat}
    and
    \l{Qt Style Sheets Reference#background-origin-prop}{background-origin}
    to control the repetition and origin of the background image.

    A background-image does not scale with the size of the widget. To provide
    a "skin" or background that scales along with the widget size, one must
    you the 
    \l{Qt Style Sheets Reference#border-image-prop}{border-image}. Since the
    border-image property provides an alternate background, it is not required
    to specify a background-image when border-image is specified. In the case,
    when both of them are specified, the border-image draws over the 
    background-image.

    In addition, the \l{Qt Style Sheets Reference#image-prop}{image} property
    may be used to draw an image over the border-image. The image specified does
    not tile or stretch and when its size does not match the size of the widget,
    it's alignment is specified using the
    \l{Qt Style Sheets Reference#image-position-prop}{image-position} 
    property. Unlike background-image and border-image, one may specify a
    SVG in the image property, in which case the image is scaled automatically
    according to the widget size.

    The steps to render a rule are as follows:
        \list
        \o Set clip for entire rendering operation (border-radius)
        \o Draw the background (background-image)
        \o Draw the border (border-image, border)
        \o Draw overlay image (image)
        \endlist

    \target sub controls
    \section1 Sub-controls

    A widget is considered as a heirarchy (tree) of subcontrols drawn on top 
    of each other. For example, the QComboBox draws the drop-down sub-control
    followed by the down-arrow sub-control. A QComboBox is thus rendered as
    follows:
        \list
        \o Render the QComboBox { } rule
        \o Render the QComboBox::drop-down { } rule
        \o Render the QComboBox::down-arrow { } rule
        \endlist

    Sub-controls share a parent-child relationship. In the case of QComboBox,
    the parent of down-arrow is the drop-down and the parent of drop-down is
    the widget itself. Sub-controls are positioned within their parent using
    the \l{Qt Style Sheets Reference#subcontrol-position-prop}
    {subcontrol-position} and
    \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}
    properties.
    
    Once positioned, sub-controls can be styled using the the \l{box model}.
    */

    /*!
    \page stylesheet-reference.html
    \contentspage {Qt Style Sheet}{Contents}
    \previouspage Customizing Qt Widgets Using Style Sheets
    \nextpage Qt Style Sheets Examples
    \title Qt Style Sheets Reference

    Qt Style Sheets support various properties, pseudo-states, and
    subcontrols that make it possible to customize the look of
    widgets.

    \tableofcontents

    \section1 List of Stylable Widgets

    The following table lists the Qt widgets that can be customized
    using style sheets:

    \table 100%
    \header
        \o Widget
        \o How to Style

    \row
        \o QAbstractScrollArea \target qabstractscrollarea-widget
        \o Supports the \l{box model}.

           All derivatives of QAbstractScrollArea, including QTextEdit,
           and QAbstractItemView (all item view classes), support
           scrollable backgrounds using 
           \l{Qt Style Sheets Reference#background-attachment-prop}
           {background-attachment}. Setting the background-attachment to
           \c{fixed} provides a background-image that does not scroll with the
           viewport. Setting the background-attachment to \c{scroll}, scrolls
           the background-image when the scroll bars move.

           See \l{Qt Style Sheets Examples#Customizing QAbstractScrollArea}
           {Customizing QAbstractScrollArea} for an example.

    \row
        \o QCheckBox \target qcheckbox-widget
        \o Supports the \l{box model}. The check indicator can be
           styled using the \l{#indicator-sub}{::indicator}
           subcontrol. By default, the indicator is placed in the Top
           Left corner of the Contents rectangle of the widget.

           The \l{#spacing-prop}{spacing} property
           specifies the spacing between the check indicator and
           the text.

           See \l{Qt Style Sheets Examples#Customizing QCheckBox}
           {Customizing QCheckBox} for an example.

    \row
        \o QColumnView \target qcolumnview-widget
        \o The grip can be styled be using the \l{image-prop}{image} property.
           The arrow indicators can by styled using the 
           \l{left-arrow-sub}{::left-arrow} subcontrol and the 
           \l{right-arrow-sub}{::right-arrow} subcontrol.

    \row
        \o QComboBox \target qcombobox-widget
        \o The frame around the combobox can be styled using the 
           \l{box model}. The drop-down button can be styled using
           the \l{#drop-down-sub}{::drop-down} subcontrol. By default, the
           drop-down button is placed in the top right corner of the padding
           rectangle of the widget. The arrow mark inside the drop-down button 
           can be styled using the \l{#down-arrow-sub}{::down-arrow} 
           subcontrol. By default, the arrow is placed in the center of the 
           contents rectangle of the drop-down subcontrol.

           See \l{Qt Style Sheets Examples#Customizing QComboBox}{Customizing QComboBox} 
           for an example.

    \row
        \o QDateEdit \target qdateedit-widget
        \o See \l{#qspinbox-widget}{QSpinBox}.

    \row
        \o QDateTimeEdit \target qdatetimeedit-widget
        \o See \l{#qspinbox-widget}{QSpinBox}.

    \row
        \o QDialog \target qdialog-widget
        \o Supports only the \l{Qt Style Sheets Reference#background-prop}{background},
           \l{#background-clip-prop}{background-clip} and
           \l{#background-origin-prop}{background-origin} properties.

           If you subclass from QDialog, you need to provide a paintEvent for your
           custom QDialog as below:
           \code
               void CustomDialog::paintEvent(QPaintEvent *)
               {
                   QStyleOption opt;
                   opt.init(this);
                   QPainter p(this);
                   style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
               }
           \endcode

           The above code is a no-operation if there is no stylesheet set.

    \row
        \o QDialogButtonBox \target qdialogbuttonbox-widget
        \o The layout of buttons can be altered using the
           \l{#button-layout-prop}{button-layout} property.

    \row
        \o QDoubleSpinBox \target qdoublespinbox-widget
        \o See \l{#qspinbox-widget}{QSpinBox}.

    \row
        \o QFrame \target qframe-widget
        \o Supports the \l{box model}.

           Since 4.3, setting a stylesheet on a QLabel automatically
           sets the QFrame::frameStyle property to QFrame::StyledPanel.

           See \l{Qt Style Sheets Examples#Customizing QFrame}{Customizing QFrame}
           for an example.

    \row
        \o QGroupBox \target qgroupbox-widget
        \o Supports the \l{box model}. The title can be styled using the
           \l{#title-sub}{::title} subcontrol. By default, the title is placed
           depending on QGroupBox::textAlignment.

           In the case of a checkable QGroupBox, the title includes the
           check indicator. The indicator is styled using the 
           the \l{#indicator-sub}{::indicator} subcontrol. The 
           \l{#spacing-prop}{spacing} property can be used to control
           the spacing between the text and indicator.

           See \l{Qt Style Sheets Examples#Customizing QGroupBox}{Customizing QGroupBox}
           for an example.

    \row
        \o QHeaderView \target qheaderview-widget
        \o Supports the \l{box model}. The sections of the header view are
           styled using the \l{#section-sub}{::section} sub control. The
           \c{section} Sub-control supports the \l{#middle-ps}{:middle},
           \l{#first-ps}{:first}, \l{#last-ps}{:last}, 
           \l{#only-one-ps}{:only-one}, \l{#next-selected-ps}{:next-selected},
           \l{#previous-selected-ps}{:previous-selected}, 
           \l{#selected-ps}{:selected} pseudo states.

           Sort indicator in can be styled using the 
           \l{#up-arrow-sub}{::up-arrow} and the 
           \l{#down-arrow-sub}{::down-arrow} Sub-control.

           See \l{Qt Style Sheets Examples#Customizing QHeaderView}{Customizing QHeaderView}
           for an example.

    \row
        \o QLabel \target qlabel-widget
        \o Supports the \l{box model}. Does not support the
           \l{#hover-ps}{:hover} pseudo-state. 

           Since 4.3, setting a stylesheet on a QLabel automatically
           sets the QFrame::frameStyle property to QFrame::StyledPanel.

           See \l{Qt Style Sheets Examples#Customizing QFrame}{Customizing QFrame} for an
           example (a QLabel derives from QFrame).

    \row
        \o QLineEdit \target qlineedit-widget
        \o Support the \l{box model}.

           The color and background of the selected item is styled using
           \l{#selection-color-prop}{selection-color} and
           \l{#selection-background-color-prop}{selection-background-color}
           respectively.

           The password character can be styled using the
           \l{#lineedit-password-character-prop}{lineedit-password-character}
           property.

           See \l{Qt Style Sheets Examples#Customizing QLineEdit}{Customizing QLineEdit}
           for an example.

    \row
        \o QListView \target qlistview-widget
        \o Supports the \l{box model}. When 
           \l{QAbstractItemView::alternatingRowColors}{alternating row colors} 
           is enabled, the alternating colors can be styled using the 
           \l{#alternate-background-color-prop}{alternate-background-color}
           property.

           The color and background of the selected item is styled using
           \l{#selection-color-prop}{selection-color} and
           \l{#selection-background-color-prop}{selection-background-color}
           respectively.

           The selection behavior is controlled by the
           \l{#show-decoration-selected-prop} property.

           See \l{qabstractscrollarea-widget}{QAbsractScrollArea} to
           style scrollable backgrounds.

    \row
        \o QListWidget \target qlistwidget-widget
        \o See \l{#qlistview-widget}{QListWidget}.

    \row
        \o QMenu \target qmenu-widget
        \o Supports the \l{box model}. 

           Individual items are styled using the \l{#item-sub}{::item} 
           subcontrol. In addition to the usually supported pseudo states,
           \c{item} subcontrol supports the 
           \l{#selected-ps}{:selected}, \l{#default-ps}{:default},
           \l{#exclusive-ps}{:exclusive} and the 
           \l{#non-exclusive-ps}{non-exclusive} pseudo states. 

           The indicator of checkable menu items is styled using the
           \l{#indicator-sub}{::indicator} subcontrol.

           The separator is styled using the \l{#separator-sub}{::separator}
           subcontrol.

           For items with a sub menu, the arrow marks are styled using the
           \l{::right-arrow-sub}{right-arrow} and 
           \l{::left-arrow-sub}{left-arrow}.

            The scroller is styled using the \l{#scroller-sub}{::scroller}.

            The tear-off is styled using the \l{#tear-off-sub}{::tear-off}.

           See \l{Qt Style Sheets Examples#Customizing QMenu}{Customizing QMenu}
           for an example.

    \row
        \o QMenuBar \target qmenubar-widget
        \o Supports the \l{box model}. The \l{#spacing-prop}{spacing}
           property specifies the spacing between menu items.
           Individual items are styled using the \l{#item-sub}{::item}
           subcontrol.

           See \l{Qt Style Sheets Examples#Customizing QMenuBar}{Customizing QMenuBar}
           for an example.

    \row
        \o QMessageBox \target qmessagebox-widget
        \o The \l{#messagebox-text-interaction-flags-prop}
           {messagebox-text-interaction-flags} property can be used to alter
           the interaction with text in the message box.

    \row
        \o QProgressBar \target qprogressbar-widget
        \o Supports the \l{box model}. The chunks of the progress bar
           can be styled using the \l{#chunk-sub}{::chunk} subcontrol.
           The chunk is displayed on the Contents rectangle of the widget.

           If the progress bar displays text, use the \l{text-align-prop}{text-align}
           property to position the text.

           Indeterminate progress bars have the 
           \l{#indeterminate-ps}{:indeterminate} pseudo state set.

           See \l{Qt Style Sheets Examples#Customizing QProgressBar}{Customizing QProgressBar}
           for an example.

    \row
        \o QPushButton \target qpushbutton-widget
        \o Supports the \l{box model}. Supports the \l{#default-ps}{:default},
           \l{#flat-ps}{:flat}, \l{#checked-ps}{:checked} pseudo states.

           For QPushButton with a menu, the menu indicator is styled
           using the \l{#menu-indicator-sub}{::menu-indicator}
           subcontrol. Appearance of checkable push buttons can be
           customized using the \l{#open-ps}{:open} and 
           \l{#closed-ps}{:closed} pseudo-states.

           See \l{Qt Style Sheets Examples#Customizing QPushButton}{Customizing QPushButton}
           for an example.

    \row
        \o QRadioButton \target qradiobutton-widget
        \o Supports the \l{box model}. The check indicator can be
           styled using the \l{#indicator-sub}{::indicator}
           subcontrol. By default, the indicator is placed in the Top
           Left corner of the Contents rectangle of the widget.

           The \l{#spacing-prop}{spacing} property
           specifies the spacing between the check indicator and
           the text.

           See \l{Qt Style Sheets Examples#Customizing QRadioButton}
           {Customizing QRadioButton} for an example.

    \row
        \o QScrollBar \target qscrollbar-widget
        \o Supports the \l{box model}. The Contents rectangle of the widget
           is considered to be the groove over which the slider moves. The extent
           of the QScrollBar (i.e the width or the height depending on the orientation)
           is set using the \l{#width-prop}{width} or \l{#height-prop}{height} property
           respectively. To determine the orientation, use the 
           \l{#horizontal-ps}{:horizontal} and the \l{vertical-ps}{:vertical}
           pseudo states.

           The slider can be styled using the \l{#handle-sub}{::handle} subcontrol.
           Setting the \l{#min-width-prop}{min-width} or \l{#min-height-prop}{min-height}
           provides size contraints for the slider depending on the orientation.

           The \l{add-line-sub}{::add-line} subcontrol can be used to style the
           button to add a line. By default, the add-line subcontrol is placed in 
           top right corner of the Border rectangle of the widget. Depending on the
           orientation the \l{#right-arrow-sub}{::right-arrow} or 
           \l{#down-arrow-sub}{::down-arrow}. By default, the arrows are placed in 
           the center of the Contents rectangle of the add-line subcontrol. 

           The \l{sub-line-sub}{::sub-line} subcontrol can be used to style the
           button to subtract a line. By default, the sub-line subcontrol is placed in 
           bottom right corner of the Border rectangle of the widget. Depending on the
           orientation the \l{#left-arrow-sub}{::left-arrow} or 
           \l{#up-arrow-sub}{::up-arrow}. By default, the arrows are placed in 
           the center of the Contents rectangle of the sub-line subcontrol. 

           The \l{sub-page-sub}{::sub-page} subcontrol can be used to style the
           region of the slider that subtracts a page. The \l{add-page-sub}{::add-page}
           subcontrol can be used to style the region of the slider that adds a page.

           See \l{Qt Style Sheets Examples#Customizing QScrollBar}{Customizing QScrollBar} 
           for an example.

    \row
        \o QSizeGrip \target qsizegrip-widget
        \o Supports the \l{#width-prop}{width},
           \l{#height-prop}{height}, and \l{#image-prop}{image}
           properties.

           See \l{Qt Style Sheets Examples#Customizing QSizeGrip}{Customizing QSizeGrip}
           for an example.

    \row
        \o QSlider \target qslider-widget
        \o Supports the \l{box model}. For horizontal slides, the 
           \l{min-width-prop}{min-width} and \l{height-prop}{height}
           properties must be provided. For vertical sliders, the 
           \l{min-height-prop}{min-height} and \l{width-prop}{width}
           properties must be provided.

           The groove of the slider is styled 
           using the \l{#groove-sub}{::groove}. The groove is 
           positioned by default in the Contents rectangle of the widget. 
           The thumb of the slider is styled using \l{#handle-sub}{::handle}
           subcontrol. The subcontrol moves in the Contents rectangle of
           the groove subcontrol.

           See \l{Qt Style Sheets Examples#Customizing QSlider}{Customizing QSlider}
           for an example.

    \row
        \o QSpinBox \target qspinbox-widget
        \o The frame of the spin box can be styled using the \l{box
           model}. 

           The up button and arrow can be styled using the 
           \l{#up-button-sub}{::up-button} and
           \l{#up-arrow-sub}{::up-arrow} subcontrols. By default,
           the up-button is placed in the top right corner in the 
           Padding rectangle of the widget. Without an explicit size,
           it occupies half the height of its reference rectangle.
           The up-arrow is placed in the center of the Contents
           rectangle of the up-button.

           The down button and arrow can be styled using the 
           \l{#down-button-sub}{::down-button} and
           \l{#down-arrow-sub}{::down-arrow} subcontrols. By default,
           the down-button is placed in the bottom right corner in the 
           Padding rectangle of the widget. Without an explicit size,
           it occupies half the height of its reference rectangle.
           The bottom-arrow is placed in the center of the Contents
           rectangle of the bottom-button.

           See \l{Qt Style Sheets Examples#Customizing QSpinBox}{Customizing QSpinBox}
           for an example.

    \row
        \o QSplitter \target qsplitter-widget
        \o Supports the \l{box model}. The handle of the splitter 
           is styled using the \l{#handle-sub}{::handle} subcontrol.

           See \l{Qt Style Sheets Examples#Customizing QSplitter}{Customizing QSplitter}
           for an example.

    \row
        \o QStatusBar \target qstatusbar-widget
        \o Supports only the \l{Qt Style Sheets Reference#background-prop}
           {background} property.
           The frame for individual items can be style using the
           \l{#item-sub}{::item} subcontrol.

           See \l{Qt Style Sheets Examples#Customizing QStatusBar}{Customizing QStatusBar}
           for an example.

    \row
        \o QTabBar \target qtabbar-widget
        \o Individual tabs may be styled using the \l{#tab-sub}{::tab}
           subcontrol. The tabs support the
           \l{#only-one-ps}{:only-one}, \l{#first-ps}{:first},
           \l{#last-ps}{:last}, \l{#middle-ps}{:middle},
           \l{#previous-selected-ps}{:previous--selected},
           \l{#next-selected-ps}{:next-selected},
           \l{#selected-ps}{:selected} pseudo states.

            The \l{#top-ps}{:top}, \l{#left-ps}{:left}, \l{#right-ps}{:right},
            \l{#bottom-ps}{:bottom} pseudo states depending on the orientation
            of the tabs.

            Overlapping tabs for the selected state are created by using
            negative margins or using the \c{absolute} position scheme.

            The tear indicator of the QTabBar is styled using the 
            \l{#tear-sub}{::tear} subcontrol.

            QTabBar used two QToolButtons for its scrollers that can be styled
            using the \c{QTabBar QToolButton} selector. To specify the width
            of the scroll button use the \l{#scroller-sub}{::scroller} 
            subcontrol.

            The alignment of the tabs within the QTabBar is styled
            using the \l{#Alignment}{alignment} property. \warning 

            To change the position of the QTabBar within a QTabWidget, use the
            \l{#tab-bar-sub}{tab-bar} subcontrol (and set subcontrol-position).

           See \l{Qt Style Sheets Examples#Customizing QTabWidget and QTabBar}{Customizing QTabBar}
           for an example.

    \row
        \o QTabWidget \target qtabwidget-widget
        \o The frame of the tab widget is styled using the 
           \l{#pane-sub}{::pane} subcontrol. The left and right
           corners are styled using the \l{#left-corner-sub}{::left-corner}
           and \l{#right-corner-sub}{::right-corner} respectively.
           The position of the the tab bar is controlled using the
           \l{#tab-bar-sub}{::tab-bar} subcontrol.

           By default, the subcontrols have positions of a QTabWidget in 
           the QWindowsStyle. To place the QTabBar in the center, set the
           subcontrol-position of the tab-bar subcontrol.

            The \l{#top-ps}{:top}, \l{#left-ps}{:left}, \l{#right-ps}{:right},
            \l{#bottom-ps}{:bottom} pseudo states depending on the orientation
            of the tabs.

           See \l{Qt Style Sheets Examples#Customizing QTabWidget and QTabBar}
           {Customizing QTabWidget} for an example.

    \row
        \o QTableView \target qtableview-widget
        \o Supports the \l{box model}. When
           \l{QAbstractItemView::alternatingRowColors}{alternating row colors} 
           is enabled, the alternating colors can be styled using the 
           \l{#alternate-background-color-prop}{alternate-background-color}
           property.

           The color and background of the selected item is styled using
           \l{#selection-color-prop}{selection-color} and
           \l{#selection-background-color-prop}{selection-background-color}
           respectively.

           The corner widget in a QTableView is implemented as a QAbstractButton
           and can be styled using the "QTableView QTableCornerButton::section"
           selector.

           The color of the grid can be specified using the
           \l{#gridline-color-prop}{gridline-color} property.

           See \l{qabstractscrollarea-widget}{QAbsractScrollArea} to
           style scrollable backgrounds.

    \row
        \o QTableWidget \target qtablewidget-widget
        \o See \l{#qtableview-widget}{QTableView}.

    \row
        \o QTextEdit \target qtextedit-widget
        \o Supports the \l{box model}.

           The color and background of selected text is styled using
           \l{#selection-color-prop}{selection-color} and
           \l{#selection-background-color-prop}{selection-background-color}
           respectively.

           See \l{qabstractscrollarea-widget}{QAbsractScrollArea} to
           style scrollable backgrounds.

    \row
        \o QTimeEdit \target qtimeedit-widget
        \o See \l{#qspinbox-widget}{QSpinBox}.

    \row
        \o QToolBar \target qtoolbar-widget
        \o Supports the \l{box model}. 

           The \l{#top-ps}{:top}, \l{#left-ps}{:left}, \l{#right-ps}{:right},
           \l{#bottom-ps}{:bottom} pseudo states depending on the area in
           which the tool bar is grouped.

           The \l{#first-ps}{:first}, \l{#last-ps}{:last}, \l{#middle-ps}{:middle},
           \l{#only-one-ps}{:only-one} pseudo states indicator the position
           of the tool bar within a line group (See 
           QStyleOptionToolBar::positionWithinLine).

           The separator of a QToolBar is styled using the 
           \l{#separator-sub}{::separator} subcontrol.

           The handle (to move the toolbar) is styled using the
           \l{#handle-sub}{::handle} subcontrol.

           See \l{Qt Style Sheets Examples#Customizing QToolBar}{Customizing QToolBar} 
           for an example.

    \row
        \o QToolButton \target qtoolbutton-widget
        \o Supports the \l{box model}.

           If the QToolButton has a menu, is 
           \l{#menu-indicator-sub}{::menu-indicator} subcontrol can be used to
           style the indicator. By default, the menu-indicator is positioned
           at the bottom right of the Padding rectangle of the widget.

           If the QToolButton is in QToolButton::MenuButtonPopup mode,
           the \l{#menu-button-sub}{::menu-button} subcontrol is used to draw the
           menu button. \l{#menu-arrow-sub}{::menu-arrow} subcontrol is used to
           draw the menu arrow inside the menu-button. By default, it is
           positioned in the center of the Contents rectangle of the the
           menu-button subcontrol.

           When the QToolButton displays arrows, the \l{#up-arrow-sub}{::up-arrow},
           \l{#down-arrow-sub}{::down-arrow}, \l{#left-arrow-sub}{::left-arrow}
           and \l{#right-arrow-sub}{::right-arrow} subcontrols are used.

           \warning If you only set a background-color on a QToolButton, the background
           will not appear unless you set the border property to some value. This is
           because, by default, the QToolButton draws a native border which completely
           overlaps the background-color. For example,

           \code
                QToolButton { background-color: red; border: none; }
           \endcode

           See \l{Qt Style Sheets Examples#Customizing QToolButton}{Customizing QToolButton}
           for an example.

    \row
        \o QToolBox \target qtoolbox-widget
        \o Supports the \l{box model}. 

          The individual tabs can by styled using the 
          \l{#tab-sub}{::tab} subcontrol. The tabs support the
          \l{#only-one-ps}{:only-one}, \l{#first-ps}{:first},
          \l{#last-ps}{:last}, \l{#middle-ps}{:middle},
         \l{#previous-selected-ps}{:previous-selected},
          \l{#next-selected-ps}{:next-selected},
          \l{#selected-ps}{:selected} pseudo states.

    \row
        \o QToolTip \target qtooltip-widget
        \o Supports the \l{box model}. The \l{#opacity-prop}{opacity}
           property controls the opacity of the tooltip.

           See \l{Qt Style Sheets Examples#Customizing QFrame}{Customizing QFrame}
           for an example (a QToolTip is a QFrame).

    \row
        \o QTreeView \target qtreeview-widget
        \o Supports the \l{box model}. When 
           \l{QAbstractItemView::alternatingRowColors}{alternating row colors} 
           is enabled, the alternating colors can be styled using the 
           \l{#alternate-background-color-prop}{alternate-background-color}
           property.

           The color and background of the selected item is styled using
           \l{#selection-color-prop}{selection-color} and
           \l{#selection-background-color-prop}{selection-background-color}
           respectively.

           The branches of the tree view can be styled using the 
           \l{#branch-sub}{::branch} subcontrol. The
           ::branch Sub-control supports the \l{open-ps}{:open},
           \l{closed-ps}{:closed}, \l{has-siblings-ps}{:has-sibling} and
           \l{has-children-ps}{:has-children} pseudo states. 

           See \l{qabstractscrollarea-widget}{QAbsractScrollArea} to
           style scrollable backgrounds.

           See \l{Qt Style Sheets Examples#Customizing QTreeView}{Customizing QTreeView}
           for an example to style the branches.

    \row
        \o QTreeWidget \target qtreewidget-widget
        \o See \l{#qtreeview-widget}{QTreeView}.

    \row
        \o QWidget \target qwidget-widget
        \o Supports only the \l{Qt Style Sheets Reference#background-prop}{background},
           \l{#background-clip-prop}{backgorund-clip} and
           \l{#background-origin-prop}{background-origin} properties.

           If you subclass from QWidget, you need to provide a paintEvent for your
           custom QWidget as below:
           \code
               void CustomWidget::paintEvent(QPaintEvent *)
               {
                   QStyleOption opt;
                   opt.init(this);
                   QPainter p(this);
                   style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
               }
           \endcode

           The above code is a no-operation if there is no stylesheet set.

    \endtable

    \section1 List of Properties

    The table below lists all the properties supported by Qt Style
    Sheets. Which values can be given to an property depend on the
    \l{List of Property Types}{property's type}. Unless otherwise
    specified, properties below apply to all widgets. Properties
    marked with an asterisk * are specific to Qt and have no equivalent
    in CSS2 or CSS3.

    \table 100%
    \header
        \o Property
        \o Type
        \o Description

    \row
        \o \bold{\c alternate-background-color} \target alternate-background-color-prop
        \o \l{#Brush}{Brush} \BR
        \o The \l{QAbstractItemView::alternatingRowColors}
           {alternate background color} used in QAbstractItemView subclasses.

           If this property is not set, the default value is
           whatever is set for the palette's
           \l{QPalette::}{AlternateBase} role.

           Example:

           \code
                QTreeView {
                    alternate-background-color: blue;
                    background: yellow;
                }
           \endcode

           See also \l{Qt Style Sheets Reference#background-prop}{background} and
           \l{#selection-background-color-prop}{selection-background-color}.

    \row
        \o \bold{\c background} \target background-prop
        \o \l{#Background}{Background}
        \o Shorthand notation for setting the background. Equivalent
           to specifying \c background-color, \c background-image, \c
           background-repeat, and/or \c background-position.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QDialog, QFrame, QGroupBox, QLabel, QLineEdit,
           QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter,
           QTextEdit, QToolTip, and plain \l{QWidget}s.

           Example:

           \code
                QTextEdit { background: yellow }
           \endcode


           Often, it is required to set a fill pattern similar to the styles
           in Qt::BrushStyle. You can use the background-color property for
           Qt::SolidPattern, Qt::RadialGradientPattern, Qt::LinearGradientPattern
           and Qt::ConicalGradientPattern.  The other patterns are easily achieved 
           by creating a background image that contains the pattern.

           Example:

           \code
                QLabel { 
                    background-image: url(dense6pattern.png);
                    background-repeat: repeat-xy;
                }
            \endcode

           See also \l{#background-origin-prop}{background-origin},
           \l{#selection-background-color-prop}{selection-background-color},
           \l{#background-clip-prop}{background-clip},
           \l{#background-attachment-prop}{background-attachment}
           and \l{#alternate-background-color-prop}{alternate-background-color}.

    \row
        \o \c background-color \target background-color-prop
        \o \l{#Brush}{Brush} \BR
        \o The background color used for the widget.

           Examples:

           \code
               QLabel { background-color: yellow }
               QLineEdit { background-color: rgb(255, 0, 0) }
           \endcode

    \row
        \o \c background-image \target background-image-prop
        \o \l{#Url}{Url}
        \o The background image used for the widget. Semi-transparent
           parts of the image let the \c background-color shine
           through.

           Example:

           \code
               QFrame { background-image: url(:/images/hydro.png) }
           \endcode

    \row
        \o \c background-repeat \target background-repeat-prop
        \o \l{#Repeat}{Repeat}
        \o Whether and how the background image is repeated to fill
           the \c background-origin rectangle.

           If this property is not specified, the background image
           is repeated in both directions (\c repeat).

           Example:

           \code
                QFrame {
                    background: white url(:/images/ring.png);
                    background-repeat: repeat-y;
                    background-position: left;
                }
           \endcode

    \row
        \o \c background-position
        \o \l{#Alignment}{Alignment}
        \o The alignment of the background image within the \c
           background-origin rectangle.

           If this property is not specified, the alignment is \c
           top \c left.

           Example:

           \code
                QFrame {
                    background: url(:/images/footer.png);
                    background-position: bottom left;
                }
           \endcode

    \row
        \o \bold{\c background-attachment} \target background-attachment-prop
        \o \l{#Attachment}{Attachment}
        \o Determines whether the background-image in a QAbstractScrollArea
           is scrolled or fixed with respect to the viewport.
           By default, the background-image scrolls with the viewport.

           Example:

           \code
                QTextEdit {
                    background-image: url("leaves.png");
                    background-attachment: fixed;
                }
           \endcode

        See also \l{Qt Style Sheets Reference#background-prop}{background}

    \row
        \o \bold{\c background-clip} \target background-clip-prop
        \o \l{#Origin}{Origin}
        \o The widget's rectangle, in which the \c background is drawn.

           This property specifies the rectangle to which the \c background-color
           and \c background-image are clipped.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QDialog, QFrame, QGroupBox, QLabel,
           QPushButton, QRadioButton, QSplitter, QTextEdit, QToolTip,
           and plain \l{QWidget}s.

           If this property is not specified, the default is \c
           border.

           Example:

           \code
                QFrame {
                    background-image: url(:/images/header.png);
                    background-position: top left;
                    background-origin: content;
                    background-clip: padding;
                }
           \endcode

           See also \l{Qt Style Sheets Reference#background-prop}{background}, 
           \l{#background-origin-prop}{background-origin} and \l{The Box Model}.

    \row
        \o \bold{\c background-origin} \target background-origin-prop
        \o \l{#Origin}{Origin}
        \o The widget's background rectangle, to use in conjunction
           with \c background-position and \c background-image.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QDialog, QFrame, QGroupBox, QLabel,
           QPushButton, QRadioButton, QSplitter, QTextEdit, QToolTip,
           and plain \l{QWidget}s.

           If this property is not specified, the default is \c
           padding.

           Example:

           \code
                QFrame {
                    background-image: url(:/images/header.png);
                    background-position: top left;
                    background-origin: content;
                }
           \endcode

           See also \l{Qt Style Sheets Reference#background-prop}{background} and
           \l{The Box Model}.

    \row
        \o \bold{\c border} \target border-prop
        \o \l{#Border}{Border}
        \o Shorthand notation for setting the widget's border. Equivalent
           to specifying \c border-color, \c border-style, and/or
           \c border-width.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QDialog, QFrame, QGroupBox, QLabel, QLineEdit,
           QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter,
           QTextEdit, QToolTip, and plain \l{QWidget}s.

           Example:

           \code
                QLineEdit { border: 1px solid white }
           \endcode

    \row
        \o \c border-top
        \o \l{#Border}{Border}
        \o Shorthand notation for setting the widget's top border.
           Equivalent to specifying \c border-top-color, \c
           border-top-style, and/or \c border-top-width.

    \row
        \o \c border-right
        \o \l{#Border}{Border}
        \o Shorthand notation for setting the widget's right border.
           Equivalent to specifying \c border-right-color, \c
           border-right-style, and/or \c border-right-width.

    \row
        \o \c border-bottom
        \o \l{#Border}{Border}
        \o Shorthand notation for setting the widget's bottom border.
           Equivalent to specifying \c border-bottom-color, \c
           border-bottom-style, and/or \c border-bottom-width.

    \row
        \o \c border-left
        \o \l{#Border}{Border}
        \o Shorthand notation for setting the widget's left border.
           Equivalent to specifying \c border-left-color, \c
           border-left-style, and/or \c border-left-width.

    \row
        \o \bold{\c border-color} \target border-attrs
           \target border-color-prop
        \o \l{#Box Colors}{Box Colors}
        \o The color of all the border's edges. Equivalent to
           specifying \c border-top-color, \c border-right-color, \c
           border-bottom-color, and \c border-left-color.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QDialog, QFrame, QGroupBox, QLabel, QLineEdit,
           QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter,
           QTextEdit, QToolTip, and plain \l{QWidget}s.

           If this property is not specified, it defaults to
           \l{#color-prop}{color} (i.e., the widget's foreground
           color).

           Example:

           \code
                QLineEdit {
                    border-width: 1px;
                    border-style: solid;
                    border-color: white;
                }
           \endcode

           See also \l{Qt Style Sheets Reference#border-style-prop}{border-style},
           \l{Qt Style Sheets Reference#border-width-prop}{border-width},
           \l{#border-image-prop}{border-image}, and \l{The Box Model}.

    \row
        \o \c border-top-color
        \o \l{#Brush}{Brush} \BR
        \o The color of the border's top edge.

    \row
        \o \c border-right-color
        \o \l{#Brush}{Brush} \BR
        \o The color of the border's right edge.

    \row
        \o \c border-bottom-color
        \o \l{#Brush}{Brush} \BR
        \o The color of the border's bottom edge.

    \row
        \o \c border-left-color
        \o \l{#Brush}{Brush} \BR
        \o The color of the border's left edge.

    \row
        \o \bold{\c border-image} \target border-image-prop
        \o \l{#Border Image}{Border Image}
        \o The image used to fill the border. The image is cut into
           nine parts and stretched appropriately if necessary. See
           \l{#Border Image}{Border Image} for details.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QDialog, QFrame, QGroupBox, QLabel, QLineEdit,
           QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter,
           QTextEdit, QToolTip, and plain \l{QWidget}s.

           See also \l{#border-color-prop}{border-color},
           \l{Qt Style Sheets Reference#border-style-prop}{border-style},
           \l{Qt Style Sheets Reference#border-width-prop}{border-width}, and
           \l{The Box Model}.

    \row
        \o \bold{\c border-radius} \target border-radius-prop
        \o \l{#Radius}{Radius}
        \o The radius of the border's corners. Equivalent to
           specifying \c border-top-left-radius, \c
           border-top-right-radius, \c border-bottom-right-radius,
           and \c border-bottom-left-radius.

           The border-radius clips the element's 
           \l{Qt Style Sheets Reference#background-prop}{background}.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu,
           QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit,
           and QToolTip.

           If this property is not specified, it defaults to 0.

           Example:

           \code
                QLineEdit {
                    border-width: 1px;
                    border-style: solid;
                    border-radius: 4px;
                }
           \endcode

           See also \l{Qt Style Sheets Reference#border-width-prop}{border-width} and
           \l{The Box Model}.

    \row
        \o \c border-top-left-radius
        \o \l{#Radius}{Radius}
        \o The radius of the border's top-left corner.

    \row
        \o \c border-top-right-radius
        \o \l{#Radius}{Radius}
        \o The radius of the border's top-right corner.

    \row
        \o \c border-bottom-right-radius
        \o \l{#Radius}{Radius}
        \o The radius of the border's bottom-right corner. Setting
           this property to a positive value results in a rounded
           corner.

    \row
        \o \c border-bottom-left-radius
        \o \l{#Radius}{Radius}
        \o The radius of the border's bottom-left corner. Setting this
           property to a positive value results in a rounded corner.

    \row
        \o \bold{\c border-style} \target border-style-prop
        \o \l {Border Style}
        \o The style of all the border's edges.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu,
           QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit,
           and QToolTip.

           If this property is not specified, it defaults to \c none.

           Example:

           \code
                QLineEdit {
                    border-width: 1px;
                    border-style: solid;
                    border-color: blue;
                }
           \endcode

           See also \l{#border-color-prop}{border-color},
           \l{Qt Style Sheets Reference#border-style-prop}{border-style},
           \l{#border-image-prop}{border-image}, and \l{The Box Model}.

    \row
        \o \c border-top-style
        \o \l{#Border Style}{Border Style}
        \o The style of the border's top edge.

    \row
        \o \c border-right-style
        \o \l{#Border Style}{Border Style}
        \o The style of the border's right edge/

    \row
        \o \c border-bottom-style
        \o \l{#Border Style}{Border Style}
        \o The style of the border's bottom edge.

    \row
        \o \c border-left-style
        \o \l{#Border Style}{Border Style}
        \o The style of the border's left edge.

    \row
        \o \bold{\c border-width} \target border-width-prop
        \o \l{#Box Lengths}{Box Lengths}
        \o The width of the border. Equivalent to setting \c
           border-top-width, \c border-right-width, \c
           border-bottom-width, and \c border-left-width.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu,
           QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit,
           and QToolTip.

           Example:

           \code
                QLineEdit {
                    border-width: 2px;
                    border-style: solid;
                    border-color: darkblue;
                }
           \endcode

           See also \l{#border-color-prop}{border-color},
           \l{#border-radius-prop}{border-radius},
           \l{Qt Style Sheets Reference#border-style-prop}{border-style},
           \l{#border-image-prop}{border-image}, and
           \l{The Box Model}.

    \row
        \o \c border-top-width
        \o \l{#Length}{Length}
        \o The width of the border's top edge.

    \row
        \o \c border-right-width
        \o \l{#Length}{Length}
        \o The width of the border's right edge.

    \row
        \o \c border-bottom-width
        \o \l{#Length}{Length}
        \o The width of the border's bottom edge.

    \row
        \o \c border-left-width
        \o \l{#Length}{Length}
        \o The width of the border's left edge.

    \row
        \o \bold{\c bottom} \target bottom-prop
        \o \l{#Length}{Length}
        \o If \l{#position-prop}{position} is \c relative (the
           default), moves a \l{subcontrol} by a certain offset up;
           specifying \tt{bottom: \e{y}} is then equivalent to
           specifying \tt{\l{Qt Style Sheets Reference#top-prop}{top}: -\e{y}}.

           If \l{#position-prop}{position} is \c absolute, the \c
           bottom property specifies the subcontrol's bottom edge
           in relation to the parent's bottom edge (see also
           \l{Qt Style Sheets Reference#subcontrol-origin-prop}
           {subcontrol-origin}).

           Example:

           \code
                QSpinBox::down-button { bottom: 2px }
           \endcode

           See also \l{Qt Style Sheets Reference#left-prop}{left}, \l{#right-prop}{right}, and
           \l{Qt Style Sheets Reference#top-prop}{top}.

    \row
        \o \bold{\c button-layout} \target button-layout-prop
        \o \l{#Number}{Number}
        \o The layout of buttons in a QDialogButtonBox or
           a QMessageBox. The possible values are 0
           (\l{QDialogButtonBox::}{WinLayout}), 1
           (\l{QDialogButtonBox::}{MacLayout}), 2
           (\l{QDialogButtonBox::}{KdeLayout}), and 3
           (\l{QDialogButtonBox::}{GnomeLayout}).

           If this property is not specified, it defaults to the
           value specified by the current style for the
           \l{QStyle::}{SH_DialogButtonLayout} style hint.

           Example:

           \code
                * { button-layout: 2 }
           \endcode

    \row
        \o \bold{\c color} \target color-prop
        \o \l{#Brush}{Brush} \BR 
        \o The color used to render text.

           This property is supported by all widgets that respect
           the \l QWidget::palette.

           If this property is not set, the default is whatever is
           set for in the widget's palette for the
           QWidget::foregroundRole (typically black).

           Example:

           \code
                QPushButton { color: red }
           \endcode

           See also \l{Qt Style Sheets Reference#background-prop}{background} and
           \l{#selection-color-prop}{selection-color}.

    \omit
    \row
        \o \bold{\c etch-disabled-text}*
        \o \l{#Boolean}{Boolean}
        \o Whether disabled text is drawn etched.

           If this property is not specified, it defaults to the
           value specified by the current style for the
           \l{QStyle::}{SH_EtchDisabledText} style hint.

           Example:

           \code
                * { etch-disabled-text: 1 }
           \endcode
    \endomit

    \row
        \o \bold{\c font} \target font-prop
        \o \l{#Font}{Font}
        \o Shorthand notation for setting the text's font. Equivalent
           to specifying \c font-family, \c font-size, \c font-style,
           and/or \c font-weight.

           This property is supported by all widgets that respect
           the \l QWidget::font.

           If this property is not set, the default is the
           QWidget::font.

           Example:

           \code
                QCheckBox { font: bold italic large "Times New Roman" }
           \endcode

    \row
        \o \c font-family
        \o String
        \o The font family.

           Example:

           \code
                QCheckBox { font-family: "New Century Schoolbook" }
           \endcode

    \row
        \o \c font-size
        \o \l{#Font Size}{Font Size}
        \o The font size. In this version of Qt, only pt and px metrics are 
           supported.

           Example:

           \code
                QTextEdit { font-size: 12px }
           \endcode

    \row
        \o \c font-style
        \o \l {Font Style}
        \o The font style.

           Example:

           \code
                QTextEdit { font-style: italic }
           \endcode

    \row
        \o \c font-weight
        \o \l{#Font Weight}{Font Weight}
        \o The weight of the font.

    \row
        \o \bold{\c gridline-color}* \target gridline-color-prop
        \o \l{#Color}{Color} \BR
        \o The color of the grid line in a QTableView.

           If this property is not specified, it defaults to the
           value specified by the current style for the
           \l{QStyle::}{SH_Table_GridLineColor} style hint.

           Example:

           \code
                * { gridline-color: gray }
           \endcode

    \row
        \o \bold{\c height} \target height-prop
        \o \l{#Length}{Length}
        \o The height of a \l{subcontrol} (or in some case, a widget).

           If this property is not specified, it defaults to a value
           that depends on the subcontrol/widget and on the current style.

           \warning Unless otherwise specified, this property has no effect 
           when set on widgets. If you want a widget with a fixed height, set
           the \l{#min-width-prop}{min-height} and 
           \l{#max-width-prop}{max-height} to the same value.

           Example:

           \code
                QSpinBox::down-button { height: 10px }
           \endcode

           See also \l{#width-prop}{width}.

    \row
        \o \bold{\c image}* \target image-prop
        \o \l{#Url}{Url}+
        \o The image that is drawn in the contents rectangle of a 
           \l{subcontrol}. 

           The image property accepts a list of \l{#Url}{Url}s or 
           an \c{svg}. The actual image that is drawn is determined
           using the same algorithm as QIcon (i.e) the image is never scaled
           up but always scaled down if necessary. If a \c{svg} is specified,
           the image is scaled to the size of the contents rectangle.

           Setting the image property on sub controls implicitly sets the 
           width and height of the sub-control (unless the image in a SVG).

           In Qt 4.3 and later, the alignment of the
           image within the rectangle can be specified using 
           \l{image-position-prop}{image-position}.

           \warning The QIcon SVG plugin is needed to render SVG images.

           Example:

           \code
            / * implicitly sets the size of down-button to the size of spindown.png * /
            QSpinBox::down-button { image: url(:/images/spindown.png) }

            QTextEdit { image: url(x1.png) url(x2.png) }
            QTextEdit { image: url(pic1.svg) }
           \endcode

    \row
        \o \bold{\c image-position} \target image-position-prop
        \o \l{#Alignment}{alignment}
        \o In Qt 4.3 and later, the alignment of the image image's position can be specified
           using relative or absolute position.

    \row
        \o \bold{\c left} \target left-prop
        \o \l{#Length}{Length}
        \o If \l{#position-prop}{position} is \c relative (the
           default), moves a \l{subcontrol} by a certain offset to
           the right.

           If \l{#position-prop}{position} is \c absolute, the \c
           left property specifies the subcontrol's left edge in
           relation to the parent's left edge (see also
           \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}).

           If this property is not specified, it defaults to \c 0.

           Example:

           \code
                QSpinBox::down-button { left: 2px }
           \endcode

           See also \l{#right-prop}{right}, \l{Qt Style Sheets Reference#top-prop}{top}, and
           \l{#bottom-prop}{bottom}.

    \row
        \o \bold{\c lineedit-password- \BR \c character}* \target lineedit-password-character-prop
        \o \l{#Number}{Number}
        \o The QLineEdit password character as a Unicode number.

           If this property is not specified, it defaults to the
           value specified by the current style for the
           \l{QStyle::}{SH_LineEdit_PasswordCharacter} style hint.

           Example:

           \code
                * { lineedit-password-character: 9679 }
           \endcode

    \row
        \o \bold{\c margin} \target margin-prop
        \o \l {Box Lengths}
        \o The widget's margins. Equivalent to specifying \c
           margin-top, \c margin-right, \c margin-bottom, and \c
           margin-left.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu,
           QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit,
           and QToolTip.

           If this property is not specified, it defaults to \c 0.

           Example:

           \code
                QLineEdit { margin: 2px }
           \endcode

           See also \l{Qt Style Sheets Reference#padding-prop}{padding},
           \l{#spacing-prop}{spacing}, and \l{The Box Model}.

    \row
        \o \c margin-top
        \o \l{#Length}{Length}
        \o The widget's top margin.

    \row
        \o \c margin-right
        \o \l{#Length}{Length}
        \o The widget's right margin.

    \row
        \o \c margin-bottom
        \o \l{#Length}{Length}
        \o The widget's bottom margin.

    \row
        \o \c margin-left
        \o \l{#Length}{Length}
        \o The widget's left margin.

    \row
        \o \bold{\c max-height} \target max-height-prop
        \o \l{#Length}{Length}
        \o The widget's or a subcontrol's maximum height.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu,
           QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox,
           QSplitter, QStatusBar, QTextEdit, and QToolTip.

           Example:

           \code
                QSpinBox { max-height: 24px }
           \endcode

           See also \l{#max-width-prop}{max-width}.

    \row
        \o \bold{\c max-width} \target max-width-prop
        \o \l{#Length}{Length}
        \o The widget's or a subcontrol's maximum width.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu,
           QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox,
           QSplitter, QStatusBar, QTextEdit, and QToolTip.

           Example:

           \code
                QComboBox { max-width: 72px }
           \endcode

           See also \l{#max-height-prop}{max-height}.


    \row
        \o \bold{\c messagebox-text- \target messagebox-text-interaction-flags-prop
           \BR \c interaction-flags}*
        \o \l{#Number}{Number}
        \o The interaction behavior for text in a message box.
           Possible values are based on Qt::TextInteractionFlags.

           If this property is not specified, it defaults to the
           value specified by the current style for the
           \l{QStyle::}{SH_MessageBox_TextInteractionFlags} style
           hint.

           Example:

           \code
                QMessageBox { messagebox-text-interaction-flags: 5 }
           \endcode

    \row
        \o \bold{\c min-height} \target min-height-prop
        \o \l{#Length}{Length}
        \o The widget's or a subcontrol's minimum height.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu,
           QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox,
           QSplitter, QStatusBar, QTextEdit, and QToolTip.

           If this property is not specified, the minimum height is
           derived based on the widget's contents and the style.

           Example:

           \code
                QComboBox { min-height: 24px }
           \endcode

           See also \l{#min-width-prop}{min-width}.

    \row
        \o \bold{\c min-width} \target min-width-prop
        \o \l{#Length}{Length}
        \o The widget's or a subcontrol's minimum width.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu,
           QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox,
           QSplitter, QStatusBar, QTextEdit, and QToolTip.

           If this property is not specified, the minimum width is
           derived based on the widget's contents and the style.

           Example:

           \code
                QComboBox { min-width: 72px }
           \endcode

           See also \l{#min-height-prop}{min-height}.

    \row
        \o \bold{\c opacity}* \target opacity-prop
        \o \l{#Number}{Number}
        \o The opacity for a widget. Possible values are from 0
           (transparent) to 255 (opaque). For the moment, this is
           only supported for \l{QToolTip}{tooltips}.

           If this property is not specified, it defaults to the
           value specified by the current style for the
           \l{QStyle::}{SH_ToolTipLabel_Opacity} style hint.

           Example:

           \code
                QToolTip { opacity: 223 }
           \endcode

    \row
        \o \bold{\c padding} \target padding-prop
        \o \l{#Box Lengths}{Box Lengths}
        \o The widget's padding. Equivalent to specifying \c
           padding-top, \c padding-right, \c padding-bottom, and \c
           padding-left.

           This property is supported by QAbstractItemView
           subclasses, QAbstractSpinBox subclasses, QCheckBox,
           QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu,
           QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit,
           and QToolTip.

           If this property is not specified, it defaults to \c 0.

           Example:

           \code
                QLineEdit { padding: 3px }
           \endcode

           See also \l{#margin-prop}{margin},
           \l{#spacing-prop}{spacing}, and \l{The Box Model}.

    \row
        \o \c padding-top
        \o \l{#Length}{Length}
        \o The widget's top padding.

    \row
        \o \c padding-right
        \o \l{#Length}{Length}
        \o The widget's right padding.

    \row
        \o \c padding-bottom
        \o \l{#Length}{Length}
        \o The widget's bottom padding.

    \row
        \o \c padding-left
        \o \l{#Length}{Length}
        \o The widget's left padding.

    \row
        \o \bold{\c position} \target position-prop
        \o \c relative \BR
           | \c absolute
        \o Whether offsets specified using \l{Qt Style Sheets Reference#left-prop}{left},
           \l{#right-prop}{right}, \l{Qt Style Sheets Reference#top-prop}{top}, and
           \l{#bottom-prop}{bottom} are relative or absolute
           coordinates.

           If this property is not specified, it defaults to \c
           relative.

    \row
        \o \bold{\c right} \target right-prop
        \o \l{#Length}{Length}
        \o If \l{#position-prop}{position} is \c relative (the
           default), moves a \l{subcontrol} by a certain offset to
           the left; specifying \tt{right: \e{x}} is then equivalent
           to specifying \tt{\l{Qt Style Sheets Reference#left-prop}{left}: -\e{x}}.

           If \l{#position-prop}{position} is \c absolute, the \c
           right property specifies the subcontrol's right edge in
           relation to the parent's right edge (see also
           \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}).

           Example:

           \code
                QSpinBox::down-button { right: 2px }
           \endcode

           See also \l{Qt Style Sheets Reference#left-prop}{left}, \l{Qt Style Sheets Reference#top-prop}{top}, and
           \l{#bottom-prop}{bottom}.

    \row
        \o \bold{\c selection-background-color}* \target selection-background-color-prop
        \o \l{#Brush}{Brush} \BR
        \o The background of selected text or items.

           This property is supported by all widgets that respect
           the \l QWidget::palette and that show selection text.

           If this property is not set, the default value is
           whatever is set for the palette's
           \l{QPalette::}{Highlight} role.

           Example:

           \code
                QTextEdit { selection-background-color: darkblue }
           \endcode

           See also \l{#selection-color-prop}{selection-color} and
           \l{Qt Style Sheets Reference#background-prop}{background}.

    \row
        \o \bold{\c selection-color}* \target selection-color-prop
        \o \l{#Brush}{Brush} \BR
        \o The foreground of selected text or items.

           This property is supported by all widgets that respect
           the \l QWidget::palette and that show selection text.

           If this property is not set, the default value is
           whatever is set for the palette's
           \l{QPalette::}{HighlightedText} role.

           Example:

           \code
                QTextEdit { selection-color: white }
           \endcode

           See also
           \l{#selection-background-color-prop}{selection-background-color}
           and \l{#color-prop}{color}.

    \row
        \o \bold{\c show-decoration- \target show-decoration-selected-prop
           \BR \c selected}*
        \o \l{#Boolean}{Boolean}
        \o Controls whether selections in a QListView cover the
           entire row or just the extent of the text.

           If this property is not specified, it defaults to the
           value specified by the current style for the
           \l{QStyle::}{SH_ItemView_ShowDecorationSelected} style
           hint.

           Example:

           \code
                * { show-decoration-selected: 1 }
           \endcode

    \row
        \o \bold{\c spacing}* \target spacing-prop
        \o \l{#Length}{Length}
        \o Internal spacing in the widget.

           This property is supported by QCheckBox, checkable
           \l{QGroupBox}es, QMenuBar, and QRadioButton.

           If this property is not specified, the default value
           depends on the widget and on the current style.

           Example:

           \code
                QMenuBar { spacing: 10 }
           \endcode

           See also \l{Qt Style Sheets Reference#padding-prop}{padding} and
           \l{#margin-prop}{margin}.

    \row
        \o \bold{\c subcontrol-origin}* \target subcontrol-origin-prop
        \o \l{#Origin}{Origin}
        \o The origin rectangle of the \l subcontrol within the
           parent element.

           If this property is not specified, the default is \c
           padding.

           Example:

           \code
                QSpinBox::up-button {
                    image: url(:/images/spinup.png);
                    subcontrol-origin: content;
                    subcontrol-position: right top;
                }
           \endcode

           See also
           \l{Qt Style Sheets Reference#subcontrol-position-prop}{subcontrol-position}.

    \row
        \o \bold{\c subcontrol-position}* \target subcontrol-position-prop
        \o \l{#Alignment}{Alignment}
        \o The alignment of the \l subcontrol within the origin
           rectangle specified by \l{Qt Style Sheets Reference#subcontrol-origin-prop}
           {subcontrol-origin}.

           If this property is not specified, it defaults to a value
           that depends on the subcontrol.

           Example:

           \code
                QSpinBox::down-button {
                    image: url(:/images/spindown.png);
                    subcontrol-origin: padding;
                    subcontrol-position: right bottom;
                }
           \endcode

           See also
           \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}.

    \row
        \o \bold{\c text-align} \target text-align-prop
        \o \l{#Alignment}{Alignment}
        \o The alignment of text and icon within the contents of the widget.

           If this value is not specified, it defaults to the value
           that depends on the native style.

           Example:

           \code
                QPushButton {
                    text-align: left;
                }
           \endcode

            This property is currently supported only by QPushButton 
            and QProgressBar.

    \row
        \o \bold{\c top} \target top-prop
        \o \l{#Length}{Length}
        \o If \l{#position-prop}{position} is \c relative (the
           default), moves a \l{subcontrol} by a certain offset
           down.

           If \l{#position-prop}{position} is \c absolute, the \c top
           property specifies the subcontrol's top edge in relation
           to the parent's top edge (see also
           \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}).

           If this property is not specified, it defaults to \c 0.

           Example:

           \code
                QSpinBox::up-button { top: 2px }
           \endcode

           See also \l{Qt Style Sheets Reference#left-prop}{left}, \l{#right-prop}{right}, and
           \l{#bottom-prop}{bottom}.

    \row
        \o \bold{\c width} \target width-prop
        \o \l{#Length}{Length}
        \o The width of a \l{subcontrol} (or a widget in some cases).

           If this property is not specified, it defaults to a value
           that depends on the subcontrol/widget and on the current style.

           \warning Unless otherwise specified, this property has no effect 
           when set on widgets. If you want a widget with a fixed width, set
           the \l{#min-width-prop}{min-width} and 
           \l{#max-width-prop}{max-width} to the same value.

           Example:

           \code
                QSpinBox::up-button { width: 12px }
           \endcode

           See also \l{#height-prop}{height}.

    \endtable

    \section1 List of Property Types

    The following table summarizes the syntax and meaning of the
    different property types.

    \table 100%
    \header
        \o Type
        \o Syntax
        \o Description

    \row
        \o \bold Alignment \target Alignment
        \o \{ \c top \BR
           | \c bottom \BR
           | \c left \BR
           | \c right \BR
           | \c center \}*
        \o Horizontal and/or vertical alignment.

           Example:

    \code
        QTextEdit { background-position: bottom center }
    \endcode

    \row
        \o \bold Attachment \target Attachment
        \o \{ \c scroll \BR
           | \c fixed \}*
        \o Scroll or fixed attachment.

    \row
        \o \bold Background \target Background
        \o \{ \l{#Brush}{Brush} \BR
           | \l{#Url}{Url} \BR
           | \l{#Repeat}{Repeat} \BR
           | \l{#Alignment}{Alignment} \}*
        \o A sequence of \l{#Brush}{Brush}, \l{#Url}{Url},
           \l{#Repeat}{Repeat}, and \l{#Alignment}{Alignment}.

    \row
        \o \bold Boolean \target Boolean
        \o 0 | 1
        \o True (\c 1) or false (\c 0).

           Example:

    \code
        QDialog { etch-disabled-text: 1 }
    \endcode

    \row
        \o \bold Border \target Border
        \o \{ \l{#Border Style}{Border Style} \BR
           | \l{#Length}{Length} \BR
           | \l{#Brush}{Brush} \}*
        \o Shorthand border property.

    \row
        \o \bold{Border \target Border Image
           Image}
        \o \c none \BR
           | \l{Url} \l{Number}\{4\} \BR (\c stretch | \c repeat){0,2}
        \o A border image is an image that is composed of nine parts
           (top left, top center, top right, center left, center,
           center right, bottom left, bottom center, and bottom
           right). When a border of a certain size is required, the
           corner parts are used as is, and the top, right, bottom,
           and left parts are stretched or repeated to produce a
           border with the desired size.

           See the
           \l{http://www.w3.org/TR/css3-background/#the-border-image}
           {CSS3 Draft Specification} for details.

    \row
        \o \bold{Border \target Border Style
           Style}
        \o \c dashed \BR
           | \c dot-dash \BR
           | \c dot-dot-dash \BR
           | \c dotted \BR
           | \c double \BR
           | \c groove \BR
           | \c inset \BR
           | \c outset \BR
           | \c ridge \BR
           | \c solid \BR
           | \c none
        \o Specifies the pattern used to draw a border.
           See the \l{http://www.w3.org/TR/css3-background/#border-style}
           {CSS3 Draft Specification} for details.

    \row
        \o \bold{Box \target Box Colors 
        Colors}
        \o \l{#Brush}{Brush}\{1,4\}
        \o One to four occurrences of \l{#Brush}{Brush}, specifying the top,
           right, bottom, and left edges of a box, respectively. If
           the left color is not specified, it is taken to be the
           same as the right color. If the bottom color is not
           specified, it is taken to be the same as the top color. If
           the right color is not specified, it is taken to be the
           same as the top color.

           Example:

           \code
                QLabel { border-color: red }   / * red red red red   * /
                QLabel { border-color: red blue } / * red blue red blue * /
                QLabel { border-color: red blue green } / * red blue green blue
* /
                QLabel { border-color: red blue green yellow }  / * red
blue green yellow * /
           \endcode

    \row
        \o \bold{Box \target Box Lengths
           Lengths}
        \o \l{#Length}{Length}\{1,4\}
        \o One to four occurrences of \l{#Length}{Length}, specifying the
           top, right, bottom, and left edges of a box,
           respectively. If the left length is not specified, it is
           taken to be the same as the right length. If the bottom
           length is not specified, is it taken to be the same as the
           top length. If the right length is not specified, it is
           taken to be the same as the top length.

           Examples:

           \code
        QLabel { border-width: 1px }                    / * 1px 1px 1px 1px * /
        QLabel { border-width: 1px 2px }                / * 1px 2px 1px 2px * /
        QLabel { border-width: 1px 2px 3px }            / * 1px 2px 3px 2px * /
        QLabel { border-width: 1px 2px 3px 4px }        / * 1px 2px 3px 4px * /
           \endcode

    \row
        \o \bold Brush \target Brush
        \o \l{#Color}{Color} \BR
           | \l{Gradient} \BR
           | \l{PaletteRole}
        \o Specifies a Color or a Gradient or an entry in the Palette.

    \row
        \o \bold Color \target Color
        \o \tt{rgb(\e{r}, \e{g}, \e{b})} \BR
           | \tt{rgba(\e{r}, \e{g}, \e{b}, \e{a})} \BR
           | \tt{#\e{rrggbb}} \BR
           | \l{QColor::setNamedColor()}{Color Name} \BR
        \o Specifies a color as RGB (red, green, blue) or RGBA
           (red, green, blue, alpha). The \c rgb() or \c rgba() syntax can be
           used with integer values between 0 and 255, or with
           percentages.

           Examples:

    \code
        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 * /
    \endcode

    \row
        \o \bold Font \target Font
        \o (\l{#Font Style}{Font Style} | \l{#Font Weight}{Font Weight}){0,2} \l{#Font Size}{Font Size} String
        \o Shorthand font property.

    \row
        \o \bold{Font \target Font Size
           Size}
        \o \l{Length}
        \o The size of a font.

    \row
        \o \bold{Font \target Font Style
           Style}
        \o \c normal \BR
           | \c italic \BR
           | \c oblique
        \o The style of a font.

    \row
        \o \bold{Font \target Font Weight
           Weight}
        \o \c normal \BR
           | \c bold \BR
           | \c 100 \BR
           | \c 200 \BR
           ... \BR
           | \c 900
        \o The weight of a font.

    \row
        \o \bold Gradient \target Gradient
        \o \c qlineargradient \BR
           | \c qradialgradient \BR
           | \c qconicalgradient
        \o Specifies gradient fills. There are three types of gradient fills:

           \list
           \o \e{Linear} gradients interpolate colors between start and
              end points.
           \o \e{Radial} gradients interpolate colors between a focal
              point and end points on a circle surrounding it.
           \o \e{Conical} gradients interpolate colors around a center
              point.
           \endlist

        Gradients are specified in Object Bounding Mode. Imagine the box 
        in which the gradient is rendered, to have its top left corner at (0, 0)
        and its bottom right corner at (1, 1). Gradient parameters are
        then specified as percentages from 0 to 1. These values are 
        extrapolated to actual box coordinates at runtime. It is possible
        specify values that lie outside the bounding box (-0.6 or 1.8, for
        instance).

        \warning The stops have to appear sorted in ascending order.

        Examples:

        \code
            / * linear gradient from white to green * /
            QTextEdit {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
                            stop:0 white, stop: 0.4 gray, stop:1 green)
            }

            / * linear gradient from white to green * /
            QTextEdit {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
                            stop:0 white, stop: 0.4 rgba(10, 20, 30, 40), stop:1 rgb(0, 200, 230, 200))
            }


            / * conical gradient from white to green * /
            QTextEdit {
                background: qconicalgradient(cx:0.5, cy:0.5, angle:30,
                            stop:0 white, stop:1 #00FF00)
            }

            / * radial gradient from white to green * /
            QTextEdit {
                background: qradialgradient(cx:0, cy:0, radius: 1, 
                            fx:0.5, fy:0.5, stop:0 white, stop:1 green)
            } 
        \endcode

    \row
        \o \bold Length \target Length
        \o \l{#Number}{Number} (\c px | \c pt | \c em | \c ex)?
        \o A number followed by a measurement unit. The supported
           units are:

           \list
           \o \c px: pixels (the default when no units are specified)
           \o \c pt: the size of one point (i.e., 1/72 of an inch)
           \o \c em: the em width of the font (i.e., the width of 'M')
           \o \c ex: the ex width of the font (i.e., the height of 'x')
           \endlist

    \row
        \o \bold Number \target Number
        \o A decimal integer or a real number
        \o Examples: \c 0, \c 18, \c +127, \c -255, \c 12.34, \c -.5,
           \c 0009.

    \row
        \o \bold Origin \target Origin
        \o \c margin \BR
           | \c border \BR
           | \c padding \BR
           | \c content
        \o Indicates which of four rectangles to use.

           \list
           \o \c margin: The margin rectangle. The margin falls outside the border.
           \o \c border: The border rectangle. This is where any border is drawn.
           \o \c padding: The padding rectangle. Unlike the margins,
                          padding is located inside the border.
           \o \c content: The content rectangle. This specifies where
                          the actual contents go, excluding any
                          padding, border, or margin.
           \endlist

           See also \l{The Box Model}.

    \row
        \o \bold PaletteRole \target PaletteRole
        \o \c alternate-base \BR
              | \c base \BR
              | \c bright-text \BR
              | \c button \BR
              | \c button-text \BR
              | \c dark \BR
              | \c highlight \BR
              | \c highlighted-text \BR
              | \c light \BR
              | \c link \BR
              | \c link-visited \BR
              | \c mid \BR
              | \c mid-light \BR
              | \c shadow \BR
              | \c text \BR
              | \c window \BR
              | \c window-text \BR
        \o These values correspond the \l{QPalette::ColorRole}{Color roles} 
           in the widget's QPalette.

            For example,
            \code
                QPushButton { color: palette(dark); }
            \endcode

    \row
        \o \bold Radius \target Radius
        \o \l{#Length}{Length}\{1, 2\}
        \o One or two occurrences of \l{#Length}{Length}. If only one length is
           specified, it is used as the radius of the quarter circle
           defining the corner. If two lengths are specified, the
           first length is the horizontal radius of a quarter
           ellipse, whereas the second length is the vertical radius.

    \row
        \o \bold Repeat \target Repeat
        \o \c repeat-x \BR
           | \c repeat-y \BR
           | \c repeat \BR
           | \c no-repeat
        \o A value indicating the nature of repetition.

           \list
           \o \c repeat-x: Repeat horizontally.
           \o \c repeat-y: Repeat vertically.
           \o \c repeat: Repeat horizontally and vertically.
           \o \c no-repeat: Don't repeat.
           \endlist

    \row
        \o \bold Url \target Url
        \o \tt{url(\e{filename})}
        \o \tt{\e{filename}} is the name of a file on the local disk
           or stored using \l{the Qt Resource System}. Setting an
           image implicitly sets the width and height of the element.

    \endtable

    \section1 List of Pseudo-States

    The following pseudo-states are supported:

    \table 100%
    \header
        \o Pseudo-State
        \o Description

    \row
        \o \c :adjoins-item \target adjoins-item-ps
        \o This state is set when the the \l{#branch-sub}{::branch} of a QTreeView
           is adjacent to an item.

    \row
        \o \c :bottom \target bottom-ps
        \o The item is positioned at the bottom. For example, a QTabBar
           that has its tabs positioned at the bottom.

    \row
        \o \c :checked \target checked-ps
        \o The item is checked. For example, the 
            \l{QAbstractButton::checked}{checked} state of QAbstractButton.

    \row
        \o \c :closed \target closed-ps
        \o The item is in the closed state. For example, an non-expanded 
           item in a QTreeView

    \row
        \o \c :default \target default-ps
        \o The item is the default. For example, a 
           \l{QPushButton::default}{default} QPushButton or a default action
           in a QMenu.

    \row
        \o \c :disabled \target disabled-ps
        \o The item is \l{QWidget::enabled}{disabled}.

    \row
        \o \c :editable \target editable-ps
        \o The QComboBox is editable.

    \row
        \o \c :enabled \target enabled-ps
        \o The item is \l{QWidget::enabled}{enabled}.

    \row
        \o \c :exclusive \target exclusive-ps
        \o The item is part of an exclusive item group. For example, a menu
           item in a exclusive QActionGroup.

    \row
        \o \c :first \target first-ps
        \o The item is the first (in a list). For example, the first
           tab in a QTabBar.

    \row
        \o \c :flat \target flat-ps
        \o The item is flat. For example, a
           \l{QPushButton::flat}{flat} QPushButton.

    \row
        \o \c :focus \target focus-ps
        \o The item has \l{QWidget::hasFocus()}{input focus}.

    \row
        \o \c :has-children \target has-children-ps
        \o The item has children. For example, an item in a
           QTreeView that has child items.

    \row
        \o \c :has-siblings \target has-siblings-ps
        \o The item has siblings. For example, an item in a
           QTreeView that siblings.

    \row
        \o \c :horizontal \target horizontal-ps
        \o The item has horizontal orientation

    \row
        \o \c :hover \target hover-ps
        \o The mouse is hovering over the item.

    \row
        \o \c :indeterminate \target indeterminate-ps
        \o The item has indeterminate state. For example, a QCheckBox 
           or QRadioButton is \l{Qt::PartiallyChecked}{partially checked}.

    \row
        \o \c :last \target last-ps
        \o The item is the last (in a list). For example, the last
           tab in a QTabBar.

    \row
        \o \c :left \target left-ps
        \o The item is positioned at the left. For example, a QTabBar
           that has its tabs positioned at the left.

    \row
        \o \c :middle \target middle-ps
        \o The item is in the middle (in a list). For example, a tab
           that is not in the beginning or the end in a QTabBar.

    \row
        \o \c :no-frame \target no-frame-ps
        \o The item has no frame. For example, a frameless QSpinBox
           or QLineEdit.

    \row
        \o \c :non-exclusive \target non-exclusive-ps
        \o The item is part of a non-exclusive item group. For example, a menu
           item in a non-exclusive QActionGroup.

    \row
        \o \c :off \target off-ps
        \o For items that can be toggled, this applies to items
           in the "off" state.

    \row
        \o \c :on \target on-ps
        \o For items that can be toggled, this applies to widgets
           in the "on" state. 

    \row
        \o \c :only-one \target only-one-ps
        \o The item is the only one (in a list). For example, a lone tab
           in a QTabBar.

    \row
        \o \c :open \target open-ps
        \o The item is in the open state. For example, an expanded 
           item in a QTreeView, or a QComboBox or QPushButton with
           an open menu.

    \row
        \o \c :next-selected \target next-selected-ps
        \o The next item (in a list) is selected. For example, the
           selected tab of a QTabBar is next to this item.

    \row
        \o \c :pressed \target pressed-ps
        \o The item is being pressed using the mouse.

    \row
        \o \c :previous-selected \target previous-selected-ps
        \o The previous item (in a list) is selected. For example, a
           tab in a QTabBar that is next to the selected tab.

    \row
        \o \c :read-only \target read-only-ps
        \o The item is marked read only or non-editable. For example,
           a read only QLineEdit or a non-editable QComboBox.

    \row
        \o \c :right \target right-ps
        \o The item is positioned at the right. For example, a QTabBar
           that has its tabs positioned at the right.

    \row 
        \o \c :selected \target selected-ps
        \o The item is selected. For example, the selected tab in
           a QTabBar or the selected item in a QMenu.

    \row
        \o \c :top \target top-ps
        \o The item is positioned at the top. For example, a QTabBar
           that has its tabs positioned at the top.

    \row
        \o \c :unchecked \target unchecked-ps
        \o The item is
           \l{QAbstractButton::checked}{unchecked}.

    \row
        \o \c :vertical \target vertical-ps
        \o The item has vertical orientation.

    \endtable

    \target subcontrols
    \section1 List of Sub-Controls

    The following subcontrols are available:

    \table 100%
    \header
        \o Sub-Control
        \o Description

    \row
        \o \c ::add-line \target add-line-sub
        \o The button to add a line of a QScrollBar.

    \row
        \o \c ::add-page \target add-page-sub
        \o The region between the handle (slider) and the \l{#add-line-sub}{add-line}
           of a QScrollBar.

    \row
        \o \c ::branch \target branch-sub
        \o The branch indicator of a QTreeView.

    \row
        \o \c ::chunk \target chunk-sub
        \o The progress chunk of a QProgressBar.

    \row
        \o \c ::down-arrow \target down-arrow-sub
        \o The down arrow of a QComboBox, QHeaderView (sort indicator),
           QScrollBar or QSpinBox.

    \row
        \o \c ::down-button \target down-button-sub
        \o  The down button of a QScrollBar or a QSpinBox.

    \row
        \o \c ::drop-down \target drop-down-sub
        \o The drop-down button of a QComboBox.

    \row
        \o \c ::groove \target groove-sub
        \o The groove of a QSlider.

    \row
        \o \c ::indicator \target indicator-sub
        \o The indicator of a QCheckBox, a QRadioButton, a checkable
            QMenu item or a checkable QGroupBox.

    \row
        \o \c ::handle \target handle-sub
        \o The handle (slider) of a QScrollBar or a QSlider.

    \row
        \o \c ::item \target item-sub
        \o An item of a QMenuBar, a QMenu, or a QStatusBar.

    \row
        \o \c ::left-arrow \target left-arrow-sub
        \o The left arrow of a QScrollBar.

    \row
        \o \c ::left-corner \target left-corner-sub
        \o The left corner of a QTabWidget. For example, this control can be
           used to control position the left corner widget in a QTabWidget.

    \row
        \o \c ::menu-arrow \target menu-arrow-sub
        \o The arrow of a QToolButton with a menu.

    \row
        \o \c ::menu-button \target menu-button-sub
        \o The menu button of a QToolButton.

    \row
        \o \c ::menu-indicator \target menu-indicator-sub
        \o The menu indicator of a QPushButton.

    \row
        \o \c ::right-arrow \target right-arrow-sub
        \o The right arrow of a QMenu or a QScrollBar.

    \row
        \o \c ::pane \target pane-sub
        \o The pane (frame) of a QTabWidget.

    \row
        \o \c ::right-corner \target right-corner-sub
        \o The right corner of a QTabWidget. For example, this control can be
           used to control the position the right corner widget in a QTabWidget.

    \row
        \o \c ::scroller \target scroller-sub
        \o The scroller of a QMenu or QTabBar.

    \row
        \o \c ::section \target section-sub
        \o The section of a QHeaderView.

    \row
        \o \c ::separator \target separator-sub
        \o The separator of a QMenu.

    \row
        \o \c ::sub-line \target sub-line-sub
        \o The button to subtract a line of a QScrollBar.

    \row
        \o \c ::sub-page \target sub-page-sub
        \o The region between the handle (slider) and the \l{#sub-line-sub}{sub-line}
           of a QScrollBar.

    \row
        \o \c ::tab \target tab-sub
        \o The tab of a QTabBar or QToolBox.

    \row
        \o \c ::tab-bar \target tab-bar-sub
        \o The tab bar of a QTabWidget. This subcontrol exists only to
           control the position of the QTabBar inside the QTabWidget. To
           style the tabs using the \l{#tab-sub}{::tab} subcontrol.

    \row
        \o \c ::tear \target tear-sub
        \o The tear indicator of a QTabBar.

    \row
        \o \c ::tear-off \target tear-off-sub
        \o The tear-off indicator of a QMenu.

    \row
        \o \c ::title \target title-sub
        \o The title of a QGroupBox.

    \row
        \o \c ::up-arrow \target up-arrow-sub
        \o The up arrow of a QHeaderView (sort indicator), QScrollBar 
           or a QSpinBox.

    \row
        \o \c ::up-button \target up-button-sub
        \o The up button of a QSpinBox.

    \endtable

    See \l{Customizing the QPushButton's Menu Indicator Sub-Control}
    for an example of how to customize a subcontrol.
    */

    /*!
    \page stylesheet-examples.html
    \contentspage {Qt Style Sheet}{Contents}
    \previouspage Qt Style Sheets Reference
    \title Qt Style Sheets Examples

    \tableofcontents
    \section1 Style Sheet Usage

    We will now see a few examples to get started with using Qt Style Sheets.

    \section2 Customizing the Foreground and Background Colors

    Let's start by setting yellow as the background color of all
    \l{QLineEdit}s in an application. This could be achieved like
    this:

    \code
        qApp->setStyleSheet("QLineEdit { background-color: yellow }");
    \endcode

    If we want the property to apply only to the \l{QLineEdit}s that are
    children (or grandchildren or grand-grandchildren) of a specific dialog,
    we would rather do this:

    \code
        myDialog->setStyleSheet("QLineEdit { background-color: yellow }");
    \endcode

    If we want the property to apply only to one specific QLineEdit,
    we can give it a name using QObject::setObjectName() and use an
    ID Selector to refer to it:

    \code
        myDialog->setStyleSheet("QLineEdit#nameEdit { background-color: yellow }");
    \endcode

    Alternatively, we can set the
    \l{Qt Style Sheets Reference#background-prop}{background-color} property directly on the
    QLineEdit, omitting the selector:

    \code
        nameEdit->setStyleSheet("background-color: yellow");
    \endcode

    To ensure a good contrast, we should also specify a suitable
    color for the text:

    \code
        nameEdit->setStyleSheet("color: blue; background-color: yellow");
    \endcode

    It might be a good idea to change the colors used for selected
    text as well:

    \code
        nameEdit->setStyleSheet("color: blue;"
                                "background-color: yellow;"
                                "selection-color: yellow;"
                                "selection-background-color: blue;");
    \endcode

    There are many situations where we need to present a form that
    has mandatory fields. To indicate to the user that the field is
    mandatory, one effective (albeit esthetically dubious) solution
    is to use yellow as the background color for those fields. It
    turns out this is very easy to implement using Qt Style Sheets.
    First, we would use the following application-wide style sheet:

    \code
        *[mandatoryField="true"] { background-color: yellow }
    \endcode

    This means that every widget whose \c mandatoryField Qt property
    is set to true would have a yellow background.

    Then, for each mandatory field widget, we would simply create a
    \c mandatoryField property on the fly and set it to true. For
    example:

    \code
        QLineEdit *nameEdit = new QLineEdit(this);
        nameEdit->setProperty("mandatoryField", true);

        QLineEdit *emailEdit = new QLineEdit(this);
        emailEdit->setProperty("mandatoryField", true);

        QSpinBox *ageSpinBox = new QSpinBox(this);
        ageSpinBox->setProperty("mandatoryField", true);
    \endcode

    \section2 Customizing a QPushButton Using the Box Model

    This time, we will show how to create a red QPushButton. This
    QPushButton would presumably be connected to a very destructive
    piece of code.

    First, we are tempted to use this style sheet:

    \code
        QPushButton#evilButton { background-color: red }
    \endcode

    However, the result is a boring, flat button with no borders:

    \image stylesheet-redbutton1.png A flat red button

    What happened is this:

    \list
    \o We have made a request that cannot be satisfied using the
       native styles alone (e.g., the Windows XP theme engine doesn't
       let us specify the background color of a button).
    \o Therefore, the button is rendered using style sheets.
    \o We haven't specified any values for
       \l{Qt Style Sheets Reference#border-width-prop}{border-width} and
       \l{Qt Style Sheets Reference#border-style-prop}{border-style}, so by default we obtain
       a 0-pixel wide border of style \c none.
    \endlist

    Let's improve the situation by specifying a border:

    \code
        QPushButton#evilButton {
            background-color: red;
            border-style: outset;
            border-width: 2px;
            border-color: beige;
        }
    \endcode

    \image stylesheet-redbutton2.png A red button with a beige border

    Things look already a lot better. But the button looks a bit
    cramped. Let's specify some spacing between the border and the
    text using the \l{Qt Style Sheets Reference#padding-prop}{padding}. Additionally, we will
    enforce a minimum width, round the corners, and specify a larger
    font to make the button look nicer:

    \code
        QPushButton#evilButton {
            background-color: red;
            border-style: outset;
            border-width: 2px;
            border-radius: 10px;
            border-color: beige;
            font: bold 14px;
            min-width: 10em;
            padding: 6px;
        }
    \endcode

    \image stylesheet-redbutton3.png A red button with a round beige border and big, bold text

    The only issue remaining is that the button doesn't react when we
    press it. We can fix this by specifying a slightly different
    background color and use a different border style.

    \code
        QPushButton#evilButton {
            background-color: red;
            border-style: outset;
            border-width: 2px;
            border-radius: 10px;
            border-color: beige;
            font: bold 14px;
            min-width: 10em;
            padding: 6px;
        }
        QPushButton#evilButton:pressed {
            background-color: rgb(224, 0, 0);
            border-style: inset;
        }
    \endcode

    \section2 Customizing the QPushButton's Menu Indicator Sub-Control

    Subcontrols give access to the sub-elements of a widget. For
    example, a QPushButton associated with a menu (using
    QPushButton::setMenu()) has a menu indicator. Let's customize
    the menu indicator for the red push button:

    \code
        QPushButton#evilButton::menu-indicator {
            image: url(myindicator.png);
        }
    \endcode

    By default, the menu indicator is located at the bottom-right
    corner of the padding rectangle. We can change this by specifying
    \l{Qt Style Sheets Reference#subcontrol-position-prop}{subcontrol-position} and
    \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin} to anchor the
    indicator differently. We can also use \l{Qt Style Sheets Reference#top-prop}{top} and
    \l{Qt Style Sheets Reference#left-prop}{left} to move the indicator by a few pixels. For
    example:

    \code
        QPushButton::menu-indicator {
            image: url(myindicator.png);
            subcontrol-position: right center;
            subcontrol-origin: padding;
            left: -2px;
        }
    \endcode

    This positions the \c myindicator.png to the center right of the
    QPushButton's \l{Qt Style Sheets Reference#padding-prop}{padding} rectangle (see
    \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin} for more
    information).

    \section2 Complex Selector Example

    Since red seems to be our favorite color, let's make the text in
    QLineEdit red by setting the following application-wide
    stylesheet:

    \code
        QLineEdit { color: red }
    \endcode

    However, we would like to give a visual indication that a
    QLineEdit is read-only by making it appear gray:

    \code
        QLineEdit { color: red }
        QLineEdit[readOnly="true"] { color: gray }
    \endcode

    At some point, our design team comes with the requirement that
    all \l{QLineEdit}s in the registration form (with the
    \l{QObject::objectName}{object name} \c registrationDialog) to be
    brown:

    \code
        QLineEdit { color: red }
        QLineEdit[readOnly="true"] { color: gray }
        #registrationDialog QLineEdit { color: brown }
    \endcode

    A few UI design meetings later, we decide that all our
    \l{QDialog}s should have brown colored \l{QLineEdit}s:

    \code
        QLineEdit { color: red }
        QLineEdit[readOnly="true"] { color: gray }
        QDialog QLineEdit { color: brown }
    \endcode

    Quiz: What happens if we have a read-only QLineEdit in a QDialog?
    [Hint: The \l{The Style Sheet Syntax#Conflict Resolution}{Conflict Resolution} section above explains
    what happens in cases like this.]

    \section1 Customizing specific widgets

    This section provides examples to customize specific widgets using Style Sheets.

    \section2 Customizing QAbstractScrollArea

    The background of any QAbstractScrollArea (Item views, QTextEdit 
    and QTextBrowser) can be set using the background properties. For example,
    to set a background-image that scrolls with the scroll bar:
    \code
        QTextEdit, QListView {
            background-color: white;
            background-image: url(draft.png);
            background-attachment: scroll;
        }
    \endcode

    If the background-image is to be fixed with the viewport:
    \code
        QTextEdit, QListView {
            background-color: white;
            background-image: url(draft.png);
            background-attachment: fixed;
        }
    \endcode

    \section2 Customizing QCheckBox

    Styling of a QCheckBox is almost indentical to styling a QRadioButton. The
    main difference is that a tristate QCheckBox has an indeterminate state.

    \code
        QCheckBox {
            spacing: 5px;
        }

        QCheckBox::indicator {
            width: 13px;
            height: 13px;
        }

        QCheckBox::indicator:unchecked {
            image: url(:/images/checkbox_unchecked.png);
        }

        QCheckBox::indicator:unchecked:hover {
            image: url(:/images/checkbox_unchecked_hover.png);
        }

        QCheckBox::indicator:unchecked:pressed {
            image: url(:/images/checkbox_unchecked_pressed.png);
        }

        QCheckBox::indicator:checked {
            image: url(:/images/checkbox_checked.png);
        }

        QCheckBox::indicator:checked:hover {
            image: url(:/images/checkbox_checked_hover.png);
        }

        QCheckBox::indicator:checked:pressed {
            image: url(:/images/checkbox_checked_pressed.png);
        }

        QCheckBox::indicator:indeterminate:hover {
            image: url(:/images/checkbox_indeterminate_hover.png);
        }

        QCheckBox::indicator:indeterminate:pressed {
            image: url(:/images/checkbox_indeterminate_pressed.png);
        }
    \endcode

    \section2 Customizing QComboBox

    We will look at an example where the drop down button of a QComboBox
    appears "merged" with the combo box frame.

    \code
        QComboBox {
            border: 1px solid gray;
            border-radius: 3px;
            padding: 1px 18px 1px 3px;
            min-width: 6em;
        }

        QComboBox:editable {
            background: white;
        }

        QComboBox:!editable, QComboBox::drop-down:editable {
             background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                         stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
                                         stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
        }

        / * QComboBox gets the "on" state when the popup is open * /
        QComboBox:!editable:on, QComboBox::drop-down:editable:on {
            background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                        stop: 0 #D3D3D3, stop: 0.4 #D8D8D8,
                                        stop: 0.5 #DDDDDD, stop: 1.0 #E1E1E1);
        }

        QComboBox:on { / * shift the text when the popup opens * /
            padding-top: 3px;
            padding-left: 4px;
        }

        QComboBox::drop-down {
            subcontrol-origin: padding;
            subcontrol-position: top right;
            width: 15px;

            border-left-width: 1px;
            border-left-color: darkgray;
            border-left-style: solid; / * just a single line * /
            border-top-right-radius: 3px; / * same radius as the QComboBox * /
            border-bottom-right-radius: 3px;
        }

        QComboBox::down-arrow {
            image: url(/usr/share/icons/crystalsvg/16x16/actions/1downarrow.png);
        }

        QComboBox::down-arrow:on { / * shift the arrow when popup is open * /
            top: 1px;
            left: 1px;
        } 
    \endcode

    The popup of the QComboBox is a QAbstractItemView and is styled using 
    the descendant selector:
    \code
        QComboBox QAbstractItemView {
            border: 2px solid darkgray;
            selection-background-color: lightgray;
        }
    \endcode

    \section2 Customizing QSpinBox

    QSpinBox can be completely customized as below (the style sheet has commentary inline):

    \code
        QSpinBox {
            padding-right: 15px; / * make room for the arrows * /
            border-image: url(:/images/frame.png) 4;
            border-width: 3;
        }

        QSpinBox::up-button {
            subcontrol-origin: border;
            subcontrol-position: top right; / * position at the top right corner * /

            width: 16px; / * 16 + 2*1px border-width = 15px padding + 3px parent border * /
            border-image: url(:/images/spinup.png) 1;
            border-width: 1px;
        }

        QSpinBox::up-button:hover {
            border-image: url(:/images/spinup_hover.png) 1;
        }

        QSpinBox::up-button:pressed {
            border-image: url(:/images/spinup_pressed.png) 1;
        }

        QSpinBox::up-arrow {
            image: url(:/images/up_arrow.png);
            width: 7px;
            height: 7px;
        }

        QSpinBox::up-arrow:disabled, QSpinBox::up-arrow:off { / * off state when value is max * /
           image: url(:/images/up_arrow_disabled.png);
        }

        QSpinBox::down-button {
            subcontrol-origin: border;
            subcontrol-position: bottom right; / * position at bottom right corner * /

            width: 16px;
            border-image: url(:/images/spindown.png) 1;
            border-width: 1px;
            border-top-width: 0;
        }

        QSpinBox::down-button:hover {
            border-image: url(:/images/spindown_hover.png) 1;
        }

        QSpinBox::down-button:pressed {
            border-image: url(:/images/spindown_pressed.png) 1;
        }

        QSpinBox::down-arrow {
            image: url(:/images/down_arrow.png);
            width: 7px;
            height: 7px;
        }

        QSpinBox::down-arrow:disabled,
        QSpinBox::down-arrow:off { / * off state when value in min * /
           image: url(:/images/down_arrow_disabled.png);
        }

    \endcode

    \section2 Customizing QFrame

    A QFrame is styled using the \l{The Box Model}.

    \code
        QFrame, QLabel, QToolTip {
            border: 2px solid green;
            border-radius: 4px;
            padding: 2px;
            background-image: url(images/welcome.png);
        }
    \endcode

    \section2 Customizing QGroupBox
    
    Let us look at an example that moves the QGroupBox's title to
    the center.

    \code
        QGroupBox {
            background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                              stop: 0 #E0E0E0, stop: 1 #FFFFFF);
            border: 2px solid gray;
            border-radius: 5px;
            margin-top: 1ex; / * leave space at the top for the title * /
        }

        QGroupBox::title {
            subcontrol-origin: margin;
            subcontrol-position: top center; / * position at the top center * /
            padding: 0 3px;
            background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                              stop: 0 #FFOECE, stop: 1 #FFFFFF);
        }
    \endcode

    For a checkable QGroupBox, use the \{#indicator-sub}{::indicator} subcontrol
    and style it exactly like a QCheckBox (i.e)

    \code
        QGroupBox::indicator {
            width: 13px;
            height: 13px;
        }

        QGroupBox::indicator:unchecked {
            image: url(:/images/checkbox_unchecked.png);
        }
        
        / * proceed with styling just like QCheckBox * /
    \endcode

    \section2 Customizing QHeaderView

    QHeaderView is customized as follows:

    \code
        QHeaderView::section {
            background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, 
                                              stop:0 #616161, stop: 0.5 #505050, 
                                              stop: 0.6 #434343, stop:1 #656565);
            color: white;
            padding-left: 4px;
            border: 1px solid #6c6c6c;
        }

        / * style the sort indicator * /
        QHeaderView::down-arrow {
            image: url(down_arrow.png);
        }

        QHeaderView::up-arrow {
            image: url(up_arrow.png);
        }
    \endcode

    \section2 Customizing QLineEdit

    The frame of a QLineEdit is styled using the \l{The Box Model}. To
    create a line edit with rounded corners, we can set:
    \code
        QLineEdit {
            border: 2px solid gray;
            border-radius: 10px;
            padding: 0 8px;
            background: yellow;
            selection-background-color: darkgray;
        }
    \endcode

    The password character of line edits that have QLineEdit::Password
    echo mode can be set using:
    \code
        QLineEdit[echoMode="2"] {
            lineedit-password-character: 9679;
        }
    \endcode

    The background of a read only QLineEdit can be modified as below:
    \code
        QLineEdit:read-only {
            background: lightblue;
    \endcode

    \section2 Customizing QMenu
    
    Individual items of a QMenu are styled using the 'item' subcontrol as 
    follows:

    \code
        QMenu {
            background-color: #ABABAB; / * sets background of the menu * /
            border: 1px solid black; 
        }

        QMenu::item {
            / * sets background of menu item. set this to something non-transparent 
                if you want menu color and menu item color to be different * /
            background-color: transparent; 
        }

        QMenu::item:selected { / * when user selects item using mouse or keyboard * /
            background-color: #654321;
        }
    \endcode

    For a more advanced customization, use a style sheet as follows:

    \code
        QMenu {
            background-color: white;
            margin: 2px; / * some spacing around the menu * /
        }

        QMenu::item {
            padding: 2px 25px 2px 20px;
            border: 1px solid transparent; / * reserve space for selection border * /
        }

        QMenu::item:selected {
            border-color: darkblue;
            background: rgba(100, 100, 100, 150);
        }

        QMenu::icon:checked { / * appearance of a 'checked' icon * /
            background: gray;
            border: 1px inset gray;
            position: absolute;
            top: 1px; 
            right: 1px; 
            bottom: 1px; 
            left: 1px;
        }

        QMenu::separator {
            height: 2px;
            background: lightblue;
            margin-left: 10px; 
            margin-right: 5px;
        }

        QMenu::indicator {
            width: 13px;
            height: 13px;
        }

        / * non-exclusive indicator = check box style indicator (see QActionGroup::setExclusive) * /
        QMenu::indicator:non-exclusive:unchecked {
            image: url(:/images/checkbox_unchecked.png);
        }

        QMenu::indicator:non-exclusive:unchecked:selected {
            image: url(:/images/checkbox_unchecked_hover.png);
        }

        QMenu::indicator:non-exclusive:checked {
            image: url(:/images/checkbox_checked.png);
        }

        QMenu::indicator:non-exclusive:checked:selected {
            image: url(:/images/checkbox_checked_hover.png);
        }

        / * exclusive indicator = radio button style indicator (see QActionGroup::setExclusive) * /
        QMenu::indicator:exclusive:unchecked {
            image: url(:/images/radiobutton_unchecked.png);
        }

        QMenu::indicator:exclusive:unchecked:selected {
            image: url(:/images/radiobutton_unchecked_hover.png);
        }

        QMenu::indicator:exclusive:checked {
            image: url(:/images/radiobutton_checked.png);
        }

        QMenu::indicator:exclusive:checked:selected {
            image: url(:/images/radiobutton_checked_hover.png);
        }
 
    \endcode

    \section2 Customizing QMenuBar

    QMenuBar is styled as follows:

    \code
        QMenuBar {
            background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
                                              stop:0 lightgray, stop:1 darkgray);
        }

        QMenuBar::item {
            spacing: 3px; / * spacing between menu bar items * /
            padding: 1px 4px;
            background: transparent;
            border-radius: 4px;
        }

        QMenuBar::item:selected { / * when selected using mouse or keyboard * /
            background: #a8a8a8;
        }

        QMenuBar::item:pressed {
            background: #888888;
        }
    \endcode

    \section2 Customizing QProgressBar

    The QProgressBar's \l{stylesheet-reference.html#border-prop}{border},
    \l{stylesheet-reference.html#chunk-sub}{chunk}, and
    \l{stylesheet-reference.html#text-align-prop}{text-align} can be customized using
    style sheets. However, if one property or sub-control is customized,
    all the other properties or sub-controls must be customized as well.

    \image progressBar-stylesheet.png

    For example, we change the \l{stylesheet-reference.html#border-prop}
    {border} to grey and the \l{stylesheet-reference.html#chunk-sub}{chunk}
    to cerulean.

    \code
        QProgressBar {
            border: 2px solid grey;
            border-radius: 5px;
        }

        QProgressBar::chunk {
            background-color: #05B8CC;
            width: 20px;
        }
    \endcode

    This leaves the \l{stylesheet-reference.html#text-align-prop}
    {text-align}, which we customize by positioning the text in the center of
    the progress bar.

    \code
    QProgressBar {
        border: 2px solid grey;
        border-radius: 5px;
        text-align: center;
    }
    \endcode

    A \l{stylesheet-reference.html#margin-prop}{margin} can be included to
    obtain more visible chunks.

    \image progressBar2-stylesheet.png

    In the screenshot above, we use a
    \l{stylesheet-reference.html#margin-prop}{margin} of 0.5 pixels.

    \code
    QProgressBar::chunk {
        background-color: #CD96CD;
        width: 10px;
        margin: 0.5px;
    }
    \endcode

    \section2 Customizing QPushButton

    A QPushButton is styled as follows:
    \code
        QPushButton {
            border: 2px solid #8f8f91;
            border-radius: 6px;
            background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 
                                              stop: 0 #f6f7fa, stop: 1 #dadbde);
            min-width: 80px;
        }

        QPushButton:pressed {
            background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 
                                              stop: 0 #dadbde, stop: 1 #f6f7fa);
        }

        QPushButton:flat {
            border: none; / * no border for a flat push button * /
        }

        QPushButton:default {
            border-color: navy; / * make the default button prominent * /
        }
    \endcode

    For a QPushButton with a menu, use the 
    \l{Qt Style Sheets Reference#menu-indicator-sub}{::menu-indicator} 
    subcontrol.

    \code
        QPushButton:open { / * when the button has its menu open * /
            background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 
                                              stop: 0 #dadbde, stop: 1 #f6f7fa);
        }

        QPushButton::menu-indicator { 
            image: url(menu_indicator.png);
            subcontrol-origin: padding; 
            subcontrol-position: bottom right;
        }

        QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
            position: relative; 
            top: 2px; left: 2px; / * shift the arrow by 2 px * /
        }
    \endcode

    Checkable QPushButton have the \l{Qt Style Sheets Reference#checked-ps}
    {:checked} pseudo state set.

    \section2 Customizing QRadioButton

    The indicator of a QRadioButton can be changed using:
    \code
        QRadioButton::indicator {
            width: 13px;
            height: 13px;
        }

        QRadioButton::indicator::unchecked {
            image: url(:/images/radiobutton_unchecked.png);
        }

        QRadioButton::indicator:unchecked:hover {
            image: url(:/images/radiobutton_unchecked_hover.png);
        }

        QRadioButton::indicator:unchecked:pressed {
            image: url(:/images/radiobutton_unchecked_pressed.png);
        }

        QRadioButton::indicator::checked {
            image: url(:/images/radiobutton_checked.png);
        }

        QRadioButton::indicator:checked:hover {
            image: url(:/images/radiobutton_checked_hover.png);
        }

        QRadioButton::indicator:checked:pressed {
            image: url(:/images/radiobutton_checked_pressed.png);
        }
    \endcode

    \section2 Customizing QScrollBar

    The QScrollBar can be styled using its subcontrols like
    \l{stylesheet-reference.html#handle-sub}{handle},
    \l{stylesheet-reference.html#add-line-sub}{add-line},
    \l{stylesheet-reference.html#sub-line-sub}{sub-line}, and so on. Note that
    if one property or sub-control is customized, all the other properties or
    sub-controls must be customized as well.

    \image stylesheet-scrollbar1.png

    The scroll bar above has been styled in aquamarine with a solid grey
    border.

    \code
        QScrollBar:horizontal {
            border: 2px solid grey;
            background: #32CC99;
            height: 15px;
            margin: 0px 20px 0 20px;
        }
    \endcode

    \code
        QScrollBar::handle:horizontal {
            background: white;
            min-width: 20px;
        }
    \endcode

    \code
        QScrollBar::add-line:horizontal {
            border: 2px solid grey;
            background: #32CC99;
            width: 20px;
            subcontrol-position: right;
            subcontrol-origin: margin;
        }

        QScrollBar::sub-line:horizontal {
            border: 2px solid grey;
            background: #32CC99;
            width: 20px;
            subcontrol-position: left;
            subcontrol-origin: margin;
        }
    \endcode

    The \l{stylesheet-reference.html#left-arrow-sub}{left-arrow} and
    \l{stylesheet-reference.html#right-arrow-sub}{right-arrow} have a solid grey
    border with a white background. As an alternative, you could also embed the
    image of an arrow.

    \code
        QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {
            border: 2px solid grey;
            width: 3px;
            height: 3px;
            background: white;
        }

        QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
            background: none;
        }
    \endcode

    If you want the scroll buttons of the scroll bar to be placed together
    (instead of the edges) like on Mac OS X, you can use the following
    stylesheet:
    \code
        QScrollBar:horizontal {
            border: 2px solid green;
            background: cyan;
            height: 15px;
            margin: 0px 40px 0 0px;
        }

        QScrollBar::handle:horizontal {
            background: gray;
            min-width: 20px;
        }

        QScrollBar::add-line:horizontal {
            background: blue;
            width: 16px;
            subcontrol-position: right;
            subcontrol-origin: margin;
            border: 2px solid black;
        }

        QScrollBar::sub-line:horizontal {
            background: magenta;
            width: 16px;
            subcontrol-position: top right;
            subcontrol-origin: margin;
            border: 2px solid black;
            position: absolute;
            right: 20px;
        }

        QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {
            width: 3px;
            height: 3px;
            background: pink;
        }

        QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
            background: none;
        }

    \endcode
    
    The scroll bar using the above stylesheet looks like this:
        \image stylesheet-scrollbar2.png

    \section2 Customizing QSizeGrip

    QSizeGrip is usually styled by just setting an image.

    \code
        QSizeGrip {
            image: url(:/images/sizegrip.png);
            width: 16px;
            height: 16px;
        }
    \endcode

    \section2 Customizing QSlider

    You can style horizontal slider as below:
    \code
        QSlider::groove:horizontal {
            border: 1px solid #999999;
            height: 8px; / * the groove expands to the size of the slider by default. by giving it a height, it has a fixed size * /
            background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4);
        }

        QSlider::handle:horizontal {
            background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
            border: 1px solid #5c5c5c;
            width: 18px;
            margin: -2px 0; / * handle is placed by default on the contents rect of the groove. Expand outside the groove * /
            border-radius: 3px;
        }
    \endcode

    If you want to change the color of the slider parts before and after the handle, you can use the add-page
    and sub-page subcontrols. For example, for a vertical slider:

    \code
        QSlider::groove:vertical {
            background: red;
            position: absolute; / * absolutely position 4px from the left and right of the widget. setting margins on the widget should work too... * /
            left: 4px; right: 4px;
        }

        QSlider::handle:vertical {
            height: 10px;
            background: green;
            margin: 0 -4px; / * expand outside the groove * /
        }

        QSlider::add-page:vertical {
            background: white;
        }

        QSlider::sub-page:vertical {
            background: pink;
        }
    \endcode

    \section2 Customizing QSplitter

    A QSplitter derives from a QFrame and hence can be styled like a QFrame. 
    The grip or the handle is customized using the 
    \l{Qt Style Sheets Reference#handle-sub}{::handle} subcontrol.

    \code
        QSplitter::handle {
            image: url(images/splitter.png);
        }

        QSplitter::handle:horizontal {
            height: 2px;
        }

        QSplitter::handle:vertical {
            width: 2px;
        }
    \endcode

    \section2 Customizing QStatusBar

    We can provide a background for the status bar and a border for items
    inside the status bar as follows:
    \code
        QStatusBar {
            background: brown;
        }

        QStatusBar::item {
            border: 1px solid red;
            border-radius: 3px;
        }
    \endcode

    Note that widgets that have been added to the QStatusBar can be styled
    using the descendant declaration (i.e)
    \code
        QStatusBar QLabel {
            border: 3px solid white;
        }
    \endcode

    \section2 Customizing QTabWidget and QTabBar

    \image tabWidget-stylesheet1.png

    For the screenshot above, we need a stylesheet as follows:

    \code
        QTabWidget::pane { / * The tab widget frame * /
            border-top: 2px solid #C2C7CB;
        }

        QTabWidget::tab-bar {
            left: 5px; / * move to the right by 5px * /
        }

        / * Style the tab using the tab sub-control. Note that 
            it reads QTabBar _not_ QTabWidget * /
        QTabBar::tab {
            background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 
                                        stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, 
                                        stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
            border: 2px solid #C4C4C3;
            border-bottom-color: #C2C7CB; / * same as the pane color * /
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;
            min-width: 8ex;
            padding: 2px;
        }

        QTabBar::tab:selected, QTabBar::tab:hover {
            background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 
                                        stop: 0 #fafafa, stop: 0.4 #f4f4f4, 
                                        stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
        }

        QTabBar::tab:selected {
            border-color: #9B9B9B;
            border-bottom-color: #C2C7CB; / * same as pane color * /
        }

        QTabBar::tab:!selected {
            margin-top: 2px; / * make non-selected tabs look smaller * /
        }
    \endcode

    Often we require the tabs to overlap to look like below:
    \image tabWidget-stylesheet2.png

    For a tab widget that looks like above, we make use of 
    \l{http://www.communitymx.com/content/article.cfm?cid=B0029}
    {negative margins}. The resulting stylesheet looks like this:

    \code
        QTabWidget::pane { / * The tab widget frame * /
            border-top: 2px solid #C2C7CB;
        }

        QTabWidget::tab-bar {
            left: 5px; / * move to the right by 5px * /
        }

        / * Style the tab using the tab sub-control. Note that 
            it reads QTabBar _not_ QTabWidget * /
        QTabBar::tab {
            background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 
                                        stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, 
                                        stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
            border: 2px solid #C4C4C3;
            border-bottom-color: #C2C7CB; / * same as the pane color * /
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;
            min-width: 8ex;
            padding: 2px;
        }

        QTabBar::tab:selected, QTabBar::tab:hover {
            background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 
                                        stop: 0 #fafafa, stop: 0.4 #f4f4f4, 
                                        stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
        }

        QTabBar::tab:selected {
            border-color: #9B9B9B;
            border-bottom-color: #C2C7CB; / * same as pane color * /
        }

        QTabBar::tab:!selected {
            margin-top: 2px; / * make non-selected tabs look smaller * /
        }

        / * make use of negative margins for overlapping tabs * /
        QTabBar::tab:selected {
            / * expand/overlap to the left and right by 4px * /
            margin-left: -4px;
            margin-right: -4px;
        }

        QTabBar::tab:first:selected {
            margin-left: 0; / * the first selected tab has nothing to overlap with on the left * /
        }

        QTabBar::tab:last:selected {
            margin-right: 0; / * the last selected tab has nothing to overlap with on the right * /
        }

        QTabBar::tab:only-one {
            margin: 0; / * if there is only one tab, we don't want overlapping margins * /
        }
    \endcode

    To move the tab bar to the center (as below), we require the following stylesheet:
    \image tabWidget-stylesheet3.png

    \code
        QTabWidget::pane { / * The tab widget frame * /
            border-top: 2px solid #C2C7CB;
            position: absolute; 
            top: -0.5em; 
        }

        QTabWidget::tab-bar { 
            alignment: center; 
        }

        / * Style the tab using the tab sub-control. Note that 
            it reads QTabBar _not_ QTabWidget * /
        QTabBar::tab {
            background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 
                                        stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, 
                                        stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
            border: 2px solid #C4C4C3;
            border-bottom-color: #C2C7CB; / * same as the pane color * /
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;
            min-width: 8ex;
            padding: 2px;
        }

        QTabBar::tab:selected, QTabBar::tab:hover {
            background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 
                                        stop: 0 #fafafa, stop: 0.4 #f4f4f4, 
                                        stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
        }

        QTabBar::tab:selected {
            border-color: #9B9B9B;
            border-bottom-color: #C2C7CB; / * same as pane color * /
        }
    \endcode

    The tear indicator and the scroll buttons can be further customized as follows:
    \code
        QTabBar::tear {
            image: url(tear_indicator.png);
        }

        QTabBar::scroller { / * the width of the scroll buttons * /
            width: 20px;
        }

        QTabBar QToolButton { / * the scroll buttons are tool buttons * /
            border-image: url(scrollbutton.png) 2;
            border-width: 2px;
        }

        QTabBar QToolButton::right-arrow { / * the arrow mark in the tool buttons * /
            image: url(rightarrow.png);
        }

        QTabBar QToolButton::left-arrow {
            image: url(leftarrow.png);
        }
    \endcode

    \section2 Customizing QTableWidget

    Suppose we'd like our selected item in QTableWidget to have bubblegum pink
    fade to white as its background.

    \image tableWidget-stylesheet.png

    This is possible with the
    \l{stylesheet-reference.html#selection-background-color-prop}
    {selection-background-color} property and the syntax required is:

    \code
        QTableWidget {
            selection-background-color: qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,
                                        stop: 0 #FF92BB, stop: 1 white);
        }
    \endcode

    The corner widget can be customized using the following style sheet

    \code
        QTableWidget QTableCornerButton::section {
            background: red;
            border: 2px outset red;
        }
    \endcode

    \section2 Customizing QToolBar
    
    The background and the handle of a QToolBar is customized as below:
    \code
        QToolBar {
            background: red;
            spacing: 3px; / * spacing between items in the tool bar * /
        }

        QToolBar::handle {
            image: url(handle.png);
        }
    \endcode

    \section2 Customizing QToolBox

    The tabs of the QToolBox are customized using the 'tab' subcontrol.

    \code
        QToolBox::tab {
            background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                        stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
                                        stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
            border-radius: 5px;
            color: darkgray;
        }

        QToolBox::tab:selected { / * italicize selected tabs * /
            font: italic;
            color: white;
        }
    \endcode

    \section2 Customizing QToolButton

    There are three types of QToolButtons.
    \list
       \i The QToolButton has no menu. In this case, the QToolButton is styled
          exactly like QPushButton.  See 
          \l{#Customizing QPushButton}{Customizing QPushButton} for an
          example.

       \i The QToolButton has a menu and has the QToolButton::popupMode set to
          QToolButton::DelayedPopup or QToolButton::InstantPopup. In this case,
          the QToolButton is styled exactly like a QPushButton with a menu.
          See \l{#Customizing QPushButton}{Customizing QPushButton} for an
          example of the usage of the menu-indicator pseudo state.

        \i The QToolButton has its QToolButton::popupMode set to
           QToolButton::MenuButtonPopup. In this case, we style it as follows:
           
           \code
            QToolButton { / * all types of tool button * /
                border: 2px solid #8f8f91;
                border-radius: 6px;
                background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                                 stop: 0 #f6f7fa, stop: 1 #dadbde);
            }

            QToolButton[popupMode="1"] { / * only for MenuButtonPopup * /
                padding-right: 20px; / * make way for the popup button * /
            }

            QToolButton:pressed {
                background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                                  stop: 0 #dadbde, stop: 1 #f6f7fa);
            }

            / * the subcontrols below are used only in the MenuButtonPopup mode * /
            QToolButton::menu-button {
                border: 2px solid gray;
                border-top-right-radius: 6px;
                border-bottom-right-radius: 6px;
                / * 16px width + 4px for border = 20px allocated above * /
                width: 16px;
            }

            QToolButton::menu-arrow {
                image: url(downarrow.png);
            }

            QToolButton::menu-arrow:open {
                top: 1px; left: 1px; / * shift it a bit * /
            }
           \endcode
    \endlist

    \section2 Customizing QToolTip

    QToolTip is customized exactly like a QLabel. In addition, for platforms
    that support it, the opacity property may be set to adjust the opacity.

    For example,
    \code
        QToolTip {
            border: 2px solid darkkhaki;
            padding: 5px;
            border-radius: 3px;
            opacity: 200;
        }
    \endcode

    \section2 Customizing QTreeView

    The branches of a QTreeView are styled using the 
    \l{Qt Style Sheets Reference#branch-sub}{::branch} subcontrol. The
    following stylesheet color codes the various states when drawing
    a branch.

    \code
        QTreeView::branch {
                background: palette(base);
        }

        QTreeView::branch:has-siblings:!adjoins-item {
                background: cyan;
        }

        QTreeView::branch:has-siblings:adjoins-item {
                background: red;
        }

        QTreeView::branch:!has-children:!has-siblings:adjoins-item {
                background: blue;
        }

        QTreeView::branch:closed:has-children:has-siblings {
                background: pink;
        }

        QTreeView::branch:has-children:!has-siblings:closed {
                background: gray;
        }

        QTreeView::branch:open:has-children:has-siblings {
                background: magenta;
        }

        QTreeView::branch:open:has-children:!has-siblings {
                background: green;
        }

    \endcode
    
    Colorful, though it is, a more useful example can be made using the
    following images:

    \table
    \row
    \o \inlineimage stylesheet-vline.png
    \o \inlineimage stylesheet-branch-more.png
    \o \inlineimage stylesheet-branch-end.png
    \o \inlineimage stylesheet-branch-closed.png
    \o \inlineimage stylesheet-branch-open.png
    \row
    \o vline.png
    \o branch-more.png
    \o branch-end.png
    \o branch-closed.png
    \o branch-open.png
    \endtable

    \code
        QTreeView::branch:has-siblings:!adjoins-item {
            border-image: url(vline.png) 0;
        }

        QTreeView::branch:has-siblings:adjoins-item {
            border-image: url(branch-more.png) 0;
        }

        QTreeView::branch:!has-children:!has-siblings:adjoins-item {
            border-image: url(branch-end.png) 0;
        }

        QTreeView::branch:has-children:!has-siblings:closed,
        QTreeView::branch:closed:has-children:has-siblings {
                border-image: none;
                image: url(branch-closed.png);
        }

        QTreeView::branch:open:has-children:!has-siblings,
        QTreeView::branch:open:has-children:has-siblings  {
                border-image: none;
                image: url(branch-open.png);
        }
    \endcode

    The resulting tree view looks like this:

    \image stylesheet-treeview.png

    \sa {Style Sheet Example}, {Supported HTML Subset}, QStyle
    */
