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


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

本文整理汇总了C++中QColorDialog::selectedColor方法的典型用法代码示例。如果您正苦于以下问题:C++ QColorDialog::selectedColor方法的具体用法?C++ QColorDialog::selectedColor怎么用?C++ QColorDialog::selectedColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QColorDialog的用法示例。


在下文中一共展示了QColorDialog::selectedColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: selectComponentColor

void gNodeComponentWidget::selectComponentColor()
{
   QColorDialog w;
   if(!w.exec())return;
   QColor q = w.selectedColor();
   m_component->setColor(q.red(),q.green(),q.blue());
}
开发者ID:enriquevaquero,项目名称:Jarvis,代码行数:7,代码来源:gnodecomponentwidget.cpp

示例2: on_AddColorButton__released

	void ColorListEditorWidget::on_AddColorButton__released ()
	{
		QColorDialog dia (this);
		if (dia.exec () != QDialog::Accepted)
			return;

		AddColor (dia.selectedColor ());
	}
开发者ID:AlexWMF,项目名称:leechcraft,代码行数:8,代码来源:colorlisteditorwidget.cpp

示例3: textColor

void XYZTextEditor::textColor() {
    QColor color;
    QColorDialog *dlg = new QColorDialog(this);
    if (dlg->exec() == QDialog::Accepted) {
        color = dlg->selectedColor();
    } else return;
    QTextCharFormat fmt;
    fmt.setForeground( QBrush( color ) );
    mergeFormatOnWordOrSelection(fmt);
}
开发者ID:gamalielmendez,项目名称:BibliotecaImpresionSql,代码行数:10,代码来源:XYZ_TextEditor.cpp

示例4: selectColor

void PageSettingDlg::selectColor() {
    QColor color;
    QColorDialog *dlg = new QColorDialog(color, this);
    if (dlg->exec() == QDialog::Accepted) {
        color = dlg->selectedColor();
    } else return;

    strColor = colorToString(color);
    pageSetting.borderColor = strColor;
    ui->lblBorderColor->setStyleSheet("QLabel {background-color: "+strColor+"}");
}
开发者ID:cedoduarte,项目名称:SistemaSeguros,代码行数:11,代码来源:PageSettingDlg.cpp

示例5: on_pushButtonCouleurPointsAxes_clicked

void FenetreParametresAffichage::on_pushButtonCouleurPointsAxes_clicked()
{
    ParametresPoint parametresPointsAxes = this->parametresAffichage.getParametresPointsAxes();
    QColorDialog* fenetreCouleurPointsAxes = new QColorDialog(
            QColor(parametresPointsAxes.getCouleurPoint()), this);
    if (fenetreCouleurPointsAxes->exec() == QColorDialog::Rejected)
        return;
    parametresPointsAxes.setCouleurPoint(fenetreCouleurPointsAxes->selectedColor().rgb());
    this->parametresAffichage.setParametresPointsAxes(parametresPointsAxes);
    this->actualiserElementsGraphiques();
}
开发者ID:lovehina13,项目名称:NumerisationDeCourbes,代码行数:11,代码来源:FenetreParametresAffichage.cpp

示例6: on_textColorChangeButton_clicked

void SettingsWindow::on_textColorChangeButton_clicked()
{
  QColorDialog dialog;
  dialog.setWindowTitle("select a color for selector items text");
  if(dialog.exec())
  {
    QColor color=dialog.selectedColor();
    QString name=color.name();
    ui->textColorPreview->setStyleSheet("QLabel{\n	background:"+name+";\n background-repeat: repeat-y;\n  background-position: left;\n}");
    ui->textColorPreview->setText(name);
  }
}
开发者ID:Reemjd,项目名称:genius,代码行数:12,代码来源:settingswindow.cpp

示例7: showColourDialog

void SettingsWidget::showColourDialog() {
    QColorDialog colorDialog;
    colorDialog.setCurrentColor(settings.tableColour);

    if (colorDialog.exec() == QDialog::Accepted) {
        QColor colour = colorDialog.selectedColor();
        settings.tableColour = colour.name();
        QString colourStyleSheet = "background-color: " + colour.name() + ";";
        ui->colourButton->setStyleSheet(colourStyleSheet);
        applySettings();
    }

}
开发者ID:alecs1,项目名称:home,代码行数:13,代码来源:SettingsWidget.cpp

示例8: on_highlightBarColor_clicked

void EnvironmentSettingsDialog::on_highlightBarColor_clicked()
{
   QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
   QColorDialog dlg;

   dlg.setCurrentColor(m_highlightBarColor);

   if (dlg.exec() == QColorDialog::Accepted)
   {
      m_highlightBarColor = dlg.selectedColor();
      m_scintilla->setMarkerBackgroundColor(m_highlightBarColor,Marker_Highlight);
   }
}
开发者ID:Heathcode,项目名称:nesicide,代码行数:13,代码来源:environmentsettingsdialog.cpp

示例9: on_styleColor_clicked

