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

isRotating() returns false when QTransform is rotated exactly 180 degrees

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.8.2
    • GUI: Painting
    • None

    Description

      Can be reproduced with the attached example project (RotateExample.zip).

      void MainWindow::paintEvent(QPaintEvent *)
      {
          QPainter paint(this);
      
          QTransform transform;
          transform.rotate(180.0);  // test with 180.0 degrees and then with 180.01 degrees
      
          if ( transform.isRotating() )
          {
          qDebug() << "isRotating():" << transform.isRotating();
          }
          else
          {
          qDebug() << "isRotating():" << transform.isRotating();
          }
      
          paint.drawPixmap(0,0, QPixmap::fromImage(QImage(QString(":/example.jpg")).transformed(transform)));
      }
      

      In the example the picture is rotated like expected but the value for isRotating() is wrong with 180 degrees.

      Attachments

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

        Activity

          People

            rodal Samuel Rødal
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes