SystemPalette Element Reference

The SystemPalette element provides access to the Qt palettes.

This element was introduced in Qt 4.7.

Detailed Description

The SystemPalette element provides access to the Qt palettes.

The SystemPalette element provides access to the Qt application palettes. This provides information about the standard colors used for application windows, buttons and other features. These colors are grouped into three color groups: Active, Inactive, and Disabled. See the QPalette documentation for details about color groups and the properties provided by SystemPalette.

This can be used to color items in a way that provides a more native look and feel.

The following example creates a palette from the Active color group and uses this to color the window and text items appropriately:

  1. import QtQuick 1.0
  2.  
  3. Rectangle  {
  4.     SystemPalette  { id: myPalette; colorGroup: SystemPalette.Active }
  5.  
  6.     width: 640; height: 480
  7.     color: myPalette.window
  8.  
  9.     Text  {
  10.         anchors.fill: parent
  11.         text: "Hello!"; color: myPalette.windowText
  12.     }
  13. }

Properties

Property Documentation

The alternate base color of the current color group.

See also QPalette::ColorRole.

The base color of the current color group.

See also QPalette::ColorRole.

The button color of the current color group.

See also QPalette::ColorRole.

The button text foreground color of the current color group.

See also QPalette::ColorRole.

The color group of the palette. This can be one of:

See also QPalette::ColorGroup.

The dark color of the current color group.

See also QPalette::ColorRole.

The highlight color of the current color group.

See also QPalette::ColorRole.

  • highlightedText : color

The highlighted text color of the current color group.

See also QPalette::ColorRole.

The light color of the current color group.

See also QPalette::ColorRole.

The mid color of the current color group.

See also QPalette::ColorRole.

The midlight color of the current color group.

See also QPalette::ColorRole.

The shadow color of the current color group.

See also QPalette::ColorRole.

The text color of the current color group.

See also QPalette::ColorRole.

The window (general background) color of the current color group.

See also QPalette::ColorRole.

The window text (general foreground) color of the current color group.

See also QPalette::ColorRole.

Notes provided by the Qt Community

No notes