• 7461阅读
  • 1回复

【提问】鼠标双击Qlistviewitem的signal问题 [复制链接]

上一主题 下一主题
离线buben
 

只看楼主 倒序阅读 楼主  发表于: 2006-02-10
— 本帖被 XChinux 从 General Qt Programming 移动到本区(2011-01-02) —
我在主窗口内用Qlistview做了一个树形显示,希望双击不同的子节点时,窗口显示不同的照片.
但使用SIGNAL("doubleClicked(QListViewItem*)"),信号能被接收,但用SIGNAL("doubleClicked(QListViewItem*,const QPoint&,int)")就不行。不知这两个信号有什么区别?我认为前者是不区分节点,后者是区分节点,但后者传出的信号是什么呢?
[ 此贴被XChinux在2006-02-10 16:30重新编辑 ]
离线flyingwind
只看该作者 1楼 发表于: 2006-09-17
这两个信号都是响应双击事件,本质上没有什么区别。以下是帮助文件的说明:

void QListView::doubleClicked ( QListViewItem *, const QPoint &, int ) [signal]
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 ) [signal]
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.
大道泛兮,其可左右!
快速回复
限100 字节
 
上一个 下一个