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


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

本文整理汇总了C++中tomahawk::query_ptr::data方法的典型用法代码示例。如果您正苦于以下问题:C++ query_ptr::data方法的具体用法?C++ query_ptr::data怎么用?C++ query_ptr::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tomahawk::query_ptr的用法示例。


在下文中一共展示了query_ptr::data方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: connect

void
TrackModelItem::setupItem( const Tomahawk::query_ptr& query, TrackModelItem* parent, int row )
{
    this->parent = parent;
    if ( parent )
    {
        if ( row < 0 )
        {
            parent->children.append( this );
            row = parent->children.count() - 1;
        }
        else
        {
            parent->children.insert( row, this );
        }

        this->model = parent->model;
    }

    m_isPlaying = false;
    toberemoved = false;
    m_query = query;
    if ( !query->numResults() )
    {
        connect( query.data(), SIGNAL( resultsAdded( QList<Tomahawk::result_ptr> ) ),
                               SIGNAL( dataChanged() ) );

        connect( query.data(), SIGNAL( resultsRemoved( Tomahawk::result_ptr ) ),
                               SIGNAL( dataChanged() ) );

        connect( query.data(), SIGNAL( resultsChanged() ),
                               SIGNAL( dataChanged() ) );
    }
}
开发者ID:Pritoj,项目名称:tomahawk,代码行数:34,代码来源:trackmodelitem.cpp

示例2: connect

void
DynamicModel::newTrackGenerated( const Tomahawk::query_ptr& query )
{
    if ( m_onDemandRunning )
    {
        bool isDuplicate = false;
        for ( int i = 0; i < m_deduper.size(); i++ )
        {
            if ( m_deduper[ i ].first == query->track() && m_deduper[ i ].second == query->artist() )
                isDuplicate = true;
        }
        if ( isDuplicate )
        {
            m_playlist->generator()->fetchNext();

            return;
        }
        else
        {
            m_deduper.append( QPair< QString, QString >( query->track(), query->artist() ) );
        }

        connect( query.data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolveFinished( bool ) ) );

        m_waitingFor << query.data();
        appendQuery( query );
    }
}
开发者ID:ChrisOHu,项目名称:tomahawk,代码行数:28,代码来源:DynamicModel.cpp

示例3: QObject

TreeModelItem::TreeModelItem( const Tomahawk::query_ptr& query, TreeModelItem* parent, int row )
    : QObject( parent )
    , m_query( query )
{
    this->parent = parent;
    fetchingMore = false;
    m_isPlaying = false;

    if ( parent )
    {
        if ( row < 0 )
        {
            parent->children.append( this );
            row = parent->children.count() - 1;
        }
        else
        {
            parent->children.insert( row, this );
        }

        this->model = parent->model;
    }

    toberemoved = false;
    onResultsChanged();

    connect( query.data(), SIGNAL( resultsAdded( QList<Tomahawk::result_ptr> ) ),
                             SLOT( onResultsChanged() ) );

    connect( query.data(), SIGNAL( resultsRemoved( Tomahawk::result_ptr ) ),
                             SLOT( onResultsChanged() ) );

    connect( query.data(), SIGNAL( resultsChanged() ),
                             SLOT( onResultsChanged() ) );
}
开发者ID:seezer,项目名称:tomahawk,代码行数:35,代码来源:TreeModelItem.cpp

示例4: connect

void
DynamicModel::newTrackGenerated( const Tomahawk::query_ptr& query )
{
    if( m_onDemandRunning ) {
        connect( query.data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolveFinished( bool ) ) );

        m_waitingFor << query.data();
        append( query );
    }
}
开发者ID:euroelessar,项目名称:tomahawk,代码行数:10,代码来源:DynamicModel.cpp

示例5: ErrorStatusMessage

