Results 1 to 2 of 2

Thread: itemAt(position,QTransform & deviceTransform) below qt 4.6

  1. #1
    Join Date
    Mar 2010
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default itemAt(position,QTransform & deviceTransform) below qt 4.6

    I want to know what is alternative for scene.itemAt(position,QTransform & deviceTransform) for older version of Qt below 4.6,
    deviceTransform to be provided if the scene contains items that ignore transformations.

    In my code, I have few qgraphicstext which are place on qgraphicsscene -> qgraphicsview.
    I have subclass QGraphicsText and reimplementing mouseEvents for textitem which emit a signal about textitem's position change at mouseMovementEvent
    and also subclass QGraphicsView for rubberband effect for zoom-in of selected area in View.

    I have set flag for textitem to ItemIgnoresTransformations and now if I zoomout my view below 50% then if I click on a textitem then it doesn't pick the correct text in otherwords my mouse event pos even after maptoScene doesn't give correct co-ordinates which in turn my, scene.itemAt(mapToScene(event.pos()) pickes a different point.
    But works fine if I provide deviceTransform to itemAt then it works like a charm,

    But I am worried about qt version below 4.6, at this point if I tried to move a textitem when I zoom out, along with moving the textitem it also zoom's in

    I have attaching python file below,
    after running the program with minus key reduce the view below 50% and try to move the qgraphicstextitem, itemAt returns a different textitem or None, But comment line 53-59 and uncomment line 60-66 try the same and it works

    Any help

    Thank you in advance
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2010
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: itemAt(position,QTransform & deviceTransform) below qt 4.6

    Anybody? No one has encounter this problem?

Similar Threads

  1. ItemAt and ScenePos
    By jano_alex_es in forum Newbie
    Replies: 3
    Last Post: 26th October 2009, 14:48
  2. Qt: TableWidget’s ItemAt() acting weirdly
    By emredog in forum Qt Programming
    Replies: 2
    Last Post: 19th October 2009, 07:50
  3. itemAt - does not select rect
    By gjshannon in forum Qt Programming
    Replies: 3
    Last Post: 14th March 2009, 21:51
  4. QTreeWidget itemAt
    By maartenS in forum Newbie
    Replies: 4
    Last Post: 17th September 2008, 19:19
  5. Order of elemetns with QGraphicsScene::itemAt
    By Morea in forum Qt Programming
    Replies: 2
    Last Post: 20th December 2006, 21:00

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.