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

On Mac OS X, the transformation of QPainter is not applied on QPainter::drawLine()

    XMLWordPrintable

Details

    • macOS

    Description

      On Mac OS X (carbon or Cocoa), QTransform is not applied correctly on all painting function. (The painting work correctly with the raster engine)

      Here is an example to reproduce the issue:

      #include <QtGui>

      class Widget : public QWidget
      {
      public:
      Widget();

      protected:
      void paintEvent(QPaintEvent* event);
      };

      Widget::Widget()
      {
      setFixedSize(600, 450);
      }

      void Widget::paintEvent(QPaintEvent*)
      {
      QPainter painter(this);
      QTransform transform;
      transform.rotate(50.0, Qt::YAxis);
      painter.setTransform(transform);
      painter.fillRect(0, 0, 300, 200, Qt::red);
      painter.drawLine(0, 200, 300, 200);
      }

      int main(int argc, char** argv)
      {
      QApplication app(argc, argv);
      Widget widget;
      widget.show();
      return app.exec();
      }

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            poulain Benjamin Poulain (closed Nokia identity) (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes