当前位置: 代码迷 >> QT开发 >> QML 关于ListView
  详细解决方案

QML 关于ListView

热度:406   发布时间:2016-04-25 04:25:06.0
QML 关于ListView求助
我用ListView显示了
我加了二个button来控制
ListView 内容向前翻页和向后翻页,但速度分成按
即我按下button半天才有效果
const_word_width 为显示的最大值
m_page_max 为ListView.count
JScript code
function up_page(){        var page_t = listview1.indexAt(listview1.contentX+1,listview1.contentY+1);        if(page_t>=const_word_width){            m_page = page_t-const_word_width;            listview1.currentIndex = m_page;        }        else{            m_page = 0;            listview1.currentIndex = 0;        }        set_button_show(m_page);    }    function down_page(){        var page_t = listview1.indexAt(listview1.contentX+listview1.width-1,listview1.contentY+listview1.height-1);        vrf_view.debug_s(page_t);        if(page_t+const_word_width>=m_page_max){            m_page = m_page_max-1;            listview1.currentIndex = m_page_max-1;        }        else{            m_page = page_t+const_word_width-1;            listview1.currentIndex = page_t+const_word_width-1;        }        vrf_view.debug_s(m_page);        set_button_show(m_page);    }    function set_button_show(page_){        pbutton1.visible = page_>0?true:false;        pbutton2.visible = (page_+const_word_width<m_page_max)?true:false;    }

各位有什么好的办法没。我调试了半天也没办法加快响应速度。
大家是如何做翻页的?
  相关解决方案