mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
* Try using indexRowSizeHint for calculating view's height.
This commit is contained in:
@@ -799,12 +799,16 @@ TrackView::deleteSelectedItems()
|
|||||||
void
|
void
|
||||||
TrackView::verifySize()
|
TrackView::verifySize()
|
||||||
{
|
{
|
||||||
if ( !autoResize() || !m_proxyModel )
|
if ( !autoResize() || !m_proxyModel || !m_proxyModel->rowCount() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( m_proxyModel->rowCount() > 0 )
|
unsigned int height = 0;
|
||||||
setFixedHeight( m_proxyModel->rowCount() * m_delegate->sizeHint( QStyleOptionViewItem(), m_proxyModel->index( 0, 0 ) ).height() +
|
for ( int i = 0; i < m_proxyModel->rowCount(); i++ )
|
||||||
contentsMargins().top() + contentsMargins().bottom() );
|
{
|
||||||
|
height += indexRowSizeHint( m_proxyModel->index( i, 0 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
setFixedHeight( height + contentsMargins().top() + contentsMargins().bottom() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user