本文整理汇总了C++中ColorPicker::setCol方法的典型用法代码示例。如果您正苦于以下问题:C++ ColorPicker::setCol方法的具体用法?C++ ColorPicker::setCol怎么用?C++ ColorPicker::setCol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColorPicker
的用法示例。
在下文中一共展示了ColorPicker::setCol方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
TuneColorDialog::TuneColorDialog(int hue,int sat,int gamma,QWidget *parent) : QDialog(parent)
{
setWindowTitle(tr("Tune the color of the HTML output"));
QGridLayout *layout = new QGridLayout(this);
m_image = new QImage(QString::fromAscii(":/images/tunecolor.png"));
m_imageLab = new QLabel;
updateImage(hue,sat,gamma);
layout->addWidget(new QLabel(tr("Example output: use the sliders on the right to adjust the color")),0,0);
layout->addWidget(m_imageLab,1,0);
QHBoxLayout *buttonsLayout = new QHBoxLayout;
QPushButton *okButton = new QPushButton(tr("Ok"));
connect(okButton,SIGNAL(clicked()),SLOT(accept()));
okButton->setDefault(true);
QPushButton *cancelButton = new QPushButton(tr("Cancel"));
connect(cancelButton,SIGNAL(clicked()),SLOT(reject()));
ColorPicker *huePicker = new ColorPicker(ColorPicker::Hue);
huePicker->setCol(hue,sat,gamma);
huePicker->setFixedWidth(20);
layout->addWidget(huePicker,1,1);
ColorPicker *satPicker = new ColorPicker(ColorPicker::Saturation);
satPicker->setCol(hue,sat,gamma);
satPicker->setFixedWidth(20);
layout->addWidget(satPicker,1,2);
ColorPicker *gamPicker = new ColorPicker(ColorPicker::Gamma);
gamPicker->setCol(hue,sat,gamma);
gamPicker->setFixedWidth(20);
layout->addWidget(gamPicker,1,3);
connect(huePicker,SIGNAL(newHsv(int,int,int)),satPicker,SLOT(setCol(int,int,int)));
connect(satPicker,SIGNAL(newHsv(int,int,int)),huePicker,SLOT(setCol(int,int,int)));
connect(huePicker,SIGNAL(newHsv(int,int,int)),gamPicker,SLOT(setCol(int,int,int)));
connect(satPicker,SIGNAL(newHsv(int,int,int)),gamPicker,SLOT(setCol(int,int,int)));
connect(gamPicker,SIGNAL(newHsv(int,int,int)),satPicker,SLOT(setCol(int,int,int)));
connect(gamPicker,SIGNAL(newHsv(int,int,int)),huePicker,SLOT(setCol(int,int,int)));
connect(huePicker,SIGNAL(newHsv(int,int,int)),this,SLOT(updateImage(int,int,int)));
connect(satPicker,SIGNAL(newHsv(int,int,int)),this,SLOT(updateImage(int,int,int)));
connect(gamPicker,SIGNAL(newHsv(int,int,int)),this,SLOT(updateImage(int,int,int)));
buttonsLayout->addStretch();
buttonsLayout->addWidget(okButton);
buttonsLayout->addWidget(cancelButton);
layout->addLayout(buttonsLayout,5,0,1,4);
}