Results 1 to 4 of 4

Thread: Do a special cast with qobject_cast

  1. #1
    Join Date
    Jul 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question Do a special cast with qobject_cast

    Hi there.
    Can we cast a QList<T> with qobject_cast?

  2. #2
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Thanks
    2
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Do a special cast with qobject_cast

    To do what?

  3. #3
    Join Date
    Jul 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Do a special cast with qobject_cast

    Actually, I'm trying to use collidingItems fonction and it returns a list of QGraphicsItem* , in another hand I've defined a class named Trame, which Inherits from QObject and QGraphicsItem.
    Now, I want to get all colliding objects of type Trame with an other object of the same type?

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Do a special cast with qobject_cast

    1) Use qgraphicsitem_cast
    2) You will have to iterate over the list.
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. Problem with qobject_cast
    By Tepi in forum Qt Programming
    Replies: 6
    Last Post: 31st August 2009, 08:03
  2. Why doesn't this cast?
    By spraff in forum Qt Programming
    Replies: 2
    Last Post: 19th November 2008, 19:28
  3. qobject_cast for Qt3 ?
    By sunil.thaha in forum Qt Programming
    Replies: 3
    Last Post: 18th December 2006, 05:12
  4. cast
    By mickey in forum General Programming
    Replies: 1
    Last Post: 12th July 2006, 11:10
  5. Cast problem
    By yellowmat in forum Newbie
    Replies: 3
    Last Post: 7th February 2006, 15: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.