forked from qt-creator/qt-creator
Avoid compiler warnings about truncation from double to float
They appeared when compiling against Qt 6 Change-Id: I6bb94168f9776a7fa416d51ff4bb3ca32c9f02fc Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -492,7 +492,7 @@ static void drawPrimitiveTweakedForDarkTheme(QStyle::PrimitiveElement element,
|
|||||||
QPen outline(indicatorColor, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
|
QPen outline(indicatorColor, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
|
||||||
painter->setPen(outline);
|
painter->setPen(outline);
|
||||||
QColor fill(frameColor);
|
QColor fill(frameColor);
|
||||||
fill.setAlphaF(0.8);
|
fill.setAlphaF(0.8f);
|
||||||
painter->setBrush(fill);
|
painter->setBrush(fill);
|
||||||
const double o = 3.5;
|
const double o = 3.5;
|
||||||
painter->drawRect(QRectF(option->rect).adjusted(o, o, -o, -o));
|
painter->drawRect(QRectF(option->rect).adjusted(o, o, -o, -o));
|
||||||
@@ -675,9 +675,9 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
|||||||
}
|
}
|
||||||
if (option->state & State_HasFocus && (option->state & State_KeyboardFocusChange)) {
|
if (option->state & State_HasFocus && (option->state & State_KeyboardFocusChange)) {
|
||||||
QColor highlight = option->palette.highlight().color();
|
QColor highlight = option->palette.highlight().color();
|
||||||
highlight.setAlphaF(0.4);
|
highlight.setAlphaF(0.4f);
|
||||||
painter->setPen(QPen(highlight.lighter(), 1));
|
painter->setPen(QPen(highlight.lighter(), 1));
|
||||||
highlight.setAlphaF(0.3);
|
highlight.setAlphaF(0.3f);
|
||||||
painter->setBrush(highlight);
|
painter->setBrush(highlight);
|
||||||
painter->setRenderHint(QPainter::Antialiasing);
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
const QRectF rect = option->rect;
|
const QRectF rect = option->rect;
|
||||||
@@ -743,10 +743,10 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
|||||||
|
|
||||||
painter->setPen(Qt::NoPen);
|
painter->setPen(Qt::NoPen);
|
||||||
QColor dark = StyleHelper::borderColor();
|
QColor dark = StyleHelper::borderColor();
|
||||||
dark.setAlphaF(0.4);
|
dark.setAlphaF(0.4f);
|
||||||
|
|
||||||
QColor light = StyleHelper::baseColor();
|
QColor light = StyleHelper::baseColor();
|
||||||
light.setAlphaF(0.4);
|
light.setAlphaF(0.4f);
|
||||||
|
|
||||||
painter->fillPath(path, light);
|
painter->fillPath(path, light);
|
||||||
painter->save();
|
painter->save();
|
||||||
@@ -908,7 +908,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
|||||||
case CE_SizeGrip: {
|
case CE_SizeGrip: {
|
||||||
painter->save();
|
painter->save();
|
||||||
QColor dark = Qt::white;
|
QColor dark = Qt::white;
|
||||||
dark.setAlphaF(0.1);
|
dark.setAlphaF(0.1f);
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
option->rect.getRect(&x, &y, &w, &h);
|
option->rect.getRect(&x, &y, &w, &h);
|
||||||
int sw = qMin(h, w);
|
int sw = qMin(h, w);
|
||||||
|
@@ -169,13 +169,13 @@ private: // functions
|
|||||||
QColor highlightBrushColor() const
|
QColor highlightBrushColor() const
|
||||||
{
|
{
|
||||||
QColor color = Theme::getColor(Theme::Color::DSnavigatorDropIndicatorBackground);
|
QColor color = Theme::getColor(Theme::Color::DSnavigatorDropIndicatorBackground);
|
||||||
color.setAlphaF(0.7);
|
color.setAlphaF(0.7f);
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
QColor highlightLineColor() const
|
QColor highlightLineColor() const
|
||||||
{
|
{
|
||||||
QColor color = Theme::getColor(Theme::Color::DSnavigatorDropIndicatorOutline);
|
QColor color = Theme::getColor(Theme::Color::DSnavigatorDropIndicatorOutline);
|
||||||
color.setAlphaF(0.7);
|
color.setAlphaF(0.7f);
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -504,7 +504,7 @@ AnnotationColors &AnnotationColors::getAnnotationColors(const QColor &markColor,
|
|||||||
: highClipHsl(backgroundLightness + 0.5);
|
: highClipHsl(backgroundLightness + 0.5);
|
||||||
|
|
||||||
colors.rectColor = markColor;
|
colors.rectColor = markColor;
|
||||||
colors.rectColor.setAlphaF(0.15);
|
colors.rectColor.setAlphaF(0.15f);
|
||||||
|
|
||||||
colors.textColor.setHslF(markColor.hslHueF(),
|
colors.textColor.setHslF(markColor.hslHueF(),
|
||||||
markColor.hslSaturationF(),
|
markColor.hslSaturationF(),
|
||||||
|
Reference in New Issue
Block a user