我的主页

快递查询 :http://m.kuaidi100.com     爱快递查询 :http://www.aikuaidi.cn/              

http://www.qtcn.org/bbs/u/168050  [收藏] [复制]

w642833823

  • 9

    关注

  • 30

    粉丝

  • 28

    访客

  • 等级:新手上路
  • 总积分:41
  • 保密,2011-12-07

最后登录:2020-10-23

更多资料

日志

对歌词实现动态颜色

2020-09-21 12:17
  //实现颜色随机
    int R=qrand()%255;
    int G=qrand()%255;
    int B=qrand()%255;
    if(m_lyric_list.size() <= 0 || m_iCurrentIndex >= m_lyric_list.size())
        return;


    for(int i = 0; i < m_lyric_list.size(); i++)
    {

        if(position > m_lyric_list.at(i).time)
        {
            m_iCurrentIndex = i;
        }
    }


    if(position > m_lyric_list.at(m_iCurrentIndex).time)
    {
        QString lrc;
        lrc.clear();
        lrc += QString("<p align='center'><span style=' font-style:italic;color:green'>");
        lrc += m_aristName + " - " + m_songName;
        lrc += QString("</span></p>");

        for(int j = m_iCurrentIndex - 1; j < m_lyric_list.size(); j++)
        {
            if(j < 0)
                continue;

            if(m_iCurrentIndex == j)
            {//动态颜色
                lrc += QString("<p align='center'><span style=' font-size:30px;color:rgb(%1,%2,%3)'>").arg(R).arg(G).arg(B);
                lrc += m_lyric_list.at(m_iCurrentIndex).lyric;
                lrc += QString("</span></p>");
            }
分类:QT|回复:0|浏览:90|全站可见|转载
 

Powered by phpwind v8.7 Certificate Copyright Time now is:10-23 14:17
©2005-2016 QTCN开发网 版权所有 Gzip disabled