Commit 7dab0bbd authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

DEPENDENCY CHANGE! Require at least Qt 5.15.2

parent a33735ea
Pipeline #194147 passed with stage
in 10 minutes and 36 seconds
......@@ -58,7 +58,7 @@ find_package(KF5 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config ConfigW
OPTIONAL_COMPONENTS DocTools FileMetaData Crash Purpose)
# Qt
set(QT_MIN_VERSION 5.11.0)
set(QT_MIN_VERSION 5.15.2)
if (NOT DEFINED QT_MAJOR_VERSION)
set(QT_MAJOR_VERSION 5)
endif()
......@@ -72,6 +72,7 @@ if(NOT NODBUS)
find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS DBus)
endif()
add_definitions(-DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING)
#add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F02)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt${QT_MAJOR_VERSION}Widgets_EXECUTABLE_COMPILE_FLAGS}")
# MLT
......
......@@ -47,11 +47,7 @@ int main(int argc, char **argv)
if (args.count() > 5 && args.at(0) == QLatin1String("-split")) {
args.removeFirst();
// chunks to render
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList chunks = args.at(0).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
QStringList chunks = args.at(0).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
args.removeFirst();
// chunk size in frames
int chunkSize = args.at(0).toInt();
......@@ -63,11 +59,7 @@ int main(int argc, char **argv)
QString extension = args.at(0);
args.removeFirst();
// avformat consumer params
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList consumerParams = args.at(0).split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
QStringList consumerParams = args.at(0).split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
args.removeFirst();
QDir baseFolder(target);
......
......@@ -61,7 +61,7 @@ KeyframeView::KeyframeView(std::shared_ptr<KeyframeModelList> model, int duratio
KeyframeView::~KeyframeView()
{
QObject::disconnect( m_centerConnection );
QObject::disconnect(m_centerConnection);
}
void KeyframeView::slotModelChanged()
......
......@@ -297,11 +297,7 @@ void AssetParameterModel::internalSetParameter(const QString &name, const QStrin
if (m_params.count(name) > 0) {
ParamType type = m_params.at(name).type;
if (type == ParamType::Curve) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList vals = paramValue.split(QLatin1Char(';'), QString::SkipEmptyParts);
#else
QStringList vals = paramValue.split(QLatin1Char(';'), Qt::SkipEmptyParts);
#endif
int points = vals.size();
m_asset->set("3", points / 10.);
m_params[QStringLiteral("3")].value = points / 10.;
......
......@@ -28,18 +28,8 @@ ButtonParamWidget::ButtonParamWidget(std::shared_ptr<AssetParameterModel> model,
// setEnabled(m_model->getOwnerId().first != ObjectType::TimelineTrack);
auto *layout = new QVBoxLayout(this);
QVariantList filterData = m_model->data(m_index, AssetParameterModel::FilterJobParamsRole).toList();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList filterAddedParams = m_model->data(m_index, AssetParameterModel::FilterParamsRole).toString().split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
QStringList filterAddedParams = m_model->data(m_index, AssetParameterModel::FilterParamsRole).toString().split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList consumerParams =
m_model->data(m_index, AssetParameterModel::FilterConsumerParamsRole).toString().split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
QStringList consumerParams = m_model->data(m_index, AssetParameterModel::FilterConsumerParamsRole).toString().split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
QString conditionalInfo;
QString defaultValue;
for (const QVariant &jobElement : qAsConst(filterData)) {
......
......@@ -129,11 +129,7 @@ QSize WheelContainer::minimumSizeHint() const
void WheelContainer::wheelEvent(QWheelEvent *event)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
if (m_sliderRegion.contains(event->pos())) {
#else
if (m_sliderRegion.contains(event->position().toPoint())) {
#endif
double y = m_color.valueF();
if (event->modifiers() & Qt::ShiftModifier) {
y += event->angleDelta().y() > 0 ? 0.002 : -0.002;
......
......@@ -58,11 +58,7 @@ private:
setPixmap(QPixmap());
} else {
auto color = CurveParamWidget<CurveWidget_t>::modeToColorsRGB(m_mode);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
setPixmap(QPixmap::fromImage(ColorTools::rgbCurveLine(s, color, palette().background().color().rgb())).transformed(t));
#else
setPixmap(QPixmap::fromImage(ColorTools::rgbCurveLine(s, color, palette().window().color().rgb())).transformed(t));
#endif
}
}
......
......@@ -51,17 +51,17 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include <KActionMenu>
#include <KColorScheme>
#include <KIO/ApplicationLauncherJob>
#include <KIO/JobUiDelegate>
#include <KIO/OpenFileManagerWindowJob>
#include <KIconEffect>
#include <KIconTheme>
#include <KMessageBox>
#include <KOpenWithDialog>
#include <KRatingPainter>
#include <KService>
#include <KXMLGUIFactory>
#include <kwidgetsaddons_version.h>
#include <KService>
#include <KIO/ApplicationLauncherJob>
#include <KIO/JobUiDelegate>
#include <KOpenWithDialog>
#include <QCryptographicHash>
#include <QDrag>
......@@ -4015,8 +4015,7 @@ void Bin::slotOpenClipExtern()
case ClipType::TextTemplate:
showTitleWidget(clip);
break;
case ClipType::Image:
{
case ClipType::Image: {
if (KdenliveSettings::defaultimageappId().isEmpty() && !KdenliveSettings::defaultimageapp().isEmpty()) {
// Keep for compatibility
QProcess::startDetached(KdenliveSettings::defaultimageapp(), {clip->url()});
......@@ -4046,10 +4045,8 @@ void Bin::slotOpenClipExtern()
} else {
KMessageBox::sorry(QApplication::activeWindow(), i18n("Please set a default application to open image files in the Settings dialog"));
}
}
break;
case ClipType::Audio:
{
} break;
case ClipType::Audio: {
if (KdenliveSettings::defaultaudioappId().isEmpty() && !KdenliveSettings::defaultaudioapp().isEmpty()) {
// Keep for compatibility
QProcess::startDetached(KdenliveSettings::defaultaudioapp(), {clip->url()});
......@@ -4079,8 +4076,7 @@ void Bin::slotOpenClipExtern()
} else {
KMessageBox::sorry(QApplication::activeWindow(), i18n("Please set a default application to open audio files in the Settings dialog"));
}
}
break;
} break;
case ClipType::Animation: {
QString glaxBinary = QStandardPaths::findExecutable(QStringLiteral("glaxnimate"));
if (glaxBinary.isEmpty()) {
......@@ -4167,11 +4163,7 @@ void Bin::slotGotFilterJobResults(const QString &id, int startPos, int track, co
QString label = filterInfo.value(QStringLiteral("label"));
QString key = filterInfo.value(QStringLiteral("key"));
int offset = filterInfo.value(QStringLiteral("offset")).toInt();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList value = results.value(key).split(QLatin1Char(';'), QString::SkipEmptyParts);
#else
QStringList value = results.value(key).split(QLatin1Char(';'), Qt::SkipEmptyParts);
#endif
// qCDebug(KDENLIVE_LOG)<<"// RESULT; "<<key<<" = "<<value;
if (filterInfo.contains(QStringLiteral("resultmessage"))) {
QString mess = filterInfo.value(QStringLiteral("resultmessage"));
......
......@@ -120,9 +120,12 @@ void SubtitleModel::importSubtitle(const QString &filePath, int offset, bool ext
};
GenTime subtitleOffset(offset, pCore->getCurrentFps());
if (filePath.endsWith(".srt") || filePath.endsWith(".vtt") || filePath.endsWith(".sbv")) {
//if (!filePath.endsWith(".vtt") || !filePath.endsWith(".sbv")) {defaultTurn = -10;}
if (filePath.endsWith(".vtt") || filePath.endsWith(".sbv")) {defaultTurn = -10; turn = defaultTurn;}
endIndex = filePath.endsWith(".sbv") ? 1 : 2;
// if (!filePath.endsWith(".vtt") || !filePath.endsWith(".sbv")) {defaultTurn = -10;}
if (filePath.endsWith(".vtt") || filePath.endsWith(".sbv")) {
defaultTurn = -10;
turn = defaultTurn;
}
endIndex = filePath.endsWith(".sbv") ? 1 : 2;
QFile srtFile(filePath);
if (!srtFile.exists() || !srtFile.open(QIODevice::ReadOnly)) {
qDebug() << " File not found " << filePath;
......@@ -136,13 +139,13 @@ void SubtitleModel::importSubtitle(const QString &filePath, int offset, bool ext
stream.setCodec(QTextCodec::codecForName("UTF-8"));
#endif
QString line;
QStringList srtTime;
QRegExp rx("([0-9]{1,2}):([0-9]{2})");
QLatin1Char separator = filePath.endsWith(".sbv") ? QLatin1Char(',') : QLatin1Char(' ');
QStringList srtTime;
QRegExp rx("([0-9]{1,2}):([0-9]{2})");
QLatin1Char separator = filePath.endsWith(".sbv") ? QLatin1Char(',') : QLatin1Char(' ');
while (stream.readLineInto(&line)) {
line = line.simplified();
//qDebug()<<"Turn: "<<turn;
//qDebug()<<"Line: "<<line<<"\n";
// qDebug()<<"Turn: "<<turn;
// qDebug()<<"Line: "<<line<<"\n";
if (!line.isEmpty()) {
if (!turn) {
// index=atoi(line.toStdString().c_str());
......@@ -154,7 +157,7 @@ void SubtitleModel::importSubtitle(const QString &filePath, int offset, bool ext
srtTime = timeLine.split(separator);
if (srtTime.count() > endIndex) {
start = srtTime.at(0);
startPos= stringtoTime(start);
startPos = stringtoTime(start);
end = srtTime.at(endIndex);
endPos = stringtoTime(end);
} else {
......@@ -172,7 +175,7 @@ void SubtitleModel::importSubtitle(const QString &filePath, int offset, bool ext
} else {
if (endPos > startPos) {
addSubtitle(startPos + subtitleOffset, endPos + subtitleOffset, comment, undo, redo, false);
//qDebug()<<"Adding Subtitle: \n Start time: "<<start<<"\n End time: "<<end<<"\n Text: "<<comment;
// qDebug()<<"Adding Subtitle: \n Start time: "<<start<<"\n End time: "<<end<<"\n Text: "<<comment;
} else {
qDebug() << "===== INVALID SUBTITLE FOUND: " << start << "-" << end << ", " << comment;
}
......@@ -315,7 +318,7 @@ void SubtitleModel::importSubtitle(const QString &filePath, int offset, bool ext
update_model();
if (externalImport) {
pCore->pushUndo(undo, redo, i18n("Edit subtitle"));
}
}
}
void SubtitleModel::parseSubtitle(const QString &subPath)
......@@ -421,7 +424,7 @@ bool SubtitleModel::addSubtitle(int id, GenTime start, GenTime end, const QStrin
if (!temporary && end.frames(pCore->getCurrentFps()) > m_timeline->duration()) {
m_timeline->updateDuration();
}
//qDebug() << "Added to model";
// qDebug() << "Added to model";
if (updateFilter) {
emit modelChanged();
}
......
......@@ -8,16 +8,16 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#pragma once
#include <QAudioBuffer>
#include <QAudioRecorder>
#include <QAudioInput>
#include <QAudioRecorder>
#include <QCamera>
#include <QMediaRecorder>
#include <QElapsedTimer>
#include <QIODevice>
#include <QMediaRecorder>
#include <QMutex>
#include <QStringList>
#include <QElapsedTimer>
#include <QUrl>
#include <QTimer>
#include <QMutex>
#include <QUrl>
#include <memory>
class QAudioRecorder;
......
......@@ -89,11 +89,7 @@ QStringList ClipCreationDialog::getExtensions()
allExtensions.append(QStringLiteral("*.rawr"));
}
// process custom user extensions
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList customs = KdenliveSettings::addedExtensions().split(' ', QString::SkipEmptyParts);
#else
const QStringList customs = KdenliveSettings::addedExtensions().split(' ', Qt::SkipEmptyParts);
#endif
if (!customs.isEmpty()) {
for (const QString &ext : customs) {
if (ext.startsWith(QLatin1String("*."))) {
......
......@@ -1519,28 +1519,16 @@ void KdenliveSettingsDialog::slotUpdatev4lDevice()
m_configCapture.kcfg_v4l_format->addItem(i18n("Current settings"));
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList pixelformats = info.split('>', QString::SkipEmptyParts);
#else
QStringList pixelformats = info.split('>', Qt::SkipEmptyParts);
#endif
QString itemSize;
QStringList itemRates;
for (int i = 0; i < pixelformats.count(); ++i) {
QString format = pixelformats.at(i).section(QLatin1Char(':'), 0, 0);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList sizes = pixelformats.at(i).split(':', QString::SkipEmptyParts);
#else
QStringList sizes = pixelformats.at(i).split(':', Qt::SkipEmptyParts);
#endif
sizes.takeFirst();
for (int j = 0; j < sizes.count(); ++j) {
itemSize = sizes.at(j).section(QLatin1Char('='), 0, 0);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
itemRates = sizes.at(j).section(QLatin1Char('='), 1, 1).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
itemRates = sizes.at(j).section(QLatin1Char('='), 1, 1).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
for (int k = 0; k < itemRates.count(); ++k) {
m_configCapture.kcfg_v4l_format->addItem(
QLatin1Char('[') + format + QStringLiteral("] ") + itemSize + QStringLiteral(" (") + itemRates.at(k) + QLatin1Char(')'),
......
......@@ -107,11 +107,7 @@ void MarkerDialog::slotUpdateThumb()
QImage MarkerDialog::markerImage() const
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
return clip_thumb->pixmap()->toImage();
#else
return clip_thumb->pixmap(Qt::ReturnByValue).toImage();
#endif
}
CommentedTime MarkerDialog::newMarker()
......
......@@ -159,11 +159,7 @@ void ProxyTest::startTest()
} else {
parameters << QStringLiteral("-i") << src.fileName();
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList paramList = params.split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
QStringList paramList = params.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
for (const QString &s : qAsConst(paramList)) {
QString t = s.simplified();
if (t != QLatin1String("-noautorotate")) {
......
......@@ -992,11 +992,7 @@ void RemapView::wheelEvent(QWheelEvent *event)
update();
return;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
if (event->position().y() < m_bottomView) {
#else
if (event->y() < m_bottomView) {
#endif
int change = event->angleDelta().y() > 0 ? -1 : 1;
int pos = qBound(0, m_position + change, m_duration - 1);
emit seekToPos(pos + m_inFrame, -1);
......
......@@ -317,29 +317,17 @@ void Wizard::slotUpdateCaptureParameters()
<< QString::number(profileInfo->height()) << QString::number(profileInfo->frame_rate_num())
<< QString::number(profileInfo->frame_rate_den()));
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList pixelformats = formats.split('>', QString::SkipEmptyParts);
#else
QStringList pixelformats = formats.split('>', Qt::SkipEmptyParts);
#endif
QString itemSize;
QString pixelFormat;
QStringList itemRates;
for (int i = 0; i < pixelformats.count(); ++i) {
QString format = pixelformats.at(i).section(QLatin1Char(':'), 0, 0);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList sizes = pixelformats.at(i).split(':', QString::SkipEmptyParts);
#else
QStringList sizes = pixelformats.at(i).split(':', Qt::SkipEmptyParts);
#endif
pixelFormat = sizes.takeFirst();
for (int j = 0; j < sizes.count(); ++j) {
itemSize = sizes.at(j).section(QLatin1Char('='), 0, 0);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
itemRates = sizes.at(j).section(QLatin1Char('='), 1, 1).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
itemRates = sizes.at(j).section(QLatin1Char('='), 1, 1).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
for (int k = 0; k < itemRates.count(); ++k) {
QString formatDescription =
QLatin1Char('[') + format + QStringLiteral("] ") + itemSize + QStringLiteral(" (") + itemRates.at(k) + QLatin1Char(')');
......
......@@ -49,11 +49,7 @@ std::shared_ptr<EffectTreeModel> EffectTreeModel::construct(const QString &categ
if (!KdenliveSettings::gpu_accel() && groupName == i18n("GPU effects")) {
continue;
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList list = groups.at(i).toElement().attribute(QStringLiteral("list")).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
QStringList list = groups.at(i).toElement().attribute(QStringLiteral("list")).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
auto groupItem = self->rootItem->appendChild(QList<QVariant>{groupName, QStringLiteral("root")});
for (const QString &effect : qAsConst(list)) {
effectCategory[effect] = groupItem;
......
......@@ -881,7 +881,7 @@ void EffectStackModel::registerItem(const std::shared_ptr<TreeItem> &item)
// check for subtitle effect
auto ms = m_masterService.lock();
int ct = ms->filter_count();
QVector <int> ixToMove;
QVector<int> ixToMove;
for (int i = 0; i < ct; i++) {
if (ms->filter(i)->get_int("internal_added") > 0) {
ixToMove << i;
......
......@@ -761,11 +761,7 @@ void CollapsibleEffectView::importKeyframes(const QString &kf)
{
QMap<QString, QString> keyframes;
if (kf.contains(QLatin1Char('\n'))) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList params = kf.split(QLatin1Char('\n'), QString::SkipEmptyParts);
#else
const QStringList params = kf.split(QLatin1Char('\n'), Qt::SkipEmptyParts);
#endif
for (const QString &param : params) {
keyframes.insert(param.section(QLatin1Char('='), 0, 0), param.section(QLatin1Char('='), 1));
}
......
......@@ -163,11 +163,7 @@ void CutTask::start(const ObjectId &owner, int in, int out, QObject *object, boo
return;
}
path = ui.file_url->url().toLocalFile();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList encodingParams = ui.extra_params->toPlainText().split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
QStringList encodingParams = ui.extra_params->toPlainText().split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
KdenliveSettings::setAdd_new_clip(ui.add_clip->isChecked());
delete d;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment