Results 1 to 5 of 5

Thread: menu on right click on canvas

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: menu on right click on canvas

    Maybe you could just simply store the item as a member variable? Or use QAction::setData() for storing a pointer to the item. It's totally up to you how do you want to implement it. It might also depend on which slots and where do the actions trigger..
    J-P Nurmi

  2. #2
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: menu on right click on canvas

    i am getting some feel of it.
    Ihave declared a member variable Q3canvasitem class pointer.in contentsMousePressEvents() i am checking rtti() of canvas item( obatained through collision) .There i am storing corresponding item in member pointer and generating menu there only.
    With other development i will keep updating.

Similar Threads

  1. Context Menu on QTableWidget
    By ankurjain in forum Qt Programming
    Replies: 9
    Last Post: 17th December 2009, 09:52
  2. When is the best time to delete a QCanvasItem
    By irudkin in forum Qt Programming
    Replies: 12
    Last Post: 8th March 2007, 21:28
  3. Setting focus on Canvas
    By Kapil in forum Qt Programming
    Replies: 10
    Last Post: 17th May 2006, 12:55
  4. Tracking separators in a menu (insertSeparator)
    By PrimeCP in forum Qt Programming
    Replies: 4
    Last Post: 25th January 2006, 18:10
  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
  •  
Qt is a trademark of The Qt Company.