Results 1 to 3 of 3

Thread: Trivial graphics view framework coordination problem

  1. #1
    Join Date
    Mar 2009
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Trivial graphics view framework coordination problem

    I'm confused with the graphics view framework coordinate system. There is so much information about all kinds of conversions, relations, mappings etc. that I haven't been able to find out solution for my trivial problem.

    The problem is: I want to draw my item so that it fills the view completely. How can I do this after I've scrolled the view? I don't want to use QGraphicsView::fitInView(), I just need to tell in my item's paint function that draw yourself and fill the whole view while doing it.

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Trivial graphics view framework coordination problem

    you should operate in scene context, because it is not a widget itself, but the content of graphics view. So whatever you do with graphics view (scroll, change it size) the scene remains unchanged. So just make your item fill whole scene (it's bounding rect = 0, 0, scene.width, scene.height). And of course if you want to fill whole graphics view, the scene should cover at least graphics view viewport area.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  3. #3
    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: Trivial graphics view framework coordination problem

    Please don't start multiple threads on the same subject.

    http://www.qtcentre.org/forum/f-newb...hat-21233.html
    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.


Similar Threads

  1. Qt Coordinate System and the Graphics View Framework
    By djurodrljaca in forum Qt Programming
    Replies: 14
    Last Post: 17th February 2012, 12:19
  2. Graphics View Event Propagation
    By pherthyl in forum Qt Programming
    Replies: 10
    Last Post: 3rd July 2008, 11:39
  3. Graphics view display problem.
    By kiranraj in forum Qt Programming
    Replies: 3
    Last Post: 20th July 2007, 08:08
  4. graphics view FitInView problem
    By aamer4yu in forum Qt Programming
    Replies: 6
    Last Post: 25th January 2007, 11:24
  5. Adding Rectangular overlay on graphics view
    By forrestfsu in forum Qt Programming
    Replies: 10
    Last Post: 21st November 2006, 20:42

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.