Results 1 to 8 of 8

Thread: setSceneRect not being called properly?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: setSceneRect not being called properly?

    This code is surely invalid. Changing location as a result of a repaint is probably not what you want.
    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.


  2. The following user says thank you to wysota for this useful post:

    qtzcute (13th July 2009)

  3. #2
    Join Date
    Jun 2009
    Posts
    38
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: setSceneRect not being called properly?

    Sorry but i am very new in Qt's world and could not understand what you said. Can u kindly tell me where am i changing the location?

    If you are talking about updating the 'xLocation' integer variable in paint function then well, i am doing that because i want each new rectangle to be drawn at new place.

    If not, then please guide as to what i need to do.

    Thanks a lot wysota

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: setSceneRect not being called properly?

    Quote Originally Posted by qtzcute View Post
    Sorry but i am very new in Qt's world and could not understand what you said. Can u kindly tell me where am i changing the location?
    In the paint() routine.

    If you are talking about updating the 'xLocation' integer variable in paint function then well, i am doing that because i want each new rectangle to be drawn at new place.
    That's surely not the right way to do this. paint() will be called for each of the rectangles more than once.

    In my opinion you should stick to QGraphicsRectItem or its subclass.
    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. The following user says thank you to wysota for this useful post:

    qtzcute (13th July 2009)

  6. #4
    Join Date
    Jun 2009
    Posts
    38
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: setSceneRect not being called properly?

    Many thanks wysota...problem solved.

    You were right i should not have change the position in paint function...Now my rectangles are appearing quite finely.

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.