[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Sun Dec 12 12:31:09 CET 2010
SVN commit 1205744 by tgridel:
FileviewWidget: sort and resize the view properly
M +4 -0 FileViewWidget.cpp
--- trunk/KDE/kdeedu/marble/src/lib/FileViewWidget.cpp #1205743:1205744
@@ -63,11 +63,15 @@
widget->fileViewModel(), SLOT( saveFile() ) );
connect( d->m_fileViewUi.m_closeButton, SIGNAL( clicked() ) ,
widget->fileViewModel(), SLOT( closeFile() ) );
+
d->m_treeSortProxy = new QSortFilterProxyModel( this );
d->m_treeSortProxy->setSourceModel( widget->model()->treeModel() );
d->m_treeSortProxy->setDynamicSortFilter( true );
d->m_fileViewUi.m_treeView->setModel( d->m_treeSortProxy );
d->m_fileViewUi.m_treeView->setSortingEnabled( true );
+ d->m_fileViewUi.m_treeView->sortByColumn( 0, Qt::AscendingOrder );
+ d->m_fileViewUi.m_treeView->resizeColumnToContents( 0 );
+ d->m_fileViewUi.m_treeView->resizeColumnToContents( 1 );
connect( d->m_fileViewUi.m_treeView, SIGNAL( activated( QModelIndex ) ),
this, SLOT( mapCenterOnTreeViewModel( QModelIndex ) ) );
}
More information about the Marble-commits
mailing list