Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8557

QTransform::type() doesn't always return correct transformation type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.6.2
    • Fix Version/s: 4.6.3
    • Component/s: GUI: Painting
    • Labels:
      None
    • Commits:
      4fc638c0b4562f4b1e9c9a367535e4b570602942

      Description

      Consider the following:

      QTransformBug.cpp
      #include <QTransform>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QTransform t1;
          t1.scale(10,10);
          qDebug() << "type 1: " << t1.type(); // Good.
      
          QTransform t2 = t1.inverted();
          qDebug() << "type 2: " << t2.type(); // Good.
      
          QTransform t3 = t1.adjoint() / t1.determinant();
          // This prints 0(TxNone), but I don't think that is
          // the right answer. Then all of the map() functions
          // treat the transform as the identity matrix.
          qDebug() << "type 3: " << t3.type(); // Bad.
          qDebug() << "(t2 == t3): " << (t2 == t3);
      
          return 0;
      }
      

      using QTransform::inverted() should (and does) return the same transform matrix as (QTransform::adjoint() / QTransform.determinate()) yet the type flag is not set correctly when taking the inverse manually. This is erroneous behavior.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            rodal Samuel Rødal
            Reporter:
            janichol Andy Nichols
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes