| Home | ![]() |
The QtColorComboBox class provides a combobox with colors and texts. More...
#include <qtcolorcombobox.h>
The QtColorComboBox class provides a combobox with colors and texts.
Colors are inserted with insertColor(), which takes a color, a text, and an optional index position. The combobox can also be populated with a standard set of colors using setStandardColors(). Users can add their own colors if the color dialog is enabled (see setColorDialogEnabled()).
When a color is highlighted (for example when the mouse moves over it after the combobox has been dropped down), the highlighted() signal is emitted. When a color is activated (for example, clicked), the activated() signal is emitted. If the color dialog is enabled and the item clicked is the "More..." item at the end, the color dialog is popped up and if the user chooses a color the activated signal is emitted after the dialog closes.
Use color() to get the color at a certain index position, and currentColor() to get the color that is currently selected.

See also
This signal is emitted when the color color has been activated.
This signal is emitted when the color color has been highlighted on the popup color grid.
If index is -1, then color is appended at the end of the list.
When the color dialog is enabled, an extra item is available at the bottom of the list of colors in the combobox with the translatable text "More...". Selecting this item will pop up the color dialog, allowing the user to add new colors to the list. The new colors will be called "User color 1", "User color 2", and so on; the names can be changed by translating "User color %1".
See also insertColor().
See also insertColor().
(The names given to the colors, "Black", "White", "Red", etc., are all translatable.)
See also insertColor().
This file is part of the Qt Solutions.
Copyright © 2003-2006
Trolltech. All Rights Reserved.
| Copyright © 2003-2006 Trolltech | Trademarks | Qt Solutions
|