Qt:Документация 4.3.2/qcolordialog

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QColorDialog Class Reference
[модуль QtGui ]

The QColorDialog class provides a dialog widget for specifying colors. Далее...

 #include <QColorDialog>

Наследует QDialog.

[править] Статические открытые члены

  • 4 статических открытых члена, унаследованных от QWidget
  • 5 статических открытых членов, унаследованных от QObject

[править] Дополнительные унаследованные члены

  • 2 войства, унаследованные от QDialog
  • 56 свойств, унаследованных от QWidget
  • 1 свойство, унаследованное от QObject
  • 5 открытых функций, унаследованных от QDialog
  • 201 свойство, унаследованное от QWidget
  • 29 открытых функций, унаследованных от QObject
  • 12 открытых функций, унаследованных от QPaintDevice
  • 4 открытых слота, унаследованные от QDialog
  • 19 открытых слотов, унаследованных от QWidget
  • 1 открытый слот, унаследованный от QObject
  • 3 сигнала, унаследованные от QDialog
  • 1 сигнал, унаследованный от QWidget
  • 1 сигнал, унаследованный от QObject
  • 38 защищенных функций, унаследованных от QWidget
  • 7 защищенных функций, унаследованных от QObject
  • 1 защищенная функция, унаследованных от QPaintDevice
  • 1 защищенный слот, унаследованый от QWidget

[править] Подробное описание

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. The getRgba() function does the same, but also allows the user to specify a color with an alpha channel (transparency) value.

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.

Файл:Plastique-colordialog.png

See also QColor, QFileDialog, QPrintDialog, QFontDialog, and Standard Dialogs Example.


[править] Описание функций-членов

[править]
QRgb QColorDialog::customColor ( int i ) [static]

Returns custom color number i as a QRgb value.

See also setCustomColor().

[править]
int QColorDialog::customCount () [static]

Returns the number of custom colors supported by QColorDialog. All color dialogs share the same custom colors.

[править]
QColor QColorDialog::getColor ( const QColor & initial = Qt::white, QWidget * parent = 0 ) [static]

Pops up a modal color dialog, 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. All colors allocated by the dialog will be deallocated before this function returns.

[править]
QRgb QColorDialog::getRgba ( QRgb initial = 0xffffffff, bool * ok = 0, QWidget * parent = 0 ) [static]

Pops up a modal color dialog to allow the user to choose a color and an alpha channel (transparency) value. The color+alpha is initially set to initial. The dialog is a child of parent.

If ok is non-null, *a ok is set to true if the user clicked OK, and to false if the user clicked Cancel.

If the user clicks Cancel, the initial value is returned.

[править]
void QColorDialog::setCustomColor ( int number, QRgb color ) [static]

Sets the custom color number to the QRgb color value.

See also customColor().

[править]
void QColorDialog::setStandardColor ( int number, QRgb color ) [static]

Sets the standard color number to the QRgb color value given.



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2