[][src]Struct qt_gui::q_palette::ColorRole

#[repr(transparent)]
pub struct ColorRole(_);

Color Roles

C++ enum: QPalette::ColorRole.

C++ documentation:

Color Roles

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; QColor linkColor(Qt::red); QString sheet = QString::fromLatin1("a { text-decoration: underline; color: %1 }").arg(linkColor.name()); browser.document()->setDefaultStyleSheet(sheet);

Methods

impl ColorRole[src]

pub fn to_int(&self) -> c_int[src]

impl ColorRole[src]

pub const WindowText: ColorRole[src]

A general foreground color. (C++ enum variant: WindowText = 0)

pub const Button: ColorRole[src]

The general button background color. This background can be different from Window as some styles require a different background color for buttons. (C++ enum variant: Button = 1)

pub const Light: ColorRole[src]

Lighter than Button color. (C++ enum variant: Light = 2)

pub const Midlight: ColorRole[src]

Between Button and Light. (C++ enum variant: Midlight = 3)

pub const Dark: ColorRole[src]

Darker than Button. (C++ enum variant: Dark = 4)

pub const Mid: ColorRole[src]

Between Button and Dark. (C++ enum variant: Mid = 5)

pub const Text: ColorRole[src]

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. (C++ enum variant: Text = 6)

pub const BrightText: ColorRole[src]

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. (C++ enum variant: BrightText = 7)

pub const ButtonText: ColorRole[src]

A foreground color used with the Button color. (C++ enum variant: ButtonText = 8)

pub const Base: ColorRole[src]

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. (C++ enum variant: Base = 9)

pub const Window: ColorRole[src]

A general background color. (C++ enum variant: Window = 10)

pub const Shadow: ColorRole[src]

A very dark color. By default, the shadow color is Qt::black. (C++ enum variant: Shadow = 11)

pub const Highlight: ColorRole[src]

A color to indicate a selected item or the current item. By default, the highlight color is Qt::darkBlue. (C++ enum variant: Highlight = 12)

pub const HighlightedText: ColorRole[src]

A text color that contrasts with Highlight. By default, the highlighted text color is Qt::white. (C++ enum variant: HighlightedText = 13)

A text color used for unvisited hyperlinks. By default, the link color is Qt::blue. (C++ enum variant: Link = 14)

pub const LinkVisited: ColorRole[src]

A text color used for already visited hyperlinks. By default, the linkvisited color is Qt::magenta. (C++ enum variant: LinkVisited = 15)

pub const AlternateBase: ColorRole[src]

Used as the alternate background color in views with alternating row colors (see QAbstractItemView::setAlternatingRowColors()). (C++ enum variant: AlternateBase = 16)

pub const NoRole: ColorRole[src]

No role; this special role is often used to indicate that a role has not been assigned. (C++ enum variant: NoRole = 17)

pub const ToolTipBase: ColorRole[src]

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. (C++ enum variant: ToolTipBase = 18)

pub const ToolTipText: ColorRole[src]

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. (C++ enum variant: ToolTipText = 19)

pub const NColorRoles: ColorRole[src]

C++ enum variant: NColorRoles = 20

pub const Foreground: ColorRole[src]

This value is obsolete. Use WindowText instead. (C++ enum variant: Foreground = 0)

pub const Background: ColorRole[src]

This value is obsolete. Use Window instead. (C++ enum variant: Background = 10)

pub const PlaceholderText: ColorRole[src]

Used as the placeholder color for various text input widgets. This enum value has been introduced in Qt 5.12 (C++ enum variant: PlaceholderText = 20)

pub const NColorRoles2: ColorRole[src]

C++ enum variant: NColorRoles = 21

Trait Implementations

impl Clone for ColorRole[src]

impl Copy for ColorRole[src]

impl Debug for ColorRole[src]

impl Eq for ColorRole[src]

impl From<ColorRole> for c_int[src]

impl From<i32> for ColorRole[src]

impl PartialEq<ColorRole> for ColorRole[src]

impl StructuralEq for ColorRole[src]

impl StructuralPartialEq for ColorRole[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.