Commit 46b812b5 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: preferences, show correctly the column items

Close #3887
(cherry picked from commit 71542b4b6f161251ca31b39de55d70bec1bde0bd)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 08e3cf3a
...@@ -53,9 +53,8 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -53,9 +53,8 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
QTreeWidget( _parent ), p_intf( _p_intf ) QTreeWidget( _parent ), p_intf( _p_intf )
{ {
/* General Qt options */ /* General Qt options */
setColumnCount( 1 );
setAlternatingRowColors( true ); setAlternatingRowColors( true );
header()->hide(); setHeaderHidden( true );
setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) ); setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) );
setTextElideMode( Qt::ElideNone ); setTextElideMode( Qt::ElideNone );
...@@ -125,7 +124,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -125,7 +124,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
current_item = new QTreeWidgetItem(); current_item = new QTreeWidgetItem();
current_item->setText( 0, data->name ); current_item->setText( 0, data->name );
current_item->setIcon( 0 , icon ); current_item->setIcon( 0 , icon );
current_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) ); //current_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
current_item->setData( 0, Qt::UserRole, current_item->setData( 0, Qt::UserRole,
qVariantFromValue( data ) ); qVariantFromValue( data ) );
addTopLevelItem( current_item ); addTopLevelItem( current_item );
...@@ -177,7 +176,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -177,7 +176,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
subcat_item->setText( 0, data_sub->name ); subcat_item->setText( 0, data_sub->name );
subcat_item->setData( 0, Qt::UserRole, subcat_item->setData( 0, Qt::UserRole,
qVariantFromValue( data_sub ) ); qVariantFromValue( data_sub ) );
subcat_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) ); //subcat_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
/* Add it to the parent */ /* Add it to the parent */
assert( current_item ); assert( current_item );
...@@ -271,7 +270,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -271,7 +270,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
module_item->setText( 0, qtr( module_get_name( p_module, false ) ) ); module_item->setText( 0, qtr( module_get_name( p_module, false ) ) );
module_item->setData( 0, Qt::UserRole, module_item->setData( 0, Qt::UserRole,
QVariant::fromValue( module_data) ); QVariant::fromValue( module_data) );
module_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) ); //module_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
subcat_item->addChild( module_item ); subcat_item->addChild( module_item );
} }
...@@ -279,6 +278,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -279,6 +278,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
sortItems( 0, Qt::AscendingOrder ); sortItems( 0, Qt::AscendingOrder );
module_list_free( p_list ); module_list_free( p_list );
resizeColumnToContents( 0 );
} }
PrefsTree::~PrefsTree() {} PrefsTree::~PrefsTree() {}
......
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