Hello,

I am using QT3 and am not so much fimiliar with the qt-programming. I have to make a rotation function on a qframe widget. I have my own rectangle class. The follow is what i have made but its not done correctly. Can someone please take a look at the code and give me some suggestion?

Qt Code:
  1. double View::Rotate(double a_dRotate)
  2. {
  3. MyRect m_Dev;
  4. MyRect m_Form;
  5. FRect m_Window;
  6.  
  7. int iWidth = m_Dev.Width();
  8.  
  9. QRect R = rect();
  10. m_Form.Rect( R.left(), R.top(), R.right(), R.bottom() );
  11.  
  12. m_Dev.Width(m_Dev.Width() * a_dRotate);
  13.  
  14. if (m_Dev.Width() > 12000)
  15. m_Dev.Width(12000);
  16.  
  17. if (m_Dev.Width() > 5000000)
  18. m_Dev.Width(5000000);
  19.  
  20. if (m_Dev.Width() < 50)
  21. m_Dev.Width(50);
  22.  
  23.  
  24. m_Dev.Height( (double)m_Dev.Width() / ((double)m_Window.Width() / (double)m_Window.Height()) );
  25. return ((double)m_Dev.Width() / (double)iWidth);
  26. }
To copy to clipboard, switch view to plain text mode