本文整理汇总了C++中source_ptr::data方法的典型用法代码示例。如果您正苦于以下问题:C++ source_ptr::data方法的具体用法?C++ source_ptr::data怎么用?C++ source_ptr::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类source_ptr
的用法示例。
在下文中一共展示了source_ptr::data方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SourceTreeItem
bool
SourcesModel::appendItem( const source_ptr& source )
{
SourceTreeItem* item = new SourceTreeItem( source, this );
connect( item, SIGNAL( clicked( QModelIndex ) ), this, SIGNAL( clicked( QModelIndex ) ) );
// qDebug() << "Appending source item:" << item->source()->username();
invisibleRootItem()->appendRow( item->columns() );
if ( !source.isNull() )
{
connect( source.data(), SIGNAL( offline() ), SLOT( onSourceChanged() ) );
connect( source.data(), SIGNAL( online() ), SLOT( onSourceChanged() ) );
connect( source.data(), SIGNAL( stats( QVariantMap ) ), SLOT( onSourceChanged() ) );
connect( source.data(), SIGNAL( playbackStarted( Tomahawk::query_ptr ) ), SLOT( onSourceChanged() ) );
connect( source.data(), SIGNAL( stateChanged() ), SLOT( onSourceChanged() ) );
}
return true; // FIXME
}
示例2: QObject
Collection::Collection( const source_ptr& source, const QString& name, QObject* parent )
: QObject( parent )
, m_name( name )
, m_lastmodified( 0 )
, m_changed( false )
, m_source( source )
{
qDebug() << Q_FUNC_INFO << name << source->friendlyName();
connect( source.data(), SIGNAL( synced() ), SLOT( onSynced() ) );
}
示例3: if
CustomPlaylistView::CustomPlaylistView( CustomPlaylistView::PlaylistType type, const source_ptr& s, QWidget* parent )
: PlaylistView ( parent )
, m_type( type )
, m_source( s )
, m_model( new PlaylistModel( this ) )
{
// Generate the tracks, add them to the playlist
m_model->setStyle( PlayableModel::Large );
setPlaylistModel( m_model );
generateTracks();
if ( m_type == SourceLovedTracks )
connect( m_source.data(), SIGNAL( socialAttributesChanged( QString ) ), this, SLOT( socialAttributesChanged( QString ) ) );
else if ( m_type == TopLovedTracks )
{
connect( SourceList::instance()->getLocal().data(), SIGNAL( socialAttributesChanged( QString ) ), this, SLOT( socialAttributesChanged( QString ) ) );
foreach ( const source_ptr& s, SourceList::instance()->sources( true ) )
connect( s.data(), SIGNAL( socialAttributesChanged( QString ) ), this, SLOT( socialAttributesChanged( QString ) ) );
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), this, SLOT( sourceAdded( Tomahawk::source_ptr ) ) );
}
示例4: if
CustomPlaylistView::CustomPlaylistView( CustomPlaylistView::PlaylistType type, const source_ptr& s, QWidget* parent )
: PlaylistView ( parent )
, m_type( type )
, m_source( s )
, m_model( new PlaylistModel( this ) )
{
// Generate the tracks, add them to the playlist
setFrameShape( QFrame::NoFrame );
setAttribute( Qt::WA_MacShowFocusRect, 0 );
setPlaylistModel( m_model );
generateTracks();
if ( m_type == SourceLovedTracks )
connect( m_source.data(), SIGNAL( socialAttributesChanged() ), this, SLOT( reload() ) );
else if ( m_type == AllLovedTracks )
{
connect( SourceList::instance()->getLocal().data(), SIGNAL( socialAttributesChanged() ), this, SLOT( reload() ) );
foreach ( const source_ptr& s, SourceList::instance()->sources( true ) )
connect( s.data(), SIGNAL( socialAttributesChanged() ), this, SLOT( reload() ) );
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), this, SLOT( sourceAdded( Tomahawk::source_ptr ) ) );
}