Results 1 to 2 of 2

Thread: [QPainter] difference SetWorldMatrix and setWorldTransform

  1. #1
    Join Date
    Mar 2008
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    9

    Question [QPainter] difference SetWorldMatrix and setWorldTransform

    Hi!

    I have a question regarding QPainter::setWorldMatrix and QPainter::setWorldTransform...

    in the Qt4 assistant in the description of setWorldMatrix it says:
    Note: It is advisable to use setWorldTransform() instead of this function to preserve the properties of perspective transformations.
    But when you check the implementation of QPainter::setWorldMatrix, it directly calls setWorldTransform:

    void QPainter::setWorldMatrix(const QMatrix &matrix, bool combine)
    {
    setWorldTransform(QTransform(matrix), combine);
    }
    I don't even know what exactly is meant with 'preserve the properties of the perspective transformations', but I don't think it will give any different result calling one or the other function. Is this an error in the documentation or is it something that is planned for the future and not yet implemented?

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

    Default Re: [QPainter] difference SetWorldMatrix and setWorldTransform

    Quote Originally Posted by Boy View Post
    But when you check the implementation of QPainter::setWorldMatrix, it directly calls setWorldTransform:
    Not directly. It creates a 3D matrix out of 2D matrix first.

    I don't even know what exactly is meant with 'preserve the properties of the perspective transformations', but I don't think it will give any different result calling one or the other function.
    It depends on the transformation set previously.

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
  •  
Qt is a trademark of The Qt Company.