コード例 #1
0
void gNodeComponentWidget::selectComponentColor()
{
   QColorDialog w;
   if(!w.exec())return;
   QColor q = w.selectedColor();
   m_component->setColor(q.red(),q.green(),q.blue());
}
コード例 #2
0
	void ColorListEditorWidget::on_AddColorButton__released ()
	{
		QColorDialog dia (this);
		if (dia.exec () != QDialog::Accepted)
			return;

		AddColor (dia.selectedColor ());
	}
コード例 #3
0
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
0
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
0
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
0
ファイル: settingswindow.cpp プロジェクト: Reemjd/genius
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
0
ファイル: SettingsWidget.cpp プロジェクト: alecs1/home
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
0
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
0
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
0
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
0
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
0
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
0
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
0
ファイル: itemaction.cpp プロジェクト: efferre79/quiterss
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
0
ファイル: labeldialog.cpp プロジェクト: efferre79/quiterss
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);
}
コード例 #16
0
void EditFldDlg::chooseColor() {
    QColor color;
    if (sender() == ui->btnColorF)
        color = colorFromString(ui->lblColorF->styleSheet());
    if (sender() == ui->btnColorB)
        color = colorFromString(ui->lblColorB->styleSheet());
    QColorDialog *dlg = new QColorDialog(color, this);
    if (dlg->exec() == QDialog::Accepted) {
        color = dlg->selectedColor();
    } else return;

    QString strColor = colorToString(color);
    if (sender() == ui->btnColorB)
        ui->lblColorB->setStyleSheet("QLabel {background-color: "+strColor+"}");
    if (sender() == ui->btnColorF)
        ui->lblColorF->setStyleSheet("QLabel {background-color: "+strColor+"}");

    encodeHighLightingString();
}
コード例 #17
0
ファイル: PlanSimSubpanel.cpp プロジェクト: quesnel/packages
void
PlanSimSubpanel::onToolColor()
{
    QTreeWidgetItem* item = right->ui->treeSimViews->currentItem();
    QString viewName = item->data(0, Qt::UserRole + 1).toString();
    QString portName = item->data(0, Qt::UserRole + 2).toString();
    if (portName == "") {
        return;
    } else {
        QColorDialog* colorDialog = new QColorDialog(left);
        colorDialog->setOptions(QColorDialog::DontUseNativeDialog);
        if (colorDialog->exec()) {
            portToPlot* p = getPortToPlot(viewName, portName);
            p->color = colorDialog->selectedColor();
            onTreeItemSelected();
            updateCustomPlot();
        }
    }
}
コード例 #18
0
void GameObjectLightComponentWidget::on_m_ColorChangerButton_clicked()
{
	if (!m_IsReady)
	{
		return;
	}

	Light* light = nullptr;

	////////////////////////////////////////
	// Verify LOC and Get Light Object
	light = GetLight();

	if(light == nullptr)
	{
		AETODO("Add log");

		return;
	}

	////////////////////////////////////////
	// Get QColor from Dialog
	QColorDialog qColorDiaglog;

	int result = qColorDiaglog.exec();

	if(result != QDialog::Accepted)
	{
		return;
	}

	QColor qColor = qColorDiaglog.selectedColor();

	////////////////////////////////////////
	// Set Color to Widget
	SetColorToColorWidget(qColor);

	////////////////////////////////////////
	// Set Color to Instance
	Color color = AEQTHelpers::GetColorFromQColor(qColor);

	light->SetColor(color);
}
コード例 #19
0
void ShowPicture::onBtnColorSettingClicked()
{
    QColorDialog* colorDlg = new QColorDialog;
    colorDlg->exec();
    QColor selectColor = colorDlg->selectedColor();
}