diff --git a/src/libtomahawk/playlist/TrackView.cpp b/src/libtomahawk/playlist/TrackView.cpp index 19f440086..fc2766e59 100644 --- a/src/libtomahawk/playlist/TrackView.cpp +++ b/src/libtomahawk/playlist/TrackView.cpp @@ -57,6 +57,7 @@ TrackView::TrackView( QWidget* parent ) , m_resizing( false ) , m_dragging( false ) , m_updateContextView( true ) + , m_alternatingRowColors( true ) , m_contextMenu( new ContextMenu( this ) ) { setFrameShape( QFrame::NoFrame ); @@ -233,7 +234,7 @@ TrackView::setEmptyTip( const QString& tip ) void TrackView::onModelFilling() { - setAlternatingRowColors( true ); + QTreeView::setAlternatingRowColors( m_alternatingRowColors ); } @@ -241,7 +242,7 @@ void TrackView::onModelEmptyCheck() { if ( !m_proxyModel->rowCount( QModelIndex() ) ) - setAlternatingRowColors( false ); + QTreeView::setAlternatingRowColors( false ); } @@ -429,7 +430,7 @@ TrackView::resizeEvent( QResizeEvent* event ) int sortSection = m_header->sortIndicatorSection(); Qt::SortOrder sortOrder = m_header->sortIndicatorOrder(); - tDebug() << Q_FUNC_INFO << width(); +// tDebug() << Q_FUNC_INFO << width(); if ( m_header->checkState() && sortSection >= 0 ) { @@ -795,3 +796,11 @@ TrackView::setAutoResize( bool b ) if ( m_autoResize ) setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); } + + +void +TrackView::setAlternatingRowColors( bool enable ) +{ + m_alternatingRowColors = enable; + QTreeView::setAlternatingRowColors( enable ); +} diff --git a/src/libtomahawk/playlist/TrackView.h b/src/libtomahawk/playlist/TrackView.h index 3549a06a9..2281c7999 100644 --- a/src/libtomahawk/playlist/TrackView.h +++ b/src/libtomahawk/playlist/TrackView.h @@ -84,6 +84,8 @@ public: bool autoResize() const { return m_autoResize; } void setAutoResize( bool b ); + void setAlternatingRowColors( bool enable ); + // Starts playing from the beginning if resolved, or waits until a track is playable void startPlayingFromStart(); @@ -150,6 +152,7 @@ private: bool m_updateContextView; bool m_autoResize; + bool m_alternatingRowColors; QModelIndex m_contextMenuIndex;