Results 1 to 16 of 16

Thread: A Object inheriting from QGraphicsLineItem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Qt products
    Qt4
    Platforms
    Symbian S60
    Thanks
    38
    Thanked 19 Times in 19 Posts

    Default A Object inheriting from QGraphicsLineItem

    I have class which inherits from QGraphicsLineItem, I did that in order to have its methods and events (I need to inherit from other class, so I can´t create directly a GraphicsItem)

    When I create an object, I send the line coordinates. But when is created, it pos is always 0,0. If I create five differents objects with different line coordinates, they are displayed correctly in the scene but they're pos() always give me back 0,0.

    On the other hand, when I drag and drop one of the object its pos is changed according to its starting 0,0 coordinate, but the line().pos() gives me back the starting coords.


    When I think on it, both functions should act differently... "pos()" giving me back the scene position and "line" the scene position of the line (but it should be the same, or similar, to "pos").

    do it has any explanation? or is normal because I'm not working with the item itself?

    thanks!
    Last edited by jano_alex_es; 13th July 2009 at 09:46.

Similar Threads

  1. Getting std::string object from QString object ( qt3)
    By joseph in forum Qt Programming
    Replies: 11
    Last Post: 28th March 2013, 20:09
  2. Replies: 4
    Last Post: 19th February 2009, 11:10
  3. Help with Q_PROPERTY with object pointer
    By lni in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2009, 17:31
  4. A form returning an object.
    By cbarmpar in forum Qt Programming
    Replies: 3
    Last Post: 8th September 2008, 05:21
  5. Open a QMainWindow Object in QDialog Object
    By chuengchuenghq in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2008, 06:33

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.