[vlc-commits] Qt: fix column size in complete preferences

Jean-Baptiste Kempf git at videolan.org
Wed Aug 24 17:17:27 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Aug 24 17:16:32 2011 +0200| [6d04a56fa8fd7c19e5353ff07f51f59507f94779] | committer: Jean-Baptiste Kempf

Qt: fix column size in complete preferences

Close #3887

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6d04a56fa8fd7c19e5353ff07f51f59507f94779
---

 .../gui/qt4/components/complete_preferences.cpp    |   12 +++++++++---
 .../gui/qt4/components/complete_preferences.hpp    |    4 +++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/components/complete_preferences.cpp b/modules/gui/qt4/components/complete_preferences.cpp
index 5db1bba..d0c7592 100644
--- a/modules/gui/qt4/components/complete_preferences.cpp
+++ b/modules/gui/qt4/components/complete_preferences.cpp
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * preferences.cpp : "Normal preferences"
  ****************************************************************************
- * Copyright (C) 2006-2007 the VideoLAN team
+ * Copyright (C) 2006-2011 the VideoLAN team
  * $Id$
  *
  * Authors: Clément Stenac <zorglub at videolan.org>
@@ -59,6 +59,9 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
     setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) );
     setTextElideMode( Qt::ElideNone );
 
+    setUniformRowHeights( true );
+    CONNECT( this, itemExpanded(QTreeWidgetItem*), this, resizeColumns() );
+
     /* Nice icons */
 #define BI( a,b) QIcon a##_icon = QIcon( b )
     BI( audio, ":/prefsmenu/advanced/audio" );
@@ -285,8 +288,6 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
     resizeColumnToContents( 0 );
 }
 
-PrefsTree::~PrefsTree() {}
-
 void PrefsTree::applyAll()
 {
     doAll( false );
@@ -411,6 +412,11 @@ void PrefsTree::filter( const QString &text )
     }
 }
 
+void PrefsTree::resizeColumns()
+{
+    resizeColumnToContents( 0 );
+}
+
 /* go over the module config items and search text in psz_text
  * also search the module name and head */
 bool PrefsItemData::contains( const QString &text, Qt::CaseSensitivity cs )
diff --git a/modules/gui/qt4/components/complete_preferences.hpp b/modules/gui/qt4/components/complete_preferences.hpp
index 2c24cd6..19f2a50 100644
--- a/modules/gui/qt4/components/complete_preferences.hpp
+++ b/modules/gui/qt4/components/complete_preferences.hpp
@@ -68,7 +68,6 @@ class PrefsTree : public QTreeWidget
     Q_OBJECT
 public:
     PrefsTree( intf_thread_t *, QWidget * );
-    virtual ~PrefsTree();
 
     void applyAll();
     void cleanAll();
@@ -79,6 +78,9 @@ private:
     bool filterItems( QTreeWidgetItem *item, const QString &text, Qt::CaseSensitivity cs );
     bool collapseUnselectedItems( QTreeWidgetItem *item );
     intf_thread_t *p_intf;
+
+private slots:
+    void resizeColumns();
 };
 
 class ConfigControl;



More information about the vlc-commits mailing list