Commit 985844f6 authored by Vincent Pinon's avatar Vincent Pinon
Browse files

Fix Qt 5.15 / KF 5.78 warnings

parent 7ba3ff0b
......@@ -19,6 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <KLocalizedContext>
#include "assetlistwidget.hpp"
#include "assets/assetlist/model/assetfilter.hpp"
#include "assets/assetlist/model/assettreemodel.hpp"
......@@ -37,7 +39,7 @@ AssetListWidget::AssetListWidget(QWidget *parent)
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
kdeclarative.setupEngine(engine());
kdeclarative.setupContext();
engine()->rootContext()->setContextObject(new KLocalizedContext(this));
}
AssetListWidget::~AssetListWidget()
......
......@@ -973,9 +973,9 @@ void SubtitleModel::jsontoSubtitle(const QString &data)
QTextStream out(&outF);
out.setCodec("UTF-8");
if (assFormat) {
out<<scriptInfoSection<<endl;
out<<styleSection<<endl;
out<<eventSection;
out<<scriptInfoSection<<'\n';
out<<styleSection<<'\n';
out<<eventSection;
}
for (const auto &entry : qAsConst(list)) {
if (!entry.isObject()) {
......@@ -1031,10 +1031,10 @@ void SubtitleModel::jsontoSubtitle(const QString &data)
.arg(millisec,3,10,QChar('0'));
line++;
if (assFormat) {
//Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
out <<"Dialogue: 0,"<<startTimeString<<","<<endTimeString<<","<<styleName<<",,0000,0000,0000,,"<<dialogue<<endl;
//Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
out <<"Dialogue: 0,"<<startTimeString<<","<<endTimeString<<","<<styleName<<",,0000,0000,0000,,"<<dialogue<<'\n';
} else {
out<<line<<"\n"<<startTimeStringSRT<<" --> "<<endTimeStringSRT<<"\n"<<dialogue<<"\n"<<endl;
out<<line<<"\n"<<startTimeStringSRT<<" --> "<<endTimeStringSRT<<"\n"<<dialogue<<"\n"<<'\n';
}
//qDebug() << "ADDING SUBTITLE to FILE AT START POS: " << startPos <<" END POS: "<<endPos;//<< ", FPS: " << pCore->getCurrentFps();
......
......@@ -788,7 +788,7 @@ QMap<QString, QRect> DvdWizardMenu::buttonsInfo(bool letterbox)
if (button->backMenu()) {
command.prepend(QStringLiteral("g1 = 999;"));
}
info.insertMulti(command, adjustedRect);
info.insert(command, adjustedRect);
}
}
return info;
......
......@@ -19,6 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <KLocalizedContext>
#include "builtstack.hpp"
#include "assets/assetpanel.hpp"
#include "core.h"
......@@ -35,10 +37,10 @@ BuiltStack::BuiltStack(AssetPanel *parent)
, m_model(nullptr)
{
KDeclarative::KDeclarative kdeclarative;
QQmlEngine *eng = engine();
kdeclarative.setDeclarativeEngine(eng);
kdeclarative.setupEngine(eng);
kdeclarative.setupContext();
kdeclarative.setDeclarativeEngine(engine());
kdeclarative.setupEngine(engine());
engine()->rootContext()->setContextObject(new KLocalizedContext(this));
// qmlRegisterType<ColorWheelItem>("Kdenlive.Controls", 1, 0, "ColorWheelItem");
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
setMinimumHeight(300);
......
......@@ -100,6 +100,7 @@
#include <kns3/downloaddialog.h>
#include <kns3/knewstuffaction.h>
#include <ktogglefullscreenaction.h>
#include <kwidgetsaddons_version.h>
#include "kdenlive_debug.h"
#include <QAction>
......@@ -1163,7 +1164,11 @@ void MainWindow::setupActions()
} else {
m_timeFormatButton->setCurrentItem(0);
}
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5,78,0)
connect(m_timeFormatButton, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &MainWindow::slotUpdateTimecodeFormat);
#else
connect(m_timeFormatButton, &KSelectAction::indexTriggered, this, &MainWindow::slotUpdateTimecodeFormat);
#endif
m_timeFormatButton->setToolBarMode(KSelectAction::MenuMode);
m_timeFormatButton->setToolButtonPopupMode(QToolButton::InstantPopup);
addAction(QStringLiteral("timeline_timecode"), m_timeFormatButton);
......@@ -1511,7 +1516,11 @@ void MainWindow::setupActions()
monitorGamma->addAction(i18n("Rec. 709 (TV)"));
addAction(QStringLiteral("mlt_gamma"), monitorGamma);
monitorGamma->setCurrentItem(KdenliveSettings::monitor_gamma());
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5,78,0)
connect(monitorGamma, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &MainWindow::slotSetMonitorGamma);
#else
connect(monitorGamma, &KSelectAction::indexTriggered, this, &MainWindow::slotSetMonitorGamma);
#endif
actionCollection()->setShortcutsConfigurable(monitorGamma, false);
addAction(QStringLiteral("switch_trim"), i18n("Trim Mode"), this, SLOT(slotSwitchTrimMode()), QIcon::fromTheme(QStringLiteral("cursor-arrow")));
......
......@@ -26,6 +26,7 @@
#include <mlt++/Mlt.h>
#include "klocalizedstring.h"
#include <kwidgetsaddons_version.h>
#include <KDualAction>
#include "kdenlive_debug.h"
......@@ -465,7 +466,11 @@ void MonitorManager::setupActions()
} else {
interlace->setCurrentItem(0);
}
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5,78,0)
connect(interlace, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &MonitorManager::slotSetDeinterlacer);
#else
connect(interlace, &KSelectAction::indexTriggered, this, &MonitorManager::slotSetDeinterlacer);
#endif
pCore->window()->addAction(QStringLiteral("mlt_interlace"), interlace);
pCore->window()->actionCollection()->setShortcutsConfigurable(interlace, false);
......@@ -483,7 +488,11 @@ void MonitorManager::setupActions()
} else {
interpol->setCurrentItem(0);
}
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5,78,0)
connect(interpol, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &MonitorManager::slotSetInterpolation);
#else
connect(interpol, &KSelectAction::indexTriggered, this, &MonitorManager::slotSetInterpolation);
#endif
pCore->window()->addAction(QStringLiteral("mlt_interpolation"), interpol);
pCore->window()->actionCollection()->setShortcutsConfigurable(interpol, false);
......
......@@ -187,7 +187,7 @@ QString Timecode::getTimecode(const GenTime &time) const
return getTimecodeSeconds(time);
break;
default:
qCWarning(KDENLIVE_LOG) << "Unknown timecode format specified, defaulting to HH_MM_SS_FF" << endl;
qCWarning(KDENLIVE_LOG) << "Unknown timecode format specified, defaulting to HH_MM_SS_FF" << '\n';
return getTimecodeHH_MM_SS_FF(time);
}
}
......
......@@ -19,6 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <KLocalizedContext>
#include "timelinewidget.h"
#include "../model/builders/meltBuilder.hpp"
#include "assets/keyframes/model/keyframemodel.hpp"
......@@ -58,7 +60,7 @@ TimelineWidget::TimelineWidget(QWidget *parent)
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
kdeclarative.setupEngine(engine());
kdeclarative.setupContext();
engine()->rootContext()->setContextObject(new KLocalizedContext(this));
setClearColor(palette().window().color());
setMouseTracking(true);
registerTimelineItems();
......
......@@ -203,7 +203,7 @@ TitleWidget::TitleWidget(const QUrl &url, QString projectTitlePath, Monitor *mon
twinfo->setMessageType(KMessageWidget::Warning);
twinfo->setCloseButtonVisible(false);
twinfo->setEnabled(true);
gridLayout_12->addWidget(twinfo, 3, 0, 1, 4, 0);
gridLayout_12->addWidget(twinfo, 3, 0, 1, 4);
}
connect(fontColorButton, &KColorButton::changed, this, &TitleWidget::slotUpdateText);
......@@ -2525,7 +2525,6 @@ void TitleWidget::slotAnimStart(bool anim)
} else {
m_startViewport->setZValue(-1000);
m_startViewport->setBrush(QBrush());
m_startViewport->setFlags(nullptr);
if (!anim_end->isChecked()) {
deleteAnimInfoText();
}
......
......@@ -19,6 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <KLocalizedContext>
#include "transitionparameterview.hpp"
#include "transitions/transitionsrepository.hpp"
......@@ -34,7 +36,7 @@ TransitionParameterView::TransitionParameterView(QWidget *parent)
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
kdeclarative.setupEngine(engine());
kdeclarative.setupContext();
engine()->rootContext()->setContextObject(new KLocalizedContext(this));
// Set void model for the moment
auto *model = new QStringListModel();
......
......@@ -55,7 +55,7 @@ bool OtioConvertions::getOtioConverters()
return false;
}
QProcess listAdapters;
listAdapters.start(pyExec);
listAdapters.start(pyExec,QStringList());
listAdapters.write(QStringLiteral(
"from opentimelineio import *\n"
"for a in plugins.ActiveManifest().adapters:\n"
......
......@@ -34,6 +34,8 @@
#include <QFontDatabase>
#include <QStyle>
#include <klocalizedstring.h>
#include <kwidgetsaddons_version.h>
DragValue::DragValue(const QString &label, double defaultValue, int decimals, double min, double max, int id, const QString &suffix, bool showSlider, bool oddOnly,
QWidget *parent)
......@@ -142,7 +144,11 @@ DragValue::DragValue(const QString &label, double defaultValue, int decimals, do
m_menu->addAction(timeline);
}
connect(this, &QWidget::customContextMenuRequested, this, &DragValue::slotShowContextMenu);
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5,78,0)
connect(m_scale, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &DragValue::slotSetScaleMode);
#else
connect(m_scale, &KSelectAction::indexTriggered, this, &DragValue::slotSetScaleMode);
#endif
connect(m_directUpdate, &QAction::triggered, this, &DragValue::slotSetDirectUpdate);
}
......@@ -518,7 +524,11 @@ void CustomLabel::mouseReleaseEvent(QMouseEvent *e)
void CustomLabel::wheelEvent(QWheelEvent *e)
{
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
if (e->delta() > 0) {
#else
if (e->angleDelta().y() > 0) {
#endif
if (e->modifiers() == Qt::ControlModifier) {
slotValueInc(10);
} else if (e->modifiers() == Qt::AltModifier) {
......
Markdown is supported
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