Fix conversion warnings when setting alpha to QColor

Adapt to 5bb4baae03.

Change-Id: Id65f87740f9de8e0d3624ff63c431dcad642f3a5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
bb10
Friedemann Kleint 2020-09-15 05:46:57 +02:00
parent 6ca50b79bc
commit 978a43ad4d
4 changed files with 4 additions and 4 deletions

View File

@ -1017,7 +1017,7 @@ QPixmap QItemDelegate::selectedPixmap(const QPixmap &pixmap, const QPalette &pal
QColor color = palette.color(enabled ? QPalette::Normal : QPalette::Disabled,
QPalette::Highlight);
color.setAlphaF((qreal)0.3);
color.setAlphaF(0.3f);
QPainter painter(&img);
painter.setCompositionMode(QPainter::CompositionMode_SourceAtop);

View File

@ -5388,7 +5388,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
#endif
QPainter p(q);
QColor tint = q->palette().window().color();
tint.setAlphaF(qreal(.6));
tint.setAlphaF(.6f);
p.fillRect(toBePainted.boundingRect(), tint);
#ifndef QT_NO_OPENGL
endBackingStorePainting();

View File

@ -6435,7 +6435,7 @@ QPixmap QCommonStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &p
case QIcon::Selected: {
QImage img = pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
QColor color = opt->palette.color(QPalette::Normal, QPalette::Highlight);
color.setAlphaF(qreal(0.3));
color.setAlphaF(0.3f);
QPainter painter(&img);
painter.setCompositionMode(QPainter::CompositionMode_SourceAtop);
painter.fillRect(0, 0, img.width(), img.height(), color);

View File

@ -348,7 +348,7 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter)
QPointF dp = calcRadialPos(option, qreal(0.70));
buttonColor = buttonColor.lighter(104);
buttonColor.setAlphaF(qreal(0.8));
buttonColor.setAlphaF(0.8f);
const qreal ds = r/qreal(7.0);
QRectF dialRect(dp.x() - ds, dp.y() - ds, 2*ds, 2*ds);
QRadialGradient dialGradient(dialRect.center().x() + dialRect.width()/2,