Get index of the delegate currently displayed - QML ListView

前端 未结 4 968
无人共我
无人共我 2021-02-20 03:03

I created a ListView, which displays a couple of pages of content defined by the user (plain text). The page displayed is a delegate. Only one page is visible at a time. I decid

4条回答
  •  终归单人心
    2021-02-20 03:22

    You can do like that:

    QModelIndex index =this->indexAt(event->pos());
            this ->setCurrentIndex(index);
    

提交回复
热议问题