标题:【提问】鼠标双击Qlistviewitem的signal问题
作者:buben
日期:2006-02-10 18:57
内容:
我在主窗口内用Qlistview做了一个树形显示,希望双击不同的子节点时,窗口显示不同的照片.
但使用SIGNAL("doubleClicked(QListViewItem*)"),信号能被接收,但用SIGNAL("doubleClicked(QListViewItem*,const QPoint&,int)")就不行。不知这两个信号有什么区别?我认为前者是不区分节点,后者是区分节点,但后者传出的信号是什么呢?
#1 [flyingwind 09-17 12:28]
这两个信号都是响应双击事件,本质上没有什么区别。以下是帮助文件的说明:
void QListView::doubleClicked ( QListViewItem *, const QPoint &, int )
This signal is emitted whenever an item is double-clicked. It's emitted on the second button press, not the second button release. The arguments are the relevant QListViewItem (may be 0), the point in global coordinates and the relevant column (or -1 if the click was outside the list).
Warning: Do not delete any QListViewItem objects in slots connected to this signal.
void QListView::doubleClicked ( QListViewItem * item )
This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. (use doubleClicked( QListViewItem *, const QPoint&, int ))
This signal is emitted whenever an item is double-clicked. It's emitted on the second button press, not the second button release. item is the list view item on which the user did the double-click.