Qt 4.8
Classes | Functions | Variables
qcolordialog.cpp File Reference
#include "qcolordialog_p.h"
#include "qapplication.h"
#include "qdesktopwidget.h"
#include "qdrawutil.h"
#include "qevent.h"
#include "qimage.h"
#include "qlabel.h"
#include "qlayout.h"
#include "qlineedit.h"
#include "qmenu.h"
#include "qpainter.h"
#include "qpixmap.h"
#include "qpushbutton.h"
#include "qsettings.h"
#include "qstyle.h"
#include "qstyleoption.h"
#include "qvalidator.h"
#include "qmime.h"
#include "qspinbox.h"
#include "qdialogbuttonbox.h"
#include "private/qguiplatformplugin_p.h"
#include "qcolordialog.moc"
#include "moc_qcolordialog.cpp"

Go to the source code of this file.

Classes

class  QColorLuminancePicker
 
class  QColorPicker
 
class  QColorShower
 
class  QColorShowLabel
 
class  QColorWell
 
class  QColSpinBox
 
class  QWellArray
 
struct  QWellArrayData
 

Functions

static void initRGB ()
 
static void rgb2hsv (QRgb rgb, int &h, int &s, int &v)
 

Variables

static QRgb cusrgb [2 *8]
 
static bool customSet = false
 
static const Qt::WindowFlags DefaultWindowFlags
 
static bool initrgb = false
 
static int pHeight = 200
 
static int pWidth = 220
 
static QRgb stdrgb [6 *8]
 

Function Documentation

◆ initRGB()

static void initRGB ( )
static

Definition at line 438 of file qcolordialog.cpp.

Referenced by QColorDialog::customColor(), QColorDialogPrivate::init(), QColorDialog::setCustomColor(), and QColorDialog::setStandardColor().

439 {
440  if (initrgb)
441  return;
442  initrgb = true;
443  int i = 0;
444  for (int g = 0; g < 4; g++)
445  for (int r = 0; r < 4; r++)
446  for (int b = 0; b < 3; b++)
447  stdrgb[i++] = qRgb(r * 255 / 3, g * 255 / 3, b * 255 / 2);
448 
449  for (i = 0; i < 2*8; i++)
450  cusrgb[i] = 0xffffffff;
451 }
static QRgb cusrgb[2 *8]
static QRgb stdrgb[6 *8]
QRgb qRgb(int r, int g, int b)
Returns the ARGB quadruplet (255, {r}, {g}, {b}).
Definition: qrgb.h:69
static bool initrgb

◆ rgb2hsv()

static void rgb2hsv ( QRgb  rgb,
int &  h,
int &  s,
int &  v 
)
inlinestatic

Definition at line 510 of file qcolordialog.cpp.

Referenced by QColorDialogPrivate::_q_newColorTypedIn(), QColorShower::rgbEd(), and QColorShower::setRgb().

511 {
512  QColor c;
513  c.setRgb(rgb);
514  c.getHsv(&h, &s, &v);
515 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
void setRgb(int r, int g, int b, int a=255)
Sets the RGB value to r, g, b and the alpha value to a.
Definition: qcolor.cpp:980
unsigned char c[8]
Definition: qnumeric_p.h:62
void getHsv(int *h, int *s, int *v, int *a=0) const
Sets the contents pointed to by h, s, v, and a, to the hue, saturation, value, and alpha-channel (tra...
Definition: qcolor.cpp:679
#define rgb(r, g, b)
Definition: qcolor_p.cpp:130

Variable Documentation

◆ cusrgb

QRgb cusrgb[2 *8]
static

◆ customSet

bool customSet = false
static

◆ DefaultWindowFlags

const Qt::WindowFlags DefaultWindowFlags
static

◆ initrgb

bool initrgb = false
static

Definition at line 432 of file qcolordialog.cpp.

Referenced by initRGB().

◆ pHeight

int pHeight = 200
static

Definition at line 665 of file qcolordialog.cpp.

Referenced by QColorDialogPrivate::init(), and QColorPicker::sizeHint().

◆ pWidth

int pWidth = 220
static

Definition at line 664 of file qcolordialog.cpp.

Referenced by QColorDialogPrivate::init(), and QColorPicker::sizeHint().

◆ stdrgb

QRgb stdrgb[6 *8]
static