本文整理汇总了C++中QListWidgetItem::foreground方法的典型用法代码示例。如果您正苦于以下问题:C++ QListWidgetItem::foreground方法的具体用法?C++ QListWidgetItem::foreground怎么用?C++ QListWidgetItem::foreground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListWidgetItem
的用法示例。
在下文中一共展示了QListWidgetItem::foreground方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save
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();
}
示例2: on_colorChanged
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 );
}
}
示例3: refreshSyntaxFont
/**
* 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());
}
示例4: on_pushButtonUndo_clicked
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);
}
示例5: create_header_item
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;
}