void
AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::query_ptr& query )
{
    if ( query->resolvingFinished() )
    {
        if ( query->numResults() && query->results().first()->isOnline() )
        {
            playItem( playlist, query->results().first() );
            return;
        }

        JobStatusView::instance()->model()->addJob(
            new ErrorStatusMessage( tr( "Sorry, Tomahawk couldn't find the track '%1' by %2" ).arg( query->track() ).arg( query->artist() ), 15 ) );

        if ( isStopped() )
            emit stopped(); // we do this so the original caller knows we couldn't find this track
    }
    else
    {
        Pipeline::instance()->resolve( query );

        NewClosure( query.data(), SIGNAL( resolvingFinished( bool ) ),
                    const_cast<AudioEngine*>(this), SLOT( playItem( Tomahawk::playlistinterface_ptr, Tomahawk::query_ptr ) ), playlist, query );
    }
}
开发者ID:nowrep,项目名称:tomahawk,代码行数:25,代码来源:AudioEngine.cpp

示例6: connect

void
PlaylistEntry::setQuery( const Tomahawk::query_ptr& q )
{
    Q_D( PlaylistEntry );
    d->query = q;

    connect( q.data(), SIGNAL( resolvingFinished( bool ) ), SLOT( onQueryResolved( bool ) ) );
}
开发者ID:AltarBeastiful,项目名称:tomahawk,代码行数:8,代码来源:PlaylistEntry.cpp

示例7: QObject

PlayableItem::PlayableItem( const Tomahawk::query_ptr& query, PlayableItem* parent, int row )
    : QObject( parent )
    , m_query( query )
{
    init( parent, row );

    connect( query->track().data(), SIGNAL( socialActionsLoaded() ),
                                    SIGNAL( dataChanged() ) );

    connect( query->track().data(), SIGNAL( updated() ),
                                    SIGNAL( dataChanged() ) );

    connect( query.data(), SIGNAL( resultsChanged() ),
                             SLOT( onResultsChanged() ) );
}
开发者ID:AndyCoder,项目名称:tomahawk,代码行数:15,代码来源:PlayableItem.cpp

示例8: stream

void
SourceTreeView::dropEvent( QDropEvent* event )
{
    bool accept = false;
    const QPoint pos = event->pos();
    const QModelIndex index = indexAt( pos );

    if ( event->mimeData()->hasFormat( "application/tomahawk.query.list" ) )
    {
        const QPoint pos = event->pos();
        const QModelIndex index = indexAt( pos );

        if ( index.isValid() )
        {
            if ( SourcesModel::indexType( index ) == SourcesModel::PlaylistSource )
            {
                playlist_ptr playlist = SourcesModel::indexToPlaylist( index );
                if ( !playlist.isNull() && playlist->author()->isLocal() )
                {
                    accept = true;
                    QByteArray itemData = event->mimeData()->data( "application/tomahawk.query.list" );
                    QDataStream stream( &itemData, QIODevice::ReadOnly );
                    QList<Tomahawk::query_ptr> queries;

                    while ( !stream.atEnd() )
                    {
                        qlonglong qptr;
                        stream >> qptr;

                        Tomahawk::query_ptr* query = reinterpret_cast<Tomahawk::query_ptr*>(qptr);
                        if ( query && !query->isNull() )
                        {
                            qDebug() << "Dropped query item:" << query->data()->artist() << "-" << query->data()->track();
                            queries << *query;
                        }
                    }

                    qDebug() << "on playlist:" << playlist->title() << playlist->guid();

                    SourceTreeItem* treeItem = SourcesModel::indexToTreeItem( index );
                    if ( treeItem )
                    {
                        QString rev = treeItem->currentlyLoadedPlaylistRevision( playlist->guid() );
                        playlist->addEntries( queries, rev );
                    }
                }
            }
        }
开发者ID:hatstand,项目名称:tomahawk,代码行数:48,代码来源:sourcetreeview.cpp

示例9: textChanged

void
QueryLabel::setQuery( const Tomahawk::query_ptr& query )
{
    if ( query.isNull() )
        return;

    setContentsMargins( BOXMARGIN * 2, BOXMARGIN / 2, BOXMARGIN * 2, BOXMARGIN / 2 );

    if ( m_query.isNull() || m_query.data() != query.data() )
    {
        m_query = query;
        m_result.clear();
        updateLabel();

        emit textChanged( text() );
        emit queryChanged( m_query );
    }
}
开发者ID:LittleForker,项目名称:tomahawk,代码行数:18,代码来源:querylabel.cpp


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