Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QPalette.ColorRole

    java.lang.Object
      java.lang.Enum
          com.trolltech.qt.gui.QPalette.ColorRole

All Implemented Interfaces:
  QtEnumerator, java.io.Serializable, java.lang.Comparable

Enclosing class:
  QPalette

    public static final class QPalette.ColorRole

extends java.lang.Enum
implements QtEnumerator

See the description for details.

The `ColorRole` enum defines the different symbolic color roles used in current GUIs.

The central roles are: There are some color roles used mostly for 3D bevel and shadow effects. All of these are normally derived from `Window`, and used in ways that depend on that relationship. For example, buttons depend on it to make the bevels look attractive, and Motif scroll bars depend on `Mid` to be slightly different from `Window`. Selected (marked) items have two roles: There are two color roles related to hyperlinks: Note that we do not use the `Link` and `LinkVisited` roles when rendering rich text in Qt, and that we recommend that you use CSS and the `QTextDocument::setDefaultStyleSheet()` function to alter the appearance of links. For example:

        QTextBrowser browser = new QTextBrowser();
        QColor linkColor = QColor.red;
        String sheet = "a { text-decoration: underline; color: " + linkColor.name();
        browser.document().setDefaultStyleSheet(sheet);

See Also:
  Serialized Form

Field Summary
`static QPalette.ColorRole` | `AlternateBase` Used as the alternate background color in views with alternating row colors (see `QAbstractItemView.:setAlternatingRowColors()`).
`static QPalette.ColorRole` | `Base` Used mostly as the background color for text entry widgets, but can also be used for other painting - such as the background of combobox drop down lists and toolbar handles.
`static QPalette.ColorRole` | `BrightText` A text color that is very different from `WindowText`, and contrasts well with e.g.
`static QPalette.ColorRole` | `Button` The general button background color.
`static QPalette.ColorRole` | `ButtonText` A foreground color used with the `Button` color.
`static QPalette.ColorRole` | `Dark` Darker than `Button`.
`static QPalette.ColorRole` | `Highlight` A color to indicate a selected item or the current item.
`static QPalette.ColorRole` | `HighlightedText` A text color that contrasts with `Highlight`.
`static QPalette.ColorRole` | `Light` Lighter than `Button` color.
`static QPalette.ColorRole` | `Link` A text color used for unvisited hyperlinks.
`static QPalette.ColorRole` | `LinkVisited` A text color used for already visited hyperlinks.
`static QPalette.ColorRole` | `Mid`
`static QPalette.ColorRole` | `Midlight` Between `Button` and `Light`.
`static QPalette.ColorRole` | `NoRole` No role; this special role is often used to indicate that a role has not been assigned.
`static QPalette.ColorRole` | `Shadow` A very dark color.
`static QPalette.ColorRole` | `Text` The foreground color used with `Base`.
`static QPalette.ColorRole` | `ToolTipBase` Used as the background color for `QToolTip` and `QWhatsThis`.
`static QPalette.ColorRole` | `ToolTipText` Used as the foreground color for `QToolTip` and `QWhatsThis`.
`static QPalette.ColorRole` | `Window`
`static QPalette.ColorRole` | `WindowText` A general background color.

Method Summary
`static QPalette.ColorRole` | `resolve(int value)` Returns the ColorRole constant with the specified `int`.
`int` | `value()` This function should return an integer value for the enum values of the enumeration that implements this interface.
`static QPalette.ColorRole` | `valueOf(java.lang.String name)`
`static QPalette.ColorRole[]` | `values()`

Methods inherited from class java.lang.Enum
`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### WindowText

    public static final QPalette.ColorRole WindowText

  A general background color.

### Button

    public static final QPalette.ColorRole Button

  The general button background color. This background can be different from `Window` as some styles require a different background color for buttons.

### Light

    public static final QPalette.ColorRole Light

  Lighter than `Button` color.

### Midlight

    public static final QPalette.ColorRole Midlight

  Between `Button` and `Light`.

### Dark

    public static final QPalette.ColorRole Dark

  Darker than `Button`.

### Mid

    public static final QPalette.ColorRole Mid

### Text

    public static final QPalette.ColorRole Text

  The foreground color used with `Base`. This is usually the same as the `WindowText`, in which case it must provide good contrast with `Window` and `Base`.

### BrightText

    public static final QPalette.ColorRole BrightText

  A text color that is very different from `WindowText`, and contrasts well with e.g. `Dark`. Typically used for text that needs to be drawn where `Text` or `WindowText` would give poor contrast, such as on pressed push buttons. Note that text colors can be used for things other than just words; text colors are usually used for text, but it's quite common to use the text color roles for lines, icons, etc.

### ButtonText

    public static final QPalette.ColorRole ButtonText

  A foreground color used with the `Button` color.

### Base

    public static final QPalette.ColorRole Base

  Used mostly as the background color for text entry widgets, but can also be used for other painting - such as the background of combobox drop down lists and toolbar handles. It is usually white or another light color.

### Window

    public static final QPalette.ColorRole Window

### Shadow

    public static final QPalette.ColorRole Shadow

  A very dark color. By default, the shadow color is `Qt::black` .

### Highlight

    public static final QPalette.ColorRole Highlight

  A color to indicate a selected item or the current item. By default, the highlight color is `Qt::darkBlue` .

### HighlightedText

    public static final QPalette.ColorRole HighlightedText

  A text color that contrasts with `Highlight`. By default, the highlighted text color is `Qt::white` .

### Link

    public static final QPalette.ColorRole Link

  A text color used for unvisited hyperlinks. By default, the link color is `Qt::blue` .

### LinkVisited

    public static final QPalette.ColorRole LinkVisited

  A text color used for already visited hyperlinks. By default, the linkvisited color is `Qt::magenta` .

### AlternateBase

    public static final QPalette.ColorRole AlternateBase

  Used as the alternate background color in views with alternating row colors (see `QAbstractItemView.:setAlternatingRowColors()`).

### NoRole

    public static final QPalette.ColorRole NoRole

  No role; this special role is often used to indicate that a role has not been assigned.

### ToolTipBase

    public static final QPalette.ColorRole ToolTipBase

  Used as the background color for `QToolTip` and `QWhatsThis`. Tool tips use the Inactive color group of `QPalette`, because tool tips are not active windows.

### ToolTipText

    public static final QPalette.ColorRole ToolTipText

  Used as the foreground color for `QToolTip` and `QWhatsThis`. Tool tips use the Inactive color group of `QPalette`, because tool tips are not active windows.

Method Detail

### values

    public static QPalette.ColorRole[] values()

### valueOf

    public static QPalette.ColorRole valueOf(java.lang.String name)

### value

    public int value()

  This function should return an integer value for the enum values of the enumeration that implements this interface.

  Specified by:
    `value` in interface `QtEnumerator`

### resolve

    public static QPalette.ColorRole resolve(int value)

  Returns the ColorRole constant with the specified `int`.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD