本文整理汇总了C++中QColorGroup::setColor方法的典型用法代码示例。如果您正苦于以下问题:C++ QColorGroup::setColor方法的具体用法?C++ QColorGroup::setColor怎么用?C++ QColorGroup::setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QColorGroup
的用法示例。
在下文中一共展示了QColorGroup::setColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintCell
void GCUserViewGroupItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int alignment)
{
QColorGroup xcg = cg;
QFont f = p->font();
f.setPointSize(common_smallFontSize);
p->setFont(f);
xcg.setColor(QColorGroup::Text, PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.grouping.header-foreground").value<QColor>());
if (!PsiOptions::instance()->getOption("options.ui.look.contactlist.use-slim-group-headings").toBool()) {
#if QT_VERSION < 0x040301
xcg.setColor(QColorGroup::Background, PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.grouping.header-background").value<QColor>());
#else
xcg.setColor(QColorGroup::Base, PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.grouping.header-background").value<QColor>());
#endif
}
Q3ListViewItem::paintCell(p, xcg, column, width, alignment);
if (PsiOptions::instance()->getOption("options.ui.look.contactlist.use-slim-group-headings").toBool() && !isSelected()) {
QFontMetrics fm(p->font());
int x = fm.width(text(column)) + 8;
if(x < width - 8) {
int h = (height() / 2) - 1;
p->setPen(QPen(PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.grouping.header-background").value<QColor>()));
p->drawLine(x, h, width - 8, h);
h++;
p->setPen(QPen(PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.grouping.header-foreground").value<QColor>()));
p->drawLine(x, h, width - 8, h);
}
}
}
示例2: QMainWindow
IsometryWindow::IsometryWindow( int u, Organizer *organ, vector <ManifoldInterface *> v)
: QMainWindow(0,0,Qt::WStyle_Tool)
{
setCaption("Compare");
items = v;
o = organ;
upper_bound = u;
box = new QVBox( this );
setCentralWidget( box );
top = new QHBox( box, "top");
blank = new QLabel( "",top, 0 );
blank->setPixmap( compare_xpm );
top->setStretchFactor( blank, 10 );
button = new QPushButton("Compare", top, 0 );
connect( button, SIGNAL( clicked() ),
this, SLOT( sameManifoldSlot() ) );
lists = new QHBox( box, "lists" );
list1 = new QListBox( lists );
QPalette p = list1->palette();
QColorGroup cg = p.active();
cg.setColor(QColorGroup::Base, BASE );
cg.setColor(QColorGroup::Text, TEXT );
cg.setColor(QColorGroup::Highlight, HIGHLIGHT );
p.setBrush(QColorGroup::Text, TEXT );
p.setBrush(QColorGroup::Base, BASE );
p.setActive(cg);
list1->setPalette(p);
list2 = new QListBox( lists );
p = list1->palette();
cg = p.active();
cg.setColor(QColorGroup::Base, BASE );
cg.setColor(QColorGroup::Text, TEXT );
cg.setColor(QColorGroup::Highlight, HIGHLIGHT );
p.setBrush(QColorGroup::Text, TEXT );
p.setBrush(QColorGroup::Base, BASE );
p.setActive(cg);
list2->setPalette(p);
buttonGroup = new QHButtonGroup( "Random matching:", box, "buttonGroup");
checkBox = new QCheckBox("Use",buttonGroup, "checkBox");
slider = new QSlider( 1, 1000, 100, 0, Qt::Horizontal, buttonGroup, "slider" );
setMinimumWidth( 225 );
setMaximumWidth( 500 );
setMinimumHeight( 100 );
setMaximumHeight( 500 );
setGeometry(0,353,250,180);
}
示例3: polish
/*!
Reimplementation from QStyle
*/
void MetalStyle::polish( QApplication *app)
{
oldPalette = app->palette();
// we simply create a nice QColorGroup with a couple of fancy
// pixmaps here and apply to it all widgets
QFont f("times", app->font().pointSize() );
f.setBold( TRUE );
f.setItalic( TRUE );
app->setFont( f, TRUE, "QMenuBar");
app->setFont( f, TRUE, "QPopupMenu");
// QPixmap button( stonedark_xpm );
QColor gold("#B9B9A5A54040"); //same as topgrad below
QPixmap button( 1, 1 ); button.fill( gold );
QPixmap background(marble_xpm);
QPixmap dark( 1, 1 ); dark.fill( red.dark() );
QPixmap mid( stone1_xpm );
QPixmap light( stone1_xpm );//1, 1 ); light.fill( green );
QPalette op = app->palette();
QColor backCol( 227,227,227 );
// QPalette op(white);
QColorGroup active (op.active().foreground(),
QBrush(op.active().button(),button),
QBrush(op.active().light(), light),
QBrush(op.active().dark(), dark),
QBrush(op.active().mid(), mid),
op.active().text(),
Qt::white,
op.active().base(),// QColor(236,182,120),
QBrush(backCol, background)
);
active.setColor( QColorGroup::ButtonText, Qt::white );
active.setColor( QColorGroup::Shadow, Qt::black );
QColorGroup disabled (op.disabled().foreground(),
QBrush(op.disabled().button(),button),
QBrush(op.disabled().light(), light),
op.disabled().dark(),
QBrush(op.disabled().mid(), mid),
op.disabled().text(),
Qt::white,
op.disabled().base(),// QColor(236,182,120),
QBrush(backCol, background)
);
QPalette newPalette( active, disabled, active );
app->setPalette( newPalette, TRUE );
}
示例4: FLAccessControl
FLAccessControlForm::FLAccessControlForm() : FLAccessControl() {
QColorGroup cg;
QColor bg = qApp->palette().color( QPalette::Active, QColorGroup::Background );
cg.setColor( QColorGroup::Foreground, bg );
cg.setColor( QColorGroup::Text, bg );
cg.setColor( QColorGroup::ButtonText, bg );
cg.setColor( QColorGroup::Base, bg );
cg.setColor( QColorGroup::Background, bg );
pal.setDisabled( cg );
}
示例5: QWidget
DiskInfoWidget::DiskInfoWidget(QWidget *parent, const char *name, ConfigDialogImpl *config, bool init)
: QWidget(parent, name)
{
_config = config;
connect(&mDiskList , SIGNAL(readDFDone() ), this, SLOT (updateDFDone()) );
connect(&mDiskList , SIGNAL(criticallyFull(DiskEntry*)), this, SLOT (criticallyFull(DiskEntry*)) );
mTabProp.resize(8);
mTabProp[0] = new CTabEntry( "Icon", i18n("Icon"), false, 0);
mTabProp[1] = new CTabEntry( "Device", i18n("Device"), false, 0);
mTabProp[2] = new CTabEntry( "Type", i18n("Type"), false, 0);
mTabProp[3] = new CTabEntry( "Size", i18n("Size"), false, 0);
mTabProp[4] = new CTabEntry( "MountPoint", i18n("Mount Point"), true, 90 );
mTabProp[5] = new CTabEntry( "Free", i18n("Free"), false, 0);
// xgettext:no-c-format
mTabProp[6] = new CTabEntry( "Full%", i18n("Full %"), false, 0);
mTabProp[7] = new CTabEntry( "UsageBar", i18n("Usage"), true, 100);
GUI = !init;
if( GUI )
{
QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 0 );
mList = new CListView( this, "list" );
topLayout->addWidget( mList );
mList->setAllColumnsShowFocus( true );
mList->setFrameStyle( QFrame::WinPanel + QFrame::Sunken );
mList->setShowSortIndicator(true);
QPalette pal;
QColorGroup cg;
cg.setColor( QColorGroup::Button, BACKGROUND );
cg.setColor( QColorGroup::ButtonText, TEXTCOLOR );
cg.setColor( QColorGroup::Base, BACKGROUND );
pal.setActive( cg );
cg.setColor( QColorGroup::Button, BACKGROUND );
cg.setColor( QColorGroup::ButtonText, TEXTCOLOR );
cg.setColor( QColorGroup::Base, BACKGROUND );
pal.setInactive( cg );
cg.setColor( QColorGroup::Button, BACKGROUND );
cg.setColor( QColorGroup::ButtonText, TEXTCOLOR );
cg.setColor( QColorGroup::Base, BACKGROUND );
pal.setDisabled( cg );
mList->setPalette( pal );
// connect( mList,
// SIGNAL( pressed( QListViewItem *, const QPoint &, int )),
// this, SLOT( rightButtonPressed( QListViewItem *, const QPoint &, int )));
// connect( mList,
// SIGNAL( clicked( QListViewItem *, const QPoint &, int )),
// this, SLOT( rightButtonClicked( QListViewItem *, const QPoint &, int )));
connect( mList->header(), SIGNAL(sizeChange(int, int, int)),
this, SLOT(columnSizeChanged(int, int, int)) );
makeColumns();
}
updateDF();
setUpdateFrequency(60);
}
示例6: buildDisabled
void PaletteEditorAdvanced::buildDisabled()
{
QColorGroup cg = editPalette.active();
cg.setColor( QColorGroup::ButtonText, darkGray );
cg.setColor( QColorGroup::Foreground, darkGray );
cg.setColor( QColorGroup::Text, darkGray );
cg.setColor( QColorGroup::HighlightedText, darkGray );
editPalette.setDisabled( cg );
if ( checkBuildEffect->isChecked() )
buildDisabledEffect();
else {
setPreviewPalette( editPalette );
updateColorButtons();
}
}
示例7: mapToDisabledEffectRole
void PaletteEditorAdvanced::mapToDisabledEffectRole( const QColor& c )
{
QColorGroup cg = editPalette.disabled();
cg.setColor( effectFromItem(comboEffect->currentItem()), c );
editPalette.setDisabled( cg );
setPreviewPalette( editPalette );
}
示例8: mapToInactiveEffectRole
void PaletteEditorAdvanced::mapToInactiveEffectRole( const QColor& c )
{
QColorGroup cg = editPalette.inactive();
cg.setColor( effectFromItem(comboEffect->currentItem()), c );
editPalette.setInactive( cg );
setPreviewPalette( editPalette );
}
示例9: mapToDisabledCentralRole
void PaletteEditorAdvanced::mapToDisabledCentralRole( const QColor& c )
{
QColorGroup cg = editPalette.disabled();
cg.setColor( centralFromItem(comboCentral->currentItem()), c );
editPalette.setDisabled( cg );
buildDisabledEffect();
setPreviewPalette( editPalette );
}
示例10: mapToInactiveCentralRole
void PaletteEditorAdvanced::mapToInactiveCentralRole( const QColor& c )
{
QColorGroup cg = editPalette.inactive();
cg.setColor( centralFromItem(comboCentral->currentItem()), c );
editPalette.setInactive( cg );
buildInactiveEffect();
setPreviewPalette( editPalette );
}
示例11: paintCell
void FileListItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align )
{
QColorGroup mcg = cg;
if ( isActive() )
{
mcg.setColor( QColorGroup::Base, Qt::yellow );
}
QListViewItem::paintCell( p, mcg, column, width, align );
}
示例12: paintRegisterCellSetup
bool InvestTransactionDownloaded::paintRegisterCellSetup(QPainter* painter, int& row, int& col, QRect& cellRect, QRect& textRect, QColorGroup& cg, QBrush& brush)
{
bool rc = Transaction::paintRegisterCellSetup(painter, row, col, cellRect, textRect, cg, brush);
// if not selected paint in selected background color
if(!isSelected()) {
cg.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::importedTransactionColor());
brush = QBrush(cg.base());
}
return rc;
}
示例13: paintCell
void paintCell( QPainter * p, const QColorGroup & cg,
int column, int width, int align )
{
if ( !isSelectable() || !isAvailable() ) {
QColorGroup c = cg;
c.setColor(QColorGroup::Text, lightGray);
QCheckListItem::paintCell(p,c,column,width,align);
} else {
QCheckListItem::paintCell(p,cg,column,width,align);
}
}
示例14: mapToActiveEffectRole
void PaletteEditorAdvanced::mapToActiveEffectRole( const QColor& c )
{
QColorGroup cg = editPalette.active();
cg.setColor( effectFromItem(comboEffect->currentItem()), c );
editPalette.setActive( cg );
if(checkBuildInactive->isChecked())
buildInactive();
if(checkBuildDisabled->isChecked())
buildDisabled();
setPreviewPalette( editPalette );
}
示例15: loadColorGroup
/*!
Auxiliary function to load a color group. The colorgroup must not
contain pixmaps.
*/
QColorGroup Uic::loadColorGroup( const QDomElement &e ) {
QColorGroup cg;
int r = -1;
QDomElement n = e.firstChild().toElement();
QColor col;
while ( !n.isNull() ) {
if ( n.tagName() == "color" ) {
r++;
cg.setColor(( QColorGroup::ColorRole )r, ( col = DomTool::readColor( n ) ) );
}
n = n.nextSibling().toElement();
}
return cg;
}