QListWidget获取当前视图索引的方法

xiaoxiao2025-04-06  25

Qt在开发QListWidget控件的时候,会遇到获取当前视图所处的索引的问题,那么我们如何获取这些索引以进行相应处理呢?

方法: int index = QListWidget->indexAt(QListWidget->viewport->contentsRect->topLeft->row()); 获取左上角的项索引;

其他类似;

转载请注明原文地址: https://www.6miu.com/read-5027634.html

最新回复(0)