Commit c0243124 authored by Vincent Pinon's avatar Vincent Pinon
Browse files

fix some more warnings

parent b2ae458f
......@@ -126,7 +126,7 @@ void RenderJob::receivedStderr()
if (m_args.contains(QStringLiteral("pass=1"))) {
m_progress /= 2.0;
} else if (m_args.contains(QStringLiteral("pass=2"))) {
m_progress = 50 + m_progress / 2.0;
m_progress = int(50 + m_progress / 2.0);
}
if ((m_kdenliveinterface != nullptr) && m_kdenliveinterface->isValid()) {
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingProgress"), {m_dest, m_progress, frame});
......@@ -152,7 +152,7 @@ void RenderJob::receivedStderr()
m_jobUiserver->call(QStringLiteral("setProcessedAmount"), qulonglong(frame - m_framein), tr("frames"));
m_jobUiserver->call(QStringLiteral("setSpeed"), qulonglong(speed));
}
m_seconds = elapsedTime;
m_seconds = int(elapsedTime);
m_frame = frame;
m_logstream << QStringLiteral("%1\t%2\t%3\t%4\n").arg(m_seconds).arg(m_frame).arg(m_progress).arg(speed);
}
......@@ -180,7 +180,7 @@ void RenderJob::start()
QDBusInterface kuiserver(QStringLiteral("org.kde.JobViewServer"), QStringLiteral("/JobViewServer"), QStringLiteral("org.kde.JobViewServer"));
QDBusReply<QDBusObjectPath> objectPath =
kuiserver.asyncCall(QStringLiteral("requestView"), QLatin1String("kdenlive"), QLatin1String("kdenlive"), 0x0001);
QString reply = ((QDBusObjectPath)objectPath).path();
QString reply = QDBusObjectPath(objectPath).path();
// Use of the KDE JobViewServer is an ugly hack, it is not reliable
QString dbusView = QStringLiteral("org.kde.JobViewV2");
......@@ -188,7 +188,7 @@ void RenderJob::start()
if ((m_jobUiserver != nullptr) && m_jobUiserver->isValid()) {
m_startTime = QDateTime::currentDateTime();
if (!m_args.contains(QStringLiteral("pass=2"))) {
m_jobUiserver->call(QStringLiteral("setPercent"), (uint)0);
m_jobUiserver->call(QStringLiteral("setPercent"), 0);
}
m_jobUiserver->call(QStringLiteral("setInfoMessage"), tr("Rendering %1").arg(QFileInfo(m_dest).fileName()));
......@@ -256,7 +256,7 @@ void RenderJob::slotCheckProcess(QProcess::ProcessState state)
void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
{
if (m_jobUiserver) {
m_jobUiserver->call(QStringLiteral("setDescriptionField"), (uint)1, tr("Rendered file"), m_dest);
m_jobUiserver->call(QStringLiteral("setDescriptionField"), 1, tr("Rendered file"), m_dest);
m_jobUiserver->call(QStringLiteral("terminate"), QString());
}
if (!isWritable) {
......@@ -280,7 +280,7 @@ void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
QStringList args;
QString error = tr("Rendering of %1 aborted, resulting video will probably be corrupted.").arg(m_dest);
if (m_frame > 0) {
error += QLatin1Char('\n') + tr("Frame: ") + m_frame;
error += QLatin1Char('\n') + tr("Frame: %1").arg(m_frame);
}
args << QStringLiteral("--error") << error;
m_logstream << error << "\n";
......
......@@ -123,7 +123,7 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
res.description = metadata->get("description") ? i18n(metadata->get("description")) + QString(" (%1)").arg(id) : id;
res.author = metadata->get("creator");
res.version_str = metadata->get("version");
res.version = ceil(100 * metadata->get_double("version"));
res.version = int(100 * metadata->get_double("version"));
res.id = res.mltId = assetId;
parseType(metadata, res);
// Create params
......
......@@ -59,7 +59,7 @@ KeyframeView::KeyframeView(std::shared_ptr<KeyframeModelList> model, int duratio
m_colSelected = palette().highlight().color();
m_colKeyframe = scheme.foreground(KColorScheme::NormalText).color();
m_size = QFontInfo(font()).pixelSize() * 3;
m_lineHeight = m_size / 2.1;
m_lineHeight = int(m_size / 2.1);
m_zoomHeight = m_size * 3 / 4;
m_offset = m_size / 4;
setFixedHeight(m_size);
......@@ -278,7 +278,7 @@ void KeyframeView::mousePressEvent(QMouseEvent *event)
double zoomStart = m_zoomHandle.x() * (width() - 2 * m_offset);
double zoomEnd = m_zoomHandle.y() * (width() - 2 * m_offset);
double zoomFactor = (width() - 2 * m_offset) / (zoomEnd - zoomStart);
int pos = ((event->x() - m_offset) / zoomFactor + zoomStart ) / m_scale;
int pos = int(((event->x() - m_offset) / zoomFactor + zoomStart ) / m_scale);
pos = qBound(0, pos, m_duration - 1);
m_moveKeyframeMode = false;
if (event->button() == Qt::LeftButton) {
......@@ -561,7 +561,7 @@ void KeyframeView::mouseDoubleClickEvent(QMouseEvent *event)
double zoomStart = m_zoomHandle.x() * (width() - 2 * m_offset);
double zoomEnd = m_zoomHandle.y() * (width() - 2 * m_offset);
double zoomFactor = (width() - 2 * m_offset) / (zoomEnd - zoomStart);
int pos = ((event->x() - m_offset) / zoomFactor + zoomStart ) / m_scale;
int pos = int(((event->x() - m_offset) / zoomFactor + zoomStart ) / m_scale);
pos = qBound(0, pos, m_duration - 1);
GenTime position(pos + offset, pCore->getCurrentFps());
bool ok;
......@@ -677,12 +677,12 @@ void KeyframeView::paintEvent(QPaintEvent *event)
// Position of left border in frames
double tickOffset = m_zoomStart * m_zoomFactor;
double frameSize = factor * m_scale * m_zoomFactor;
int base = tickOffset / frameSize;
int base = int(tickOffset / frameSize);
tickOffset = frameSize - (tickOffset - (base * frameSize));
// Draw frame ticks
int scaledTick = 0;
for (int i = 0; i < maxWidth / frameSize; i++) {
scaledTick = m_offset + (i * frameSize) + tickOffset;
scaledTick = int(m_offset + (i * frameSize) + tickOffset);
if (scaledTick >= maxWidth + m_offset) {
break;
}
......@@ -750,7 +750,7 @@ void KeyframeView::paintEvent(QPaintEvent *event)
scaledPos *= m_zoomFactor;
scaledPos += m_offset;
QPolygon pa(3);
int cursorwidth = (m_zoomHeight - m_lineHeight) / 1.8;
int cursorwidth = int((m_zoomHeight - m_lineHeight) / 1.8);
QPolygonF position = QPolygonF() << QPointF(-cursorwidth, m_zoomHeight - 3) << QPointF(cursorwidth, m_zoomHeight - 3) << QPointF(0, m_lineHeight + 1);
position.translate(scaledPos, 0);
p.setBrush(m_colKeyframe);
......@@ -759,8 +759,8 @@ void KeyframeView::paintEvent(QPaintEvent *event)
}
// Rubberband
if (m_clickEnd >= 0) {
int min = (qMin(m_clickPoint, m_clickEnd) * m_scale - m_zoomStart) * m_zoomFactor + m_offset;
int max = (qMax(m_clickPoint, m_clickEnd) * m_scale - m_zoomStart) * m_zoomFactor + m_offset;
int min = int((qMin(m_clickPoint, m_clickEnd) * m_scale - m_zoomStart) * m_zoomFactor + m_offset);
int max = int((qMax(m_clickPoint, m_clickEnd) * m_scale - m_zoomStart) * m_zoomFactor + m_offset);
p.setOpacity(0.5);
p.fillRect(QRect(min, 0, max - min, m_lineHeight), palette().highlight());
p.setOpacity(1);
......@@ -771,7 +771,11 @@ void KeyframeView::paintEvent(QPaintEvent *event)
p.setBrush(palette().mid());
p.drawRoundedRect(m_offset, m_zoomHeight + 3, width() - 2 * m_offset, m_size - m_zoomHeight - 3, m_lineHeight / 5, m_lineHeight / 5);
p.setBrush(palette().highlight());
p.drawRoundedRect(m_offset + (width() - m_offset) * m_zoomHandle.x(), m_zoomHeight + 3, (width() - 2 * m_offset) * (m_zoomHandle.y() - m_zoomHandle.x()), m_size - m_zoomHeight - 3, m_lineHeight / 5, m_lineHeight / 5);
p.drawRoundedRect(int(m_offset + (width() - m_offset) * m_zoomHandle.x()),
m_zoomHeight + 3,
int((width() - 2 * m_offset) * (m_zoomHandle.y() - m_zoomHandle.x())),
m_size - m_zoomHeight - 3,
m_lineHeight / 5, m_lineHeight / 5);
}
......
......@@ -124,7 +124,7 @@ WheelContainer::WheelContainer(QString id, QString name, NegQColor color, int un
, m_name(std::move(name))
{
m_initialSize = QSize(m_unitSize * 11, m_unitSize * 11);
m_sliderWidth = m_unitSize * 1.5;
m_sliderWidth = int(m_unitSize * 1.5);
resize(m_initialSize);
setMinimumSize(m_initialSize * .4);
setMaximumSize(m_initialSize * 1.5);
......@@ -405,9 +405,9 @@ void WheelContainer::drawSlider()
{
QPainter painter(&m_image);
painter.setRenderHint(QPainter::Antialiasing);
int ws = wheelSize() + m_unitSize * .2;
int ws = int(wheelSize() + m_unitSize * .2);
qreal scale = qreal(ws + m_sliderWidth) / maximumWidth();
int w = m_sliderWidth * scale - m_unitSize * .4;
int w = int(m_sliderWidth * scale - m_unitSize * .4);
int h = ws - m_margin * 2;
QLinearGradient gradient(0, 0, w, h);
gradient.setColorAt(0.0, Qt::white);
......@@ -465,7 +465,7 @@ void WheelContainer::drawSliderBar(QPainter &painter)
}
int ws = wheelSize();
qreal scale = qreal(ws + m_sliderWidth) / maximumWidth();
int w = m_sliderWidth * scale;
int w = int(m_sliderWidth * scale);
int h = ws - m_margin * 2;
QPen pen(Qt::white);
pen.setWidth(2);
......
......@@ -44,8 +44,8 @@ template <typename Curve_t> void AbstractCurveWidget<Curve_t>::paintBackground(Q
*/
m_wWidth = width() - 1;
m_wHeight = height() - 1;
int offsetX = 1 / 8. * m_zoomLevel * m_wWidth;
int offsetY = 1 / 8. * m_zoomLevel * m_wHeight;
int offsetX = int(1 / 8. * m_zoomLevel * m_wWidth);
int offsetY = int(1 / 8. * m_zoomLevel * m_wHeight);
m_wWidth -= 2 * offsetX;
m_wHeight -= 2 * offsetY;
......
......@@ -408,7 +408,7 @@ template <typename CurveWidget_t> void CurveParamWidget<CurveWidget_t>::slotRefr
if (m_model->data(m_index, AssetParameterModel::TypeRole).template value<ParamType>() == ParamType::Curve) {
QList<QPointF> points;
// Rounding gives really weird results. (int) (10 * 0.3) gives 2! So for now, add 0.5 to get correct result
int number = m_model->data(m_index, AssetParameterModel::Enum3Role).toDouble() * 10 + 0.5;
int number = int(m_model->data(m_index, AssetParameterModel::Enum3Role).toDouble() * 10 + 0.5);
int start = m_model->data(m_index, AssetParameterModel::MinRole).toInt();
// for the curve, inpoints are numbered: 6, 8, 10, 12, 14
// outpoints, 7, 9, 11, 13,15 so we need to deduce these enums
......
......@@ -43,7 +43,7 @@ GeometryEditWidget::GeometryEditWidget(std::shared_ptr<AssetParameterModel> mode
Mlt::GeometryItem item;
QRect rect;
if (geometry.fetch(&item, 0) == 0) {
rect = QRect(item.x(), item.y(), item.w(), item.h());
rect = QRect(int(item.x()), int(item.y()), int(item.w()), int(item.h()));
} else {
// Cannot read value, use random default
rect = QRect(50, 50, 200, 200);
......
......@@ -505,7 +505,7 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
double frameFactor = double(out - in) / br.width();
int offset = 1;
if (limitKeyframes > 0) {
offset = (out - in) / limitKeyframes / frameFactor;
offset = int((out - in) / limitKeyframes / frameFactor);
}
double min = m_dataCombo->currentData(Qt::UserRole + 2).toDouble();
double max = m_dataCombo->currentData(Qt::UserRole + 3).toDouble();
......@@ -534,11 +534,11 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
txtRect.setWidth(br.width() - 4);
txtRect.moveTop(br.height() - txtRect.height());
QRectF drawnText;
int maxHeight = br.height() - txtRect.height() - 2;
int maxHeight = int(br.height() - txtRect.height() - 2);
painter.setPen(textColor);
int rectSize = txtRect.height() / 2;
int rectSize = int(txtRect.height() / 2);
if (xDist > 0) {
painter.fillRect(txtRect.x(), txtRect.top() + rectSize / 2, rectSize, rectSize, cX);
painter.fillRect(int(txtRect.x()), int(txtRect.top() + rectSize / 2), rectSize, rectSize, cX);
txtRect.setX(txtRect.x() + rectSize * 2);
painter.drawText(txtRect, 0, i18nc("X as in x coordinate", "X") + QStringLiteral(" (%1-%2)").arg(m_maximas.at(0).x()).arg(m_maximas.at(0).y()),
&drawnText);
......@@ -547,7 +547,7 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
if (drawnText.isValid()) {
txtRect.setX(drawnText.right() + rectSize);
}
painter.fillRect(txtRect.x(), txtRect.top() + rectSize / 2, rectSize, rectSize, cY);
painter.fillRect(int(txtRect.x()), int(txtRect.top() + rectSize / 2), rectSize, rectSize, cY);
txtRect.setX(txtRect.x() + rectSize * 2);
painter.drawText(txtRect, 0, i18nc("Y as in y coordinate", "Y") + QStringLiteral(" (%1-%2)").arg(m_maximas.at(1).x()).arg(m_maximas.at(1).y()),
&drawnText);
......@@ -556,7 +556,7 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
if (drawnText.isValid()) {
txtRect.setX(drawnText.right() + rectSize);
}
painter.fillRect(txtRect.x(), txtRect.top() + rectSize / 2, rectSize, rectSize, cW);
painter.fillRect(int(txtRect.x()), int(txtRect.top() + rectSize / 2), rectSize, rectSize, cW);
txtRect.setX(txtRect.x() + rectSize * 2);
painter.drawText(txtRect, 0, i18n("Width") + QStringLiteral(" (%1-%2)").arg(m_maximas.at(2).x()).arg(m_maximas.at(2).y()), &drawnText);
}
......@@ -564,7 +564,7 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
if (drawnText.isValid()) {
txtRect.setX(drawnText.right() + rectSize);
}
painter.fillRect(txtRect.x(), txtRect.top() + rectSize / 2, rectSize, rectSize, cH);
painter.fillRect(int(txtRect.x()), int(txtRect.top() + rectSize / 2), rectSize, rectSize, cH);
txtRect.setX(txtRect.x() + rectSize * 2);
painter.drawText(txtRect, 0, i18n("Height") + QStringLiteral(" (%1-%2)").arg(m_maximas.at(3).x()).arg(m_maximas.at(3).y()), &drawnText);
}
......@@ -607,26 +607,26 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
mlt_rect rect2 = animData->anim_get_rect("key", int(i * frameFactor) + in);
if (xDist > 0) {
painter.setPen(cX);
int val1 = (rect1.x - xOffset) * maxHeight / xDist;
int val2 = (rect2.x - xOffset) * maxHeight / xDist;
int val1 = int((rect1.x - xOffset) * maxHeight / xDist);
int val2 = int((rect2.x - xOffset) * maxHeight / xDist);
painter.drawLine(prevPos, maxHeight - val1, i, maxHeight - val2);
}
if (yDist > 0) {
painter.setPen(cY);
int val1 = (rect1.y - yOffset) * maxHeight / yDist;
int val2 = (rect2.y - yOffset) * maxHeight / yDist;
int val1 = int((rect1.y - yOffset) * maxHeight / yDist);
int val2 = int((rect2.y - yOffset) * maxHeight / yDist);
painter.drawLine(prevPos, maxHeight - val1, i, maxHeight - val2);
}
if (wDist > 0) {
painter.setPen(cW);
int val1 = (rect1.w - wOffset) * maxHeight / wDist;
int val2 = (rect2.w - wOffset) * maxHeight / wDist;
int val1 = int((rect1.w - wOffset) * maxHeight / wDist);
int val2 = int((rect2.w - wOffset) * maxHeight / wDist);
painter.drawLine(prevPos, maxHeight - val1, i, maxHeight - val2);
}
if (hDist > 0) {
painter.setPen(cH);
int val1 = (rect1.h - hOffset) * maxHeight / hDist;
int val2 = (rect2.h - hOffset) * maxHeight / hDist;
int val1 = int((rect1.h - hOffset) * maxHeight / hDist);
int val2 = int((rect2.h - hOffset) * maxHeight / hDist);
painter.drawLine(prevPos, maxHeight - val1, i, maxHeight - val2);
}
rect1 = rect2;
......
......@@ -202,7 +202,7 @@ void AudioLevelWidget::paintEvent(QPaintEvent *pe)
continue;
}
//int val = (50 + m_values.at(i)) / 150.0 * rect.height();
p.fillRect(m_offset + i * (m_channelWidth + m_channelDistance) + 1, 0, m_channelFillWidth, height() - (m_values.at(i) * rect.height()), palette().dark());
p.fillRect(m_offset + i * (m_channelWidth + m_channelDistance) + 1, height() - (m_peaks.at(i) * rect.height()), m_channelFillWidth, 1, palette().text());
p.fillRect(m_offset + i * (m_channelWidth + m_channelDistance) + 1, 0, m_channelFillWidth, height() - int(m_values.at(i) * rect.height()), palette().dark());
p.fillRect(m_offset + i * (m_channelWidth + m_channelDistance) + 1, height() - int(m_peaks.at(i) * rect.height()), m_channelFillWidth, 1, palette().text());
}
}
......@@ -131,7 +131,7 @@ MixerWidget::MixerWidget(int tid, Mlt::Tractor *service, QString trackTag, const
, m_balanceFilter(nullptr)
, m_channels(pCore->audioChannels())
, m_balanceSlider(nullptr)
, m_maxLevels(qMax(30, (int)(service->get_fps() * 1.5)))
, m_maxLevels(qMax(30, int(service->get_fps() * 1.5)))
, m_solo(nullptr)
, m_record(nullptr)
, m_collapse(nullptr)
......
......@@ -146,7 +146,7 @@ public:
int type = index.data(AbstractProjectItem::ItemTypeRole).toInt();
int decoWidth = 0;
if (opt.decorationSize.height() > 0) {
decoWidth += r1.height() * pCore->getCurrentDar();
decoWidth += int(r1.height() * pCore->getCurrentDar());
}
int mid = 0;
if (type == AbstractProjectItem::ClipItem || type == AbstractProjectItem::SubClipItem) {
......
......@@ -989,7 +989,7 @@ void SubtitleModel::jsontoSubtitle(const QString &data)
}
double startPos = entryObj[QLatin1String("startPos")].toDouble();
//convert seconds to FORMAT= hh:mm:ss.SS (in .ass) and hh:mm:ss,SSS (in .srt)
int millisec = startPos * 1000;
int millisec = int(startPos * 1000);
int seconds = millisec / 1000;
millisec %=1000;
int minutes = seconds / 60;
......@@ -1009,7 +1009,7 @@ void SubtitleModel::jsontoSubtitle(const QString &data)
.arg(millisec,3,10,QChar('0'));
QString dialogue = entryObj[QLatin1String("dialogue")].toString();
double endPos = entryObj[QLatin1String("endPos")].toDouble();
millisec = endPos * 1000;
millisec = int(endPos * 1000);
seconds = millisec / 1000;
millisec %=1000;
minutes = seconds / 60;
......
......@@ -696,7 +696,7 @@ int ProjectClip::getRecordTime()
bool ok;
int frames = recInfo.section(QLatin1Char(':'), -1).toInt(&ok);
if (ok) {
frames *= pCore->getCurrentFps() / producerFps;
frames *= int(pCore->getCurrentFps() / producerFps);
recInfo.chop(2);
recInfo.append(QString::number(frames).rightJustified(1, QChar('0')));
}
......
......@@ -505,7 +505,7 @@ void ProjectItemModel::clean()
{
QWriteLocker locker(&m_lock);
std::vector<std::shared_ptr<AbstractProjectItem>> toDelete;
toDelete.reserve((size_t)rootItem->childCount());
toDelete.reserve(size_t(rootItem->childCount()));
for (int i = 0; i < rootItem->childCount(); ++i) {
toDelete.push_back(std::static_pointer_cast<AbstractProjectItem>(rootItem->child(i)));
}
......@@ -582,7 +582,7 @@ void ProjectItemModel::loadSubClips(const QString &id, const QString &dataMap, F
std::shared_ptr<AbstractProjectItem> ProjectItemModel::getBinItemByIndex(const QModelIndex &index) const
{
READ_LOCK();
return std::static_pointer_cast<AbstractProjectItem>(getItemById((int)index.internalId()));
return std::static_pointer_cast<AbstractProjectItem>(getItemById(int(index.internalId())));
}
bool ProjectItemModel::requestBinClipDeletion(const std::shared_ptr<AbstractProjectItem> &clip, Fun &undo, Fun &redo)
......
......@@ -54,7 +54,7 @@ QStringList V4lCaptureHandler::getDeviceName(const QString &input)
fprintf(stderr, "Cannot get capabilities.");
// return nullptr;
} else {
devName = strdup((char *)cap.card);
devName = strdup(reinterpret_cast<char *>(cap.card));
if ((cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == 0u) {
// Device cannot capture
captureEnabled = 0;
......
......@@ -59,7 +59,7 @@ MarkerDialog::MarkerDialog(ClipController *clip, const CommentedTime &t, const T
m_in->setRange(0, m_clip->getFramePlaytime());
m_previewTimer->setInterval(100);
connect(m_previewTimer, &QTimer::timeout, this, &MarkerDialog::slotUpdateThumb);
int width = 200 * pCore->getCurrentDar();
int width = int(200 * pCore->getCurrentDar());
QPixmap p(width, 200);
p.fill(Qt::transparent);
switch (m_clip->clipType()) {
......
......@@ -41,7 +41,7 @@ ProfilesDialog::ProfilesDialog(const QString &profileDescription, QWidget *paren
m_view.setupUi(this);
// Add message widget
auto *lay = (QGridLayout *)layout();
auto *lay = static_cast<QGridLayout *>(layout());
m_infoMessage = new KMessageWidget;
lay->addWidget(m_infoMessage, 2, 0, 1, -1);
m_infoMessage->setCloseButtonVisible(true);
......@@ -100,7 +100,7 @@ ProfilesDialog::ProfilesDialog(const QString &profilePath, bool, QWidget *parent
m_view.setupUi(this);
// Add message widget
auto *lay = (QGridLayout *)layout();
auto *lay = static_cast<QGridLayout *>(layout());
m_infoMessage = new KMessageWidget;
lay->addWidget(m_infoMessage, 2, 0, 1, -1);
m_infoMessage->setCloseButtonVisible(true);
......@@ -350,9 +350,9 @@ void ProfilesDialog::slotUpdateDisplay(QString currentProfilePath)
m_view.frame_den->setValue(curProfile->frame_rate_den());
m_view.progressive->setChecked(curProfile->progressive() != 0);
if (curProfile->progressive() != 0) {
m_view.fields->setText(locale.toString((double)curProfile->frame_rate_num() / curProfile->frame_rate_den(), 'f', 2));
m_view.fields->setText(locale.toString(double(curProfile->frame_rate_num() / curProfile->frame_rate_den()), 'f', 2));
} else {
m_view.fields->setText(locale.toString((double)2 * curProfile->frame_rate_num() / curProfile->frame_rate_den(), 'f', 2));
m_view.fields->setText(locale.toString(2.0 * curProfile->frame_rate_num() / curProfile->frame_rate_den(), 'f', 2));
}
int colorix = m_view.colorspace->findData(curProfile->colorspace());
......
......@@ -89,7 +89,7 @@ Wizard::Wizard(bool autoClose, bool appImageCheck, QWidget *parent)
, m_brokenModule(false)
{
setWindowTitle(i18n("Welcome to Kdenlive"));
int logoHeight = fontMetrics().height() * 2.5;
int logoHeight = int(fontMetrics().height() * 2.5);
setWizardStyle(QWizard::ModernStyle);
setOption(QWizard::NoBackButtonOnLastPage, true);
// setOption(QWizard::ExtendedWatermarkPixmap, false);
......
......@@ -154,7 +154,7 @@ void EffectsRepository::parseCustomAssetFile(const QString &file_name, std::unor
const QString effectTag = currentEffect.attribute(QStringLiteral("tag"));
QScopedPointer<Mlt::Properties> metadata(getMetadata(effectTag));
if (metadata && metadata->is_valid()) {
Mlt::Properties tags((mlt_properties)metadata->get_data("tags"));
Mlt::Properties tags(mlt_properties(metadata->get_data("tags")));
if (QString(tags.get(0)) == QLatin1String("Audio")) {
result.type = AssetListType::AssetType::CustomAudio;
currentEffect.setAttribute(QStringLiteral("type"), QStringLiteral("customAudio"));
......@@ -187,7 +187,7 @@ QStringList EffectsRepository::assetDirs() const
void EffectsRepository::parseType(QScopedPointer<Mlt::Properties> &metadata, Info &res)
{
res.type = AssetListType::AssetType::Video;
Mlt::Properties tags((mlt_properties)metadata->get_data("tags"));
Mlt::Properties tags(mlt_properties(metadata->get_data("tags")));
if (QString(tags.get(0)) == QLatin1String("Audio")) {
res.type = AssetListType::AssetType::Audio;
}
......
......@@ -289,7 +289,7 @@ CollapsibleEffectView::~CollapsibleEffectView()
void CollapsibleEffectView::setWidgetHeight(qreal value)
{
widgetFrame->setFixedHeight(m_view->contentHeight() * value);
widgetFrame->setFixedHeight(int(m_view->contentHeight() * value));
}
void CollapsibleEffectView::slotCreateGroup()
......
......@@ -105,7 +105,7 @@ bool AudioThumbJob::computeWithMlt()
}
// Normalize
for (double &v : mltLevels) {
m_audioLevels << 255 * v / maxLevel;
m_audioLevels << uchar(255 * v / maxLevel);
}
m_done = true;
......
......@@ -432,7 +432,7 @@ bool LoadJob::startJob()
QList<QAction*>actions = {ac};
QMetaObject::invokeMethod(pCore.get(), "displayBinMessage", Qt::QueuedConnection, Q_ARG(QString, i18n("Cannot get duration for file %1", m_resource)),
Q_ARG(int, (int)KMessageWidget::Warning), Q_ARG(QList<QAction*>, actions));
Q_ARG(int, int(KMessageWidget::Warning)), Q_ARG(QList<QAction*>, actions));
m_errorMessage.append(i18n("ERROR: Could not load clip %1: producer is invalid", m_resource));
return false;
}
......
......@@ -131,7 +131,7 @@ bool ProxyJob::startJob()
if (!ok) {
width = 640;
}
int height = width / display_ratio;
int height = int(width / display_ratio);
// Make sure we get an even height
height += height % 2;
mltParameters << QStringLiteral("s=%1x%2").arg(width).arg(height);
......
......@@ -71,10 +71,10 @@ void SpeedJob::configureProducer()
QString resource = m_producer->get("resource");
m_producer = std::make_unique<Mlt::Producer>(*m_profile.get(), "timewarp", QStringLiteral("%1:%2").arg(QString::fromStdString(std::to_string(m_speed)), resource).toUtf8().constData());
if (m_in > 0) {
m_in /= m_speed;
m_in = int(m_in / m_speed);
}
if (m_out > 0) {
m_out /= m_speed;
m_out = int(m_out / m_speed);
}
if (m_warp_pitch) {
m_producer->set("warp_pitch", 1);
......
......@@ -37,7 +37,7 @@ ThumbJob::ThumbJob(const QString &binId, int frameNumber, bool persistent, bool
, m_frameNumber(frameNumber)
, m_imageHeight(pCore->thumbProfile()->height())
, m_imageWidth(pCore->thumbProfile()->width())
, m_fullWidth(m_imageHeight * pCore->getCurrentDar() + 0.5)
, m_fullWidth(int(m_imageHeight * pCore->getCurrentDar() + 0.5))
, m_persistent(persistent)
, m_reloadAll(reloadAllThumbs)
......
......@@ -69,7 +69,7 @@ public:
QRect r1 = option.rect;
QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
int decoWidth = 2 * textMargin + r1.height() * 1.8;
int decoWidth = int(2 * textMargin + r1.height() * 1.8);
int mid = r1.height() / 2;
r1.adjust(decoWidth, 0, 0, -mid);
QFont ft = option.font;
......@@ -89,7 +89,7 @@ public:
QFontMetricsF fm(ft);
QStyle *style = option.widget ? option.widget->style() : QApplication::style();
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
int width = fm.boundingRect(r, Qt::AlignLeft | Qt::AlignTop, text).width() + option.decorationSize.width() + 2 * textMargin;
int width = int(fm.boundingRect(r, Qt::AlignLeft | Qt::AlignTop, text).width() + option.decorationSize.width() + 2 * textMargin);
hint.setWidth(width);
return {hint.width(), qMax(option.fontMetrics.lineSpacing() * 2 + 4, qMax(hint.height(), option.decorationSize.height()))};
}
......
......@@ -610,7 +610,7 @@ void ClipController::setProducerProperty(const QString &name, const QString &val
QWriteLocker lock(&m_producerLock);
if (value.isEmpty()) {
m_masterProducer->parent().set(name.toUtf8().constData(), (char *)nullptr);
m_masterProducer->parent().set(name.toUtf8().constData(), nullptr);
} else {
m_masterProducer->parent().set(name.toUtf8().constData(), value.toUtf8().constData());
}
......@@ -624,7 +624,7 @@ void ClipController::resetProducerProperty(const QString &name)
}
QWriteLocker lock(&m_producerLock);
m_masterProducer->parent().set(name.toUtf8().constData(), (char *)nullptr);
m_masterProducer->parent().set(name.toUtf8().constData(), nullptr);
}
ClipType::ProducerType ClipController::clipType() const
......@@ -788,9 +788,9 @@ void ClipController::clearBackupProperties()
}
}
for (const QString &p : qAsConst(passProps)) {
m_properties->set(p.toUtf8().constData(), (char *)nullptr);
m_properties->set(p.toUtf8().constData(), nullptr);
}
m_properties->set("kdenlive:original.backup", (char *)nullptr);
m_properties->set("kdenlive:original.backup", nullptr);
}
void ClipController::mirrorOriginalProperties(Mlt::Properties &props)
......
......@@ -1127,7 +1127,7 @@ void ClipPropertiesController::slotEnableForce(int state)
auto *timePos = findChild<TimecodeDisplay *>(param + QStringLiteral("_value"));
timePos->setValue(m_properties->get_int("kdenlive:original_length"));