本文整理汇总了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());
}
示例2: on_AddColorButton__released
void ColorListEditorWidget::on_AddColorButton__released ()
{
QColorDialog dia (this);
if (dia.exec () != QDialog::Accepted)
return;
AddColor (dia.selectedColor ());
}
示例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);
}
示例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+"}");
}
示例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();
}
示例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);
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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;
}
}
}
示例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);
}
示例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);
}