Results 1 to 3 of 3

Thread: Cartesian coordinate system in QPaint

  1. #1
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Cartesian coordinate system in QPaint

    Hi
    His there a way to change de default coordinate system of a QPaintDevice so that if works like a Cartesian coordinate system in QPainter, with (0,0) as the center?

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Cartesian coordinate system in QPaint

    Hi,

    Take a look at Coordinate System on Window-Viewport Conversion http://doc.qt.io/qt-4.8/coordsys.html.
    Last edited by ^NyAw^; 27th February 2013 at 11:30.
    Òscar Llarch i Galán

  3. The following 2 users say thank you to ^NyAw^ for this useful post:

    graciano (27th February 2013), lanz (27th February 2013)

  4. #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: Cartesian coordinate system in QPaint

    Qt Code:
    1. QPainter p(this);
    2. p.translate(width()/2, height()/2);
    3. p.scale(1, -1);
    To copy to clipboard, switch view to plain text mode 

    Note that such transformations will slow down drawing.
    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:

    graciano (27th February 2013)

Similar Threads

  1. QGraphicsScene Coordinate System
    By grayfox in forum Qt Programming
    Replies: 4
    Last Post: 27th February 2016, 20:34
  2. QGraphicsView coordinate system
    By roband915 in forum Qt Programming
    Replies: 15
    Last Post: 5th December 2013, 06:58
  3. qt coordinate system
    By qtlearner123 in forum Newbie
    Replies: 1
    Last Post: 17th April 2012, 15:20
  4. coordinate system
    By Wojtek.wk in forum Newbie
    Replies: 7
    Last Post: 12th April 2010, 13:47
  5. The coordinate system
    By avis_phoenix in forum Qt Programming
    Replies: 1
    Last Post: 28th July 2008, 12:16

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.