本文整理汇总了C++中QColorDialog::getColor方法的典型用法代码示例。如果您正苦于以下问题:C++ QColorDialog::getColor方法的具体用法?C++ QColorDialog::getColor怎么用?C++ QColorDialog::getColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QColorDialog
的用法示例。
在下文中一共展示了QColorDialog::getColor方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onBackgroundColourClicked
/**
Handler for changing the background colour of an integrated peak.
*/
void PeaksWorkspaceWidget::onBackgroundColourClicked() {
QColorDialog colourDlg;
QColor selectedColour = colourDlg.getColor();
if (selectedColour.isValid()) {
ui.btnBackgroundColor->setBackgroundColor(selectedColour);
emit backgroundColourChanged(this->m_ws, selectedColour);
}
}
示例2: mousePressEvent
void ColorWidget::mousePressEvent(QMouseEvent *)
{
QColorDialog cDialog;
QColor color = cDialog.getColor(TranslateToQColor(_color));
if (color.isValid())
_color = TranslateToFloat3(color);
update();
}
示例3: selectColor
void ColorLabel::selectColor()
{
QColorDialog cDlg;
QColor newColor = cDlg.getColor(mColor, this, text());
if(newColor.isValid())
setColor(newColor);
}
示例4: mouseDoubleClickEvent
void agente::mouseDoubleClickEvent(QMouseEvent* E){
if(E->button() ==Qt::LeftButton){
if(isChecked()){
QColorDialog* d = new QColorDialog(this);
QPixmap P(":/recursos/testigo.png");
color_ = d->getColor();
P.fill(color_);
labelColor_.setPixmap(P);
}
}
}
示例5: chooseColor
void SettingsDialog::chooseColor(QWidget* widget)
{
QToolButton* but = qobject_cast<QToolButton*>(widget);
QString colorName = but->text();
QColorDialog selector;
QColor color(SETTINGS->get("Color", colorName).toString());
color = selector.getColor(color);
if (color.isValid()) {
SETTINGS->set("Color", colorName, color.name());
updateColorToolButtonColor(but);
}
}
示例6: onSetColorClicked
void ClusterColorDialog::onSetColorClicked()
{
QColorDialog cd;
QColor c=cd.getColor();
int id=currentClusterIndex;
ClusterColorScheme::getSingleton()[id].r=c.red();
ClusterColorScheme::getSingleton()[id].g=c.green();
ClusterColorScheme::getSingleton()[id].b=c.blue();
onClusterColorChanged();
}
示例7:
void sub3dtoolguiAdvance::changeColorOutline()
{
QColorDialog nc;
QColor c;
c = nc.getColor(QColor(_data->cOutline.r, _data->cOutline.g, _data->cOutline.b));
if(c.isValid())
{
QPalette pal = ui->lineColorOutline->palette();
pal.setColor(ui->lineColorOutline->backgroundRole(), c);
ui->lineColorOutline->setPalette(pal);
}
}
示例8: colorSelectTert
void ConnectionDialog::colorSelectTert()
{
QColorDialog* ColorDiag = new QColorDialog();
*this->color3 = ColorDiag->getColor();
QPixmap* colorDisplay = new QPixmap(25, 25);
colorDisplay->fill(*this->color3);
this->ui->tertColorImage->setPixmap(*colorDisplay);
// Set image to current label
this->updateShipImage(this->ui->shipNames->currentText());
}
示例9: set_color
void QG_DlgOptionsGeneral::set_color(QComboBox* combo, QColor custom)
{
QColor current;
current.setNamedColor(combo->lineEdit()->text());
QColorDialog dlg;
dlg.setCustomColor(0, custom.rgb());
QColor color = dlg.getColor(current, this, "Select Color", QColorDialog::DontUseNativeDialog);
if (color.isValid())
{
combo->lineEdit()->setText(color.name());
}
}
示例10: on_mui_seleccionarcolor_clicked
void FamiliasTPV::on_mui_seleccionarcolor_clicked()
{
QColor coloractual;
if (QColor::isValidColor(mui_colortpvfamilia->text())) {
coloractual.setNamedColor(mui_colortpvfamilia->text());
} else {
coloractual.setNamedColor("#FFFFFF");
} // end if
QColorDialog colordialog;
QColor color = colordialog.getColor(coloractual, this);
mui_colortpvfamilia->setText(color.name());
}
示例11: pickTheColor
void MainWindow::pickTheColor()
{
QSqlQuery q;
//q.exec(QLatin1String("INSERT INTO images(genreId, bigPath, smallPath,Y,I,Q) VALUES (1,'C:/1.jpg','C:/2.jpg',140,20,20)"));
//q.exec(QLatin1String("INSERT INTO Y(imageId, x, y, sign) VALUES (1,1,1,1)"));
q.exec(QLatin1String("SELECT bigPath,smallPath,Y,I,Q FROM images"));
q.first();
qDebug()<<" [0]= "<<QString(q.value(0).toString())<<" [1]= "<<QString(q.value(1).toString())<<" [2]= "<<QString(q.value(2).toString())<<" [3]= "<<QString(q.value(3).toString());
//qDebug()<<"111";
QColorDialog dialog;
currColor=dialog.getColor(currColor);
ui->widget_2->setColor(currColor);
}