当前位置: 首页>>代码示例>>C++>>正文


C++ source_ptr::data方法代码示例

本文整理汇总了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
}
开发者ID:tiegz,项目名称:tomahawk,代码行数:20,代码来源:sourcesmodel.cpp

示例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() ) );
}
开发者ID:AndyCoder,项目名称:tomahawk,代码行数:11,代码来源:Collection.cpp

示例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 ) ) );
    }
开发者ID:eartle,项目名称:tomahawk,代码行数:21,代码来源:CustomPlaylistView.cpp

示例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 ) ) );
    }
开发者ID:jamesaxl,项目名称:tomahawk,代码行数:23,代码来源:customplaylistview.cpp


注:本文中的source_ptr::data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。