本文整理汇总了C++中QColorGroup::color方法的典型用法代码示例。如果您正苦于以下问题:C++ QColorGroup::color方法的具体用法?C++ QColorGroup::color怎么用?C++ QColorGroup::color使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QColorGroup
的用法示例。
在下文中一共展示了QColorGroup::color方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildDisabledEffect
void PaletteEditorAdvanced::buildDisabledEffect()
{
QColorGroup cg = editPalette.disabled();
QColor light, midlight, mid, dark, shadow;
QColor btn = cg.color( QColorGroup::Button );
light = btn.light(150);
midlight = btn.light(115);
mid = btn.dark(150);
dark = btn.dark();
shadow = Qt::black;
cg.setColor( QColorGroup::Light, light );
cg.setColor( QColorGroup::Midlight, midlight );
cg.setColor( QColorGroup::Mid, mid );
cg.setColor( QColorGroup::Dark, dark );
cg.setColor( QColorGroup::Shadow, shadow );
editPalette.setDisabled( cg );
setPreviewPalette( editPalette );
updateColorButtons();
}
示例2: linearGrad
/** Paint a cell of the ViewItem when in TVS_INPROGRESS state
*
* \param painter The paint where we draw the item
* \param cg The color group we can use to draw
* \param column The index of the column to draw
* \param width The width of the cell
* \param align Not yet used
*
*/
void RainbruRPG::Network::Ftp::TransferVisual::
drawInProgress(QPainter * painter,const QColorGroup & cg, int column,
int width, int align){
// controls
if (ip.isEmpty()){
LOGW("IP address is empty");
}
if (isSelected()){
painter->setPen(Qt::NoPen);
painter->setBrush(cg.color(QPalette::Highlight));
painter->drawRect(0, 0, width, height());
}
QLinearGradient linearGrad(QPointF(0, 0), QPointF(0, height()));
linearGrad.setColorAt(0, QColor( 34, 80, 184));
linearGrad.setColorAt(0.25, QColor(150, 189, 231));
linearGrad.setColorAt(0.50, QColor( 88, 154, 227));
linearGrad.setColorAt(0.75, QColor(150, 189, 231));
linearGrad.setColorAt(1, QColor(127, 205, 255));
QLinearGradient linearGrad2(QPointF(0, 0), QPointF(0, height()));
linearGrad2.setColorAt(0, QColor(163, 163, 163));
linearGrad2.setColorAt(0.25, QColor(231, 231, 231));
linearGrad2.setColorAt(0.50, QColor(217, 217, 217));
linearGrad2.setColorAt(0.75, QColor(244, 244, 244));
linearGrad2.setColorAt(1, QColor(248, 248, 248));
QPen pen(Qt::gray, 1);
if (column==6){
// Progress bar
int totalW=width-4;
int leftW=(int)(totalW*percent)/100;
int rightW=totalW-leftW;
// Drawing ProgressBar
painter->setPen(Qt::NoPen);
painter->setBrush(QBrush(linearGrad));
painter->drawRect( 2, 2, leftW, height()-4 );
painter->setBrush(QBrush(linearGrad2));
painter->drawRect( leftW+2, 2, rightW, height()-4 );
painter->setPen(pen);
painter->setBrush(Qt::NoBrush);
painter->drawRect(0, 0, width-1, height()-1);
QFont f=painter->font();
f.setPointSize(f.pointSize()-1);
painter->setFont(f);
painter->setPen(Qt::black);
QString s=QString::number(percent, 'f', 2);
s+=" %";
painter->drawText( 0, 0, width, height(), Qt::AlignCenter, s );
}
else{
painter->setPen(Qt::black);
QString s;
switch(column){
case 0:
drawIpPort(painter, width, height());
break;
case 1:
// Filename
s=absoluteFilename;
painter->drawText( 0, 0, width, height(),
Qt::AlignLeft|Qt::AlignVCenter, s);
break;
case 2:
// Green or Red arrow
drawArrow(painter, width, height());
break;
case 3:
// Download rate
s=QString::number(rate, 'f', 2);
s+=" kB/s";
painter->drawText( 0, 0, width, height(),
Qt::AlignRight|Qt::AlignVCenter, s);
break;
case 4:
// File size
painter->drawText( 0, 0, width, height(),
Qt::AlignRight|Qt::AlignVCenter, fileSizeToString());
break;
case 5:
// Remaining time
painter->drawText( 0, 0, width, height(),
//.........这里部分代码省略.........