[Qt-interest] QtreeWidget and right-click

Malyushytsky, Alex alex at wai.com
Fri Mar 27 14:09:20 CET 2009


There are a few ways to do it. Usually you either
subclass and reimplement void QWidget::contextMenuEvent ( QContextMenuEvent * event )   [virtual protected]

or

set contextMenuPolicy for you widget (QTreeWidget) to Qt::CustomContextMenu
and connect void QWidget::customContextMenuRequested ( const QPoint & pos )   signal to the custom slot. In this case you don't need subclass QtreeWidget)

For more information search for menu in QWidget topic QT documentation.

Regards,
 Alex


-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of NARCISO, Rui
Sent: Friday, March 27, 2009 3:53 AM
To: Qt Interest (E-mail)
Subject: [Qt-interest] QtreeWidget and right-click


Hi all

I'm a bit new to Qt.
I've successfully put in place an app based on a QTreeWidget and now I'd like to be able to right-click on any (or several) QtreeWidgetItems and have a menu appear with several actions.

How to go about doing this ?

Rui

The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other then the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.


_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list