Results 1 to 11 of 11

Thread: Fixed Position of QGraphicsItem

  1. #1
    Join Date
    Mar 2010
    Posts
    63
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Fixed Position of QGraphicsItem

    Hi,

    How can i set fixed position of a graphicsitem which should not be change on changing scene rect or on any applying any transformation(rotate,shear etc) on view.
    I already applied flag ItemsIgonreTransformation. and change postion when scenerect change signal emmited.But i am not able to get any signal of transformation.
    I want some items(seem to) same position .example Zoomingbar in any map shouldn't change postion ,when map get rotated or transformed.

    Please Suggest.

    Thanks

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

    Default Re: Fixed Position of QGraphicsItem

    An option is to not make those static pieces items. Another option is to use QGraphicsItem::itemChange() to be notified of item position changing and move the item back where it should be.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2010
    Posts
    63
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Fixed Position of QGraphicsItem

    Hi,
    Thanks for Reply,I tried QGraphicsItem::itemChange() but on applying transformation on view,QGraphicsitem didnt get any notification.
    Please let me know If there is any flag which make me avilable tranformation change in view.

    Thanks

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

    Default Re: Fixed Position of QGraphicsItem

    Did you read the docs carefully?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2010
    Posts
    63
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Fixed Position of QGraphicsItem

    sir,
    I tried to read docs carefully and also implement it.
    Please let me know,If I miss something.

    Thanks

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

    Default Re: Fixed Position of QGraphicsItem

    So which GraphicsItemChange would you expect to receive in your situation?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Mar 2010
    Posts
    63
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Fixed Position of QGraphicsItem

    sir,
    I am rotating view using QGraphicsView::rotate().I want a single QGraphicsItem seems to be static,I already setFlag(QGraphicsItem::ItemIgnoresTransformations) .
    Please suggest.

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

    Default Re: Fixed Position of QGraphicsItem

    Answer my question please. Which GraphicsItemChange would you expect to receive. Because without knowing that how can you enable the right one? If there is any "right one". Honestly I would rather use my other solution -- make your "other stuff" something else than items.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Mar 2010
    Posts
    63
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Fixed Position of QGraphicsItem

    Sir,
    I except to receive QGraphicsItem::ItemTransformHasChanged but on changing Tranformation of view I am not getting it.Is it possible?

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

    Default Re: Fixed Position of QGraphicsItem

    Quote Originally Posted by moh.gup@gmail.com View Post
    I except to receive QGraphicsItem::ItemTransformHasChanged but on changing Tranformation of view I am not getting it.Is it possible?
    To quote the docs:

    The item's transformation matrix has changed either because setTransform is called, or one of the transformation properties is changed.
    Item's, not view's. This is not what you're looking for. Either find something else or use a different approach.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Mar 2010
    Posts
    63
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Fixed Position of QGraphicsItem

    Thanks I thinks i need to use different apporach

Similar Threads

  1. Replies: 9
    Last Post: 13th June 2012, 15:42
  2. Scale individual QGraphicsItem's size and position
    By klep in forum Qt Programming
    Replies: 1
    Last Post: 17th December 2011, 08:29
  3. Replies: 5
    Last Post: 24th June 2011, 12:07
  4. Replies: 2
    Last Post: 16th December 2010, 11:52
  5. QGraphicsItem position
    By zgulser in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2009, 09: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.