Results 1 to 4 of 4

Thread: Inheriting from QGraphicsItem: getting pointer to custom class fromselectedItems()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Inheriting from QGraphicsItem: getting pointer to custom class fromselectedItems(

    dynamic_cast should work, it is there for exactly that purpose.

    It will return the pointer casted to your class or 0 if the object is not of the cast type.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    Durkin (13th June 2013)

  3. #2
    Join Date
    May 2013
    Posts
    13
    Thanks
    4

    Default Re: Inheriting from QGraphicsItem: getting pointer to custom class fromselectedItems(

    You 're right, it does. The seg fault was my mistake.

Similar Threads

  1. Inheriting Custom Decorated Dialog
    By dcrespo in forum Qt Programming
    Replies: 1
    Last Post: 18th October 2012, 13:18
  2. Replies: 3
    Last Post: 31st July 2011, 00:30
  3. Replies: 1
    Last Post: 7th March 2011, 14:02
  4. Replies: 2
    Last Post: 21st April 2010, 08:07
  5. QListWidget inheriting custom class
    By phannent in forum Qt Tools
    Replies: 1
    Last Post: 4th August 2008, 14:39

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.