当前位置: 首页>>代码示例>>C++>>正文


C++ QColorDialog::getColor方法代码示例

本文整理汇总了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);
  }
}
开发者ID:spaceyatom,项目名称:mantid,代码行数:11,代码来源:PeaksWorkspaceWidget.cpp

示例2: mousePressEvent

void ColorWidget::mousePressEvent(QMouseEvent *)
{
    QColorDialog cDialog;
    QColor color = cDialog.getColor(TranslateToQColor(_color));
    if (color.isValid())
        _color = TranslateToFloat3(color);
    update();
}
开发者ID:0rps,项目名称:raytrace,代码行数:8,代码来源:colorwidget.cpp

示例3: selectColor

void ColorLabel::selectColor()
{

    QColorDialog cDlg;
    QColor newColor = cDlg.getColor(mColor, this, text());

    if(newColor.isValid())
        setColor(newColor);
}
开发者ID:alcemirfernandes,项目名称:CrochetCharts,代码行数:9,代码来源:colorlabel.cpp

示例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);
        }
    }
}
开发者ID:Dariasteam,项目名称:I.A.,代码行数:11,代码来源:agente.cpp

示例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);
  }
}
开发者ID:xyz60377,项目名称:QCamber,代码行数:12,代码来源:settingsdialog.cpp

示例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();
}
开发者ID:shi-yan,项目名称:graphicsrelatedcodes,代码行数:13,代码来源:clustercolordialog.cpp

示例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);
    }
}
开发者ID:tuxamito,项目名称:sub3dtool-gui,代码行数:13,代码来源:sub3dtoolguiadvance.cpp

示例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());
}
开发者ID:jacob-swanson,项目名称:PixSpace,代码行数:14,代码来源:connectiondialog.cpp

示例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());
    }
}
开发者ID:jmundry,项目名称:LibreCAD,代码行数:14,代码来源:qg_dlgoptionsgeneral.cpp

示例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());
    
}
开发者ID:trifolio6,项目名称:Bulmages,代码行数:16,代码来源:familiastpv.cpp

示例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);

}
开发者ID:Chetter2,项目名称:WImageRecognition,代码行数:18,代码来源:mainwindow.cpp


注:本文中的QColorDialog::getColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。