mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: prevent distracing conversion warnings
We do want the -Wfloat-conversion warnings where they point out potential bugs. But they are very distracting when they are triggered by floating point literals (which the standard defines as double) passed to a function expecting float arguments. The fact that Qt6 changes the arguments to all these functions from double to float is... hard to explain, but it is what it is. With these changes, for the majority of cases we create inlined helpers that conditionally compile to do the right thing. And in a handful of other cases we simply cast to float (and accept that on Qt5 this then gets cast back to double... for none of these cases the potential loss in precision makes any difference, anyway - which likely is why the Qt community made the decision to change the type of the arguments in the first place). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
81ed23583e
commit
59fe2f3d7e
6 changed files with 84 additions and 66 deletions
|
@ -2,6 +2,7 @@
|
|||
#include "divepixmapcache.h"
|
||||
#include "core/metrics.h"
|
||||
#include "core/qthelper.h" // for renderSVGIconWidth
|
||||
#include "core/color.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
@ -49,7 +50,7 @@ DivePixmaps::DivePixmaps(int dpr) : dpr(dpr)
|
|||
// The transparen pixmap is a very obscure feature to enable tooltips without showing a pixmap.
|
||||
// See code in diveeventitem.cpp. This should probably be replaced by a different mechanism.
|
||||
QPixmap transparentPixmap(lrint(4 * dprf), lrint(20 * dprf));
|
||||
transparentPixmap.fill(QColor::fromRgbF(1.0, 1.0, 1.0, 0.01));
|
||||
transparentPixmap.fill(makeColor(1.0, 1.0, 1.0, 0.01));
|
||||
}
|
||||
|
||||
static std::vector<std::shared_ptr<const DivePixmaps>> cache;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue