Skip to content
Snippets Groups Projects
Commit b6652a8a authored by luyikei's avatar luyikei
Browse files

WorkflowFileRendererDialog: Update the preview label

parent 79a47717
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,9 @@ WorkflowFileRendererDialog::setProgressBarValue( int val )
void
WorkflowFileRendererDialog::updatePreview( const uchar* buff )
{
QImage img( buff, m_width, m_height,
QImage::Format_RGBA8888, []( void* buf ){ delete[] (uchar*) buf; } );
m_ui.previewLabel->setPixmap( QPixmap::fromImage( img ) );
}
void
......
......@@ -328,6 +328,15 @@ MainWorkflow::startRenderToFile( const QString &outputFileName, quint32 width, q
dialog.setOutputFileName( outputFileName );
connect( &cEventWatcher, &OutputEventWatcher::stopped, &dialog, &WorkflowFileRendererDialog::accept );
connect( &dialog, &WorkflowFileRendererDialog::stop, this, [&output]{ output.stop(); } );
connect( m_renderer->eventWatcher(), &RendererEventWatcher::positionChanged, &dialog,
[this, &dialog, width, height]( qint64 pos )
{
// Update the preview per five seconds
if ( pos % qRound( m_multitrack->fps() * 5 ) == 0 )
{
dialog.updatePreview( m_multitrack->image( width, height ) );
}
});
#endif
connect( &cEventWatcher, &OutputEventWatcher::stopped, this, [&output]{ output.stop(); } );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment