Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 3c287e28 authored by Laurent Montel's avatar Laurent Montel 😁

Port some deprecated methods

parent 6e9c6698
Pipeline #8283 passed with stage
in 13 minutes and 44 seconds
......@@ -23,6 +23,7 @@
#include <QStringList>
#include <QThread>
#include <QtDBus>
#include <QElapsedTimer>
#include <utility>
// Can't believe I need to do this to sleep.
class SleepThread : QThread
......@@ -165,7 +166,7 @@ void RenderJob::start()
qWarning() << "No org.kde.JobViewServer registered, trying to start kuiserver";
if (QProcess::startDetached(QStringLiteral("kuiserver"))) {
// Give it a couple of seconds to start
QTime t;
QElapsedTimer t;
t.start();
while (!interface->isServiceRegistered(QStringLiteral("org.kde.JobViewServer")) && t.elapsed() < 3000) {
SleepThread::msleep(100); // Sleep 100 ms
......
......@@ -267,14 +267,14 @@ void KeyframeView::mouseDoubleClickEvent(QMouseEvent *event)
void KeyframeView::wheelEvent(QWheelEvent *event)
{
if (event->modifiers() & Qt::AltModifier) {
if (event->delta() > 0) {
if (event->angleDelta().y() > 0) {
slotGoToPrev();
} else {
slotGoToNext();
}
return;
}
int change = event->delta() > 0 ? -1 : 1;
int change = event->angleDelta().y() > 0 ? -1 : 1;
int pos = qBound(0, m_position + change, m_duration - 1);
emit seekToPos(pos);
}
......
......@@ -222,7 +222,7 @@ public:
// Draw usage counter
int usage = index.data(AbstractProjectItem::UsageCount).toInt();
if (usage > 0) {
subText.append(QString().sprintf(" [%d]", usage));
subText.append(QString::asprintf(" [%d]", usage));
}
painter->drawText(r2, Qt::AlignLeft | Qt::AlignTop, subText, &bounding);
......
......@@ -86,7 +86,7 @@ DvdWizardVob::DvdWizardVob(QWidget *parent)
m_view.button_down->setIcon(QIcon::fromTheme(QStringLiteral("go-down")));
m_vobList = new DvdTreeWidget(this);
auto *lay1 = new QVBoxLayout;
lay1->setMargin(0);
lay1->setContentsMargins(0, 0, 0, 0);
lay1->addWidget(m_vobList);
m_view.list_frame->setLayout(lay1);
m_vobList->setColumnCount(3);
......
......@@ -14,6 +14,7 @@ the Free Software Foundation, either version 3 of the License, or
#include "kdenlive_debug.h"
#include "klocalizedstring.h"
#include <QTime>
#include <QElapsedTimer>
#include <cmath>
#include <iostream>
......@@ -128,7 +129,7 @@ void AudioCorrelation::correlate(const qint64 *envMain, size_t sizeMain, const q
*/
QTime t;
QElapsedTimer t;
t.start();
for (int shift = -(int)sizeSub; shift <= (int)sizeMain; ++shift) {
......
......@@ -9,7 +9,7 @@ the Free Software Foundation, either version 3 of the License, or
*/
#include "fftCorrelation.h"
#include <QElapsedTimer>
extern "C" {
#include "../external/kiss_fft/tools/kiss_fftr.h"
}
......@@ -35,7 +35,7 @@ void FFTCorrelation::correlate(const qint64 *left, const size_t leftSize, const
void FFTCorrelation::correlate(const qint64 *left, const size_t leftSize, const qint64 *right, const size_t rightSize, float *out_correlated)
{
QTime t;
QElapsedTimer t;
t.start();
auto *leftF = new float[leftSize];
......
......@@ -25,7 +25,7 @@ void QTimerWithTime::start(int msec)
m_time.start();
}
int QTimerWithTime::elapsed() const
qint64 QTimerWithTime::elapsed() const
{
return m_time.elapsed();
}
......@@ -20,7 +20,7 @@
#ifndef QTIMERWITHTIME_H
#define QTIMERWITHTIME_H
#include <QTime>
#include <QElapsedTimer>
#include <QTimer>
class QTimerWithTime : public QTimer
......@@ -28,9 +28,9 @@ class QTimerWithTime : public QTimer
Q_OBJECT
public:
virtual void start(int msec);
int elapsed() const;
qint64 elapsed() const;
private:
QTime m_time;
QElapsedTimer m_time;
};
#endif
......@@ -18,6 +18,7 @@ the Free Software Foundation, either version 3 of the License, or
#include <QTime>
#include <QTimer>
#include <QUrl>
#include <QElapsedTimer>
#include "timeline2/model/timelineitemmodel.hpp"
......@@ -182,7 +183,7 @@ private:
KdenliveDoc *m_project{nullptr};
std::shared_ptr<TimelineItemModel> m_mainTimelineModel;
QTime m_lastSave;
QElapsedTimer m_lastSave;
QTimer m_autoSaveTimer;
QUrl m_startUrl;
QString m_loadClipsOnOpen;
......
......@@ -409,7 +409,7 @@ void UnicodeWidget::slotPrevUnicode()
void UnicodeWidget::wheelEvent(QWheelEvent *event)
{
if (frame->underMouse()) {
if (event->delta() > 0) {
if (event->angleDelta().y() > 0) {
slotNextUnicode();
} else {
slotPrevUnicode();
......
  • Could these deprecated methods a part of the root cause of performance problem showed in issue #338 (closed)? It seems that QT5core.dll don't get the correct “input” and get “hibernated”.

    Other performance issue we have on the timeline and rendering site: #11 (closed), #349

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