Results 1 to 2 of 2

Thread: Custom GraphicsItem

  1. #1
    Join Date
    Jan 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Custom GraphicsItem

    Hello Everyone,

    I have created a CustomGrahicsIitem Class for drawing Rectangle,Circle,Line.
    Now I want to convert Rectangle to Circle using Context Menu option for Rectangle Item.
    How to do this?

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Wiki edits
    15

    Default Re: Custom GraphicsItem

    You can re-implement
    Qt Code:
    1. CustomItem::contextMenuEvent
    To copy to clipboard, switch view to plain text mode 
    and add QAction options to convert to Circle / Line. Connect the those actions to a slot to hide / show the appropriate Circle/Line in the CustomItem.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. Need Help Regarding Qt GraphicsItem Collision
    By RE in forum Qt Programming
    Replies: 4
    Last Post: 28th September 2012, 12:12
  2. need advice for GraphicsItem
    By alizadeh91 in forum Qt Programming
    Replies: 2
    Last Post: 8th March 2012, 19:25
  3. GraphicsItem is flickering
    By anafor2004 in forum Qt Programming
    Replies: 3
    Last Post: 30th September 2009, 12:44
  4. GraphicsItem Question
    By cwnelatury in forum Qt Programming
    Replies: 8
    Last Post: 14th May 2009, 21:11
  5. Best way for a graphicsitem to delete itself
    By pherthyl in forum Qt Programming
    Replies: 7
    Last Post: 22nd June 2008, 06:57

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.