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


C++ QTimeLine::currentFrame方法代码示例

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


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

示例1: updateOpacity

 void updateOpacity()
 {
     QPoint pos = q->parentWidget()->mapFromGlobal(QCursor::pos());
     QRect opaqueRect = q->geometry();
     bool opaqueCollapser = opaqueRect.contains(pos);
     int frame = mOpacityTimeLine->currentFrame();
     if (opaqueCollapser && frame == mOpacityTimeLine->startFrame()) {
         mOpacityTimeLine->setDirection(QTimeLine::Forward);
         startTimeLine();
     } else if (!opaqueCollapser && frame == mOpacityTimeLine->endFrame()) {
         mOpacityTimeLine->setDirection(QTimeLine::Backward);
         startTimeLine();
     }
 }
开发者ID:KDE,项目名称:libksane,代码行数:14,代码来源:splittercollapser.cpp

示例2: updateIndex


//.........这里部分代码省略.........

            HoverControls* controls = new HoverControls( m_view );
            controls->setFixedSize( m_margin * 2, m_margin + m_margin / 4 );
            controls->move( cRect.center() - QPoint( controls->width() / 2 -1, controls->height() / 2 -1 ) );
            controls->setContentsMargins( 0, 0, 0, 0 );
            controls->setFocusPolicy( Qt::NoFocus );
            controls->installEventFilter( this );
            controls->show();

            NewClosure( controls, SIGNAL( play() ),
                        const_cast<GridItemDelegate*>(this), SLOT( onPlayClicked( QPersistentModelIndex ) ), QPersistentModelIndex( index ) );

            m_hoverControls[ index ] = controls;
        }

        if ( m_hoveringOverArtist != index || ( !hoveringArtist && m_hoveringOverArtist.isValid() ) )
        {
            emit updateIndex( m_hoveringOverArtist );

            if ( hoveringArtist )
                m_hoveringOverArtist = index;
            else
                m_hoveringOverArtist = QPersistentModelIndex();

            emit updateIndex( index );
        }
        if ( m_hoveringOverAlbum != index || ( !hoveringAlbum && m_hoveringOverAlbum.isValid() ) )
        {
            emit updateIndex( m_hoveringOverAlbum );

            if ( hoveringAlbum )
                m_hoveringOverAlbum = index;
            else
                m_hoveringOverAlbum = QPersistentModelIndex();

            emit updateIndex( index );
        }
        if ( m_hoveringOverBuyButton != index || ( !hoveringBuyButton && m_hoveringOverBuyButton.isValid() ) )
        {
            emit updateIndex( m_hoveringOverBuyButton );

            if ( hoveringBuyButton )
                m_hoveringOverBuyButton = index;
            else
                m_hoveringOverBuyButton = QPersistentModelIndex();

            emit updateIndex( index );
        }

        if ( m_hoverIndex != index || !hoveringCover )
        {
            if ( m_hoverIndex.isValid() )
            {
                int startFrame = 100;
                if ( m_hoverFaders.contains( m_hoverIndex ) )
                {
                    QTimeLine* oldFader = m_hoverFaders.take( m_hoverIndex );
                    startFrame = oldFader->currentFrame();
                    oldFader->deleteLater();
                }

                QTimeLine* fadeOut = createTimeline( QTimeLine::Backward, startFrame );
                _detail::Closure* c = NewClosure( fadeOut, SIGNAL( frameChanged( int ) ), this, SLOT( fadingFrameChanged( QPersistentModelIndex ) ), QPersistentModelIndex( m_hoverIndex ) );
                c->setAutoDelete( false );
                c = NewClosure( fadeOut, SIGNAL( finished() ), this, SLOT( fadingFrameFinished( QPersistentModelIndex ) ), QPersistentModelIndex( m_hoverIndex ) );
                c->setAutoDelete( false );

                m_hoverFaders[ m_hoverIndex ] = fadeOut;
                fadeOut->start();
            }
            emit updateIndex( m_hoverIndex );

            foreach ( HoverControls* controls, m_hoverControls )
                controls->deleteLater();
            m_hoverControls.clear();
            m_hoverIndex = QPersistentModelIndex();
        }

        if ( hoveringCover && m_hoverIndex != index )
        {
            m_hoverIndex = index;
            int startFrame = 0;
            if ( m_hoverFaders.contains( index ) )
            {
                QTimeLine* oldFader = m_hoverFaders.take( index );
                startFrame = oldFader->currentFrame();
                oldFader->deleteLater();
            }

            QTimeLine* fadeIn = createTimeline( QTimeLine::Forward, startFrame );
            _detail::Closure* c = NewClosure( fadeIn, SIGNAL( frameChanged( int ) ), this, SLOT( fadingFrameChanged( QPersistentModelIndex ) ), QPersistentModelIndex( index ) );
            c->setAutoDelete( false );
            c = NewClosure( fadeIn, SIGNAL( finished() ), this, SLOT( fadingFrameFinished( QPersistentModelIndex ) ), QPersistentModelIndex( index ) );
            c->setAutoDelete( false );

            m_hoverFaders[ index ] = fadeIn;
            fadeIn->start();

            emit updateIndex( index );
        }
开发者ID:AshotN,项目名称:tomahawk,代码行数:101,代码来源:GridItemDelegate.cpp


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