Logo Search packages:      
Sourcecode: kdbg version File versions

void KTreeView::mouseDoubleClickEvent ( QMouseEvent *  e  )  [protected, virtual]

Reimplemented for mouse event handling. The mouse double click event is first forwarded to the item that has been clicked on (if there is one) by calling KTreeViewItem::mouseEvent.

Definition at line 1622 of file ktreeview.cpp.

References KTreeViewItem::boundingRect(), cellCoords(), indentation(), itemAt(), KTreeViewItem::mouseEvent(), and selected().

    // find out which row has been clicked
    int itemClicked = findRow(e->y());

    if (itemClicked < 0)
      return;                       /* invalid row, do nothing */

    KTreeViewItem* item = itemAt(itemClicked);
    if (item == 0)

    // translate mouse coord to cell coord
    QPoint cellCoord = cellCoords(itemClicked, e->pos());

    // first ask item
    if (item->mouseEvent(e, cellCoord))

    // hit test item
    int indent = indentation(item);
    if (item->boundingRect(indent).contains(cellCoord))
      emit selected(itemClicked);

Generated by  Doxygen 1.6.0   Back to index