qt4: uses setMinimumSize from the good thread using signal/slot
authorRafaël Carré <funman@videolan.org>
Thu, 30 Aug 2007 13:52:53 +0000 (13:52 +0000)
committerRafaël Carré <funman@videolan.org>
Thu, 30 Aug 2007 13:52:53 +0000 (13:52 +0000)
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp

index bd6af39..4779bd4 100644 (file)
@@ -55,7 +55,7 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
 {
     vlc_mutex_init( p_intf, &lock );
     p_vout = NULL;
-
+    CONNECT( this, askResize(), this, SetMinSize() );
     setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
 }
 
@@ -93,9 +93,15 @@ void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
         return NULL;
     }
     p_vout = p_nvout;
+    emit askResize();
     return ( void* )winId();
 }
 
+void VideoWidget::SetMinSize()
+{
+    setMinimumSize( 16, 16 );
+}
+
 void VideoWidget::release( void *p_win )
 {
     p_vout = NULL;
index e6e9e90..2b11a50 100644 (file)
@@ -62,6 +62,10 @@ private:
     QWidget *frame;
     intf_thread_t *p_intf;
     vlc_mutex_t lock;
+signals:
+    void askResize();
+private slots:
+    void SetMinSize();
 };
 
 /******************** Background Widget ****************/