

Definition at line 874 of file qcolordialog.cpp.
Public Slots | |
| void | setRgb (QRgb rgb) |
Signals | |
| void | newCol (QRgb rgb) |
Public Member Functions | |
| QColorShower (QWidget *parent) | |
| void | setHsv (int h, int s, int v) |
| int | currentAlpha () const |
| void | setCurrentAlpha (int a) |
| void | showAlpha (bool b) |
| QRgb | currentColor () const |
Private Slots | |
| void | rgbEd () |
| void | hsvEd () |
Private Member Functions | |
| void | showCurrentColor () |
Private Attributes | |
| int | hue |
| int | sat |
| int | val |
| QRgb | curCol |
| QColSpinBox * | hEd |
| QColSpinBox * | sEd |
| QColSpinBox * | vEd |
| QColSpinBox * | rEd |
| QColSpinBox * | gEd |
| QColSpinBox * | bEd |
| QColSpinBox * | alphaEd |
| QLabel * | alphaLab |
| QColorShowLabel * | lab |
| bool | rgbOriginal |
| QColorShower::QColorShower | ( | QWidget * | parent | ) |
Definition at line 1029 of file qcolordialog.cpp.
References QGridLayout::addWidget(), Qt::AlignRight, Qt::AlignVCenter, alphaEd, alphaLab, bEd, QObject::connect(), curCol, gEd, hEd, QWidget::hide(), hsvEd(), l, lab, newCol(), qRgb(), QRgb, rEd, rgbEd(), sEd, QLabel::setAlignment(), QLabel::setBuddy(), QLayout::setMargin(), QWidget::setMinimumWidth(), QSpinBox::setRange(), setRgb(), SIGNAL, SLOT, QLayout::spacing(), and vEd.
01030 :QWidget(parent) 01031 { 01032 curCol = qRgb(-1, -1, -1); 01033 01034 QGridLayout *gl = new QGridLayout(this); 01035 gl->setMargin(gl->spacing()); 01036 lab = new QColorShowLabel(this); 01037 lab->setMinimumWidth(60); 01038 gl->addWidget(lab, 0, 0, -1, 1); 01039 connect(lab, SIGNAL(colorDropped(QRgb)), 01040 this, SIGNAL(newCol(QRgb))); 01041 connect(lab, SIGNAL(colorDropped(QRgb)), 01042 this, SLOT(setRgb(QRgb))); 01043 01044 hEd = new QColSpinBox(this); 01045 hEd->setRange(0, 359); 01046 QLabel *l = new QLabel(QColorDialog::tr("Hu&e:"), this); 01047 #ifndef QT_NO_SHORTCUT 01048 l->setBuddy(hEd); 01049 #endif 01050 l->setAlignment(Qt::AlignRight|Qt::AlignVCenter); 01051 gl->addWidget(l, 0, 1); 01052 gl->addWidget(hEd, 0, 2); 01053 01054 sEd = new QColSpinBox(this); 01055 l = new QLabel(QColorDialog::tr("&Sat:"), this); 01056 #ifndef QT_NO_SHORTCUT 01057 l->setBuddy(sEd); 01058 #endif 01059 l->setAlignment(Qt::AlignRight|Qt::AlignVCenter); 01060 gl->addWidget(l, 1, 1); 01061 gl->addWidget(sEd, 1, 2); 01062 01063 vEd = new QColSpinBox(this); 01064 l = new QLabel(QColorDialog::tr("&Val:"), this); 01065 #ifndef QT_NO_SHORTCUT 01066 l->setBuddy(vEd); 01067 #endif 01068 l->setAlignment(Qt::AlignRight|Qt::AlignVCenter); 01069 gl->addWidget(l, 2, 1); 01070 gl->addWidget(vEd, 2, 2); 01071 01072 rEd = new QColSpinBox(this); 01073 l = new QLabel(QColorDialog::tr("&Red:"), this); 01074 #ifndef QT_NO_SHORTCUT 01075 l->setBuddy(rEd); 01076 #endif 01077 l->setAlignment(Qt::AlignRight|Qt::AlignVCenter); 01078 gl->addWidget(l, 0, 3); 01079 gl->addWidget(rEd, 0, 4); 01080 01081 gEd = new QColSpinBox(this); 01082 l = new QLabel(QColorDialog::tr("&Green:"), this); 01083 #ifndef QT_NO_SHORTCUT 01084 l->setBuddy(gEd); 01085 #endif 01086 l->setAlignment(Qt::AlignRight|Qt::AlignVCenter); 01087 gl->addWidget(l, 1, 3); 01088 gl->addWidget(gEd, 1, 4); 01089 01090 bEd = new QColSpinBox(this); 01091 l = new QLabel(QColorDialog::tr("Bl&ue:"), this); 01092 #ifndef QT_NO_SHORTCUT 01093 l->setBuddy(bEd); 01094 #endif 01095 l->setAlignment(Qt::AlignRight|Qt::AlignVCenter); 01096 gl->addWidget(l, 2, 3); 01097 gl->addWidget(bEd, 2, 4); 01098 01099 alphaEd = new QColSpinBox(this); 01100 alphaLab = new QLabel(QColorDialog::tr("A&lpha channel:"), this); 01101 #ifndef QT_NO_SHORTCUT 01102 alphaLab->setBuddy(alphaEd); 01103 #endif 01104 alphaLab->setAlignment(Qt::AlignRight|Qt::AlignVCenter); 01105 gl->addWidget(alphaLab, 3, 1, 1, 3); 01106 gl->addWidget(alphaEd, 3, 4); 01107 alphaEd->hide(); 01108 alphaLab->hide(); 01109 01110 connect(hEd, SIGNAL(valueChanged(int)), this, SLOT(hsvEd())); 01111 connect(sEd, SIGNAL(valueChanged(int)), this, SLOT(hsvEd())); 01112 connect(vEd, SIGNAL(valueChanged(int)), this, SLOT(hsvEd())); 01113 01114 connect(rEd, SIGNAL(valueChanged(int)), this, SLOT(rgbEd())); 01115 connect(gEd, SIGNAL(valueChanged(int)), this, SLOT(rgbEd())); 01116 connect(bEd, SIGNAL(valueChanged(int)), this, SLOT(rgbEd())); 01117 connect(alphaEd, SIGNAL(valueChanged(int)), this, SLOT(rgbEd())); 01118 }
Here is the call graph for this function:

| void QColorShower::setHsv | ( | int | h, | |
| int | s, | |||
| int | v | |||
| ) |
Definition at line 1181 of file qcolordialog.cpp.
References bEd, c, curCol, currentColor(), gEd, hEd, hue, qBlue(), qGreen(), qRed(), rEd, rgbOriginal, sat, sEd, QColSpinBox::setValue(), showCurrentColor(), val, and vEd.
Referenced by QColorDialogPrivate::_q_newHsv().
01182 { 01183 if (h < -1 || (uint)s > 255 || (uint)v > 255) 01184 return; 01185 01186 rgbOriginal = false; 01187 hue = h; val = v; sat = s; 01188 QColor c; 01189 c.setHsv(hue, sat, val); 01190 curCol = c.rgb(); 01191 01192 hEd->setValue(hue); 01193 sEd->setValue(sat); 01194 vEd->setValue(val); 01195 01196 rEd->setValue(qRed(currentColor())); 01197 gEd->setValue(qGreen(currentColor())); 01198 bEd->setValue(qBlue(currentColor())); 01199 01200 showCurrentColor(); 01201 }
Here is the call graph for this function:

| int QColorShower::currentAlpha | ( | ) | const [inline] |
Definition at line 883 of file qcolordialog.cpp.
References alphaEd, and QSpinBox::value().
Referenced by QColorDialogPrivate::currentAlpha(), and rgbEd().
Here is the call graph for this function:

| void QColorShower::setCurrentAlpha | ( | int | a | ) | [inline] |
Definition at line 884 of file qcolordialog.cpp.
References alphaEd, and QColSpinBox::setValue().
Referenced by QColorDialogPrivate::setCurrentAlpha().
Here is the call graph for this function:

| void QColorShower::showAlpha | ( | bool | b | ) |
Definition at line 954 of file qcolordialog.cpp.
References alphaEd, alphaLab, QWidget::hide(), and QWidget::show().
Referenced by QColorDialogPrivate::showAlpha().
00955 { 00956 if (b) { 00957 alphaLab->show(); 00958 alphaEd->show(); 00959 } else { 00960 alphaLab->hide(); 00961 alphaEd->hide(); 00962 } 00963 }
| QRgb QColorShower::currentColor | ( | ) | const [inline] |
Definition at line 888 of file qcolordialog.cpp.
References curCol.
Referenced by QColorDialogPrivate::_q_addCustom(), QColorDialogPrivate::currentColor(), hsvEd(), rgbEd(), setHsv(), setRgb(), and showCurrentColor().
00888 { return curCol; }
| void QColorShower::setRgb | ( | QRgb | rgb | ) | [slot] |
Definition at line 1163 of file qcolordialog.cpp.
References bEd, curCol, currentColor(), gEd, hEd, hue, qBlue(), qGreen(), qRed(), rEd, rgb2hsv(), rgbOriginal, sat, sEd, QColSpinBox::setValue(), showCurrentColor(), val, and vEd.
Referenced by QColorShower(), and QColorDialogPrivate::setCurrentColor().
01164 { 01165 rgbOriginal = true; 01166 curCol = rgb; 01167 01168 rgb2hsv(currentColor(), hue, sat, val); 01169 01170 hEd->setValue(hue); 01171 sEd->setValue(sat); 01172 vEd->setValue(val); 01173 01174 rEd->setValue(qRed(currentColor())); 01175 gEd->setValue(qGreen(currentColor())); 01176 bEd->setValue(qBlue(currentColor())); 01177 01178 showCurrentColor(); 01179 }
| void QColorShower::newCol | ( | QRgb | rgb | ) | [signal] |
Referenced by hsvEd(), QColorShower(), and rgbEd().
| void QColorShower::rgbEd | ( | ) | [private, slot] |
Definition at line 1126 of file qcolordialog.cpp.
References alphaEd, bEd, curCol, currentAlpha(), currentColor(), emit, gEd, hEd, hue, QWidget::isVisible(), newCol(), qRgb(), qRgba(), rEd, rgb2hsv(), rgbOriginal, sat, sEd, QColSpinBox::setValue(), showCurrentColor(), val, QSpinBox::value(), and vEd.
Referenced by QColorShower().
01127 { 01128 rgbOriginal = true; 01129 if (alphaEd->isVisible()) 01130 curCol = qRgba(rEd->value(), gEd->value(), bEd->value(), currentAlpha()); 01131 else 01132 curCol = qRgb(rEd->value(), gEd->value(), bEd->value()); 01133 01134 rgb2hsv(currentColor(), hue, sat, val); 01135 01136 hEd->setValue(hue); 01137 sEd->setValue(sat); 01138 vEd->setValue(val); 01139 01140 showCurrentColor(); 01141 emit newCol(currentColor()); 01142 }
| void QColorShower::hsvEd | ( | ) | [private, slot] |
Definition at line 1144 of file qcolordialog.cpp.
References bEd, c, curCol, currentColor(), emit, gEd, hEd, hue, newCol(), qBlue(), qGreen(), qRed(), rEd, rgbOriginal, sat, sEd, QColSpinBox::setValue(), showCurrentColor(), val, QSpinBox::value(), and vEd.
Referenced by QColorShower().
01145 { 01146 rgbOriginal = false; 01147 hue = hEd->value(); 01148 sat = sEd->value(); 01149 val = vEd->value(); 01150 01151 QColor c; 01152 c.setHsv(hue, sat, val); 01153 curCol = c.rgb(); 01154 01155 rEd->setValue(qRed(currentColor())); 01156 gEd->setValue(qGreen(currentColor())); 01157 bEd->setValue(qBlue(currentColor())); 01158 01159 showCurrentColor(); 01160 emit newCol(currentColor()); 01161 }
| void QColorShower::showCurrentColor | ( | ) | [private] |
Definition at line 1120 of file qcolordialog.cpp.
References currentColor(), lab, QWidget::repaint(), and QColorShowLabel::setColor().
Referenced by hsvEd(), rgbEd(), setHsv(), and setRgb().
01121 { 01122 lab->setColor(currentColor()); 01123 lab->repaint(); 01124 }
Here is the call graph for this function:

int QColorShower::hue [private] |
int QColorShower::sat [private] |
int QColorShower::val [private] |
QRgb QColorShower::curCol [private] |
Definition at line 901 of file qcolordialog.cpp.
Referenced by currentColor(), hsvEd(), QColorShower(), rgbEd(), setHsv(), and setRgb().
QColSpinBox* QColorShower::hEd [private] |
Definition at line 902 of file qcolordialog.cpp.
Referenced by hsvEd(), QColorShower(), rgbEd(), setHsv(), and setRgb().
QColSpinBox* QColorShower::sEd [private] |
Definition at line 903 of file qcolordialog.cpp.
Referenced by hsvEd(), QColorShower(), rgbEd(), setHsv(), and setRgb().
QColSpinBox* QColorShower::vEd [private] |
Definition at line 904 of file qcolordialog.cpp.
Referenced by hsvEd(), QColorShower(), rgbEd(), setHsv(), and setRgb().
QColSpinBox* QColorShower::rEd [private] |
Definition at line 905 of file qcolordialog.cpp.
Referenced by hsvEd(), QColorShower(), rgbEd(), setHsv(), and setRgb().
QColSpinBox* QColorShower::gEd [private] |
Definition at line 906 of file qcolordialog.cpp.
Referenced by hsvEd(), QColorShower(), rgbEd(), setHsv(), and setRgb().
QColSpinBox* QColorShower::bEd [private] |
Definition at line 907 of file qcolordialog.cpp.
Referenced by hsvEd(), QColorShower(), rgbEd(), setHsv(), and setRgb().
QColSpinBox* QColorShower::alphaEd [private] |
Definition at line 908 of file qcolordialog.cpp.
Referenced by currentAlpha(), QColorShower(), rgbEd(), setCurrentAlpha(), and showAlpha().
QLabel* QColorShower::alphaLab [private] |
QColorShowLabel* QColorShower::lab [private] |
Definition at line 910 of file qcolordialog.cpp.
Referenced by QColorShower(), and showCurrentColor().
bool QColorShower::rgbOriginal [private] |
1.5.1