void SpeedoMeter
::drawScaleContents(QPainter *painter,
const QPoint ¢er,
int radius
) const {
QRect rect
(0,
0,
2 * radius,
2 * radius
- 10);
#if QT_VERSION < 0x040000
colorGroup().text();
#else
#endif
painter->setPen(color);
const int flags = Qt::AlignBottom | Qt::AlignHCenter;
rect.
moveCenter(QPoint(center.
x()+radius
*.7,center.
y()-radius
));
painter->drawText(rect, flags, d_label);
gradient.
setColorAt(0,
QColor::fromRgbF(0,
1,
0,
1));
gradient.
setColorAt(1,
QColor::fromRgbF(0,
0,
0,
0));
painter->setBrush(gradient);
painter->setBackground(brush);
painter->setBackgroundMode(Qt::OpaqueMode);
}
void SpeedoMeter::drawScaleContents(QPainter *painter,
const QPoint ¢er, int radius) const
{
QRect rect(0, 0, 2 * radius, 2 * radius - 10);
const QColor color =
#if QT_VERSION < 0x040000
colorGroup().text();
#else
palette().color(QPalette::Text);
#endif
painter->setPen(color);
const int flags = Qt::AlignBottom | Qt::AlignHCenter;
rect.moveCenter(QPoint(center.x()+radius*.7,center.y()-radius));
painter->drawText(rect, flags, d_label);
QRadialGradient gradient(50, 50, 50, 50, 50);
gradient.setColorAt(0, QColor::fromRgbF(0, 1, 0, 1));
gradient.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0));
QBrush brush(gradient);
painter->setBrush(gradient);
painter->setBackground(brush);
painter->setBackgroundMode(Qt::OpaqueMode);
}
To copy to clipboard, switch view to plain text mode
Any help would be appreciated.
Bookmarks