Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Add more `FIXME QT6` comments to make it easier to fix leftovers later

Dmitry Kazakov5a533fee8448
diff --git a/libs/ui/dialogs/kis_dlg_preferences.cc b/libs/ui/dialogs/kis_dlg_preferences.cc
index 8be178ee70..f00cf3bdbd 100644
--- a/libs/ui/dialogs/kis_dlg_preferences.cc
+++ b/libs/ui/dialogs/kis_dlg_preferences.cc
@@ -1947,7 +1947,7 @@ DisplaySettingsTab::DisplaySettingsTab(QWidget *parent, const char *name)
QSurfaceFormat::ColorSpace colorSpace = currentFormat.colorSpace();
lblCurrentRootSurfaceFormat->setText(colorSpaceString(colorSpace, currentFormat.redBufferSize()));
#else
- // FIXME: find a way to get the namedcolorspace field out of QColorSpace.
+ // FIXME QT6: find a way to get the namedcolorspace field out of QColorSpace.
QColorSpace colorspace = currentFormat.colorSpace();
lblCurrentRootSurfaceFormat->setText(colorspace.description());
#endif
diff --git a/libs/ui/opengl/KisOpenGLModeProber.cpp b/libs/ui/opengl/KisOpenGLModeProber.cpp
index 9320cb5e90..0dd407e968 100644
--- a/libs/ui/opengl/KisOpenGLModeProber.cpp
+++ b/libs/ui/opengl/KisOpenGLModeProber.cpp
@@ -64,7 +64,7 @@ const KoColorProfile *KisOpenGLModeProber::rootSurfaceColorProfile() const
const QColorSpace surfaceColorSpace = surfaceformatInUse().colorSpace();
if (surfaceColorSpace == QColorSpace(QColorSpace::NamedColorSpace::SRgb)) {
// use the default one!
-// XXX: Fix this when fixing HDR!!!
+// FIXME QT6: Fix this when fixing HDR!!!
// #ifdef HAVE_HDR
// } else if (surfaceColorSpace == QSurfaceFormat::ColorSpace::scRGBColorSpace) {
// profile = KoColorSpaceRegistry::instance()->p709G10Profile();
diff --git a/libs/ui/utils/KisDitherUtil.cpp b/libs/ui/utils/KisDitherUtil.cpp
index f04f401b6f..b86ef4074f 100644
--- a/libs/ui/utils/KisDitherUtil.cpp
+++ b/libs/ui/utils/KisDitherUtil.cpp
@@ -32,16 +32,20 @@ void KisDitherUtil::setPattern(const QString &md5sum, const QString &patternName
if (m_pattern && m_thresholdMode == ThresholdMode::Pattern && m_patternValueMode == PatternValueMode::Auto) {
// Automatically pick between lightness-based and alpha-based patterns by whichever has maximum range
- qreal lightnessMin = 1.0, lightnessMax = 0.0;
- qreal alphaMin = 1.0, alphaMax = 0.0;
+
+ // FIXME QT6: remove after we derecate Qt5 (and use float all the time)
+ using float_type = decltype(std::declval<QColor>().alphaF());
+
+ float_type lightnessMin = 1.0, lightnessMax = 0.0;
+ float_type alphaMin = 1.0, alphaMax = 0.0;
const QImage &image = m_pattern->pattern();
for (int y = 0; y < image.height(); ++y) {
for (int x = 0; x < image.width(); ++x) {
const QColor pixel = image.pixelColor(x, y);
- lightnessMin = std::min(lightnessMin, (qreal)pixel.lightnessF());
- lightnessMax = std::max(lightnessMax, (qreal)pixel.lightnessF());
- alphaMin = std::min(alphaMin, (qreal)pixel.alphaF());
- alphaMax = std::max(alphaMax, (qreal)pixel.alphaF());
+ lightnessMin = std::min(lightnessMin, pixel.lightnessF());
+ lightnessMax = std::max(lightnessMax, pixel.lightnessF());
+ alphaMin = std::min(alphaMin, pixel.alphaF());
+ alphaMax = std::max(alphaMax, pixel.alphaF());
}
}
m_patternUseAlpha = (alphaMax - alphaMin > lightnessMax - lightnessMin);