void EnvironmentSettingsDialog::on_styleColor_clicked()
{
   QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
   QColorDialog dlg;
   int style = ui->styleName->itemData(ui->styleName->currentIndex()).toInt();

   dlg.setCurrentColor(m_lexer->color(style));

   if (dlg.exec() == QColorDialog::Accepted)
   {
      QColor chosenColor = dlg.selectedColor();
      m_lexer->setColor(chosenColor,style);
   }
}
开发者ID:Heathcode,项目名称:nesicide,代码行数:14,代码来源:environmentsettingsdialog.cpp

示例10: on_backgroundColor_clicked

void EnvironmentSettingsDialog::on_backgroundColor_clicked()
{
   QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
   QColorDialog dlg;

   dlg.setCurrentColor(m_lexer->defaultPaper());

   if (dlg.exec() == QColorDialog::Accepted)
   {
      QColor chosenColor = dlg.selectedColor();
      m_lexer->setDefaultPaper(chosenColor);
      m_lexer->setPaper(chosenColor,-1);
   }
}
开发者ID:Heathcode,项目名称:nesicide,代码行数:14,代码来源:environmentsettingsdialog.cpp

示例11: selectColor

void ListItemSettingsEditor::selectColor()
{
    QColorDialog dialog;
    if (dialog.exec()) {
        QColor color = dialog.selectedColor();
        QString senderName = sender()->objectName();
        if ("textColorToolButton" == senderName) {
            m_listitem->setTextColor(color);
            ui->textColorLineEdit->setText(color.name(QColor::HexRgb));
        } else if ("backgroundColorToolButton" == senderName) {
            m_listitem->setBackgroundColor(color);
            ui->backgroundColorLineEdit->setText(color.name(QColor::HexRgb));
        }
    }
    setupForm();
}
开发者ID:hunt978,项目名称:qt-material-widgets,代码行数:16,代码来源:listitemsettingseditor.cpp

示例12: QColorDialog

void QConsoleWidgetPrivate::
selectAndSetFontColor() {

	auto color_ = 
		this->textCharFormat.foreground().color();

	QColorDialog * dialog = new QColorDialog(color_);
	if (dialog->exec()) {
		color_ = dialog->selectedColor();
		this->textCharFormat.setForeground(color_);
		super->updateCharFormat();
	}
	
	dialog->deleteLater();
	 
}
开发者ID:ngzHappy,项目名称:QtLuaConsole,代码行数:16,代码来源:QConsoleWidget.cpp

示例13: colorToolButtonClicked

void ApplicationPreferencesDialog::colorToolButtonClicked()
{
    QToolButton *toolButton = dynamic_cast< QToolButton * >(sender());
    assert(toolButton);
    QColorDialog colorDlg;
    int result = colorDlg.exec();
    QColor selectedColor;
    if(result == QDialog::Accepted)
    {
        selectedColor = colorDlg.selectedColor();
        QPixmap pixmap(20, 20);
        pixmap.fill(selectedColor);
        toolButton->setIcon(pixmap);
        if(toolButton == ui->ui_unconnectedRailsToolButton)
        {
            m_unconnectedRailsColor = selectedColor;
        }
        else if(toolButton == ui->ui_connectedRailsToolButton)
        {
            m_connectedRailsColor = selectedColor;
        }
        else if(toolButton == ui->ui_systemFunctionToolButton)
        {
            m_systemFunctionColor = selectedColor;
        }
        else if(toolButton == ui->ui_functionNamesToolButton)
        {
            m_functionNamesColor = selectedColor;
        }
        else if(toolButton == ui->ui_functionCallsToolButton)
        {
            m_functionCallsColor = selectedColor;
        }
        else if(toolButton == ui->ui_stringsToolButton)
        {
            m_stringsColor = selectedColor;
        }
        else if(toolButton == ui->ui_variablesToolButton)
        {
            m_variablesColor = selectedColor;
        }
        else if(toolButton == ui->ui_grabbedTextToolButton)
        {
            m_grabbedTextColor = selectedColor;
        }
    }
}
开发者ID:ccebinger,项目名称:SWPSoSe14,代码行数:47,代码来源:ApplicationPreferencesDialog.cpp

示例14: selectColorText

void ItemAction::selectColorText()
{
  QColorDialog *colorDialog = new QColorDialog(this);

  if (colorDialog->exec() == QDialog::Rejected) {
    delete colorDialog;
    return;
  }

  QColor color = colorDialog->selectedColor();
  delete colorDialog;

  colorButton_->setToolTip(color.name());
  QPixmap pixmap(14, 14);
  pixmap.fill(color);
  colorButton_->setIcon(pixmap);
}
开发者ID:efferre79,项目名称:quiterss,代码行数:17,代码来源:itemaction.cpp

示例15: selectColorBg

void LabelDialog::selectColorBg()
{

  QColorDialog *colorDialog = new QColorDialog(this);

  if (colorDialog->exec() == QDialog::Rejected) {
    delete colorDialog;
    return;
  }

  QColor color = colorDialog->selectedColor();
  delete colorDialog;

  colorBgStr_ = color.name();
  QPixmap pixmap(14, 14);
  pixmap.fill(color);
  colorBgButton_->setIcon(pixmap);
}
开发者ID:efferre79,项目名称:quiterss,代码行数:18,代码来源:labeldialog.cpp


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