Commit 6d04a56f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: fix column size in complete preferences

Close #3887
parent 204eaed4
/***************************************************************************** /*****************************************************************************
* preferences.cpp : "Normal preferences" * preferences.cpp : "Normal preferences"
**************************************************************************** ****************************************************************************
* Copyright (C) 2006-2007 the VideoLAN team * Copyright (C) 2006-2011 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
...@@ -59,6 +59,9 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -59,6 +59,9 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) ); setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) );
setTextElideMode( Qt::ElideNone ); setTextElideMode( Qt::ElideNone );
setUniformRowHeights( true );
CONNECT( this, itemExpanded(QTreeWidgetItem*), this, resizeColumns() );
/* Nice icons */ /* Nice icons */
#define BI( a,b) QIcon a##_icon = QIcon( b ) #define BI( a,b) QIcon a##_icon = QIcon( b )
BI( audio, ":/prefsmenu/advanced/audio" ); BI( audio, ":/prefsmenu/advanced/audio" );
...@@ -285,8 +288,6 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -285,8 +288,6 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
resizeColumnToContents( 0 ); resizeColumnToContents( 0 );
} }
PrefsTree::~PrefsTree() {}
void PrefsTree::applyAll() void PrefsTree::applyAll()
{ {
doAll( false ); doAll( false );
...@@ -411,6 +412,11 @@ void PrefsTree::filter( const QString &text ) ...@@ -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 /* go over the module config items and search text in psz_text
* also search the module name and head */ * also search the module name and head */
bool PrefsItemData::contains( const QString &text, Qt::CaseSensitivity cs ) bool PrefsItemData::contains( const QString &text, Qt::CaseSensitivity cs )
......
...@@ -68,7 +68,6 @@ class PrefsTree : public QTreeWidget ...@@ -68,7 +68,6 @@ class PrefsTree : public QTreeWidget
Q_OBJECT Q_OBJECT
public: public:
PrefsTree( intf_thread_t *, QWidget * ); PrefsTree( intf_thread_t *, QWidget * );
virtual ~PrefsTree();
void applyAll(); void applyAll();
void cleanAll(); void cleanAll();
...@@ -79,6 +78,9 @@ private: ...@@ -79,6 +78,9 @@ private:
bool filterItems( QTreeWidgetItem *item, const QString &text, Qt::CaseSensitivity cs ); bool filterItems( QTreeWidgetItem *item, const QString &text, Qt::CaseSensitivity cs );
bool collapseUnselectedItems( QTreeWidgetItem *item ); bool collapseUnselectedItems( QTreeWidgetItem *item );
intf_thread_t *p_intf; intf_thread_t *p_intf;
private slots:
void resizeColumns();
}; };
class ConfigControl; class ConfigControl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment