upgrade to qt 6 compliance
This commit is contained in:
@@ -82,7 +82,7 @@ ViewerWidget::ViewerWidget(ViewerDisplayWidget *display, QWidget *parent) :
|
||||
{
|
||||
// Set up main layout
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
// Create main OpenGL-based view and sizer
|
||||
sizer_ = new ViewerSizer();
|
||||
@@ -166,6 +166,9 @@ ViewerWidget::~ViewerWidget()
|
||||
foreach (ViewerWindow* window, windows) {
|
||||
delete window;
|
||||
}
|
||||
|
||||
delete display_widget_;
|
||||
display_widget_ = nullptr;
|
||||
}
|
||||
|
||||
void ViewerWidget::TimeChangedEvent(const rational &time)
|
||||
@@ -1146,7 +1149,7 @@ RenderTicketPtr ViewerWidget::GetFrame(const rational &t)
|
||||
// Frame has been cached, grab the frame
|
||||
RenderTicketPtr ticket = std::make_shared<RenderTicket>();
|
||||
ticket->setProperty("time", QVariant::fromValue(t));
|
||||
QtConcurrent::run(ViewerWidget::DecodeCachedImage, ticket, GetConnectedNode()->video_frame_cache()->GetCacheDirectory(), GetConnectedNode()->video_frame_cache()->GetUuid(), Timecode::time_to_timestamp(t, timebase(), Timecode::kFloor));
|
||||
QtConcurrent::run(static_cast<void(*)(RenderTicketPtr, const QString &, const QUuid &, const int64_t &)>(ViewerWidget::DecodeCachedImage), ticket, GetConnectedNode()->video_frame_cache()->GetCacheDirectory(), GetConnectedNode()->video_frame_cache()->GetUuid(), Timecode::time_to_timestamp(t, timebase(), Timecode::kFloor));
|
||||
return ticket;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1051,7 +1051,7 @@ void ViewerDisplayWidget::DrawSubtitleTracks()
|
||||
f.setFamily(family);
|
||||
}
|
||||
|
||||
f.setWeight(OLIVE_CONFIG("DefaultSubtitleWeight").toInt());
|
||||
f.setWeight(static_cast<QFont::Weight>(OLIVE_CONFIG("DefaultSubtitleWeight").toInt()));
|
||||
|
||||
bounding_box.adjust(bounding_box.width()/10, bounding_box.height()/10, -bounding_box.width()/10, -bounding_box.height()/10);
|
||||
|
||||
@@ -1145,7 +1145,7 @@ void ViewerDisplayWidget::ForwardDragEventToTextEdit(T *e)
|
||||
bool ViewerDisplayWidget::ForwardMouseEventToTextEdit(QMouseEvent *event, bool check_if_outside)
|
||||
{
|
||||
// Transform screen mouse coords to world mouse coords
|
||||
QPointF local_pos = GetVirtualPosForTextEdit(event->localPos());
|
||||
QPointF local_pos = GetVirtualPosForTextEdit(event->position());
|
||||
|
||||
if (check_if_outside) {
|
||||
if (local_pos.x() < 0 || local_pos.x() >= text_edit_->width() || local_pos.y() < 0 || local_pos.y() >= text_edit_->height()) {
|
||||
@@ -1156,8 +1156,8 @@ bool ViewerDisplayWidget::ForwardMouseEventToTextEdit(QMouseEvent *event, bool c
|
||||
|
||||
local_pos = AdjustPosByVAlign(local_pos);
|
||||
|
||||
event->setLocalPos(local_pos);
|
||||
return ForwardEventToTextEdit(event);
|
||||
QMouseEvent derived(event->type(), local_pos, event->scenePosition(), event->globalPosition(), event->button(), event->buttons(), event->modifiers(), event->source(), event->pointingDevice());
|
||||
return ForwardEventToTextEdit(&derived);
|
||||
}
|
||||
|
||||
bool ViewerDisplayWidget::ForwardEventToTextEdit(QEvent *event)
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#ifndef VIEWERQUEUE_H
|
||||
#define VIEWERQUEUE_H
|
||||
|
||||
#include <QLinkedList>
|
||||
|
||||
#include "codec/frame.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
@@ -32,7 +32,7 @@ ViewerWindow::ViewerWindow(QWidget *parent) :
|
||||
pixel_aspect_(1)
|
||||
{
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
|
||||
display_widget_ = new ViewerDisplayWidget();
|
||||
|
||||
Reference in New Issue
Block a user