void ConfigDialog::save() { Config::editorAutoSave = edAutoSaveCheckBox->isChecked(); Config::editorEncoding = encodingComboBox->currentText().toLower(); Config::editorFont = editorFontCombo->currentFont(); Config::editorSemantic = editorSemanticCheckBox->isChecked(); Config::editorTabSize = tabsizeSpin->value(); if (compGroubBox->isEnabled()) { Config::compCharCount = acSpinBox->value(); } else { Config::compCharCount = -1; } // Write syntax highlighting preferences QStringListIterator it(Config::shGroupList); QString name; QListWidgetItem *item; for (int i=0; it.hasNext(); i++) { name = it.next(); item = shListWidget->item( i ); Config::shFormat[name].setFontWeight( item->font().weight() ); Config::shFormat[name].setFontItalic( item->font().italic() ); Config::shColor[name] = item->foreground().color(); } Config::save(); }
void CurveColorPick::on_colorChanged(QColor color) { QListWidgetItem *item = ui->listWidget->currentItem(); if( color != item->foreground().color()) { _any_modified = true; item->setForeground( color ); emit changeColor( item->text(), color ); } }
/** * Set the parameters with the current font */ void ConfigDialog::refreshSyntaxFont(int index) { if (index == -1 && index >= Config::shGroupList.size()) { return; } QListWidgetItem *item = shListWidget->item(index); QFont font = item->font(); QColor color = item->foreground().color(); shColorButton->setColor(color); shBoldButton->setChecked(font.weight() == QFont::Bold); shItalicButton->setChecked(font.italic()); }
void CurveColorPick::on_pushButtonUndo_clicked() { for(int row = 0; row < ui->listWidget->count(); row++) { QListWidgetItem *item = ui->listWidget->item(row); const std::string name = item->text().toStdString(); const QColor& color = _mapped_colors.find(name)->second; item->setForeground( color ); emit changeColor( item->text(), color ); } QListWidgetItem *item = ui->listWidget->currentItem(); QColor current_color = item->foreground().color(); _color_wheel->setColor(current_color); }
static QListWidgetItem* create_header_item(const char *pcTitle) { QListWidgetItem *pHeaderItem = new QListWidgetItem(pcTitle); pHeaderItem->setTextAlignment(Qt::AlignHCenter); QFont fontHeader = pHeaderItem->font(); fontHeader.setBold(1); pHeaderItem->setFont(fontHeader); QBrush brushHeader = pHeaderItem->foreground(); brushHeader.setColor(QColor(0xff, 0xff, 0xff)); pHeaderItem->setForeground(brushHeader); pHeaderItem->setData(Qt::UserRole, 1000); pHeaderItem->setBackgroundColor(QColor(0x65, 0x65, 0x65)); return pHeaderItem; }