title: How to rotate an QImage
body: <p>I want to <strong>rotate my QImage</strong> by the amount of x.  </p>
  
  <p>I <strong>don't</strong> want to <strong>use QPixMap</strong> <strong>or the PaintEvent</strong> if possible.</p>
  
  <p>I have already searched for possible solutions but they didn't work.  </p>
  
  <p>Right now i am trying to solve it with the QTransform method:</p>
  
  <pre><code>class MainWindow(QMainWindow):
  
      def rotate_pdf_ui(self):
          for index, object in enumerate(self.page_objects):
              if object.push_button.isChecked():
                  object.rotate(90)
          self.delete_old_position()
          self.position_push_buttons_in_grid()
  
      def position_push_buttons_in_grid(self):
          row = 0
          column = 0
          for page_object in self.page_objects:
              self.ui.pushButtonGrid.addWidget(page_object.push_button, row, column)
              column += 1
              if int(len(self.page_objects) / 4) is column:
                  row += 1
                  column = 0
          self.ui.widgetLayout.setLayout(self.ui.pushButtonGrid)
  
      def delete_old_position(self):
          for push_button in reversed(range(self.ui.pushButtonGrid.count())):
              button_to_remove = self.ui.pushButtonGrid.itemAt(push_button).widget()
              self.ui.pushButtonGrid.removeWidget(button_to_remove)
              button_to_remove.setParent(None)
          return self.ui.pushButtonGrid
  
  class PageObject:
  
      def rotate(self, rotation):
          my_transform = QTransform()
          my_transform.rotate(rotation)
          self.img.transformed(my_transform)
          self.rotation += rotation
  
  </code></pre>
  
  <p>I don't get any error message the image is just not rotated.</p>