mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-30 19:00:12 +02:00
TemporaryPage types can be handled without forcing the class
This commit is contained in:
@@ -723,10 +723,7 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
||||
}
|
||||
else if ( type == SourcesModel::TemporaryPage )
|
||||
{
|
||||
TemporaryPageItem* gpi = qobject_cast< TemporaryPageItem* >( item );
|
||||
Q_ASSERT( gpi );
|
||||
|
||||
if ( gpi && opt.state & QStyle::State_MouseOver )
|
||||
if ( opt.state & QStyle::State_MouseOver )
|
||||
{
|
||||
int padding = 3;
|
||||
m_iconHeight = ( opt.rect.height() - 2 * padding );
|
||||
@@ -852,7 +849,7 @@ SourceDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, const QSt
|
||||
SourcesModel::RowType type = static_cast< SourcesModel::RowType >( index.data( SourcesModel::SourceTreeItemTypeRole ).toInt() );
|
||||
if ( type == SourcesModel::TemporaryPage )
|
||||
{
|
||||
TemporaryPageItem* gpi = qobject_cast< TemporaryPageItem* >( index.data( SourcesModel::SourceTreeItemRole ).value< SourceTreeItem* >() );
|
||||
SourceTreeItem* gpi = index.data( SourcesModel::SourceTreeItemRole ).value< SourceTreeItem* >();
|
||||
Q_ASSERT( gpi );
|
||||
QMouseEvent* ev = static_cast< QMouseEvent* >( event );
|
||||
|
||||
|
Reference in New Issue
Block a user