本文整理汇总了C++中tomahawk::artist_ptr::loadStats方法的典型用法代码示例。如果您正苦于以下问题:C++ artist_ptr::loadStats方法的具体用法?C++ artist_ptr::loadStats怎么用?C++ artist_ptr::loadStats使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tomahawk::artist_ptr
的用法示例。
在下文中一共展示了artist_ptr::loadStats方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* parent )
: QWidget( parent )
, ui( new Ui::ArtistInfoWidget )
, m_artist( artist )
{
QWidget* widget = new QWidget;
ui->setupUi( widget );
artist->loadStats();
connect( artist.data(), SIGNAL( statsLoaded() ), SLOT( onArtistStatsLoaded() ) );
ui->lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
ui->lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
ui->lineAbove2->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
ui->lineBelow2->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
QHBoxLayout* l = new QHBoxLayout( ui->statsWidget );
m_playStatsGauge = new StatsGauge( ui->statsWidget );
m_playStatsGauge->setText( tr( "YOUR ARTIST RANK" ) );
m_playStatsGauge->setInvertedAppearance( true );
l->addSpacerItem( new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ) );
l->addWidget( m_playStatsGauge );
l->addSpacerItem( new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ) );
ui->statsWidget->setLayout( l );
TomahawkUtils::unmarginLayout( l );
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Original, QSize( 48, 48 ) );
ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Grid, ui->cover->size() ) );
ui->cover->setShowText( false );
{
m_relatedModel = new PlayableModel( ui->relatedArtists );
ui->relatedArtists->setPlayableModel( m_relatedModel );
ui->relatedArtists->proxyModel()->sort( -1 );
ui->relatedArtists->setEmptyTip( tr( "Sorry, we could not find any related artists!" ) );
ui->relatedArtists->setAutoFitItems( true );
/* ui->relatedArtists->setWrapping( false );
ui->relatedArtists->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
ui->relatedArtists->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
ui->relatedArtists->delegate()->setItemSize( QSize( 170, 170 ) );
TomahawkStyle::stylePageFrame( ui->relatedArtists );
TomahawkStyle::stylePageFrame( ui->artistFrame );
TomahawkStyle::styleScrollBar( ui->relatedArtists->verticalScrollBar() );
}
{
ui->albums->setAutoResize( true );
ui->albums->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
/* ui->albums->setWrapping( false );
ui->albums->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
ui->albums->delegate()->setItemSize( QSize( 170, 170 ) );
ui->albums->proxyModel()->setHideDupeItems( true );
m_albumsModel = new PlayableModel( ui->albums );
ui->albums->setPlayableModel( m_albumsModel );
ui->albums->proxyModel()->sort( -1 );
ui->albums->setEmptyTip( tr( "Sorry, we could not find any albums for this artist!" ) );
ui->albums->setStyleSheet( QString( "QListView { background-color: %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
TomahawkStyle::stylePageFrame( ui->albumFrame );
TomahawkStyle::styleScrollBar( ui->albums->verticalScrollBar() );
}
{
m_topHitsModel = new PlaylistModel( ui->topHits );
AlbumItemDelegate* del = new AlbumItemDelegate( ui->topHits, ui->topHits->proxyModel() );
ui->topHits->setPlaylistItemDelegate( del );
ui->topHits->proxyModel()->setStyle( PlayableProxyModel::Short );
ui->topHits->setPlayableModel( m_topHitsModel );
ui->topHits->setSortingEnabled( false );
ui->topHits->setEmptyTip( tr( "Sorry, we could not find any top hits for this artist!" ) );
ui->topHits->setAutoResize( true );
ui->topHits->setAlternatingRowColors( false );
QPalette p = ui->topHits->palette();
p.setColor( QPalette::Text, TomahawkStyle::PAGE_TRACKLIST_TRACK_SOLVED );
p.setColor( QPalette::BrightText, TomahawkStyle::PAGE_TRACKLIST_TRACK_UNRESOLVED );
p.setColor( QPalette::Foreground, TomahawkStyle::PAGE_TRACKLIST_NUMBER );
p.setColor( QPalette::Highlight, TomahawkStyle::PAGE_TRACKLIST_HIGHLIGHT );
p.setColor( QPalette::HighlightedText, TomahawkStyle::PAGE_TRACKLIST_HIGHLIGHT_TEXT );
ui->topHits->setPalette( p );
TomahawkStyle::stylePageFrame( ui->topHits );
TomahawkStyle::stylePageFrame( ui->trackFrame );
}
{
QFont f = ui->biography->font();
f.setFamily( "Titillium Web" );
QPalette p = ui->biography->palette();
p.setColor( QPalette::Text, TomahawkStyle::HEADER_TEXT );
ui->biography->setFont( f );
ui->biography->setPalette( p );
ui->biography->setOpenLinks( false );
ui->biography->setOpenExternalLinks( true );
//.........这里部分代码省略.........