Moved call to setResizeMode in SharedFilesDialog after the call to setModel on QTreeView.

Qt shows an assertion in debug mode when column count is 0.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6152 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-02-27 00:23:56 +00:00
parent 5aa6afbfdb
commit 2ed1712580

View File

@ -130,7 +130,6 @@ SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareD
/* Set header resize modes and initial section sizes */ /* Set header resize modes and initial section sizes */
QHeaderView * header = ui.dirTreeView->header () ; QHeaderView * header = ui.dirTreeView->header () ;
header->setResizeMode (0, QHeaderView::Interactive);
header->resizeSection ( 0, 490 ); header->resizeSection ( 0, 490 );
header->resizeSection ( 1, 70 ); header->resizeSection ( 1, 70 );
@ -327,6 +326,9 @@ void SharedFilesDialog::changeCurrentViewModel(int c)
ui.dirTreeView->setModel(proxyModel); ui.dirTreeView->setModel(proxyModel);
ui.dirTreeView->update(); ui.dirTreeView->update();
QHeaderView * header = ui.dirTreeView->header () ;
header->setResizeMode (0, QHeaderView::Interactive);
ui.dirTreeView->header()->headerDataChanged(Qt::Horizontal,0,4) ; ui.dirTreeView->header()->headerDataChanged(Qt::Horizontal,0,4) ;
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW #ifdef DONT_USE_SEARCH_IN_TREE_VIEW