[Qt-interest] QTreeWidget

David Boosalis david.boosalis at gmail.com
Thu Jul 30 16:37:58 CEST 2009


YOu can Inherit from QTreeWidget and then implement you own
mousePressEvent().  For instance.

/********************************************************************/
void MyTreeWidget::mousePressEvent(QMouseEvent *event)
{
  QTreeWidgetItem *pressedItem = 0;

  if (event->button() == Qt::RightButton) {
    pressedItem = itemAt(event->pos());
    if (pressedItem)
      emit showPopup(event->globalPos(),pressedItem);
  }
  else
    QTreeWidget::mousePressEvent(event);


On Thu, Jul 30, 2009 at 7:15 AM, Yixun Liu <enjoywm at cs.wm.edu> wrote:

> Hi,
> I want to right click one item in QTreeWidget and then pop up a slider.
> I cannot find the signal related right click event for QTreeWidget. How
> to solve this?
>
> Thanks.
>
> Yixun
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090730/87373635/attachment.html 


More information about the Qt-interest-old mailing list