#include <math.h>
+class ReparentableWidget : public QWidget
+{
+private:
+ VideoWidget *owner;
+public:
+ ReparentableWidget( VideoWidget *owner ) : owner( owner )
+ {
+ }
+
+protected:
+ void keyPressEvent( QKeyEvent *e )
+ {
+ emit owner->keyPressed( e );
+ }
+};
+
/**********************************************************************
* Video Widget. A simple frame on which video is drawn
* This class handles resize issues
* reparentable widget, that will be within the VideoWidget in windowed
* mode, and within the root window (NULL parent) in full-screen mode.
*/
- reparentable = new QWidget();
+ reparentable = new ReparentableWidget( this );
QLayout *innerLayout = new QHBoxLayout( reparentable );
innerLayout->setContentsMargins( 0, 0, 0, 0 );
class QPixmap;
class QHBoxLayout;
class QMenu;
+class ReparentableWidget;
/******************** Video Widget ****************/
class VideoWidget : public QFrame
{
Q_OBJECT
-friend class MainInterface;
+friend class ReparentableWidget;
public:
VideoWidget( intf_thread_t * );
QWidget *reparentable;
QLayout *layout;
+signals:
+ void keyPressed( QKeyEvent * );
+
public slots:
void SetSizing( unsigned int, unsigned int );
void SetFullScreen( bool );
videoWidget, SetSizing( unsigned int, unsigned int ) );
CONNECT( this, askVideoSetFullScreen( bool ),
videoWidget, SetFullScreen( bool ) );
+ CONNECT( videoWidget, keyPressed( QKeyEvent * ),
+ this, handleKeyPress( QKeyEvent * ) );
}
CONNECT( this, askUpdate(), this, doComponentsUpdate() );
}
void MainInterface::keyPressEvent( QKeyEvent *e )
+{
+ handleKeyPress( e );
+}
+
+void MainInterface::handleKeyPress( QKeyEvent *e )
{
if( ( e->modifiers() & Qt::ControlModifier ) && ( e->key() == Qt::Key_H )
&& !menuBar()->isVisible() )
void updateSystrayTooltipStatus( int );
void showCryptedLabel( bool );
+
+ void handleKeyPress( QKeyEvent * );
+
signals:
void askGetVideo( WId *p_id, int *pi_x, int *pi_y,
unsigned int *pi_width, unsigned int *pi_height );