Automatically refresh the v4l2 extended panel on focus.
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 8 Dec 2007 23:00:51 +0000 (23:00 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 8 Dec 2007 23:00:51 +0000 (23:00 +0000)
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.hpp

index f933aa2..034bdb0 100644 (file)
@@ -577,6 +577,12 @@ ExtV4l2::~ExtV4l2()
         delete box;
 }
 
+void ExtV4l2::showEvent( QShowEvent *event )
+{
+    QWidget::showEvent( event );
+    Refresh();
+}
+
 void ExtV4l2::Refresh( void )
 {
     vlc_object_t *p_obj = (vlc_object_t*)vlc_object_find_name( p_intf, "v4l2", FIND_ANYWHERE );
@@ -620,7 +626,7 @@ void ExtV4l2::Refresh( void )
                 case VLC_VAR_INTEGER:
                 {
                     QLabel *label = new QLabel( psz_label, box );
-                    QHBoxLayout *hlayout = new QHBoxLayout( box );
+                    QHBoxLayout *hlayout = new QHBoxLayout();
                     hlayout->addWidget( label );
                     int i_val = var_GetInteger( p_obj, psz_var );
                     if( i_type & VLC_VAR_HASCHOICE )
index fc5892c..c0aa71c 100644 (file)
@@ -63,6 +63,8 @@ public:
     ExtV4l2( intf_thread_t *, QWidget * );
     virtual ~ExtV4l2();
 
+    virtual void showEvent( QShowEvent *event );
+
 private:
     intf_thread_t *p_intf;
     Ui::ExtV4l2Widget ui;