Results 1 to 18 of 18

Thread: what item QCanvasItemList is holding..

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: what item QCanvasItemList is holding..

    You have to update the canvas, so from within the view you should call canvas()->update(). You can use Q3Canvas::setAllChanged() instead of invalidate() if setPen doesn't invalidate the item by itself.

  2. #2
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    14
    Thanked 4 Times in 4 Posts

    Default Re: what item QCanvasItemList is holding..

    Quote Originally Posted by wysota
    QCanvasItem *clicked_item = l.first(); // get the top most clicked item
    I don't know why it is not colouring the item i clicked but colouring some other item on the canvas...
    I would put the image here.. i hope this would help you to understand what exactly is happening.. i have pointed out the linei have clicked and u can see the line which it has coloured....
    Attached Images Attached Images
    All you have to decide is what to do with the time that is given to you

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: what item QCanvasItemList is holding..

    Maybe you're mixing the coordinates somewhere? It looks like your horizontal and vertical coords are inverted -- (y,x) instead of (x,y).

  4. #4
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    14
    Thanked 4 Times in 4 Posts

    Default Re: what item QCanvasItemList is holding..

    Quote Originally Posted by wysota
    Maybe you're mixing the coordinates somewhere? It looks like your horizontal and vertical coords are inverted -- (y,x) instead of (x,y).
    Hi..

    its not inverted... i have created them seperately, though it gives the look that ways as the symmetry is maintained... dont even know which part of the code would give you the idea of how to sort it out....

    i am totally confused... would try it out in a different manner by giving it some break.. i hope it sorts out the things...

    Thanks a lot for all the help and sample code you provided.. It really helped a lot...

    take care...

    with regards,
    Kapil
    All you have to decide is what to do with the time that is given to you

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: what item QCanvasItemList is holding..

    Try with a single line. If it works, add another and try again. Report coordinates of every click through qDebug or QMessageBox, etc.

Similar Threads

  1. ListWidget positions item
    By talex in forum Qt Programming
    Replies: 3
    Last Post: 21st October 2008, 15:16
  2. View, Scene, Item and thread??
    By dungsivn in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2008, 19:21
  3. Item in a DLL not getting events
    By Benne Gesserit in forum Qt Programming
    Replies: 11
    Last Post: 16th August 2008, 22:30
  4. Item Delegate Painting
    By stevey in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2008, 07:37
  5. Replies: 1
    Last Post: 19th April 2007, 22:23

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.