×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    49

    QgraphicsView after scale.

    Hello.
    This is my problem:
    I have QgrahicsView and QgraphicsScene. Put the scene on Point(0,0) and take Scene Rect
    view->sceneRect();
    and I hae QRectF(0,0, 400x500);
    Then I make
    view->scale(1.5, 1.5);
    and after that view->sceneRect(); is still QRectF(0,0, 400x500); but for example object on coords x=20 y=20 is unseen.
    How to get coordinates of QgraphicsScene rectangle that is current seen in QGraphicsView. (All scrollbars are off)

    Reagrds
    Pawel

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QgraphicsView after scale.

    Returns the scene rectangle rect to a viewport coordinate polygon:
    http://doc.trolltech.com/4.6/qgraphi...mapFromScene-2

  3. #3
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: QgraphicsView after scale.

    Or, if you want to know the scene coordinates currently displayed on the viewport, the other way around:

    Code:
    QPolygonF scenePolygon = mapToScene(viewport()->rect());

Similar Threads

  1. Replies: 1
    Last Post: 2009-05-24, 03:21
  2. Accelero: ±2g and ±6g user selectable full scale
    By mikedeklerk in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-03-27, 18:10
  3. How to Scale Bitmap Fast
    By symbianjunior in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2007-12-12, 06:53
  4. Problem with the NAC example: svg app icon doesn't always scale
    By svdwal in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2006-07-13, 18:05
  5. How to scale bitmaps ?
    By yogesh14 in forum Symbian
    Replies: 1
    Last Post: 2005-10-03, 05:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×