mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 19:30:21 +02:00
* Temporary fixes until PlaylistChartItemDelegate becomes a proper PlaylistItemDelegate.
This commit is contained in:
@@ -59,10 +59,11 @@ PlaylistChartItemDelegate::PlaylistChartItemDelegate( TrackView* parent, Playabl
|
||||
m_bottomOption = QTextOption( Qt::AlignBottom );
|
||||
m_bottomOption.setWrapMode( QTextOption::NoWrap );
|
||||
|
||||
connect( this, SIGNAL( updateIndex( QModelIndex ) ), parent, SLOT( update( QModelIndex ) ) );
|
||||
|
||||
connect( m_model, SIGNAL( modelReset() ), this, SLOT( modelChanged() ) );
|
||||
if ( PlaylistView* plView = qobject_cast< PlaylistView* >( parent ) )
|
||||
connect( plView, SIGNAL( modelChanged() ), this, SLOT( modelChanged() ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -91,11 +92,8 @@ PlaylistChartItemDelegate::sizeHint( const QStyleOptionViewItem& option, const Q
|
||||
stretch = 2;
|
||||
}
|
||||
|
||||
if ( index.isValid() )
|
||||
{
|
||||
int rowHeight = option.fontMetrics.height() + 8;
|
||||
size.setHeight( rowHeight * stretch );
|
||||
}
|
||||
int rowHeight = option.fontMetrics.height() + 8;
|
||||
size.setHeight( rowHeight * stretch );
|
||||
|
||||
return size;
|
||||
}
|
||||
@@ -241,7 +239,7 @@ PlaylistChartItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem&
|
||||
void
|
||||
PlaylistChartItemDelegate::doUpdateIndex( const QPersistentModelIndex& idx )
|
||||
{
|
||||
emit updateRequest( idx );
|
||||
emit updateIndex( idx );
|
||||
}
|
||||
|
||||
|
||||
|
@@ -43,7 +43,7 @@ public:
|
||||
PlaylistChartItemDelegate( TrackView* parent = 0, PlayableProxyModel* proxy = 0 );
|
||||
|
||||
signals:
|
||||
void updateRequest( const QModelIndex& idx );
|
||||
void updateIndex( const QModelIndex& idx );
|
||||
|
||||
protected:
|
||||
void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
||||
|
Reference in New Issue
Block a user