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++

Remove all QT_VERSION_CHECK checks for Qt5

Halla Remptd9b6aab2c4eb
diff --git a/krita/main.cc b/krita/main.cc
index 1c361cec43..61f0384843 100644
--- a/krita/main.cc
+++ b/krita/main.cc
@@ -668,9 +668,7 @@ extern "C" MAIN_EXPORT int MAIN_FN(int argc, char **argv)
// Icons in menus are ugly and distracting
KisApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
}
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
KisApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);
-#endif
app.installEventFilter(KisQtWidgetsTweaker::instance());
if (!args.noSplash()) {
diff --git a/libs/flake/KoShapeManager.cpp b/libs/flake/KoShapeManager.cpp
index 509935a295..a2a177fefc 100644
--- a/libs/flake/KoShapeManager.cpp
+++ b/libs/flake/KoShapeManager.cpp
@@ -497,11 +497,7 @@ void KoShapeManager::preparePaintJobs(PaintJobsOrder &jobsOrder,
rootShapesSet.insert(shape);
}
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
const QList<KoShape*> rootShapes(rootShapesSet.begin(), rootShapesSet.end());
-#else
- const QList<KoShape*> rootShapes = QList<KoShape*>::fromSet(rootShapesSet);
-#endif
QList<KoShape*> newRootShapes;
Q_FOREACH (KoShape *srcShape, rootShapes) {
diff --git a/libs/flake/KoToolManager.cpp b/libs/flake/KoToolManager.cpp
index 93dc5100a4..68dad2ee15 100644
--- a/libs/flake/KoToolManager.cpp
+++ b/libs/flake/KoToolManager.cpp
@@ -521,15 +521,11 @@ void KoToolManager::Private::postSwitchTool()
&& canvasData->activeTool->canvas()->shapeManager()) {
KoSelection *selection = canvasData->activeTool->canvas()->shapeManager()->selection();
Q_ASSERT(selection);
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
QList<KoShape *> shapesDelegatesList = selection->selectedEditableShapesAndDelegates();
if (!shapesDelegatesList.isEmpty()) {
shapesToOperateOn = QSet<KoShape*>(shapesDelegatesList.begin(),
shapesDelegatesList.end());
}
-#else
- shapesToOperateOn = QSet<KoShape*>::fromList(selection->selectedEditableShapesAndDelegates());
-#endif
}
if (canvasData->canvas->canvas()) {
diff --git a/libs/flake/svg/SvgCssHelper.cpp b/libs/flake/svg/SvgCssHelper.cpp
index c1848357b7..117cda2b58 100644
--- a/libs/flake/svg/SvgCssHelper.cpp
+++ b/libs/flake/svg/SvgCssHelper.cpp
@@ -146,11 +146,7 @@ public:
break;
case InList:
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList tokens = e.attribute(m_attribute).split(' ', Qt::SkipEmptyParts);
-#else
- QStringList tokens = e.attribute(m_attribute).split(' ', QString::SkipEmptyParts);
-#endif
return tokens.contains(m_value);
}
break;
@@ -502,11 +498,7 @@ public:
{
SelectorGroup group;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList selectors = pattern.split(',', Qt::SkipEmptyParts);
-#else
- QStringList selectors = pattern.split(',', QString::SkipEmptyParts);
-#endif
for (int i = 0; i < selectors.count(); ++i ) {
CssSelectorBase * selector = compileSelector(selectors[i].simplified());
if (selector)
@@ -640,11 +632,7 @@ void SvgCssHelper::parseStylesheet(const QDomElement &e)
commentExp.removeIn(data);
#endif
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList defs = data.split('}', Qt::SkipEmptyParts);
-#else
- QStringList defs = data.split('}', QString::SkipEmptyParts);
-#endif
for (int i = 0; i < defs.count(); ++i) {
QStringList def = defs[i].split('{');
if( def.count() != 2 )
@@ -655,11 +643,7 @@ void SvgCssHelper::parseStylesheet(const QDomElement &e)
QString style = def[1].simplified();
if (style.isEmpty())
break;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList selectors = pattern.split(',', Qt::SkipEmptyParts);
-#else
- QStringList selectors = pattern.split(',', QString::SkipEmptyParts);
-#endif
for (int i = 0; i < selectors.count(); ++i ) {
QString selector = selectors[i].simplified();
d->cssStyles[selector] = style;
diff --git a/libs/flake/svg/SvgStyleParser.cpp b/libs/flake/svg/SvgStyleParser.cpp
index 57f8c7f0a8..e513681822 100644
--- a/libs/flake/svg/SvgStyleParser.cpp
+++ b/libs/flake/svg/SvgStyleParser.cpp
@@ -437,11 +437,7 @@ SvgStyles SvgStyleParser::parseOneCssStyle(const QString &style, const QStringLi
SvgStyles parsedStyles;
if (style.isEmpty()) return parsedStyles;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList substyles = style.simplified().split(';', Qt::SkipEmptyParts);
-#else
- QStringList substyles = style.simplified().split(';', QString::SkipEmptyParts);
-#endif
if (!substyles.count()) return parsedStyles;
for (QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it) {
@@ -487,11 +483,7 @@ SvgStyles SvgStyleParser::collectStyles(const QDomElement &e)
// collect all css style attributes
Q_FOREACH (const QString &style, cssStyles) {
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList substyles = style.split(';', Qt::SkipEmptyParts);
-#else
- QStringList substyles = style.split(';', QString::SkipEmptyParts);
-#endif
if (!substyles.count())
continue;
for (QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it) {
diff --git a/libs/flake/svg/SvgUtil.cpp b/libs/flake/svg/SvgUtil.cpp
index ec4a7b4d4d..05352e22e9 100644
--- a/libs/flake/svg/SvgUtil.cpp
+++ b/libs/flake/svg/SvgUtil.cpp
@@ -446,11 +446,7 @@ QStringList SvgUtil::simplifyList(const QString &str)
attribute.replace(',', ' ');
attribute.remove('\r');
attribute.remove('\n');
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
return attribute.simplified().split(' ', Qt::SkipEmptyParts);
-#else
- return attribute.simplified().split(' ', QString::SkipEmptyParts);
-#endif
}
SvgUtil::PreserveAspectRatioParser::PreserveAspectRatioParser(const QString &str)
diff --git a/libs/flake/text/KoSvgTextProperties.cpp b/libs/flake/text/KoSvgTextProperties.cpp
index 751aca91bd..ef64753216 100644
--- a/libs/flake/text/KoSvgTextProperties.cpp
+++ b/libs/flake/text/KoSvgTextProperties.cpp
@@ -288,11 +288,7 @@ void KoSvgTextProperties::parseSvgTextAttribute(const SvgLoadingContext &context
setProperty(WordSpacingId, QVariant::fromValue(KoSvgText::parseAutoLengthPercentageXY(value, context, "normal", context.currentGC()->currentBoundingBox, true)));
} else if (command == "font-family") {
QStringList familiesList;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
Q_FOREACH (const QString &fam, value.split(',', Qt::SkipEmptyParts)) {
-#else
- Q_FOREACH (const QString &fam, value.split(',', QString::SkipEmptyParts)) {
-#endif
QString family = fam.trimmed();
if ((family.startsWith('\"') && family.endsWith('\"')) ||
(family.startsWith('\'') && family.endsWith('\''))) {
@@ -446,11 +442,7 @@ void KoSvgTextProperties::parseSvgTextAttribute(const SvgLoadingContext &context
QColor textDecorationColor = propertyOrDefault(TextDecorationStyleId).value<QColor>();
bool setPosition = false;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
Q_FOREACH (const QString &param, value.split(' ', Qt::SkipEmptyParts)) {
-#else
- Q_FOREACH (const QString &param, value.split(' ', QString::SkipEmptyParts)) {
-#endif
if (param == "line-through") {
deco |= DecorationLineThrough;
} else if (param == "underline") {
@@ -542,11 +534,7 @@ void KoSvgTextProperties::parseSvgTextAttribute(const SvgLoadingContext &context
setProperty(TextIndentId, QVariant::fromValue(KoSvgText::parseTextIndent(value, context)));
} else if (command == "hanging-punctuation") {
KoSvgText::HangingPunctuations hang;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
Q_FOREACH (const QString &param, value.split(' ', Qt::SkipEmptyParts)) {
-#else
- Q_FOREACH (const QString &param, value.split(' ', QString::SkipEmptyParts)) {
-#endif
if (param == "first") {
hang.setFlag(KoSvgText::HangFirst, true);
} else if (param == "last") {
diff --git a/libs/flake/text/KoSvgTextShapeLayoutFunc_inShape.cpp b/libs/flake/text/KoSvgTextShapeLayoutFunc_inShape.cpp
index b8d4b8b71b..e3ddf2992f 100644
--- a/libs/flake/text/KoSvgTextShapeLayoutFunc_inShape.cpp
+++ b/libs/flake/text/KoSvgTextShapeLayoutFunc_inShape.cpp
@@ -46,12 +46,7 @@ getShapes(QList<KoShape *> shapesInside, QList<KoShape *> shapesSubtract, const
subpathPolygons.append(precisionTF.map(subPath).toPolygon());
}
subpathPolygons = KoPolygonUtils::offsetPolygons(subpathPolygons, shapeMargin);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
p.clear();
-#else
- p = QPainterPath();
-#endif
-
Q_FOREACH (const QPolygon poly, subpathPolygons) {
p.addPolygon(poly);
}
@@ -165,11 +160,7 @@ static bool getFirstPosition(QPointF &firstPoint,
for (int j=i; j< offsetPoly.size(); j++){
QLineF line2 = offsetPoly.at(j);
QPointF intersectPoint;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
- QLineF::IntersectType intersect = line.intersects(line2, &intersectPoint);
-#else
QLineF::IntersectType intersect = line.intersects(line2, &intersectPoint);
-#endif
if (intersect != QLineF::NoIntersection) {
// should proly handle 'reflex' vertices better.
if (!p.contains(intersectPoint)) {
diff --git a/libs/flake/tools/KoPathTool.cpp b/libs/flake/tools/KoPathTool.cpp
index e0a3ad58b4..cb367b88b1 100644
--- a/libs/flake/tools/KoPathTool.cpp
+++ b/libs/flake/tools/KoPathTool.cpp
@@ -878,11 +878,7 @@ void KoPathTool::activate(const QSet<KoShape*> &shapes)
m_canvasConnections.addConnection(d->canvas->selectedShapesProxy(), SIGNAL(selectionChanged()), this, SLOT(repaintDecorations()));
m_canvasConnections.addConnection(d->canvas->selectedShapesProxy(), SIGNAL(selectionContentChanged()), this, SLOT(repaintDecorations()));
m_shapeFillResourceConnector.connectToCanvas(d->canvas);
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
initializeWithShapes(QList<KoShape*>(shapes.begin(), shapes.end()));
-#else
- initializeWithShapes(QList<KoShape*>::fromSet(shapes));
-#endif
connect(m_actionCurvePoint, SIGNAL(triggered()), this, SLOT(pointToCurve()), Qt::UniqueConnection);
connect(m_actionLinePoint, SIGNAL(triggered()), this, SLOT(pointToLine()), Qt::UniqueConnection);
connect(m_actionLineSegment, SIGNAL(triggered()), this, SLOT(segmentToLine()), Qt::UniqueConnection);
@@ -1112,11 +1108,7 @@ void KoPathTool::pointSelectionChanged()
{
Q_D(KoToolBase);
updateActions();
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
d->canvas->snapGuide()->setIgnoredPathPoints(QList<KoPathPoint*>(m_pointSelection.selectedPoints().begin(), m_pointSelection.selectedPoints().end()));
-#else
- d->canvas->snapGuide()->setIgnoredPathPoints(QList<KoPathPoint*>::fromSet(m_pointSelection.selectedPoints()));
-#endif
Q_EMIT selectionChanged(m_pointSelection.hasSelection());
}
diff --git a/libs/image/brushengine/kis_locked_properties_proxy.cpp b/libs/image/brushengine/kis_locked_properties_proxy.cpp
index 4e29e44ce0..8c65f36741 100644
--- a/libs/image/brushengine/kis_locked_properties_proxy.cpp
+++ b/libs/image/brushengine/kis_locked_properties_proxy.cpp
@@ -108,20 +108,11 @@ QList<QString> KisLockedPropertiesProxy::getPropertiesKeys() const
QList<QString> result = m_parent->getPropertiesKeys();
if (m_lockedProperties->lockedProperties() && !m_lockedProperties->lockedProperties()->getPropertiesKeys().isEmpty()) {
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
QSet<QString> properties(result.begin(), result.end());
auto lockedPropertiesKeys = m_lockedProperties->lockedProperties()->getPropertiesKeys();
QSet<QString> lockedProperties(lockedPropertiesKeys.begin(), lockedPropertiesKeys.end());
-#else
- QSet<QString> properties = QSet<QString>::fromList(result);
- QSet<QString> lockedProperties = QSet<QString>::fromList(m_lockedProperties->lockedProperties()->getPropertiesKeys());
-#endif
properties += lockedProperties;
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
result = QList<QString>(properties.begin(), properties.end()) ;
-#else
- result = QList<QString>::fromSet(properties);
-#endif
}
return result;
diff --git a/libs/image/kis_fixed_paint_device.cpp b/libs/image/kis_fixed_paint_device.cpp
index 241bacc56a..0b3bc2ad3a 100644
--- a/libs/image/kis_fixed_paint_device.cpp
+++ b/libs/image/kis_fixed_paint_device.cpp
@@ -163,11 +163,7 @@ void KisFixedPaintDevice::convertFromQImage(const QImage& _image, const QString
// Don't convert if not no profile is given and both paint dev and qimage are rgba.
if (srcProfileName.isEmpty() && colorSpace()->id() == "RGBA") {
-#if QT_VERSION >= QT_VERSION_CHECK(5,10,0)
memcpy(data(), image.constBits(), image.sizeInBytes());
-#else
- memcpy(data(), image.constBits(), image.byteCount());
-#endif
} else {
KoColorSpaceRegistry::instance()
->colorSpace( RGBAColorModelID.id(), Integer8BitsColorDepthID.id(), srcProfileName)
diff --git a/libs/image/kis_image.cc b/libs/image/kis_image.cc
index 9134734444..a94bf55e41 100644
--- a/libs/image/kis_image.cc
+++ b/libs/image/kis_image.cc
@@ -382,18 +382,14 @@ KisImageSP KisImage::fromQImage(const QImage &image, KisUndoStore *undoStore)
case QImage::Format_Grayscale8:
colorSpace = KoColorSpaceRegistry::instance()->graya8();
break;
-#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
case QImage::Format_Grayscale16:
colorSpace = KoColorSpaceRegistry::instance()->graya16();
break;
-#endif
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
case QImage::Format_RGBX64:
case QImage::Format_RGBA64:
case QImage::Format_RGBA64_Premultiplied:
colorSpace = KoColorSpaceRegistry::instance()->colorSpace(RGBAColorModelID.id(), Float32BitsColorDepthID.id(), 0);
break;
-#endif
default:
colorSpace = 0;
}
diff --git a/libs/image/kis_layer_utils.cpp b/libs/image/kis_layer_utils.cpp
index f5f3fcc829..3b606a913b 100644
--- a/libs/image/kis_layer_utils.cpp
+++ b/libs/image/kis_layer_utils.cpp
@@ -1143,20 +1143,12 @@ namespace Private {
}
}
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
nodesToRemove += KisNodeList(extraNodesToRemove.begin(), extraNodesToRemove.end());
-#else
- nodesToRemove += extraNodesToRemove.toList();
-#endif
KritaUtils::filterContainer<KisNodeList>(nodesToRemove,
[nodesToHide](KisNodeSP node) {
return !nodesToHide.contains(node);
});
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
_nodesToHide = KisNodeList(nodesToHide.begin(), nodesToHide.end());
-#else
- _nodesToHide = nodesToHide.toList();
-#endif
}
struct CleanUpNodes : private RemoveNodeHelper, public KisCommandUtils::AggregateCommand {
diff --git a/libs/image/kis_raster_keyframe_channel.cpp b/libs/image/kis_raster_keyframe_channel.cpp
index dd87368c3b..c66aca8034 100644
--- a/libs/image/kis_raster_keyframe_channel.cpp
+++ b/libs/image/kis_raster_keyframe_channel.cpp
@@ -290,11 +290,7 @@ QSet<int> KisRasterKeyframeChannel::clonesOf(int time)
}
QList<int> values = m_d->frameIDTimesMap.values(rasterKey->frameID());
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
QSet<int> clones = QSet<int>(values.cbegin(), values.cend());
-#else
- QSet<int> clones = QSet<int>::fromList(values);
-#endif
clones.remove(time); // Clones only! Remove input time from the list.
return clones;
}
@@ -304,11 +300,7 @@ QSet<int> KisRasterKeyframeChannel::timesForFrameID(int frameID) const
QSet<int> clones;
if (m_d->frameIDTimesMap.contains(frameID)) {
QList<int> values = m_d->frameIDTimesMap.values(frameID);
- #if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
clones = QSet<int>(values.cbegin(), values.cend());
- #else
- clones = QSet<int>::fromList(values);
- #endif
}
return clones;
}
diff --git a/libs/image/tests/kis_pattern_test.cpp b/libs/image/tests/kis_pattern_test.cpp
index 89530b8433..c990ceb9b0 100644
--- a/libs/image/tests/kis_pattern_test.cpp
+++ b/libs/image/tests/kis_pattern_test.cpp
@@ -53,18 +53,10 @@ void KoPatternTest::testRoundTripMd5()
QImage im2 = patPattern.pattern().convertToFormat(QImage::Format_ARGB32);
QCryptographicHash h1(QCryptographicHash::Md5);
-#if QT_VERSION >= QT_VERSION_CHECK(5,10,0)
h1.addData(QByteArray::fromRawData((const char*)im1.constBits(), im1.sizeInBytes()));
-#else
- h1.addData(QByteArray::fromRawData((const char*)im1.constBits(), im1.byteCount()));
-#endif
QCryptographicHash h2(QCryptographicHash::Md5);
-#if QT_VERSION >= QT_VERSION_CHECK(5,10,0)
h2.addData(QByteArray::fromRawData((const char*)im2.constBits(), im2.sizeInBytes()));
-#else
- h2.addData(QByteArray::fromRawData((const char*)im2.constBits(), im2.byteCount()));
-#endif
// Compares the images: they should be the same
QCOMPARE(h1.result(), h2.result());
diff --git a/libs/libkis/Krita.cpp b/libs/libkis/Krita.cpp
index f499d6b350..058be6467f 100644
--- a/libs/libkis/Krita.cpp
+++ b/libs/libkis/Krita.cpp
@@ -173,11 +173,7 @@ QStringList Krita::colorModels() const
Q_FOREACH(KoID id, ids) {
colorModelsIds << id.id();
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
return QStringList(colorModelsIds.begin(), colorModelsIds.end());
-#else
- return QStringList::fromSet(colorModelsIds);
-#endif
}
QStringList Krita::colorDepths(const QString &colorModel) const
@@ -187,11 +183,7 @@ QStringList Krita::colorDepths(const QString &colorModel) const
Q_FOREACH(KoID id, ids) {
colorDepthsIds << id.id();
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
return QStringList(colorDepthsIds.begin(), colorDepthsIds.end());
-#else
- return QStringList::fromSet(colorDepthsIds);
-#endif
}
QStringList Krita::filterStrategies() const
@@ -207,11 +199,7 @@ QStringList Krita::profiles(const QString &colorModel, const QString &colorDepth
Q_FOREACH(const KoColorProfile *profile, profiles) {
profileNames << profile->name();
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
QStringList r(profileNames.begin(), profileNames.end());
-#else
- QStringList r = QStringList::fromSet(profileNames);
-#endif
r.sort();
return r;
}
diff --git a/libs/pigment/resources/KoStopGradient.cpp b/libs/pigment/resources/KoStopGradient.cpp
index 9ea7e03262..411fe0f6ee 100644
--- a/libs/pigment/resources/KoStopGradient.cpp
+++ b/libs/pigment/resources/KoStopGradient.cpp
@@ -508,11 +508,7 @@ void KoStopGradient::parseSvgGradient(const QDomElement& element, QHash<QString,
else {
// try style attr
QString style = colorstop.attribute("style").simplified();
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList substyles = style.split(';', Qt::SkipEmptyParts);
-#else
- QStringList substyles = style.split(';', QString::SkipEmptyParts);
-#endif
Q_FOREACH(const QString & s, substyles) {
QStringList substyle = s.split(':');
QString command = substyle[0].trimmed();
diff --git a/libs/psdutils/asl/kis_asl_reader.cpp b/libs/psdutils/asl/kis_asl_reader.cpp
index 4f893e1a63..50357cefd3 100644
--- a/libs/psdutils/asl/kis_asl_reader.cpp
+++ b/libs/psdutils/asl/kis_asl_reader.cpp
@@ -380,11 +380,7 @@ QImage readVirtualArrayList(QIODevice &device, int numPlanes, const QVector<QRgb
} else if (pixelDepth1 == 8) {
format = QImage::Format_ARGB32;
} else {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
format = QImage::Format_RGBA64;
-#else
- throw ASLParseException("Qt does not support RGBA64!");
-#endif
}
QImage image(arrayRect.size(), format);
diff --git a/libs/resources/KisBundleStorage.cpp b/libs/resources/KisBundleStorage.cpp
index 3df3ca9a34..5f848cf2cb 100644
--- a/libs/resources/KisBundleStorage.cpp
+++ b/libs/resources/KisBundleStorage.cpp
@@ -97,11 +97,7 @@ KisResourceStorage::ResourceItem KisBundleStorage::resourceItem(const QString &u
{
KisResourceStorage::ResourceItem item;
item.url = url;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList parts = url.split('/', Qt::SkipEmptyParts);
-#else
- QStringList parts = url.split('/', QString::SkipEmptyParts);
-#endif
Q_ASSERT(parts.size() == 2);
item.folder = parts[0];
item.resourceType = parts[0];
@@ -261,11 +257,7 @@ bool KisBundleStorage::saveAsNewVersion(const QString &resourceType, KoResourceS
bool KisBundleStorage::exportResource(const QString &url, QIODevice *device)
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList parts = url.split('/', Qt::SkipEmptyParts);
-#else
- QStringList parts = url.split('/', QString::SkipEmptyParts);
-#endif
Q_ASSERT(parts.size() == 2);
const QString resourceType = parts[0];
diff --git a/libs/resources/KisMemoryStorage.cpp b/libs/resources/KisMemoryStorage.cpp
index ac36d6da87..c17f126754 100644
--- a/libs/resources/KisMemoryStorage.cpp
+++ b/libs/resources/KisMemoryStorage.cpp
@@ -180,11 +180,7 @@ bool KisMemoryStorage::loadVersionedResource(KoResourceSP resource)
bool KisMemoryStorage::importResource(const QString &url, QIODevice *device)
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList parts = url.split('/', Qt::SkipEmptyParts);
-#else
- QStringList parts = url.split('/', QString::SkipEmptyParts);
-#endif
Q_ASSERT(parts.size() == 2);
@@ -210,11 +206,7 @@ bool KisMemoryStorage::importResource(const QString &url, QIODevice *device)
bool KisMemoryStorage::exportResource(const QString &url, QIODevice *device)
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList parts = url.split('/', Qt::SkipEmptyParts);
-#else
- QStringList parts = url.split('/', QString::SkipEmptyParts);
-#endif
Q_ASSERT(parts.size() == 2);
const QString resourceType = parts[0];
@@ -266,11 +258,7 @@ bool KisMemoryStorage::addResource(const QString &resourceType, KoResourceSP re
QString KisMemoryStorage::resourceMd5(const QString &url)
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList parts = url.split('/', Qt::SkipEmptyParts);
-#else
- QStringList parts = url.split('/', QString::SkipEmptyParts);
-#endif
Q_ASSERT(parts.size() == 2);
diff --git a/libs/resources/KisResourceSearchBoxFilter.cpp b/libs/resources/KisResourceSearchBoxFilter.cpp
index 11fbb1dcb8..bb62dfd29c 100644
--- a/libs/resources/KisResourceSearchBoxFilter.cpp
+++ b/libs/resources/KisResourceSearchBoxFilter.cpp
@@ -169,11 +169,7 @@ void KisResourceSearchBoxFilter::initializeFilterData()
QString tempFilter(m_d->filter);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList tokens = tempFilter.split(m_d->searchTokenizer, Qt::SkipEmptyParts);
-#else
- QStringList tokens = tempFilter.split(m_d->searchTokenizer, QString::SkipEmptyParts);
-#endif
Q_FOREACH(const QString& token, tokens) {
QString workingToken(token.toLower());
diff --git a/libs/resources/KisStoragePlugin.cpp b/libs/resources/KisStoragePlugin.cpp
index f56d5abbde..7010bfd75e 100644
--- a/libs/resources/KisStoragePlugin.cpp
+++ b/libs/resources/KisStoragePlugin.cpp
@@ -37,11 +37,7 @@ KoResourceSP KisStoragePlugin::resource(const QString &url)
{
if (!url.contains('/')) return nullptr;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList parts = url.split('/', Qt::SkipEmptyParts);
-#else
- QStringList parts = url.split('/', QString::SkipEmptyParts);
-#endif
if (parts.isEmpty()) return nullptr;
diff --git a/libs/resources/KisTag.cpp b/libs/resources/KisTag.cpp
index d5745def99..fc4dbcea6e 100644
--- a/libs/resources/KisTag.cpp
+++ b/libs/resources/KisTag.cpp
@@ -247,11 +247,7 @@ bool KisTag::load(QIODevice &io)
d->resourceType = value;
}
else if (key == s_defaultResources) {
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
d->defaultResources = value.split(',', Qt::SkipEmptyParts);
-#else
- d->defaultResources = value.split(',', QString::SkipEmptyParts);
-#endif
}
else if (key == s_name) {
d->name = value;
diff --git a/libs/resources/KoResourceBundle.cpp b/libs/resources/KoResourceBundle.cpp
index 81952dc162..124c4214cc 100644
--- a/libs/resources/KoResourceBundle.cpp
+++ b/libs/resources/KoResourceBundle.cpp
@@ -267,11 +267,7 @@ void KoResourceBundle::addResource(QString resourceType, QString filePath, QVect
QList<QString> KoResourceBundle::getTagsList()
{
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
return QList<QString>(m_bundletags.begin(), m_bundletags.end());
-#else
- return QList<QString>::fromSet(m_bundletags);
-#endif
}
QStringList KoResourceBundle::resourceTypes() const
@@ -458,11 +454,7 @@ KoResourceSP KoResourceBundle::resource(const QString &resourceType, const QStri
return 0;
}
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList parts = filepath.split('/', Qt::SkipEmptyParts);
-#else
- QStringList parts = filepath.split('/', QString::SkipEmptyParts);
-#endif
Q_ASSERT(parts.size() == 2);
diff --git a/libs/resources/KoResourceBundleManifest.cpp b/libs/resources/KoResourceBundleManifest.cpp
index 867a0fafa7..e68a6b65dd 100644
--- a/libs/resources/KoResourceBundleManifest.cpp
+++ b/libs/resources/KoResourceBundleManifest.cpp
@@ -188,20 +188,11 @@ QStringList KoResourceBundleManifest::tags() const
QSet<QString> tags;
Q_FOREACH (const QString &type, m_resources.keys()) {
Q_FOREACH (const ResourceReference &ref, m_resources[type].values()) {
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
tags += QSet<QString>(ref.tagList.begin(), ref.tagList.end());
-#else
- tags += QSet<QString>::fromList(ref.tagList);
-#endif
-
}
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
return QStringList(tags.begin(), tags.end());
-#else
- return QStringList::fromSet(tags);
-#endif
-}
+ }
QList<KoResourceBundleManifest::ResourceReference> KoResourceBundleManifest::files(const QString &type) const
{
diff --git a/libs/resources/KoResourcePaths.cpp b/libs/resources/KoResourcePaths.cpp
index 553433aaa2..de5492d46c 100644
--- a/libs/resources/KoResourcePaths.cpp
+++ b/libs/resources/KoResourcePaths.cpp
@@ -713,15 +713,9 @@ QString KoResourcePaths::locateLocalInternal(const QString &type, const QString
QStringList KoResourcePaths::findExtraResourceDirs() const
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList extraResourceDirs =
QString::fromUtf8(qgetenv("EXTRA_RESOURCE_DIRS"))
.split(';', Qt::SkipEmptyParts);
-#else
- QStringList extraResourceDirs =
- QString::fromUtf8(qgetenv("EXTRA_RESOURCE_DIRS"))
- .split(';', QString::SkipEmptyParts);
-#endif
const KConfigGroup cfg(KSharedConfig::openConfig(), "");
const QString customPath =
diff --git a/libs/ui/KisDocument.cpp b/libs/ui/KisDocument.cpp
index 3057e932b9..34f1198097 100644
--- a/libs/ui/KisDocument.cpp
+++ b/libs/ui/KisDocument.cpp
@@ -1000,21 +1000,12 @@ void KisDocument::slotCompleteSavingDocument(const KritaUtils::ExportFileJob &jo
errorMessage), errorMessageTimeout);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
if (!fileBatchMode()) {
DlgLoadMessages dlg(i18nc("@title:window", "Krita"),
i18n("Could not save %1.", job.filePath),
errorMessage.split("\n", Qt::SkipEmptyParts)
+ warningMessage.split("\n", Qt::SkipEmptyParts),
status.errorMessage());
-#else
- if (!fileBatchMode()) {
- DlgLoadMessages dlg(i18nc("@title:window", "Krita"),
- i18n("Could not save %1.", job.filePath),
- errorMessage.split("\n", QString::SkipEmptyParts)
- + warningMessage.split("\n", QString::SkipEmptyParts),
- status.errorMessage());
-#endif
dlg.exec();
}
@@ -1022,11 +1013,7 @@ void KisDocument::slotCompleteSavingDocument(const KritaUtils::ExportFileJob &jo
else {
if (!fileBatchMode() && !warningMessage.isEmpty()) {
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList reasons = warningMessage.split("\n", Qt::SkipEmptyParts);
-#else
- QStringList reasons = warningMessage.split("\n", QString::SkipEmptyParts);
-#endif
DlgLoadMessages dlg(
i18nc("@title:window", "Krita"),
@@ -2017,34 +2004,20 @@ bool KisDocument::openFile()
KisUsageLogger::log(QString("Loading %1 failed: %2").arg(prettyPath(), msg));
if (!msg.isEmpty() && !fileBatchMode()) {
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
DlgLoadMessages dlg(i18nc("@title:window", "Krita"),
i18n("Could not open %1.", prettyPath()),
errorMessage().split("\n", Qt::SkipEmptyParts)
+ warningMessage().split("\n", Qt::SkipEmptyParts),
msg);
-#else
- DlgLoadMessages dlg(i18nc("@title:window", "Krita"),
- i18n("Could not open %1.", prettyPath()),
- errorMessage().split("\n", QString::SkipEmptyParts)
- + warningMessage().split("\n", QString::SkipEmptyParts),
- msg);
-#endif
dlg.exec();
}
return false;
}
else if (!warningMessage().isEmpty() && !fileBatchMode()) {
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
DlgLoadMessages dlg(i18nc("@title:window", "Krita"),
i18n("There were problems opening %1.", prettyPath()),
warningMessage().split("\n", Qt::SkipEmptyParts));
-#else
- DlgLoadMessages dlg(i18nc("@title:window", "Krita"),
- i18n("There were problems opening %1.", prettyPath()),
- warningMessage().split("\n", QString::SkipEmptyParts));
-#endif
dlg.exec();
setPath(QString());
diff --git a/libs/ui/KisImportExportManager.cpp b/libs/ui/KisImportExportManager.cpp
index e46cc20d87..02f5ca37f6 100644
--- a/libs/ui/KisImportExportManager.cpp
+++ b/libs/ui/KisImportExportManager.cpp
@@ -195,21 +195,13 @@ QStringList KisImportExportManager::supportedMimeTypes(Direction direction)
QList<KoJsonTrader::Plugin> list = KoJsonTrader::instance()->query("Krita/FileFilter", "");
Q_FOREACH(const KoJsonTrader::Plugin &loader, list) {
QJsonObject json = loader.metaData().value("MetaData").toObject();
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
Q_FOREACH(const QString &mimetype, json.value("X-KDE-Import").toString().split(",", Qt::SkipEmptyParts)) {
-#else
- Q_FOREACH(const QString &mimetype, json.value("X-KDE-Import").toString().split(",", QString::SkipEmptyParts)) {
-#endif
//qDebug() << "Adding import mimetype" << mimetype << KisMimeDatabase::descriptionForMimeType(mimetype) << "from plugin" << loader;
mimeTypes << mimetype;
}
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
m_importMimeTypes = QList<QString>(mimeTypes.begin(), mimeTypes.end());
-#else
- m_importMimeTypes = QList<QString>::fromSet(mimeTypes);
-#endif
}
return m_importMimeTypes;
}
@@ -218,22 +210,13 @@ QStringList KisImportExportManager::supportedMimeTypes(Direction direction)
QList<KoJsonTrader::Plugin> list = KoJsonTrader::instance()->query("Krita/FileFilter", "");
Q_FOREACH(const KoJsonTrader::Plugin &loader, list) {
QJsonObject json = loader.metaData().value("MetaData").toObject();
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
Q_FOREACH(const QString &mimetype, json.value("X-KDE-Export").toString().split(",", Qt::SkipEmptyParts)) {
-#else
- Q_FOREACH(const QString &mimetype, json.value("X-KDE-Export").toString().split(",", QString::SkipEmptyParts)) {
-#endif
//qDebug() << "Adding export mimetype" << mimetype << KisMimeDatabase::descriptionForMimeType(mimetype) << "from plugin" << loader;
mimeTypes << mimetype;
}
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
m_exportMimeTypes = QList<QString>(mimeTypes.begin(), mimeTypes.end());
-#else
- m_exportMimeTypes = QList<QString>::fromSet(mimeTypes);
-#endif
-
}
return m_exportMimeTypes;
}
@@ -250,11 +233,7 @@ KisImportExportFilter *KisImportExportManager::filterForMimeType(const QString &
QJsonObject json = loader.metaData().value("MetaData").toObject();
QString directionKey = direction == Export ? "X-KDE-Export" : "X-KDE-Import";
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
if (json.value(directionKey).toString().split(",", Qt::SkipEmptyParts).contains(mimetype)) {
-#else
- if (json.value(directionKey).toString().split(",", QString::SkipEmptyParts).contains(mimetype)) {
-#endif
KLibFactory *factory = qobject_cast<KLibFactory *>(loader.instance());
diff --git a/libs/ui/KisReferenceImage.cpp b/libs/ui/KisReferenceImage.cpp
index 8f42a59f22..9c4df4f60f 100644
--- a/libs/ui/KisReferenceImage.cpp
+++ b/libs/ui/KisReferenceImage.cpp
@@ -17,9 +17,7 @@
#include <QImageReader>
#include <QUrl>
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
#include <QColorSpace>
-#endif
#include <kundo2command.h>
#include <KoStore.h>
@@ -84,9 +82,7 @@ struct KisReferenceImage::Private : public QSharedData
// See https://bugs.kde.org/show_bug.cgi?id=416515 -- a jpeg image
// loaded into a qimage cannot be saved to png unless we explicitly
// convert the colorspace of the QImage
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
image.convertToColorSpace(QColorSpace(QColorSpace::SRgb));
-#endif
return (!image.isNull());
}
diff --git a/libs/ui/KisView.cpp b/libs/ui/KisView.cpp
index 0296dc89e0..f9ee84cc86 100644
--- a/libs/ui/KisView.cpp
+++ b/libs/ui/KisView.cpp
@@ -884,11 +884,7 @@ void KisView::dropEvent(QDropEvent *event)
}
QList<int> colorLabels;
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
const QStringList colorLabelsStr = configGroup.readEntry<QString>("colorLabels", "").split(',', Qt::SkipEmptyParts);
-#else
- const QStringList colorLabelsStr = configGroup.readEntry<QString>("colorLabels", "").split(',', QString::SkipEmptyParts);
-#endif
for (const QString &colorLabelStr : colorLabelsStr) {
bool ok;
diff --git a/libs/ui/animation/KisDlgAnimationRenderer.cpp b/libs/ui/animation/KisDlgAnimationRenderer.cpp
index f2478ab22d..abe587f30f 100644
--- a/libs/ui/animation/KisDlgAnimationRenderer.cpp
+++ b/libs/ui/animation/KisDlgAnimationRenderer.cpp
@@ -102,9 +102,7 @@ KisDlgAnimationRenderer::KisDlgAnimationRenderer(KisDocument *doc, QWidget *pare
m_page->ffmpegLocation->setMode(KoFileDialog::OpenFile);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
m_page->cmbRenderType->setPlaceholderText(i18nc("Not applicable. No render types without valid ffmpeg path.", "N/A"));
-#endif
{ // Establish connections...
connect(m_page->bnExportOptions, SIGNAL(clicked()), this, SLOT(sequenceMimeTypeOptionsClicked()));
diff --git a/libs/ui/animation/KisDlgImportVideoAnimation.cpp b/libs/ui/animation/KisDlgImportVideoAnimation.cpp
index d884d01604..4ad6b9c7de 100644
--- a/libs/ui/animation/KisDlgImportVideoAnimation.cpp
+++ b/libs/ui/animation/KisDlgImportVideoAnimation.cpp
@@ -266,11 +266,7 @@ RenderedFrames KisDlgImportVideoAnimation::renderFrames(const QDir& directory)
connect(ffmpeg.data(), &KisFFMpegWrapper::sigReadSTDOUT, [&](QByteArray arr) {
QString out = QString(arr);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList integerOuts = out.split("\n", Qt::SkipEmptyParts);
-#else
- QStringList integerOuts = out.split("\n", QString::SkipEmptyParts);
-#endif
Q_FOREACH(const QString& str, integerOuts){
bool ok = false;
const int value = str.toUInt(&ok);
diff --git a/libs/ui/animation/KisVideoSaver.cpp b/libs/ui/animation/KisVideoSaver.cpp
index 5e411113f7..2480eac178 100644
--- a/libs/ui/animation/KisVideoSaver.cpp
+++ b/libs/ui/animation/KisVideoSaver.cpp
@@ -78,11 +78,7 @@ KisImportExportErrorCode KisAnimationVideoSaver::encode(const QString &savedFile
const QString suffix = resultFileInfo.suffix().toLower();
const QString palettePath = videoDir.filePath("KritaTempPalettegen_\%06d.png");
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList additionalOptionsList = options.customFFMpegOptions.split(' ', Qt::SkipEmptyParts);
-#else
- QStringList additionalOptionsList = options.customFFMpegOptions.split(' ', QString::SkipEmptyParts);
-#endif
QScopedPointer<KisFFMpegWrapper> ffmpegWrapper(new KisFFMpegWrapper(this));
diff --git a/libs/ui/animation/VideoExportOptionsDialog.cpp b/libs/ui/animation/VideoExportOptionsDialog.cpp
index b447b885c3..7459ec2d02 100644
--- a/libs/ui/animation/VideoExportOptionsDialog.cpp
+++ b/libs/ui/animation/VideoExportOptionsDialog.cpp
@@ -377,15 +377,9 @@ void KisVideoExportOptionsDialog::slotSaveCustomLine()
QStringList KisVideoExportOptionsDialog::customUserOptions() const
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
return ui->chkCustomLine->isChecked() ?
ui->txtCustomLine->text().split(" ", Qt::SkipEmptyParts) :
generateCustomLine();
-#else
- return ui->chkCustomLine->isChecked() ?
- ui->txtCustomLine->text().split(" ", QString::SkipEmptyParts) :
- generateCustomLine();
-#endif
}
QString KisVideoExportOptionsDialog::customUserOptionsString() const
diff --git a/libs/ui/dialogs/kis_about_application.cpp b/libs/ui/dialogs/kis_about_application.cpp
index 5e7bc56e7c..827a1ea97d 100644
--- a/libs/ui/dialogs/kis_about_application.cpp
+++ b/libs/ui/dialogs/kis_about_application.cpp
@@ -54,11 +54,7 @@ KisAboutApplication::KisAboutApplication(QWidget *parent)
if (fileDevelopers.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream developersText(&fileDevelopers);
KisPortingUtils::setUtf8OnStream(developersText);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
authors.append(developersText.readAll().split("\n", Qt::SkipEmptyParts).join(", "));
-#else
- authors.append(developersText.readAll().split("\n", QString::SkipEmptyParts).join(", "));
-#endif
}
authors.append(".</p></body></html>");
wdgTab->lblAuthors->setText(authors);
@@ -117,11 +113,7 @@ KisAboutApplication::KisAboutApplication(QWidget *parent)
QTextStream creditsText(&fileCredits);
KisPortingUtils::setUtf8OnStream(creditsText);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
Q_FOREACH (const QString &credit, creditsText.readAll().split('\n', Qt::SkipEmptyParts)) {
-#else
- Q_FOREACH (const QString &credit, creditsText.readAll().split('\n', QString::SkipEmptyParts)) {
-#endif
if (credit.contains(":")) {
QList<QString> creditSplit = credit.split(':');
@@ -177,11 +169,7 @@ KisAboutApplication::KisAboutApplication(QWidget *parent)
"<h1 align=\"center\"><b>Third-party Libraries used by Krita</b></h1>"
"<p>Krita is built on the following free software libraries:</p><p><ul>");
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
Q_FOREACH (const QString &lib, thirdPartyText.readAll().split('\n', Qt::SkipEmptyParts)) {
-#else
- Q_FOREACH (const QString &lib, thirdPartyText.readAll().split('\n', QString::SkipEmptyParts)) {
-#endif
if (!lib.startsWith("#")) {
QStringList parts = lib.split(',');
diff --git a/libs/ui/dialogs/kis_dlg_import_image_sequence.cpp b/libs/ui/dialogs/kis_dlg_import_image_sequence.cpp
index 7e4afe5711..3ed7b11656 100644
--- a/libs/ui/dialogs/kis_dlg_import_image_sequence.cpp
+++ b/libs/ui/dialogs/kis_dlg_import_image_sequence.cpp
@@ -29,13 +29,8 @@ public:
if (collator->numericMode()) {
const QRegExp rx(QLatin1String("[^0-9]+"));
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList ours = text().split(rx, Qt::SkipEmptyParts);
QStringList theirs = other.text().split(rx, Qt::SkipEmptyParts);
-#else
- QStringList ours = text().split(rx, QString::SkipEmptyParts);
- QStringList theirs = other.text().split(rx, QString::SkipEmptyParts);
-#endif
// Let's compare the last numbers -- they are most likely to be the serial numbers
if (ours.size() > 0 && theirs.size() > 0) {
diff --git a/libs/ui/dialogs/kis_dlg_preferences.cc b/libs/ui/dialogs/kis_dlg_preferences.cc
index 0cbefe09d6..07bf2759d1 100644
--- a/libs/ui/dialogs/kis_dlg_preferences.cc
+++ b/libs/ui/dialogs/kis_dlg_preferences.cc
@@ -1853,11 +1853,7 @@ DisplaySettingsTab::DisplaySettingsTab(QWidget *parent, const char *name)
}
if (context) {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QScreen *screen = QGuiApplication::screenAt(rect().center());
-#else
- QScreen *screen = 0;
-#endif
KisScreenInformationAdapter adapter(context);
if (screen && adapter.isValid()) {
KisScreenInformationAdapter::ScreenInfo info = adapter.infoForScreen(screen);
@@ -1887,11 +1883,7 @@ DisplaySettingsTab::DisplaySettingsTab(QWidget *parent, const char *name)
}
const QSurfaceFormat currentFormat = KisOpenGLModeProber::instance()->surfaceformatInUse();
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
KisSurfaceColorSpace colorSpace = currentFormat.colorSpace();
-#else
- KisSurfaceColorSpace colorSpace = KisSurfaceColorSpace::DefaultColorSpace;
-#endif
lblCurrentRootSurfaceFormat->setText(colorSpaceString(colorSpace, currentFormat.redBufferSize()));
cmbPreferedRootSurfaceFormat->setCurrentIndex(formatToIndex(cfg.rootSurfaceFormat()));
connect(cmbPreferedRootSurfaceFormat, SIGNAL(currentIndexChanged(int)), SLOT(slotPreferredSurfaceFormatChanged(int)));
@@ -2034,11 +2026,7 @@ void DisplaySettingsTab::slotPreferredSurfaceFormatChanged(int index)
QOpenGLContext *context = QOpenGLContext::currentContext();
if (context) {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QScreen *screen = QGuiApplication::screenAt(rect().center());
-#else
- QScreen *screen = 0;
-#endif
KisScreenInformationAdapter adapter(context);
if (adapter.isValid()) {
KisScreenInformationAdapter::ScreenInfo info = adapter.infoForScreen(screen);
diff --git a/libs/ui/input/kis_input_manager_p.cpp b/libs/ui/input/kis_input_manager_p.cpp
index 0cfa94a35f..e365545fa6 100644
--- a/libs/ui/input/kis_input_manager_p.cpp
+++ b/libs/ui/input/kis_input_manager_p.cpp
@@ -421,28 +421,6 @@ KisInputManager::Private::ProximityNotifier::ProximityNotifier(KisInputManager::
bool KisInputManager::Private::ProximityNotifier::eventFilter(QObject* object, QEvent* event )
{
- /**
- * All Qt builds in range 5.7.0...5.11.X on X11 had a problem that made all
- * the tablet events be accepted by default. It meant that no mouse
- * events were synthesized, and, therefore, no Enter/Leave were generated.
- *
- * The fix for this bug has been added only in Qt 5.12.0:
- * https://codereview.qt-project.org/#/c/239918/
- *
- * To avoid this problem we should explicitly ignore all the tablet events.
- */
-#if defined Q_OS_LINUX && \
- QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) && \
- QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
-
- if (event->type() == QEvent::TabletMove ||
- event->type() == QEvent::TabletPress ||
- event->type() == QEvent::TabletRelease) {
-
- event->ignore();
- }
-#endif
-
switch (event->type()) {
case QEvent::TabletEnterProximity:
d->debugEvent<QEvent, false>(event);
@@ -493,11 +471,7 @@ void KisInputManager::Private::addStrokeShortcut(KisAbstractInputAction* action,
BOOST_PP_REPEAT_FROM_TO(1, 25, EXTRA_BUTTON, _)
if (!buttonSet.empty()) {
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
strokeShortcut->setButtons(QSet<Qt::Key>(modifiers.cbegin(), modifiers.cend()), buttonSet);
-#else
- strokeShortcut->setButtons(QSet<Qt::Key>::fromList(modifiers), buttonSet);
-#endif
matcher.addShortcut(strokeShortcut);
}
else {
@@ -519,11 +493,7 @@ void KisInputManager::Private::addKeyShortcut(KisAbstractInputAction* action, in
//the way the shortcut matcher is currently implemented.
QList<Qt::Key> allKeys = keys;
Qt::Key key = allKeys.takeLast();
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
QSet<Qt::Key> modifiers = QSet<Qt::Key>(allKeys.begin(), allKeys.end());
-#else
- QSet<Qt::Key> modifiers = QSet<Qt::Key>::fromList(allKeys);
-#endif
keyShortcut->setKey(modifiers, key);
matcher.addShortcut(keyShortcut);
}
@@ -555,11 +525,7 @@ void KisInputManager::Private::addWheelShortcut(KisAbstractInputAction* action,
default:
return;
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
keyShortcut->setWheel(QSet<Qt::Key>(modifiers.begin(), modifiers.end()), a);
-#else
- keyShortcut->setWheel(QSet<Qt::Key>::fromList(modifiers), a);
-#endif
matcher.addShortcut(keyShortcut.take());
}
diff --git a/libs/ui/kis_painting_assistant.cc b/libs/ui/kis_painting_assistant.cc
index 774d58bd67..50554a4338 100644
--- a/libs/ui/kis_painting_assistant.cc
+++ b/libs/ui/kis_painting_assistant.cc
@@ -812,22 +812,14 @@ void KisPaintingAssistant::findPerspectiveAssistantHandleLocation() {
sort handles on the basis of X-coordinate
*/
while(hHole > 0 && hHandlesList.at(hHole -1).data()->x() > handle.data()->x()) {
-#if QT_VERSION >= QT_VERSION_CHECK(5,13,0)
hHandlesList.swapItemsAt(hHole - 1, hHole);
-#else
- hHandlesList.swap(hHole - 1, hHole);
-#endif
hHole = hHole - 1;
}
/*
sort handles on the basis of Y-coordinate
*/
while(vHole > 0 && vHandlesList.at(vHole -1).data()->y() > handle.data()->y()) {
-#if QT_VERSION >= QT_VERSION_CHECK(5,13,0)
vHandlesList.swapItemsAt(vHole-1, vHole);
-#else
- vHandlesList.swap(vHole-1, vHole);
-#endif
vHole = vHole - 1;
}
}
diff --git a/libs/ui/opengl/KisOpenGLModeProber.cpp b/libs/ui/opengl/KisOpenGLModeProber.cpp
index fba1b8c0e1..36cbd6ec57 100644
--- a/libs/ui/opengl/KisOpenGLModeProber.cpp
+++ b/libs/ui/opengl/KisOpenGLModeProber.cpp
@@ -48,8 +48,6 @@ const KoColorProfile *KisOpenGLModeProber::rootSurfaceColorProfile() const
{
const KoColorProfile *profile = KoColorSpaceRegistry::instance()->p709SRGBProfile();
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
-
const KisSurfaceColorSpace surfaceColorSpace = surfaceformatInUse().colorSpace();
if (surfaceColorSpace == KisSurfaceColorSpace::sRGBColorSpace) {
// use the default one!
@@ -60,9 +58,6 @@ const KoColorProfile *KisOpenGLModeProber::rootSurfaceColorProfile() const
profile = KoColorSpaceRegistry::instance()->p2020PQProfile();
#endif
}
-
-#endif
-
return profile;
}
@@ -102,12 +97,6 @@ private:
};
-#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
-QString qEnvironmentVariable(const char *varName) {
- return qgetenv(varName);
-}
-#endif
-
struct EnvironmentSetter
{
EnvironmentSetter(const QLatin1String &env, const QString &value)
@@ -210,12 +199,10 @@ KisOpenGLModeProber::probeFormat(const KisOpenGL::RendererConfig &rendererConfig
return boost::none;
}
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
if (!fuzzyCompareColorSpaces(context.format().colorSpace(), format.colorSpace())) {
dbgOpenGL << "Failed to create an OpenGL context with requested color space. Requested:" << format.colorSpace() << "Actual:" << context.format().colorSpace();
return boost::none;
}
-#endif
Result result(context);
@@ -263,16 +250,9 @@ void KisOpenGLModeProber::initSurfaceFormatFromConfig(KisConfig::RootSurfaceForm
format->setRedBufferSize(8);
format->setGreenBufferSize(8);
format->setBlueBufferSize(8);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
format->setAlphaBufferSize(8);
-#else
- format->setAlphaBufferSize(0);
-#endif
-
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
// TODO: check if we can use real sRGB space here
format->setColorSpace(KisSurfaceColorSpace::DefaultColorSpace);
-#endif
}
}
diff --git a/libs/ui/opengl/KisScreenInformationAdapter.cpp b/libs/ui/opengl/KisScreenInformationAdapter.cpp
index c245437858..3b4cb1920b 100644
--- a/libs/ui/opengl/KisScreenInformationAdapter.cpp
+++ b/libs/ui/opengl/KisScreenInformationAdapter.cpp
@@ -84,7 +84,7 @@ void KisScreenInformationAdapter::Private::initialize(QOpenGLContext *newContext
try {
-#if defined Q_OS_WIN && QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
+#if defined Q_OS_WIN
if (!context->isOpenGLES()) {
throw EGLException("the context is not OpenGL ES");
@@ -191,7 +191,7 @@ KisScreenInformationAdapter::ScreenInfo KisScreenInformationAdapter::infoForScre
{
ScreenInfo info;
-#if defined Q_OS_WIN && QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
+#if defined Q_OS_WIN
QPlatformNativeInterface *nativeInterface = qGuiApp->platformNativeInterface();
HMONITOR monitor = reinterpret_cast<HMONITOR>(nativeInterface->nativeResourceForScreen("handle", screen));
diff --git a/libs/ui/opengl/kis_opengl.cpp b/libs/ui/opengl/kis_opengl.cpp
index 082526190d..05627961f2 100644
--- a/libs/ui/opengl/kis_opengl.cpp
+++ b/libs/ui/opengl/kis_opengl.cpp
@@ -714,10 +714,8 @@ public:
ORDER_BY(!isFallbackOnly(lhs.rendererId()), !isFallbackOnly(rhs.rendererId()));
}
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
ORDER_BY(isPreferredColorSpace(lhs.format.colorSpace()),
isPreferredColorSpace(rhs.format.colorSpace()));
-#endif
if (doPreferHDR()) {
ORDER_BY(isHDRFormat(lhs.format), isHDRFormat(rhs.format));
@@ -1009,11 +1007,7 @@ KisOpenGL::RendererConfig KisOpenGL::selectSurfaceConfig(KisOpenGL::OpenGLRender
if (preferredRenderer != RendererNone) {
Q_FOREACH (const KisOpenGL::RendererConfig &config, preferredConfigs) {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
dbgDetection() <<"Probing format..." << config.format.colorSpace() << config.rendererId();
-#else
- dbgDetection() <<"Probing format..." << config.rendererId();
-#endif
Info info = KisOpenGLModeProber::instance()->probeFormat(config);
if (info && info->isSupportedVersion()) {
@@ -1042,12 +1036,8 @@ KisOpenGL::RendererConfig KisOpenGL::selectSurfaceConfig(KisOpenGL::OpenGLRender
{
const bool colorSpaceIsCorrect =
- #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
KisOpenGLModeProber::fuzzyCompareColorSpaces(compareOp.preferredColorSpace(),
resultConfig.format.colorSpace());
-#else
- true;
-#endif
const bool rendererIsCorrect =
compareOp.preferredRendererByUser() == KisOpenGL::RendererAuto ||
diff --git a/libs/ui/opengl/kis_opengl_canvas2.cpp b/libs/ui/opengl/kis_opengl_canvas2.cpp
index 1d6af28acd..9744a39be6 100644
--- a/libs/ui/opengl/kis_opengl_canvas2.cpp
+++ b/libs/ui/opengl/kis_opengl_canvas2.cpp
@@ -99,7 +99,6 @@ KisOpenGLCanvas2::KisOpenGLCanvas2(KisCanvas2 *canvas,
setAttribute(Qt::WA_DontCreateNativeAncestors, true);
setUpdateBehavior(PartialUpdate);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
// we should make sure the texture doesn't have alpha channel,
// otherwise blending will not work correctly.
if (KisOpenGLModeProber::instance()->useHDRMode()) {
@@ -118,7 +117,6 @@ KisOpenGLCanvas2::KisOpenGLCanvas2(KisCanvas2 *canvas,
setTextureFormat(GL_RGB8);
}
}
-#endif
connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(slotConfigChanged()));
connect(KisConfigNotifier::instance(), SIGNAL(pixelGridModeChanged()), SLOT(slotPixelGridModeChanged()));
diff --git a/libs/ui/tool/kis_selection_tool_config_widget_helper.cpp b/libs/ui/tool/kis_selection_tool_config_widget_helper.cpp
index 344c64e5b5..9365bb9bde 100644
--- a/libs/ui/tool/kis_selection_tool_config_widget_helper.cpp
+++ b/libs/ui/tool/kis_selection_tool_config_widget_helper.cpp
@@ -270,15 +270,9 @@ void KisSelectionToolConfigWidgetHelper::reloadExactToolConfig()
const QString referenceLayersStr =
cfgToolSpecific.readEntry("sampleLayersMode", "sampleCurrentLayer");
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
const QStringList colorLabelsStr =
cfgToolSpecific.readEntry<QString>("colorLabels", "")
.split(',', Qt::SkipEmptyParts);
-#else
- const QStringList colorLabelsStr =
- cfgToolSpecific.readEntry<QString>("colorLabels", "")
- .split(',', QString::SkipEmptyParts);
-#endif
const KisSelectionOptions::ReferenceLayers referenceLayers =
referenceLayersStr == "sampleAllLayers"
diff --git a/libs/ui/utils/KisAppimageUpdater.cpp b/libs/ui/utils/KisAppimageUpdater.cpp
index 437b959f84..c713a527cd 100644
--- a/libs/ui/utils/KisAppimageUpdater.cpp
+++ b/libs/ui/utils/KisAppimageUpdater.cpp
@@ -213,12 +213,6 @@ void KisAppimageUpdater::slotAppendUpdateOutput()
m_updateOutput.append(m_updateProcess->readAllStandardOutput());
}
-#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
-QString qEnvironmentVariable(const char *varName) {
- return qgetenv(varName);
-}
-#endif
-
void KisAppimageUpdater::initialize(QString& updaterPath)
{
m_appimagePath = qEnvironmentVariable("APPIMAGE");
diff --git a/libs/ui/widgets/kis_cmb_composite.cc b/libs/ui/widgets/kis_cmb_composite.cc
index 45c5123e43..2d82f3e6ec 100644
--- a/libs/ui/widgets/kis_cmb_composite.cc
+++ b/libs/ui/widgets/kis_cmb_composite.cc
@@ -423,12 +423,7 @@ void KisCompositeOpComboBox::wheelEvent(QWheelEvent *e)
QStyleOptionComboBox opt;
initStyleOption(&opt);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
if (style()->styleHint(QStyle::SH_ComboBox_AllowWheelScrolling, &opt, this)) {
-#else
- if (1) {
-#endif
-
if (e->angleDelta().y() != 0) {
selectNeighbouringBlendMode(e->angleDelta().y() < 0);
}
diff --git a/libs/ui/widgets/kis_cmb_gradient.cpp b/libs/ui/widgets/kis_cmb_gradient.cpp
index b732f0e518..cff400a2dd 100644
--- a/libs/ui/widgets/kis_cmb_gradient.cpp
+++ b/libs/ui/widgets/kis_cmb_gradient.cpp
@@ -66,11 +66,7 @@ QSize KisCmbGradient::sizeHint() const
{
ensurePolished();
QFontMetrics fm = fontMetrics();
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
int maxW = 7 * fm.horizontalAdvance(QChar('x')) + 18;
-#else
- int maxW = 7 * fm.width(QChar('x')) + 18;
-#endif
int maxH = qMax(fm.lineSpacing(), 14) + 2;
QStyleOptionComboBox options;
diff --git a/libs/ui/widgets/kis_color_label_button.cpp b/libs/ui/widgets/kis_color_label_button.cpp
index c4e5dd56c0..ca73e3cca4 100644
--- a/libs/ui/widgets/kis_color_label_button.cpp
+++ b/libs/ui/widgets/kis_color_label_button.cpp
@@ -236,11 +236,7 @@ void KisColorLabelFilterGroup::setViableLabels(const QSet<int> &labels) {
void KisColorLabelFilterGroup::setViableLabels(const QList<int> &viableLabels)
{
QSet<int> uniqueViableLabels;
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
uniqueViableLabels = QSet<int>(viableLabels.cbegin(), viableLabels.cend());
-#else
- uniqueViableLabels = QSet<int>::fromList(viableLabels);
-#endif
setViableLabels(uniqueViableLabels);
}
diff --git a/libs/ui/widgets/kis_floating_message.cpp b/libs/ui/widgets/kis_floating_message.cpp
index a3fe765c12..a1f7d4c4bf 100644
--- a/libs/ui/widgets/kis_floating_message.cpp
+++ b/libs/ui/widgets/kis_floating_message.cpp
@@ -110,12 +110,7 @@ void KisFloatingMessage::showMessage()
m_messageLabel->setWordWrap(m_alignment & Qt::TextWordWrap);
m_messageLabel->adjustSize();
- QRect geom;
-#if QT_VERSION >= QT_VERSION_CHECK(5,13,0)
- geom = determineMetrics(fontMetrics().horizontalAdvance('x'));
-#else
- geom = determineMetrics(fontMetrics().width('x'));
-#endif
+ QRect geom = determineMetrics(fontMetrics().horizontalAdvance('x'));
setGeometry(geom);
setWindowOpacity(OSD_WINDOW_OPACITY);
@@ -162,7 +157,6 @@ QRect KisFloatingMessage::determineMetrics( const int M )
// determine a sensible maximum size, don't cover the whole desktop or cross the screen
const QSize margin( (M + MARGIN) * 2, (M + MARGIN) * 2); //margins
const QSize image = m_icon.isNull() ? QSize(0, 0) : minImageSize;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QRect geom = parentWidget()->geometry();
QPoint p(geom.width() / 2 + geom.left(), geom.height() / 2 + geom.top());
QScreen *s = qApp->screenAt(p);
@@ -173,10 +167,6 @@ QRect KisFloatingMessage::determineMetrics( const int M )
else {
max = QSize(1024, 768);
}
-#else
- const QSize max = QApplication::desktop()->availableGeometry(parentWidget()).size() - margin;
-#endif
-
// If we don't do that, the boundingRect() might not be suitable for drawText() (Qt issue N67674)
m_message.replace(QRegExp( " +\n"), "\n");
@@ -207,7 +197,6 @@ QRect KisFloatingMessage::determineMetrics( const int M )
const QSize newSize = rect.size();
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QRect screen;
if (s) {
screen = s->availableGeometry();
@@ -215,10 +204,6 @@ QRect KisFloatingMessage::determineMetrics( const int M )
else {
screen = QRect(0, 0, 1024, 768);
}
-#else
- QRect screen = QApplication::desktop()->screenGeometry(parentWidget());
-#endif
-
QPoint newPos(MARGIN, MARGIN);
diff --git a/libs/ui/widgets/kis_layer_filter_widget.cpp b/libs/ui/widgets/kis_layer_filter_widget.cpp
index d601694bd1..fc178bbf1c 100644
--- a/libs/ui/widgets/kis_layer_filter_widget.cpp
+++ b/libs/ui/widgets/kis_layer_filter_widget.cpp
@@ -179,12 +179,8 @@ void KisLayerFilterWidget::showEvent(QShowEvent *show)
parentMenu->resize(sizeHint());
parentMenu->adjustSize();
qApp->sendEvent(parentMenu, &event);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QScreen *screen = QGuiApplication::screenAt(parentMenu->mapToGlobal(parentMenu->pos()));
QRect screenGeometry = screen ? screen->geometry() : parentMenu->parentWidget()->window()->geometry();
-#else
- QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
-#endif
const bool onRightEdge = (parentMenu->pos().x() + widthBefore + rightEdgeThreshold) > screenGeometry.width();
const int widthAfter = parentMenu->width();
diff --git a/libs/widgets/KisAngleSelector.cpp b/libs/widgets/KisAngleSelector.cpp
index d6047dbd88..ef2271ff81 100644
--- a/libs/widgets/KisAngleSelector.cpp
+++ b/libs/widgets/KisAngleSelector.cpp
@@ -128,20 +128,11 @@ QSize KisAngleSelectorSpinBox::minimumSizeHint() const
s = textFromValue(minimum());
s.truncate(18);
s += fixedContent;
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
w = qMax(w, fm.horizontalAdvance(s));
-#else
- w = qMax(w, fm.width(s));
-#endif
s = textFromValue(maximum());
s.truncate(18);
s += fixedContent;
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
w = qMax(w, fm.horizontalAdvance(s));
-#else
- w = qMax(w, fm.width(s));
-#endif
-
w += 2; // cursor blinking space
diff --git a/libs/widgets/KoRuler.cpp b/libs/widgets/KoRuler.cpp
index 66d0f71c8a..880a71f47c 100644
--- a/libs/widgets/KoRuler.cpp
+++ b/libs/widgets/KoRuler.cpp
@@ -261,11 +261,7 @@ void HorizontalPaintingStrategy::drawMeasurements(const KoRulerPrivate *d, QPain
// length of a unit in pixels
const qreal unitLength = d->viewConverter->documentToViewX(d->unit.fromUserValue(1.0));
// length of the text for longest number with some padding
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
const int textLength = fontMetrics.horizontalAdvance(QString::number(qCeil(rulerLengthUnit))) + 20;
-#else
- const int textLength = fontMetrics.width(QString::number(qCeil(rulerLengthUnit))) + 20;
-#endif
// the minimal separation of numbers that won't make the text a mess
const qreal minimalNumberSeparation = qCeil(textLength / unitLength);
// the chosen separation of numbers so that we have "whole" numbers
@@ -337,15 +333,9 @@ void HorizontalPaintingStrategy::drawMeasurements(const KoRulerPrivate *d, QPain
QPointF(x, rectangle.bottom() - fullStepMarkerLength));
QString numberText = QString::number(n);
painter.setPen(numberPen);
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
painter.drawText(QPointF(x - fontMetrics.horizontalAdvance(numberText)/2.0,
rectangle.bottom() - fullStepMarkerLength - measurementTextAboveBelowMargin),
numberText);
-#else
- painter.drawText(QPointF(x - fontMetrics.width(numberText)/2.0,
- rectangle.bottom() - fullStepMarkerLength - measurementTextAboveBelowMargin),
- numberText);
-#endif
// start to draw secondary marks following the primary mark
painter.setPen(markerPen);
@@ -501,11 +491,7 @@ void VerticalPaintingStrategy::drawMeasurements(const KoRulerPrivate *d, QPainte
// length of a unit in pixels
const qreal unitLength = d->viewConverter->documentToViewY(d->unit.fromUserValue(1.0));
// length of the text for longest number with some padding
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
const int textLength = fontMetrics.horizontalAdvance(QString::number(qCeil(rulerLengthUnit))) + 20;
-#else
- const int textLength = fontMetrics.width(QString::number(qCeil(rulerLengthUnit))) + 20;
-#endif
// the minimal separation of numbers that won't make the text a mess
const qreal minimalNumberSeparation = qCeil(textLength / unitLength);
@@ -557,13 +543,8 @@ void VerticalPaintingStrategy::drawMeasurements(const KoRulerPrivate *d, QPainte
QPointF(rectangle.right() - fullStepMarkerLength, 0));
painter.setPen(numberPen);
painter.rotate(-90);
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
painter.drawText(QPointF(-fontMetrics.horizontalAdvance(numberText) / 2.0, 0),
numberText);
-#else
- painter.drawText(QPointF(-fontMetrics.width(numberText) / 2.0, 0),
- numberText);
-#endif
painter.restore();
// start to draw secondary marks following the primary mark
@@ -637,22 +618,13 @@ void HorizontalDistancesPaintingStrategy::drawDistanceLine(const KoRulerPrivate
const QFontMetrics fontMetrics(font);
QString label = d->unit.toUserStringValue(
d->viewConverter->viewToDocumentX(line.length())) + ' ' + d->unit.symbol();
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
QPointF labelPosition = QPointF(midPoint.x() - fontMetrics.horizontalAdvance(label)/2,
midPoint.y() + fontMetrics.ascent()/2);
-#else
- QPointF labelPosition = QPointF(midPoint.x() - fontMetrics.width(label)/2,
- midPoint.y() + fontMetrics.ascent()/2);
-#endif
painter.setFont(font);
painter.drawText(labelPosition, label);
// Draw the arrow lines
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
qreal arrowLength = (line.length() - fontMetrics.horizontalAdvance(label)) / 2 - 2;
-#else
- qreal arrowLength = (line.length() - fontMetrics.width(label)) / 2 - 2;
-#endif
arrowLength = qMax(qreal(0.0), arrowLength);
QLineF startArrow(line.p1(), line.pointAt(arrowLength / line.length()));
QLineF endArrow(line.p2(), line.pointAt(1.0 - arrowLength / line.length()));
diff --git a/libs/widgets/KoSliderCombo.cpp b/libs/widgets/KoSliderCombo.cpp
index f17731a2d4..f36f2b8ba6 100644
--- a/libs/widgets/KoSliderCombo.cpp
+++ b/libs/widgets/KoSliderCombo.cpp
@@ -79,11 +79,7 @@ QSize KoSliderCombo::minimumSizeHint() const
QSize sh;
const QFontMetrics &fm = fontMetrics();
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
sh.setWidth(5 * fm.horizontalAdvance(QLatin1Char('8')));
-#else
- sh.setWidth(5 * fm.width(QLatin1Char('8')));
-#endif
sh.setHeight(qMax(fm.lineSpacing(), 14) + 2);
// add style and strut values
diff --git a/libs/widgets/kis_warning_block.cpp b/libs/widgets/kis_warning_block.cpp
index bc81502b72..123e4bda8d 100644
--- a/libs/widgets/kis_warning_block.cpp
+++ b/libs/widgets/kis_warning_block.cpp
@@ -44,11 +44,7 @@ QString KisWarningBlock::text() const
QPixmap KisWarningBlock::pixmap() const
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
return m_d->lblIcon->pixmap(Qt::ReturnByValue);
-#else
- return QPixmap(*m_d->lblIcon->pixmap());
-#endif
}
void KisWarningBlock::setText(const QString &text)
diff --git a/libs/widgetutils/KisActionsSnapshot.cpp b/libs/widgetutils/KisActionsSnapshot.cpp
index efd46ea1da..3c161d7b23 100644
--- a/libs/widgetutils/KisActionsSnapshot.cpp
+++ b/libs/widgetutils/KisActionsSnapshot.cpp
@@ -31,12 +31,7 @@ KisActionsSnapshot::KisActionsSnapshot()
: m_d(new Private)
{
QList<QString> registeredShortcutIds = KisActionRegistry::instance()->registeredShortcutIds();
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
m_d->nonRegisteredShortcuts = QSet<QString>(registeredShortcutIds.begin(), registeredShortcutIds.end());
-#else
- m_d->nonRegisteredShortcuts = QSet<QString>::fromList(registeredShortcutIds);
-#endif
-
}
KisActionsSnapshot::~KisActionsSnapshot()
diff --git a/libs/widgetutils/KoFileDialog.cpp b/libs/widgetutils/KoFileDialog.cpp
index 76f57108bc..505bbcfa4a 100644
--- a/libs/widgetutils/KoFileDialog.cpp
+++ b/libs/widgetutils/KoFileDialog.cpp
@@ -384,11 +384,7 @@ QStringList KoFileDialog::splitNameFilter(const QString &nameFilter, QStringList
description = nameFilter.left(nameFilter.indexOf("(") -1).trimmed();
}
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList entries = nameFilter.mid(nameFilter.indexOf("(") + 1).split(" ", Qt::SkipEmptyParts);
-#else
- QStringList entries = nameFilter.mid(nameFilter.indexOf("(") + 1).split(" ", QString::SkipEmptyParts);
-#endif
entries.sort();
Q_FOREACH (QString entry, entries) {
diff --git a/libs/widgetutils/katecommandbar.cpp b/libs/widgetutils/katecommandbar.cpp
index c95df8caf6..98d117bc10 100644
--- a/libs/widgetutils/katecommandbar.cpp
+++ b/libs/widgetutils/katecommandbar.cpp
@@ -181,11 +181,7 @@ public:
// collect rects for each word
QVector<QPair<QRect, QString>> btns;
const auto list = [&shortcutString] {
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
- auto list = shortcutString.split(QLatin1Char('+'), QString::SkipEmptyParts);
-#else
auto list = shortcutString.split(QLatin1Char('+'), Qt::SkipEmptyParts);
-#endif
if (shortcutString.endsWith(QLatin1String("+"))) {
list.append(QStringLiteral("+"));
}
diff --git a/libs/widgetutils/kis_font_family_combo_box.cpp b/libs/widgetutils/kis_font_family_combo_box.cpp
index 88bf836ee5..df98d98588 100644
--- a/libs/widgetutils/kis_font_family_combo_box.cpp
+++ b/libs/widgetutils/kis_font_family_combo_box.cpp
@@ -124,14 +124,8 @@ void KisFontFamilyComboBox::refillComboBox(QVector<QFontDatabase::WritingSystem>
duplicateFonts.append(family + "_" + style);
}
filteredFonts.append(family);
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
int width = 1.5 * view()->fontMetrics()
.horizontalAdvance(family + " " + fonts.writingSystemSample(QFontDatabase::Any));
-#else
- int width = 1.5 * view()->fontMetrics()
- .width(family + " " + fonts.writingSystemSample(QFontDatabase::Any));
-
-#endif
if (width > maxWidth) {
maxWidth = width;
}
@@ -302,11 +296,7 @@ void KisFontComboBoxes::fontFamilyChanged()
}
if (!styles.contains(style)) {
styles.insert(bindex, style);
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
maxWidth = qMax(m_styles->view()->fontMetrics().horizontalAdvance(style + " "), maxWidth);
-#else
- maxWidth = qMax(m_styles->view()->fontMetrics().width(style + " "), maxWidth);
-#endif
}
}
m_styles->addItems(styles);
diff --git a/libs/widgetutils/xmlgui/kactioncollection.cpp b/libs/widgetutils/xmlgui/kactioncollection.cpp
index 91030e5412..2d2e4b8b17 100644
--- a/libs/widgetutils/xmlgui/kactioncollection.cpp
+++ b/libs/widgetutils/xmlgui/kactioncollection.cpp
@@ -236,11 +236,7 @@ const QList< QActionGroup * > KisKActionCollection::actionGroups() const
if (action->actionGroup()) {
set.insert(action->actionGroup());
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
return QList<QActionGroup*>(set.begin(), set.end());
-#else
- return QList<QActionGroup*>::fromSet(set);
-#endif
}
QAction *KisKActionCollection::addCategorizedAction(const QString &name, QAction *action, const QString &categoryName)
diff --git a/plugins/dockers/advancedcolorselector/kis_common_colors_recalculation_runner.cpp b/plugins/dockers/advancedcolorselector/kis_common_colors_recalculation_runner.cpp
index c5128b1a3e..9124c9e9f2 100644
--- a/plugins/dockers/advancedcolorselector/kis_common_colors_recalculation_runner.cpp
+++ b/plugins/dockers/advancedcolorselector/kis_common_colors_recalculation_runner.cpp
@@ -212,9 +212,5 @@ QList<QRgb> KisCommonColorsRecalculationRunner::getColors()
colorList.insert(tmpImage.pixel(i, j)|qRgba(0,0,0,255));
}
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
return QList<QRgb>(colorList.begin(), colorList.end());
-#else
- return QList<QRgb>::fromSet(colorList);
-#endif
}
diff --git a/plugins/dockers/advancedcolorselector/kis_minimal_shade_selector.cpp b/plugins/dockers/advancedcolorselector/kis_minimal_shade_selector.cpp
index db0e64de37..16ca79617b 100644
--- a/plugins/dockers/advancedcolorselector/kis_minimal_shade_selector.cpp
+++ b/plugins/dockers/advancedcolorselector/kis_minimal_shade_selector.cpp
@@ -70,11 +70,7 @@ void KisMinimalShadeSelector::updateSettings()
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
QString stri = cfg.readEntry("minimalShadeSelectorLineConfig", "0|0.2|0|0");
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList strili = stri.split(';', Qt::SkipEmptyParts);
-#else
- QStringList strili = stri.split(';', QString::SkipEmptyParts);
-#endif
int lineCount = strili.size();
while(lineCount-m_shadingLines.size() > 0) {
diff --git a/plugins/dockers/advancedcolorselector/kis_shade_selector_line_combo_box.cpp b/plugins/dockers/advancedcolorselector/kis_shade_selector_line_combo_box.cpp
index b74fffee97..b0552b4197 100644
--- a/plugins/dockers/advancedcolorselector/kis_shade_selector_line_combo_box.cpp
+++ b/plugins/dockers/advancedcolorselector/kis_shade_selector_line_combo_box.cpp
@@ -63,7 +63,6 @@ void KisShadeSelectorLineComboBox::showPopup()
m_popup->show();
const int widgetMargin = 20;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QScreen *screen = qApp->screenAt(QCursor::pos());
QRect fitRect;
if (screen) {
@@ -72,9 +71,6 @@ void KisShadeSelectorLineComboBox::showPopup()
else {
fitRect = kisGrowRect(QRect(0, 0, 1024, 768), -widgetMargin);
}
-#else
- QRect fitRect = kisGrowRect(QApplication::desktop()->screenGeometry(), -widgetMargin);
-#endif
QRect popupRect = m_popup->rect();
popupRect.moveTo(mapToGlobal(QPoint()));
popupRect = kisEnsureInRect(popupRect, fitRect);
diff --git a/plugins/dockers/advancedcolorselector/kis_shade_selector_lines_settings.cpp b/plugins/dockers/advancedcolorselector/kis_shade_selector_lines_settings.cpp
index 8a001e75c2..4cd681b0a9 100644
--- a/plugins/dockers/advancedcolorselector/kis_shade_selector_lines_settings.cpp
+++ b/plugins/dockers/advancedcolorselector/kis_shade_selector_lines_settings.cpp
@@ -33,11 +33,7 @@ QString KisShadeSelectorLinesSettings::toString() const
void KisShadeSelectorLinesSettings::fromString(const QString &stri)
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList strili = stri.split(';', Qt::SkipEmptyParts);
-#else
- QStringList strili = stri.split(';', QString::SkipEmptyParts);
-#endif
setLineCount(strili.size());
for(int i=0; i<strili.size(); i++) {
diff --git a/plugins/dockers/animation/KisAnimTimelineFramesView.cpp b/plugins/dockers/animation/KisAnimTimelineFramesView.cpp
index 7d9dcd3e94..be3f113507 100644
--- a/plugins/dockers/animation/KisAnimTimelineFramesView.cpp
+++ b/plugins/dockers/animation/KisAnimTimelineFramesView.cpp
@@ -1463,11 +1463,7 @@ void KisAnimTimelineFramesView::insertKeyframes(int count, int timing, TimelineD
}
if (!rows.isEmpty()) {
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
m_d->model->insertFrames(insertionColumn, QList<int>(rows.begin(), rows.end()), count, timing);
-#else
- m_d->model->insertFrames(insertionColumn, QList<int>::fromSet(rows), count, timing);
-#endif
}
}
diff --git a/plugins/dockers/lut/lutdocker_dock.cpp b/plugins/dockers/lut/lutdocker_dock.cpp
index 244ca1a80f..af3243715c 100644
--- a/plugins/dockers/lut/lutdocker_dock.cpp
+++ b/plugins/dockers/lut/lutdocker_dock.cpp
@@ -229,11 +229,7 @@ bool LutDockerDock::canChangeExposureAndGamma() const
#ifdef HAVE_HDR
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
KisSurfaceColorSpace currentColorSpace = KisOpenGLModeProber::instance()->surfaceformatInUse().colorSpace();
-#else
- KisSurfaceColorSpace currentColorSpace = KisSurfaceColorSpace::DefaultColorSpace;
-#endif
#endif
const bool exposureManagementEnabled =
diff --git a/plugins/dockers/presethistory/presethistory_dock.cpp b/plugins/dockers/presethistory/presethistory_dock.cpp
index 0cb75de586..b7d05ba625 100644
--- a/plugins/dockers/presethistory/presethistory_dock.cpp
+++ b/plugins/dockers/presethistory/presethistory_dock.cpp
@@ -98,11 +98,7 @@ void PresetHistoryDock::setCanvas(KoCanvasBase * canvas)
if (!m_initialized) {
KisConfig cfg(true);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList presetHistory = cfg.readEntry<QString>("presethistory", "").split(",", Qt::SkipEmptyParts);
-#else
- QStringList presetHistory = cfg.readEntry<QString>("presethistory", "").split(",", QString::SkipEmptyParts);
-#endif
m_presetLimit = cfg.readEntry("presethistoryLimit", 10);
diff --git a/plugins/dockers/recorder/recorder_snapshots_manager.cpp b/plugins/dockers/recorder/recorder_snapshots_manager.cpp
index f538735f53..4b56aa2ba0 100644
--- a/plugins/dockers/recorder/recorder_snapshots_manager.cpp
+++ b/plugins/dockers/recorder/recorder_snapshots_manager.cpp
@@ -22,25 +22,6 @@
namespace
{
-#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
-// FIXME This is to support Ubuntu 16.04. Remove this after dropping support of Qt < 5.10.
-QString qlocale_formattedDataSize(qint64 bytes)
-{
- static QStringList suffixes = {"B", "KiB", "MiB", "GiB", "TiB"};
- constexpr const qreal divider = 1024;
-
- int index = 0;
- qreal size = bytes;
-
- while (size > divider && index < suffixes.length()) {
- size /= divider;
- ++index;
- }
-
- return QString("%1 %2").arg(size, 0, 'f', 1).arg(suffixes[index]);
-}
-#endif
-
constexpr int valueRole = Qt::UserRole + 1;
constexpr int defaultColumnMargin = 16;
@@ -148,11 +129,7 @@ void RecorderSnapshotsManager::onScanningFinished(SnapshotDirInfoList snapshots)
model->appendRow({
new CheckedIconItem(info.thumbnail, ui->treeDirectories->iconSize()),
nameCol,
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
new DataSortedItem(locale.formattedDataSize(info.size), info.size),
-#else
- new DataSortedItem(qlocale_formattedDataSize(info.size), info.size),
-#endif
new DataSortedItem(info.dateTime.toString(dateFormat), info.dateTime.toMSecsSinceEpoch())
});
}
@@ -214,12 +191,7 @@ void RecorderSnapshotsManager::updateSpaceToBeFreed()
QAbstractItemModel *model = ui->treeDirectories->model();
for (const QModelIndex &index : indexes)
totalSize += model->data(index, valueRole).toULongLong();
-
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
ui->labelSpace->setText(locale().formattedDataSize(totalSize));
-#else
- ui->labelSpace->setText(qlocale_formattedDataSize(totalSize));
-#endif
ui->buttonSelectAll->setText(indexes.size() != model->rowCount() ? i18n("Select All") : i18n("Select None"));
}
diff --git a/plugins/dockers/smallcolorselector/KisGLImageWidget.cpp b/plugins/dockers/smallcolorselector/KisGLImageWidget.cpp
index 1bc7480454..aa6e2d9ee2 100644
--- a/plugins/dockers/smallcolorselector/KisGLImageWidget.cpp
+++ b/plugins/dockers/smallcolorselector/KisGLImageWidget.cpp
@@ -49,9 +49,7 @@ KisGLImageWidget::KisGLImageWidget(KisSurfaceColorSpace colorSpace,
{
Q_UNUSED(colorSpace);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
setTextureFormat(GL_RGBA16F);
-#endif
#ifdef HAVE_HDR
setTextureColorSpace(colorSpace);
diff --git a/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp b/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp
index c66e64878f..2bbc593fd4 100644
--- a/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp
+++ b/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp
@@ -76,11 +76,7 @@ void StoryboardDelegate::paint(QPainter *p, const QStyleOptionViewItem &option,
if (m_view->thumbnailIsVisible()) {
QRect frameNumRect = option.rect;
frameNumRect.setHeight(m_view->fontMetrics().height()+3);
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
frameNumRect.setWidth(3 * m_view->fontMetrics().horizontalAdvance("0") + 2);
-#else
- frameNumRect.setWidth(3 * m_view->fontMetrics().width('0') + 2);
-#endif
frameNumRect.moveBottom(option.rect.top()-1);
p->setPen(QPen(option.palette.dark(), 2));
p->drawRect(frameNumRect);
diff --git a/plugins/dockers/storyboarddocker/StoryboardUtils.cpp b/plugins/dockers/storyboarddocker/StoryboardUtils.cpp
index 97c69577ff..3433343530 100644
--- a/plugins/dockers/storyboarddocker/StoryboardUtils.cpp
+++ b/plugins/dockers/storyboarddocker/StoryboardUtils.cpp
@@ -2,9 +2,5 @@
QModelIndex siblingAtRow(const QModelIndex &index, int row)
{
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
return index.siblingAtRow(row);
-#else
- return index.sibling(row, index.column());
-#endif
}
diff --git a/plugins/dockers/storyboarddocker/StoryboardView.cpp b/plugins/dockers/storyboarddocker/StoryboardView.cpp
index 4947ab079d..2c2f11677c 100644
--- a/plugins/dockers/storyboarddocker/StoryboardView.cpp
+++ b/plugins/dockers/storyboarddocker/StoryboardView.cpp
@@ -154,12 +154,7 @@ QRect StoryboardView::visualRect(const QModelIndex &index) const
parentRect.setTopLeft(parentRect.topLeft() + QPoint(5, 5));
parentRect.setBottomRight(parentRect.bottomRight() - QPoint(5, 5));
int fontHeight = fontMetrics().height() + 3;
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
int numericFontWidth = fontMetrics().horizontalAdvance("0");
-#else
- int numericFontWidth = fontMetrics().width("0");
-#endif
-
int parentWidth = parentRect.width();
int childRow = index.row();
diff --git a/plugins/dockers/widegamutcolorselector/WGColorPatches.cpp b/plugins/dockers/widegamutcolorselector/WGColorPatches.cpp
index 4289b34021..2ea72ee021 100644
--- a/plugins/dockers/widegamutcolorselector/WGColorPatches.cpp
+++ b/plugins/dockers/widegamutcolorselector/WGColorPatches.cpp
@@ -20,11 +20,7 @@
namespace {
inline QPoint transposed(QPoint point) {
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
return point.transposed();
-#else
- return QPoint(point.y(), point.x());
-#endif
}
}
WGColorPatches::WGColorPatches(WGSelectorDisplayConfigSP displayConfig, KisUniqueColorSet *history, QWidget *parent)
diff --git a/plugins/dockers/widegamutcolorselector/WGColorSelectorSettings.cpp b/plugins/dockers/widegamutcolorselector/WGColorSelectorSettings.cpp
index c1f1741b7a..6a36e10f6d 100644
--- a/plugins/dockers/widegamutcolorselector/WGColorSelectorSettings.cpp
+++ b/plugins/dockers/widegamutcolorselector/WGColorSelectorSettings.cpp
@@ -49,11 +49,7 @@ WGColorSelectorSettings::WGColorSelectorSettings(QWidget *parent)
m_shadeLineGroup->setExclusive(false);
slotSetShadeLineCount(m_ui->sbShadeLineCount->value());
-#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
connect(m_shadeLineGroup, SIGNAL(idClicked(int)), SLOT(slotShowLineEditor(int)));
-#else
- connect(m_shadeLineGroup, SIGNAL(buttonClicked(int)), SLOT(slotShowLineEditor(int)));
-#endif
}
WGColorSelectorSettings::~WGColorSelectorSettings()
diff --git a/plugins/dockers/widegamutcolorselector/WGCommonColorsCalculationRunner.cpp b/plugins/dockers/widegamutcolorselector/WGCommonColorsCalculationRunner.cpp
index f61cad1f43..522e21135f 100644
--- a/plugins/dockers/widegamutcolorselector/WGCommonColorsCalculationRunner.cpp
+++ b/plugins/dockers/widegamutcolorselector/WGCommonColorsCalculationRunner.cpp
@@ -232,9 +232,5 @@ QList<QRgb> WGCommonColorsCalculationRunner::getColors()
colorList.insert(tmpImage.pixel(i, j)|qRgba(0,0,0,255));
}
}
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
return QList<QRgb>(colorList.begin(), colorList.end());
-#else
- return QList<QRgb>::fromSet(colorList);
-#endif
}
diff --git a/plugins/dockers/widegamutcolorselector/WGQuickSettingsWidget.cpp b/plugins/dockers/widegamutcolorselector/WGQuickSettingsWidget.cpp
index 2aa9dbacf6..1b16085f78 100644
--- a/plugins/dockers/widegamutcolorselector/WGQuickSettingsWidget.cpp
+++ b/plugins/dockers/widegamutcolorselector/WGQuickSettingsWidget.cpp
@@ -27,11 +27,7 @@ WGQuickSettingsWidget::WGQuickSettingsWidget(QWidget *parent, KisVisualColorSele
m_modelGroup->addButton(m_ui->btnHSL, KisVisualColorModel::HSL);
m_modelGroup->addButton(m_ui->btnHSI, KisVisualColorModel::HSI);
m_modelGroup->addButton(m_ui->btnHSY, KisVisualColorModel::HSY);
-#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
connect(m_modelGroup, SIGNAL(idToggled(int,bool)), SLOT(slotColorGroupToggled(int,bool)));
-#else
- connect(m_modelGroup, SIGNAL(buttonToggled(int,bool)), SLOT(slotColorGroupToggled(int,bool)));
-#endif
m_selectorConf = new WGSelectorConfigGrid(this);
m_ui->verticalLayout->addWidget(m_selectorConf);
diff --git a/plugins/generators/multigridpattern/multigridpatterngenerator.cpp b/plugins/generators/multigridpattern/multigridpatterngenerator.cpp
index 5abb3a227d..5faa0c77b0 100644
--- a/plugins/generators/multigridpattern/multigridpatterngenerator.cpp
+++ b/plugins/generators/multigridpattern/multigridpatterngenerator.cpp
@@ -177,11 +177,7 @@ void KisMultigridPatternGenerator::generate(KisProcessingInformation dstInfo,
lineWidthTransform.scale(scaleForLineWidth, scaleForLineWidth);
shape = lineWidthTransform.map(shape);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
if (shape.intersects(bounds) && shape.boundingRect().width()>0) {
-#else
- if (!shape.intersected(bounds).isEmpty() && shape.boundingRect().width()>0) {
-#endif
QPainterPath p;
p.addPolygon(lineWidthTransform.map(shape));
diff --git a/plugins/impex/jxl/JPEGXLExport.cpp b/plugins/impex/jxl/JPEGXLExport.cpp
index b5e81a540b..d006b3bd2c 100644
--- a/plugins/impex/jxl/JPEGXLExport.cpp
+++ b/plugins/impex/jxl/JPEGXLExport.cpp
@@ -671,12 +671,8 @@ KisImportExportErrorCode JPEGXLExport::convert(KisDocument *document, QIODevice
const auto *frames = projection->paintDevice()->keyframeChannel();
const auto times = [&]() {
QList<int> t;
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
QSet<int> s = frames->allKeyframeTimes();
t = QList<int>(s.begin(), s.end());
-#else
- t = frames->allKeyframeTimes();.toList();
-#endif
std::sort(t.begin(), t.end());
return t;
}();
diff --git a/plugins/impex/raw/3rdparty/libkdcraw/src/rsliderspinbox.cpp b/plugins/impex/raw/3rdparty/libkdcraw/src/rsliderspinbox.cpp
index b6ae232c30..854479a13b 100644
--- a/plugins/impex/raw/3rdparty/libkdcraw/src/rsliderspinbox.cpp
+++ b/plugins/impex/raw/3rdparty/libkdcraw/src/rsliderspinbox.cpp
@@ -363,11 +363,7 @@ QSize RAbstractSliderSpinBox::sizeHint() const
QFontMetrics fm(font());
// We need at least 50 pixels or things start to look bad
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
int w = qMax(fm.horizontalAdvance(QString::number(d->maximum)), 50);
-#else
- int w = qMax(fm.width(QString::number(d->maximum)), 50);
-#endif
QSize hint(w, d->edit->sizeHint().height() + 3);
// Getting the size of the buttons is a pain as the calcs require a rect
diff --git a/plugins/impex/raw/3rdparty/libkdcraw/src/rwidgetutils.cpp b/plugins/impex/raw/3rdparty/libkdcraw/src/rwidgetutils.cpp
index 94e2db876c..1ea286bd0d 100644
--- a/plugins/impex/raw/3rdparty/libkdcraw/src/rwidgetutils.cpp
+++ b/plugins/impex/raw/3rdparty/libkdcraw/src/rwidgetutils.cpp
@@ -257,7 +257,6 @@ QSize RAdjustableLabel::minimumSizeHint() const
QSize RAdjustableLabel::sizeHint() const
{
QFontMetrics fm(fontMetrics());
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QRect geom = geometry();
QPoint p(geom.width() / 2 + geom.left(), geom.height() / 2 + geom.top());
QScreen *s = qApp->screenAt(p);
@@ -268,15 +267,7 @@ QSize RAdjustableLabel::sizeHint() const
else {
maxW = 1024;
}
-#else
- int maxW = QApplication::desktop()->screenGeometry(this).width() * 3 / 4;
-#endif
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
int currentW = fm.horizontalAdvance(d->ajdText);
-#else
- int currentW = fm.width(d->ajdText);
-#endif
return (QSize(currentW > maxW ? maxW : currentW, QLabel::sizeHint().height()));
}
@@ -318,11 +309,7 @@ void RAdjustableLabel::adjustTextToLabel()
Q_FOREACH(const QString& line, d->ajdText.split(QLatin1Char('\n')))
{
-#if QT_VERSION >= QT_VERSION_CHECK(5,11,0)
int lineW = fm.horizontalAdvance(line);
-#else
- int lineW = fm.width(line);
-#endif
if (lineW > lblW)
{
adjusted = true;
diff --git a/plugins/impex/webp/kis_webp_export.cpp b/plugins/impex/webp/kis_webp_export.cpp
index be98b710ac..8df6db45af 100644
--- a/plugins/impex/webp/kis_webp_export.cpp
+++ b/plugins/impex/webp/kis_webp_export.cpp
@@ -245,12 +245,8 @@ KisImportExportErrorCode KisWebPExport::convert(KisDocument *document, QIODevice
projection->paintDevice()->keyframeChannel();
const auto times = [&]() -> QList<int> {
QList<int> t;
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
QSet<int> s = frames->allKeyframeTimes();
t = QList<int>(s.begin(), s.end());
-#else
- t = frames->allKeyframeTimes().toList();
-#endif
std::sort(t.begin(), t.end());
return t;
}();
diff --git a/plugins/paintops/libpaintop/KisKritaSensorPack.cpp b/plugins/paintops/libpaintop/KisKritaSensorPack.cpp
index d37b44c0a5..607c80f5e1 100644
--- a/plugins/paintops/libpaintop/KisKritaSensorPack.cpp
+++ b/plugins/paintops/libpaintop/KisKritaSensorPack.cpp
@@ -128,16 +128,10 @@ bool KisKritaSensorPack::read(KisCurveOptionDataCommon &data, const KisPropertie
QSet<KisSensorData*> sensorsToReset;
-#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
-
QList l = sensorById.values();
if (!l.isEmpty()) {
sensorsToReset = QSet<KisSensorData*>(l.begin(), l.end());
}
-#else
- sensorsToReset =
- QSet<KisSensorData*>::fromList(sensorById.values());
-#endif
const QString sensorDefinition = setting->getString(data.id.id() + "Sensor");
diff --git a/plugins/tools/basictools/kis_tool_fill.cc b/plugins/tools/basictools/kis_tool_fill.cc
index ec57c0d4f1..81bf19f3d0 100644
--- a/plugins/tools/basictools/kis_tool_fill.cc
+++ b/plugins/tools/basictools/kis_tool_fill.cc
@@ -925,11 +925,7 @@ void KisToolFill::loadConfiguration()
}
}
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
const QStringList colorLabelsStr = m_configGroup.readEntry<QString>("colorLabels", "").split(',', Qt::SkipEmptyParts);
-#else
- const QStringList colorLabelsStr = m_configGroup.readEntry<QString>("colorLabels", "").split(',', QString::SkipEmptyParts);
-#endif
m_selectedColorLabels.clear();
for (const QString &colorLabelStr : colorLabelsStr) {
bool ok;
diff --git a/plugins/tools/tool_enclose_and_fill/KisToolEncloseAndFill.cpp b/plugins/tools/tool_enclose_and_fill/KisToolEncloseAndFill.cpp
index 09b09f1606..03468ad34f 100644
--- a/plugins/tools/tool_enclose_and_fill/KisToolEncloseAndFill.cpp
+++ b/plugins/tools/tool_enclose_and_fill/KisToolEncloseAndFill.cpp
@@ -837,11 +837,7 @@ void KisToolEncloseAndFill::loadConfiguration()
}
}
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
const QStringList colorLabelsStr = m_configGroup.readEntry<QString>("colorLabels", "").split(',', Qt::SkipEmptyParts);
-#else
- const QStringList colorLabelsStr = m_configGroup.readEntry<QString>("colorLabels", "").split(',', QString::SkipEmptyParts);
-#endif
m_selectedColorLabels.clear();
for (const QString &colorLabelStr : colorLabelsStr) {