QColorDialog Class ReferenceThe QColorDialog class provides a dialog widget for specifying colors. Далее... #include <QColorDialog> Унаследован от: QDialog. Открытые типы
Свойства
Открытые функции
Переопределённые открытые функции
Сигналы
Статические открытые члены
Переопределённые защищённые функции
Дополнительные унаследованные члены
Подробное описаниеThe QColorDialog class provides a dialog widget for specifying colors. The color dialog's function is to allow users to choose colors. For example, you might use this in a drawing program to allow the user to set the brush color. The static functions provide modal color dialogs. The static getColor() function shows the dialog, and allows the user to specify a color. This function can also be used to let users choose a color with a level of transparency: pass the ShowAlphaChannel option as an additional argument. The user can store customCount() different custom colors. The custom colors are shared by all color dialogs, and remembered during the execution of the program. Use setCustomColor() to set the custom colors, and use customColor() to get them. Additional widgets that allow users to pick colors are available as Qt Solutions. The Standard Dialogs example shows how to use QColorDialog as well as other built-in Qt dialogs. See also QColor, QFileDialog, QPrintDialog, QFontDialog, and Standard Dialogs Example. Описание типов-членовenum QColorDialog::ColorDialogOption
|
Константа | Значение | Описание |
---|---|---|
QColorDialog::ShowAlphaChannel | 0x00000001 | Allow the user to select the alpha component of a color. |
QColorDialog::NoButtons | 0x00000002 | Не показывать кнопки OK и Cancel buttons. (Полезно для "живых диалогов".) |
QColorDialog::DontUseNativeDialog | 0x00000004 | Use Qt's standard color dialog on the Mac instead of Apple's native color panel. |
Это перечисление было введено или модифицировано в Qt 4.5.
The ColorDialogOptions type is a typedef for QFlags<ColorDialogOption>. It stores an OR combination of ColorDialogOption values.
See also options, setOption(), testOption(), and windowModality().
This property holds the currently selected color in the dialog.
Функции доступа:
QColor | currentColor () const |
void | setCurrentColor ( const QColor & color ) |
Уведомляющий сигнал:
void | currentColorChanged ( const QColor & color ) |
Это свойство содержит различные опции, которые влияют на внешний вид и поведение диалога.
По умолчанию все опции отключены.
Опции должны быть установлены до показа диалога. Их установка пока диалог видим не гарантирует немедленного эффекта на диалоге (зависит от опции и платформы).
Функции доступа:
ColorDialogOptions | options () const |
void | setOptions ( ColorDialogOptions options ) |
Смотрите также setOption() и testOption().
Constructs a color dialog with the given parent.
Эта функция была введена в Qt 4.5.
Constructs a color dialog with the given parent and specified initial color.
Эта функция была введена в Qt 4.5.
Destroys the color dialog.
Переопределено от QWidget::changeEvent().
This signal is emitted just after the user has clicked OK to select a color to use. The chosen color is specified by color.
See also color and currentColorChanged().
This signal is emitted whenever the current color changes in the dialog. The current color is specified by color.
See also color and colorSelected().
Returns the custom color at the given index as a QRgb value.
Эта функция была введена в Qt 4.5.
See also setCustomColor().
Returns the number of custom colors supported by QColorDialog. All color dialogs share the same custom colors.
Переопределено из QDialog::done().
Закрывает диалог и устанавливает его код результата в result. Если этот диалог показывается с помощью exec(), done() вызывает завершение локального цикла обработки событий, а exec(), чтобы вернуть result.
Смотрите также QDialog::done().
Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.
The options argument allows you to customize the dialog.
On Symbian, this static function will use the native color dialog and not a QColorDialog. On Symbian the parameters title and parent has no relevance and the options parameter is only used to define if the native color dialog is used or not.
Эта функция была введена в Qt 4.5.
Pops up a modal color dialog, lets the user choose a color, and returns that color. The color is initially set to initial. Диалог является дочерним к parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.
On Symbian, this static function will use the native color dialog and not a QColorDialog.
Shows the dialog as a window modal dialog, returning immediately.
Эта функция была введена в Qt 4.5.
See also QDialog::open().
Это перегруженная функция.
Opens the dialog and connects its colorSelected() signal to the slot specified by receiver and member.
Сигнал будет отсоединен от слота когда диалог закрывается.
Эта функция была введена в Qt 4.5.
Returns the color that the user selected by clicking the OK or equivalent button.
Note: This color is not always the same as the color held by the currentColor property since the user can choose different colors before finally selecting the one to use.
Sets the custom color at index to the QRgb color value.
Note: This function does not apply to the Native Color Dialog on the Mac OS X platform. If you still require this function, use the QColorDialog::DontUseNativeDialog option.
See also customColor().
Устанавливает заданную опцию option включённой если on равно true; в противном случае очищает заданную опцию option.
Смотрите также options и testOption().
Sets the standard color at index to the QRgb color value.
Note: This function does not apply to the Native Color Dialog on the Mac OS X platform. If you still require this function, use the QColorDialog::DontUseNativeDialog option.
Переопределено из QWidget::setVisible().
Changes the visibility of the dialog. If visible is true, the dialog is shown; otherwise, it is hidden.
Возвращает true если заданная опция option включена; в противном случае возвращается false.
Эта функция была введена в Qt 4.5.
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |