在单QTreeWidget如何准确的获得currentItem



QTreeWidgetItem * pCurrentItem = this->itemAt(event->pos() );

event是单击、双击、右键响应函数的参数,如

void CDataTree::contextMenuEvent ( QContextMenuEvent * event )

{

     QTreeWidgetItem * pCurrentItem = this->itemAt(event->pos() );

}

void CDataTree::mouseReleaseEvent(QMouseEvent * event)

{

    QTreeWidgetItem * pCurrentItem = this->itemAt(event->pos() );

}


你可能感兴趣的:(在单QTreeWidget如何准确的获得currentItem)