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


C++ ViewPage类代码示例

本文整理汇总了C++中ViewPage的典型用法代码示例。如果您正苦于以下问题:C++ ViewPage类的具体用法?C++ ViewPage怎么用?C++ ViewPage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: allPages

ViewPage*
ViewManager::pageForInterface( Tomahawk::playlistinterface_ptr interface ) const
{
    QList< Tomahawk::ViewPage* > pages = allPages();

    for ( int i = 0; i < pages.count(); i++ )
    {
        ViewPage* page = pages.at( i );
        if ( page->playlistInterface() == interface )
            return page;
        if ( page->playlistInterface() && page->playlistInterface()->hasChildInterface( interface ) )
            return page;
    }

    return 0;
}
开发者ID:dsqmoore,项目名称:tomahawk,代码行数:16,代码来源:ViewManager.cpp

示例2: tDebug

void
ViewManager::historyForward()
{
    if ( !m_pageHistoryFwd.count() )
        return;

    ViewPage* page = m_pageHistoryFwd.takeLast();

    if ( m_currentPage )
    {
        m_pageHistoryBack << m_currentPage;
        tDebug() << "Moved to backward history:" << m_currentPage->widget()->metaObject()->className();
    }

    tDebug() << "Showing page after moving forwards in history:" << page->widget()->metaObject()->className();
    setPage( page, false );
}
开发者ID:twischer,项目名称:tomahawk,代码行数:17,代码来源:ViewManager.cpp

示例3: qDebug

void
ViewManager::onWidgetDestroyed( QWidget* widget )
{
    qDebug() << "Destroyed child:" << widget << widget->metaObject()->className();

    bool resetWidget = ( m_stack->currentWidget() == widget );

    for ( int i = 0; i < m_pageHistory.count(); i++ )
    {
        ViewPage* page = m_pageHistory.at( i );
        if ( page->widget() != widget )
            continue;

        if ( !playlistForInterface( page->playlistInterface() ).isNull() )
        {
            m_playlistViews.remove( playlistForInterface( page->playlistInterface() ) );
        }
        if ( !dynamicPlaylistForInterface( page->playlistInterface() ).isNull() )
        {
            m_dynamicWidgets.remove( dynamicPlaylistForInterface( page->playlistInterface() ) );
        }

        if ( page->widget() == widget && !resetWidget )
        {
            m_pageHistory.removeAt( i );
        }
    }

    m_stack->removeWidget( widget );

    if ( resetWidget )
    {
        historyBack();
    }
}
开发者ID:MechanisM,项目名称:tomahawk,代码行数:35,代码来源:viewmanager.cpp

示例4: tDebug

void
ViewManager::onWidgetDestroyed( QWidget* widget )
{
    tDebug() << "Destroyed child:" << widget << widget->metaObject()->className();

    bool resetWidget = ( m_stack->currentWidget() == widget );

    QList< Tomahawk::ViewPage* > p = historyPages();
    for ( int i = 0; i < p.count(); i++ )
    {
        ViewPage* page = p.at( i );
        if ( page->widget() != widget )
            continue;

        if ( !playlistForInterface( page->playlistInterface() ).isNull() )
        {
            m_playlistViews.remove( playlistForInterface( page->playlistInterface() ) );
        }
        if ( !dynamicPlaylistForInterface( page->playlistInterface() ).isNull() )
        {
            m_dynamicWidgets.remove( dynamicPlaylistForInterface( page->playlistInterface() ) );
        }
        
        m_pageHistoryBack.removeAll( page );
        m_pageHistoryFwd.removeAll( page );
    }

    m_stack->removeWidget( widget );

    if ( resetWidget )
    {
        m_currentPage = 0;
        historyBack();
    }
}
开发者ID:nowrep,项目名称:tomahawk,代码行数:35,代码来源:ViewManager.cpp


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