2021-05-24 07:25:56 +00:00
/*
SPDX - FileCopyrightText : 2008 Pino Toscano < pino @ kde . org >
SPDX - License - Identifier : GPL - 2.0 - or - later
*/
2008-08-25 01:26:47 +00:00
# include "videowidget.h"
// qt/kde includes
2008-08-25 09:23:11 +00:00
# include <qaction.h>
2012-06-29 09:16:28 +00:00
# include <qcoreapplication.h>
2008-08-25 01:26:47 +00:00
# include <qdir.h>
# include <qevent.h>
2012-06-29 09:16:28 +00:00
# include <qlabel.h>
2008-08-25 01:26:47 +00:00
# include <qlayout.h>
2008-08-27 13:54:54 +00:00
# include <qmenu.h>
2012-06-29 09:16:28 +00:00
# include <qstackedlayout.h>
2008-08-25 09:23:11 +00:00
# include <qtoolbar.h>
2008-08-27 13:54:54 +00:00
# include <qtoolbutton.h>
# include <qwidgetaction.h>
2008-08-25 09:23:11 +00:00
2014-10-19 13:20:30 +00:00
# include <KLocalizedString>
2014-10-06 06:31:17 +00:00
# include <QIcon>
2008-08-25 01:26:47 +00:00
2023-06-21 15:50:58 +00:00
# include "config-okular.h"
# if HAVE_PHONON
2012-08-21 07:37:05 +00:00
# include <phonon/mediaobject.h>
2008-08-27 13:54:54 +00:00
# include <phonon/seekslider.h>
2008-08-25 01:26:47 +00:00
# include <phonon/videoplayer.h>
2023-06-21 15:50:58 +00:00
# endif
2008-08-25 01:26:47 +00:00
# include "core/annotations.h"
2012-09-27 11:02:14 +00:00
# include "core/area.h"
2008-08-25 01:26:47 +00:00
# include "core/document.h"
# include "core/movie.h"
2012-06-29 09:16:28 +00:00
# include "snapshottaker.h"
2008-08-25 01:26:47 +00:00
2023-06-21 15:50:58 +00:00
# if HAVE_PHONON
2008-08-27 13:54:54 +00:00
static QAction * createToolBarButtonWithWidgetPopup ( QToolBar * toolBar , QWidget * widget , const QIcon & icon )
{
QToolButton * button = new QToolButton ( toolBar ) ;
QAction * action = toolBar - > addWidget ( button ) ;
button - > setAutoRaise ( true ) ;
button - > setIcon ( icon ) ;
button - > setPopupMode ( QToolButton : : InstantPopup ) ;
QMenu * menu = new QMenu ( button ) ;
button - > setMenu ( menu ) ;
QWidgetAction * widgetAction = new QWidgetAction ( menu ) ;
QWidget * dummy = new QWidget ( menu ) ;
widgetAction - > setDefaultWidget ( dummy ) ;
QVBoxLayout * dummyLayout = new QVBoxLayout ( dummy ) ;
2019-09-18 11:35:04 +00:00
dummyLayout - > setContentsMargins ( 5 , 5 , 5 , 5 ) ;
2008-08-27 13:54:54 +00:00
dummyLayout - > addWidget ( widget ) ;
menu - > addAction ( widgetAction ) ;
return action ;
}
2008-08-25 01:26:47 +00:00
/* Private storage. */
class VideoWidget : : Private
{
public :
2012-09-27 11:02:14 +00:00
Private ( Okular : : Movie * m , Okular : : Document * doc , VideoWidget * qq )
2017-09-05 21:27:18 +00:00
: q ( qq )
, movie ( m )
, document ( doc )
, player ( nullptr )
, loaded ( false )
2008-08-25 01:26:47 +00:00
{
}
2012-09-28 08:11:13 +00:00
~ Private ( )
{
if ( player ) {
player - > stop ( ) ;
2022-03-08 10:10:43 +00:00
}
2012-09-28 08:11:13 +00:00
}
2008-08-25 09:23:11 +00:00
enum PlayPauseMode { PlayMode , PauseMode } ;
2008-08-25 01:26:47 +00:00
void load ( ) ;
2008-08-25 09:23:11 +00:00
void setupPlayPauseAction ( PlayPauseMode mode ) ;
2012-06-29 09:16:28 +00:00
void setPosterImage ( const QImage & ) ;
void takeSnapshot ( ) ;
void videoStopped ( ) ;
2019-12-19 22:18:31 +00:00
void stateChanged ( Phonon : : State newState ) ;
2008-08-25 01:26:47 +00:00
// slots
void finished ( ) ;
2008-08-25 09:23:11 +00:00
void playOrPause ( ) ;
2008-08-25 01:26:47 +00:00
VideoWidget * q ;
2012-09-27 11:02:14 +00:00
Okular : : Movie * movie ;
2008-08-25 01:26:47 +00:00
Okular : : Document * document ;
Okular : : NormalizedRect geom ;
Phonon : : VideoPlayer * player ;
2008-08-27 13:54:54 +00:00
Phonon : : SeekSlider * seekSlider ;
2008-08-25 09:23:11 +00:00
QToolBar * controlBar ;
QAction * playPauseAction ;
QAction * stopAction ;
2008-08-27 13:54:54 +00:00
QAction * seekSliderAction ;
QAction * seekSliderMenuAction ;
2012-06-29 09:16:28 +00:00
QStackedLayout * pageLayout ;
QLabel * posterImagePage ;
2008-08-25 01:26:47 +00:00
bool loaded : 1 ;
2015-09-26 15:29:11 +00:00
double repetitionsLeft ;
2008-08-25 01:26:47 +00:00
} ;
2017-02-20 00:06:30 +00:00
static QUrl urlFromUrlString ( const QString & url , Okular : : Document * document )
{
QUrl newurl ;
if ( url . startsWith ( QLatin1Char ( ' / ' ) ) ) {
newurl = QUrl : : fromLocalFile ( url ) ;
} else {
newurl = QUrl ( url ) ;
if ( newurl . isRelative ( ) ) {
newurl = document - > currentDocument ( ) . adjusted ( QUrl : : RemoveFilename ) ;
newurl . setPath ( newurl . path ( ) + url ) ;
}
}
return newurl ;
}
2008-08-25 01:26:47 +00:00
void VideoWidget : : Private : : load ( )
{
2015-09-26 15:29:11 +00:00
repetitionsLeft = movie - > playRepetitions ( ) ;
2008-08-25 01:26:47 +00:00
if ( loaded ) {
return ;
2022-03-08 10:10:43 +00:00
}
2008-08-25 01:26:47 +00:00
loaded = true ;
2017-02-20 00:06:30 +00:00
player - > load ( urlFromUrlString ( movie - > url ( ) , document ) ) ;
2008-08-27 13:54:54 +00:00
2019-12-19 22:18:31 +00:00
connect ( player - > mediaObject ( ) , & Phonon : : MediaObject : : stateChanged , q , [ this ] ( Phonon : : State s ) { stateChanged ( s ) ; } ) ;
2012-08-21 07:37:05 +00:00
2008-08-27 13:54:54 +00:00
seekSlider - > setEnabled ( true ) ;
2008-08-25 01:26:47 +00:00
}
2008-08-25 09:23:11 +00:00
void VideoWidget : : Private : : setupPlayPauseAction ( PlayPauseMode mode )
{
if ( mode = = PlayMode ) {
2015-10-29 12:37:11 +00:00
playPauseAction - > setIcon ( QIcon : : fromTheme ( QStringLiteral ( " media-playback-start " ) ) ) ;
2008-08-25 09:23:11 +00:00
playPauseAction - > setText ( i18nc ( " start the movie playback " , " Play " ) ) ;
} else if ( mode = = PauseMode ) {
2015-10-29 12:37:11 +00:00
playPauseAction - > setIcon ( QIcon : : fromTheme ( QStringLiteral ( " media-playback-pause " ) ) ) ;
2008-08-25 09:23:11 +00:00
playPauseAction - > setText ( i18nc ( " pause the movie playback " , " Pause " ) ) ;
}
}
2012-06-29 09:16:28 +00:00
void VideoWidget : : Private : : takeSnapshot ( )
{
2017-02-20 00:06:30 +00:00
const QUrl url = urlFromUrlString ( movie - > url ( ) , document ) ;
SnapshotTaker * taker = new SnapshotTaker ( url , q ) ;
2012-06-29 09:16:28 +00:00
2019-12-19 22:18:31 +00:00
q - > connect ( taker , & SnapshotTaker : : finished , q , [ this ] ( const QImage & image ) { setPosterImage ( image ) ; } ) ;
2012-06-29 09:16:28 +00:00
}
void VideoWidget : : Private : : videoStopped ( )
{
2012-09-27 11:02:14 +00:00
if ( movie - > showPosterImage ( ) ) {
2012-06-29 09:16:28 +00:00
pageLayout - > setCurrentIndex ( 1 ) ;
} else {
q - > hide ( ) ;
2022-03-08 10:10:43 +00:00
}
2012-06-29 09:16:28 +00:00
}
2008-08-25 01:26:47 +00:00
void VideoWidget : : Private : : finished ( )
{
2012-09-27 11:02:14 +00:00
switch ( movie - > playMode ( ) ) {
2015-09-26 15:29:11 +00:00
case Okular : : Movie : : PlayLimited :
2008-08-25 01:26:47 +00:00
case Okular : : Movie : : PlayOpen :
2015-09-26 15:29:11 +00:00
repetitionsLeft - = 1.0 ;
if ( repetitionsLeft < 1e-5 ) { // allow for some calculation error
// playback has ended
stopAction - > setEnabled ( false ) ;
setupPlayPauseAction ( PlayMode ) ;
if ( movie - > playMode ( ) = = Okular : : Movie : : PlayLimited ) {
controlBar - > setVisible ( false ) ;
2022-03-08 10:10:43 +00:00
}
2015-09-26 15:29:11 +00:00
videoStopped ( ) ;
} else {
// not done yet, repeat
// if repetitionsLeft is less than 1, we are supposed to stop midway, but not even Adobe reader does this
2008-08-25 01:26:47 +00:00
player - > play ( ) ;
2022-03-08 10:10:43 +00:00
}
2008-08-25 01:26:47 +00:00
break ;
case Okular : : Movie : : PlayRepeat :
// repeat the playback
2015-09-26 15:29:11 +00:00
player - > play ( ) ;
2020-07-10 22:15:05 +00:00
break ;
2008-08-25 01:26:47 +00:00
case Okular : : Movie : : PlayPalindrome :
// FIXME we should play backward, but we cannot
player - > play ( ) ;
2020-07-10 22:15:05 +00:00
break ;
2008-08-25 01:26:47 +00:00
}
}
2008-08-25 09:23:11 +00:00
void VideoWidget : : Private : : playOrPause ( )
{
if ( player - > isPlaying ( ) ) {
player - > pause ( ) ;
setupPlayPauseAction ( PlayMode ) ;
} else {
q - > play ( ) ;
}
}
2012-06-29 09:16:28 +00:00
void VideoWidget : : Private : : setPosterImage ( const QImage & image )
{
if ( ! image . isNull ( ) ) {
// cache the snapshot image
2012-09-27 11:02:14 +00:00
movie - > setPosterImage ( image ) ;
2012-06-29 09:16:28 +00:00
}
posterImagePage - > setPixmap ( QPixmap : : fromImage ( image ) ) ;
}
2019-12-19 22:18:31 +00:00
void VideoWidget : : Private : : stateChanged ( Phonon : : State newState )
2012-08-21 07:37:05 +00:00
{
if ( newState = = Phonon : : PlayingState ) {
pageLayout - > setCurrentIndex ( 0 ) ;
2022-03-08 10:10:43 +00:00
}
2012-08-21 07:37:05 +00:00
}
2012-09-27 11:02:14 +00:00
VideoWidget : : VideoWidget ( const Okular : : Annotation * annotation , Okular : : Movie * movie , Okular : : Document * document , QWidget * parent )
: QWidget ( parent )
, d ( new Private ( movie , document , this ) )
2008-08-25 01:26:47 +00:00
{
2008-08-25 02:04:27 +00:00
// do not propagate the mouse events to the parent widget;
// they should be tied to this widget, not spread around...
setAttribute ( Qt : : WA_NoMousePropagation ) ;
2012-06-29 09:16:28 +00:00
// Setup player page
2018-04-02 19:18:00 +00:00
QWidget * playerPage = new QWidget ( this ) ;
2020-07-10 22:15:05 +00:00
2012-06-29 09:16:28 +00:00
QVBoxLayout * mainlay = new QVBoxLayout ( playerPage ) ;
2019-09-18 11:35:04 +00:00
mainlay - > setContentsMargins ( 0 , 0 , 0 , 0 ) ;
2008-08-25 18:27:58 +00:00
mainlay - > setSpacing ( 0 ) ;
2020-07-10 22:15:05 +00:00
2012-06-29 09:16:28 +00:00
d - > player = new Phonon : : VideoPlayer ( Phonon : : NoCategory , playerPage ) ;
d - > player - > installEventFilter ( playerPage ) ;
2008-08-25 01:26:47 +00:00
mainlay - > addWidget ( d - > player ) ;
2020-07-10 22:15:05 +00:00
2012-06-29 09:16:28 +00:00
d - > controlBar = new QToolBar ( playerPage ) ;
2008-08-25 09:23:11 +00:00
d - > controlBar - > setIconSize ( QSize ( 16 , 16 ) ) ;
d - > controlBar - > setAutoFillBackground ( true ) ;
mainlay - > addWidget ( d - > controlBar ) ;
2020-07-10 22:15:05 +00:00
2008-08-25 09:23:11 +00:00
d - > playPauseAction = new QAction ( d - > controlBar ) ;
d - > controlBar - > addAction ( d - > playPauseAction ) ;
d - > setupPlayPauseAction ( Private : : PlayMode ) ;
2015-10-29 12:37:11 +00:00
d - > stopAction = d - > controlBar - > addAction ( QIcon : : fromTheme ( QStringLiteral ( " media-playback-stop " ) ) , i18nc ( " stop the movie playback " , " Stop " ) , this , SLOT ( stop ( ) ) ) ;
2008-08-25 09:23:11 +00:00
d - > stopAction - > setEnabled ( false ) ;
2008-08-27 13:54:54 +00:00
d - > controlBar - > addSeparator ( ) ;
d - > seekSlider = new Phonon : : SeekSlider ( d - > player - > mediaObject ( ) , d - > controlBar ) ;
d - > seekSliderAction = d - > controlBar - > addWidget ( d - > seekSlider ) ;
d - > seekSlider - > setEnabled ( false ) ;
2017-09-05 21:27:18 +00:00
Phonon : : SeekSlider * verticalSeekSlider = new Phonon : : SeekSlider ( d - > player - > mediaObject ( ) , nullptr ) ;
2008-08-27 13:54:54 +00:00
verticalSeekSlider - > setMaximumHeight ( 100 ) ;
2015-10-29 12:37:11 +00:00
d - > seekSliderMenuAction = createToolBarButtonWithWidgetPopup ( d - > controlBar , verticalSeekSlider , QIcon : : fromTheme ( QStringLiteral ( " player-time " ) ) ) ;
2008-08-27 13:54:54 +00:00
d - > seekSliderMenuAction - > setVisible ( false ) ;
2008-08-25 09:23:11 +00:00
2012-09-27 11:02:14 +00:00
d - > controlBar - > setVisible ( movie - > showControls ( ) ) ;
2008-08-25 09:23:11 +00:00
2019-12-19 22:18:31 +00:00
connect ( d - > player , & Phonon : : VideoPlayer : : finished , this , [ this ] { d - > finished ( ) ; } ) ;
connect ( d - > playPauseAction , & QAction : : triggered , this , [ this ] { d - > playOrPause ( ) ; } ) ;
2008-08-25 01:26:47 +00:00
2012-09-27 11:02:14 +00:00
d - > geom = annotation - > transformedBoundingRectangle ( ) ;
2012-06-29 09:16:28 +00:00
// Setup poster image page
d - > posterImagePage = new QLabel ;
d - > posterImagePage - > setScaledContents ( true ) ;
d - > posterImagePage - > installEventFilter ( this ) ;
d - > posterImagePage - > setCursor ( Qt : : PointingHandCursor ) ;
d - > pageLayout = new QStackedLayout ( this ) ;
d - > pageLayout - > setMargin ( 0 ) ;
d - > pageLayout - > setSpacing ( 0 ) ;
d - > pageLayout - > addWidget ( playerPage ) ;
d - > pageLayout - > addWidget ( d - > posterImagePage ) ;
2012-09-27 11:02:14 +00:00
if ( movie - > showPosterImage ( ) ) {
2012-06-29 09:16:28 +00:00
d - > pageLayout - > setCurrentIndex ( 1 ) ;
2012-09-27 11:02:14 +00:00
const QImage posterImage = movie - > posterImage ( ) ;
2012-06-29 09:16:28 +00:00
if ( posterImage . isNull ( ) ) {
d - > takeSnapshot ( ) ;
2020-07-10 22:15:05 +00:00
} else {
2012-06-29 09:16:28 +00:00
d - > setPosterImage ( posterImage ) ;
}
} else {
d - > pageLayout - > setCurrentIndex ( 0 ) ;
}
2008-08-25 01:26:47 +00:00
}
VideoWidget : : ~ VideoWidget ( )
{
delete d ;
}
void VideoWidget : : setNormGeometry ( const Okular : : NormalizedRect & rect )
{
d - > geom = rect ;
}
Okular : : NormalizedRect VideoWidget : : normGeometry ( ) const
{
return d - > geom ;
}
2011-12-13 18:50:46 +00:00
bool VideoWidget : : isPlaying ( ) const
{
return d - > player - > isPlaying ( ) ;
}
2012-09-21 09:20:53 +00:00
void VideoWidget : : pageInitialized ( )
{
hide ( ) ;
}
2012-04-25 22:21:04 +00:00
void VideoWidget : : pageEntered ( )
{
2012-09-27 11:02:14 +00:00
if ( d - > movie - > showPosterImage ( ) ) {
2012-06-29 09:16:28 +00:00
d - > pageLayout - > setCurrentIndex ( 1 ) ;
show ( ) ;
}
2012-09-27 11:02:14 +00:00
if ( d - > movie - > autoPlay ( ) ) {
2012-04-25 22:21:04 +00:00
show ( ) ;
QMetaObject : : invokeMethod ( this , " play " , Qt : : QueuedConnection ) ;
2023-02-15 23:32:49 +00:00
if ( d - > movie - > startPaused ( ) ) {
QMetaObject : : invokeMethod ( this , " pause " , Qt : : QueuedConnection ) ;
}
2012-04-25 22:21:04 +00:00
}
}
2012-06-29 09:16:28 +00:00
void VideoWidget : : pageLeft ( )
{
2012-09-28 08:11:13 +00:00
d - > player - > stop ( ) ;
2012-06-29 09:16:28 +00:00
d - > videoStopped ( ) ;
hide ( ) ;
}
2008-08-25 01:26:47 +00:00
void VideoWidget : : play ( )
{
2013-10-18 14:28:54 +00:00
d - > controlBar - > setVisible ( d - > movie - > showControls ( ) ) ;
2008-08-25 01:26:47 +00:00
d - > load ( ) ;
2015-09-26 15:29:11 +00:00
// if d->repetitionsLeft is less than 1, we are supposed to stop midway, but not even Adobe reader does this
2008-08-25 01:26:47 +00:00
d - > player - > play ( ) ;
2008-08-25 09:23:11 +00:00
d - > stopAction - > setEnabled ( true ) ;
d - > setupPlayPauseAction ( Private : : PauseMode ) ;
2008-08-25 01:26:47 +00:00
}
void VideoWidget : : stop ( )
{
d - > player - > stop ( ) ;
2008-08-25 09:23:11 +00:00
d - > stopAction - > setEnabled ( false ) ;
d - > setupPlayPauseAction ( Private : : PlayMode ) ;
2008-08-25 01:26:47 +00:00
}
void VideoWidget : : pause ( )
{
d - > player - > pause ( ) ;
2008-08-25 09:23:11 +00:00
d - > setupPlayPauseAction ( Private : : PlayMode ) ;
2008-08-25 01:26:47 +00:00
}
2008-08-25 09:23:11 +00:00
bool VideoWidget : : eventFilter ( QObject * object , QEvent * event )
2008-08-25 01:26:47 +00:00
{
2012-06-29 09:16:28 +00:00
if ( object = = d - > player | | object = = d - > posterImagePage ) {
2008-08-27 13:54:54 +00:00
switch ( event - > type ( ) ) {
case QEvent : : MouseButtonPress : {
QMouseEvent * me = static_cast < QMouseEvent * > ( event ) ;
if ( me - > button ( ) = = Qt : : LeftButton ) {
if ( ! d - > player - > isPlaying ( ) ) {
play ( ) ;
}
2017-07-28 09:11:50 +00:00
event - > accept ( ) ;
2008-08-25 09:23:11 +00:00
}
2020-07-10 22:15:05 +00:00
break ;
}
2012-06-29 09:16:28 +00:00
case QEvent : : Wheel : {
if ( object = = d - > posterImagePage ) {
QWheelEvent * we = static_cast < QWheelEvent * > ( event ) ;
2020-07-10 22:15:05 +00:00
2012-06-29 09:16:28 +00:00
// forward wheel events to parent widget
2019-09-18 11:41:19 +00:00
QWheelEvent * copy = new QWheelEvent ( we - > pos ( ) , we - > globalPos ( ) , we - > angleDelta ( ) . y ( ) , we - > buttons ( ) , we - > modifiers ( ) , we - > orientation ( ) ) ;
2012-06-29 09:16:28 +00:00
QCoreApplication : : postEvent ( parentWidget ( ) , copy ) ;
}
2020-07-10 22:15:05 +00:00
break ;
}
2008-08-27 13:54:54 +00:00
default : ;
2008-08-25 01:26:47 +00:00
}
}
2008-08-25 09:23:11 +00:00
return false ;
2008-08-25 01:26:47 +00:00
}
2008-08-27 13:54:54 +00:00
bool VideoWidget : : event ( QEvent * event )
{
switch ( event - > type ( ) ) {
case QEvent : : ToolTip :
// "eat" the help events (= tooltips), avoid parent widgets receiving them
event - > accept ( ) ;
return true ;
break ;
default : ;
}
return QWidget : : event ( event ) ;
}
void VideoWidget : : resizeEvent ( QResizeEvent * event )
{
const QSize & s = event - > size ( ) ;
int usedSpace = d - > seekSlider - > geometry ( ) . left ( ) + d - > seekSlider - > iconSize ( ) . width ( ) ;
// try to give the slider at least 30px of space
if ( s . width ( ) < ( usedSpace + 30 ) ) {
d - > seekSliderAction - > setVisible ( false ) ;
d - > seekSliderMenuAction - > setVisible ( true ) ;
} else {
d - > seekSliderAction - > setVisible ( true ) ;
d - > seekSliderMenuAction - > setVisible ( false ) ;
}
}
2023-06-21 15:50:58 +00:00
# else
class VideoWidget : : Private
{
public :
Okular : : NormalizedRect geom ;
} ;
bool VideoWidget : : event ( QEvent * event )
{
return QWidget : : event ( event ) ;
}
bool VideoWidget : : eventFilter ( QObject * object , QEvent * event )
{
return QWidget : : eventFilter ( object , event ) ;
}
bool VideoWidget : : isPlaying ( ) const
{
return false ;
}
Okular : : NormalizedRect VideoWidget : : normGeometry ( ) const
{
return d - > geom ;
}
void VideoWidget : : pageEntered ( )
{
show ( ) ;
}
void VideoWidget : : pageInitialized ( )
{
}
void VideoWidget : : pageLeft ( )
{
}
void VideoWidget : : pause ( )
{
}
void VideoWidget : : play ( )
{
}
void VideoWidget : : resizeEvent ( QResizeEvent * event )
{
QWidget : : resizeEvent ( event ) ;
}
void VideoWidget : : setNormGeometry ( const Okular : : NormalizedRect & rect )
{
d - > geom = rect ;
}
void VideoWidget : : stop ( )
{
}
VideoWidget : : VideoWidget ( const Okular : : Annotation * annotation , Okular : : Movie * movie , Okular : : Document * document , QWidget * parent )
: QWidget ( parent )
, d ( new VideoWidget : : Private )
{
auto layout = new QVBoxLayout ( ) ;
d - > geom = annotation - > transformedBoundingRectangle ( ) ;
auto poster = new QLabel ;
if ( movie - > showPosterImage ( ) ) {
auto posterImage = movie - > posterImage ( ) ;
if ( ! posterImage . isNull ( ) ) {
poster - > setPixmap ( QPixmap : : fromImage ( posterImage ) ) ;
}
}
Q_EMIT document - > warning ( i18n ( " Videos not supported in this okular " ) , 5000 ) ;
poster - > setSizePolicy ( QSizePolicy : : MinimumExpanding , QSizePolicy : : MinimumExpanding ) ;
layout - > addWidget ( poster , 2 ) ;
auto label = new QLabel ( i18n ( " Videos not supported in this Okular " ) ) ;
label - > setAutoFillBackground ( true ) ;
label - > setSizePolicy ( QSizePolicy : : Expanding , QSizePolicy : : Minimum ) ;
layout - > addWidget ( label , 1 , Qt : : AlignCenter ) ;
setLayout ( layout ) ;
}
VideoWidget : : ~ VideoWidget ( ) noexcept
{
}
2008-08-27 13:54:54 +00:00
2023-06-21 15:50:58 +00:00
# endif
2014-08-08 22:00:07 +00:00
# include "moc_videowidget.cpp"