Commit ac7fc973 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix some deprecation warnings

parent 2ab1fcb0
Pipeline #36946 failed with stage
in 5 minutes and 13 seconds
......@@ -218,7 +218,11 @@ 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;
......
......@@ -1333,7 +1333,7 @@ bool Bin::eventFilter(QObject *obj, QEvent *event)
if (event->type() == QEvent::Wheel) {
auto *e = static_cast<QWheelEvent *>(event);
if ((e != nullptr) && e->modifiers() == Qt::ControlModifier) {
wheelAccumulatedDelta += e->delta();
wheelAccumulatedDelta += e->angleDelta().y();
if (abs(wheelAccumulatedDelta) >= QWheelEvent::DefaultDeltasPerStep) {
slotZoomView(wheelAccumulatedDelta > 0);
}
......
......@@ -115,7 +115,7 @@ void MarkerDialog::slotUpdateThumb()
QImage MarkerDialog::markerImage() const
{
return clip_thumb->pixmap()->toImage();
return clip_thumb->pixmap(Qt::ReturnByValue).toImage();
}
CommentedTime MarkerDialog::newMarker()
......
......@@ -72,7 +72,7 @@ ProfilesDialog::ProfilesDialog(const QString &profileDescription, QWidget *paren
void ProfilesDialog::connectDialog()
{
connect(m_view.profiles_list, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), this, [&]() { slotUpdateDisplay(); });
connect(m_view.profiles_list, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [&](int ix) { slotUpdateDisplay(m_view.profiles_list->itemText(ix)); });
connect(m_view.button_create, &QAbstractButton::clicked, this, &ProfilesDialog::slotCreateProfile);
connect(m_view.button_save, &QAbstractButton::clicked, this, &ProfilesDialog::slotSaveProfile);
connect(m_view.button_delete, &QAbstractButton::clicked, this, &ProfilesDialog::slotDeleteProfile);
......
......@@ -412,9 +412,9 @@ void DvdWizardMenu::changeProfile(DVDFORMAT format)
void DvdWizardMenu::updatePreview()
{
m_scene->setProfile(m_width, m_height);
QMatrix matrix;
QTransform matrix;
matrix.scale(0.5, 0.5);
m_view.menu_preview->setMatrix(matrix);
m_view.menu_preview->setTransform(matrix);
m_view.menu_preview->setMinimumSize(m_width / 2 + 4, m_height / 2 + 8);
if (m_color) {
......
......@@ -189,7 +189,7 @@ bool ProxyJob::startJob()
if (exif > 1) {
// Rotate image according to exif data
QImage processed;
QMatrix matrix;
QTransform matrix;
switch (exif) {
case 2:
......
......@@ -1008,7 +1008,7 @@ QStringList Monitor::mimeTypes() const
// virtual
void Monitor::wheelEvent(QWheelEvent *event)
{
slotMouseSeek(event->delta(), event->modifiers());
slotMouseSeek(event->angleDelta().y(), event->modifiers());
event->accept();
}
......
......@@ -257,7 +257,7 @@ void SimpleTimelineWidget::mouseDoubleClickEvent(QMouseEvent *event)
void SimpleTimelineWidget::wheelEvent(QWheelEvent *event)
{
int change = event->delta() < 0 ? 1 : -1;
int change = event->angleDelta().y() < 0 ? 1 : -1;
/*if (m_currentKeyframe > 0) {
m_currentKeyframe = qBound(0, m_currentKeyframe + change, m_duration);
emit keyframeMoved(m_currentKeyframeOriginal, m_currentKeyframe);
......
......@@ -458,7 +458,6 @@ TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, QString projectTit
m_frameBorder->setPen(framepen);
m_frameBorder->setZValue(1000);
m_frameBorder->setBrush(Qt::transparent);
m_frameBorder->setFlags(nullptr);
m_frameBorder->setData(-1, -1);
graphicsView->scene()->addItem(m_frameBorder);
......@@ -478,18 +477,15 @@ TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, QString projectTit
QGraphicsRectItem *safe1 = new QGraphicsRectItem(QRectF(m_frameWidth * 0.05, m_frameHeight * 0.05, m_frameWidth * 0.9, m_frameHeight * 0.9), m_frameBorder);
safe1->setBrush(Qt::transparent);
safe1->setPen(framepen);
safe1->setFlags(nullptr);
safe1->setData(-1, -1);
QGraphicsRectItem *safe2 = new QGraphicsRectItem(QRectF(m_frameWidth * 0.1, m_frameHeight * 0.1, m_frameWidth * 0.8, m_frameHeight * 0.8), m_frameBorder);
safe2->setBrush(Qt::transparent);
safe2->setPen(framepen);
safe2->setFlags(nullptr);
safe2->setData(-1, -1);
m_frameBackground = new QGraphicsRectItem(QRectF(0, 0, m_frameWidth, m_frameHeight));
m_frameBackground->setZValue(-1100);
m_frameBackground->setBrush(Qt::transparent);
m_frameBackground->setFlags(nullptr);
graphicsView->scene()->addItem(m_frameBackground);
m_frameImage = new QGraphicsPixmapItem();
......@@ -497,7 +493,6 @@ TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, QString projectTit
qtrans.scale(2.0, 2.0);
m_frameImage->setTransform(qtrans);
m_frameImage->setZValue(-1200);
m_frameImage->setFlags(nullptr);
displayBackgroundFrame();
graphicsView->scene()->addItem(m_frameImage);
......@@ -928,8 +923,10 @@ void TitleWidget::initAnimation()
m_startViewport->setZValue(-1000);
m_endViewport->setZValue(-1000);
m_startViewport->setFlags(nullptr);
m_endViewport->setFlags(nullptr);
m_startViewport->setFlag(QGraphicsItem::ItemIsMovable, false);
m_startViewport->setFlag(QGraphicsItem::ItemIsSelectable, false);
m_endViewport->setFlag(QGraphicsItem::ItemIsMovable, false);
m_endViewport->setFlag(QGraphicsItem::ItemIsSelectable, false);
graphicsView->scene()->addItem(m_startViewport);
graphicsView->scene()->addItem(m_endViewport);
......@@ -2398,7 +2395,8 @@ void TitleWidget::slotAnimEnd(bool anim)
} else {
m_endViewport->setZValue(-1000);
m_endViewport->setBrush(QBrush());
m_endViewport->setFlags(nullptr);
m_endViewport->setFlag(QGraphicsItem::ItemIsMovable, false);
m_endViewport->setFlag(QGraphicsItem::ItemIsSelectable, false);
if (!anim_start->isChecked()) {
deleteAnimInfoText();
}
......
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