Results 1 to 3 of 3

Thread: QTreeWidget right click?

  1. #1
    Join Date
    Feb 2007
    Posts
    13
    Thanks
    2

    Default QTreeWidget right click?

    QT 4.2

    I need to be able to right click in a QTreeWidget and display a context menu depending on where you are in the tree.

    I read that you can specify the Widget to signal a contextmenu event, which will give you a position that you can map back to a QWidget, but it doesn't look like the QTreeWidgetItem inherits from QWidget (according to the documentation and looking at the header)

    Can I get a context menu at an QTreeWidgetItem?

    Or am I going to have to do some round about what to do this?

    Thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTreeWidget right click?

    QTreeWidgetItem is not a QWidget but QTreeWidget is. Check for example this post: http://www.qtcentre.org/forum/f-newb...ed-1710.html#4
    J-P Nurmi

  3. #3
    Join Date
    Feb 2007
    Posts
    13
    Thanks
    2

    Default Re: QTreeWidget right click?

    ahh, good stuff. Thanks

Similar Threads

  1. QGraphicsScene Click / Double Click
    By philentropist in forum Qt Programming
    Replies: 1
    Last Post: 9th February 2007, 04:32
  2. QTreeWidget double click signal
    By Pinco Pallino in forum Newbie
    Replies: 2
    Last Post: 18th November 2006, 16:37
  3. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  4. few questions related to QTreeWidget
    By prakash in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2006, 07:32
  5. Replies: 5
    Last Post: 12th January 2006, 15:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.