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?
double View::Rotate(double a_dRotate)
{
MyRect m_Dev;
MyRect m_Form;
FRect m_Window;
int iWidth = m_Dev.Width();
m_Form.Rect( R.left(), R.top(), R.right(), R.bottom() );
m_Dev.Width(m_Dev.Width() * a_dRotate);
if (m_Dev.Width() > 12000)
m_Dev.Width(12000);
if (m_Dev.Width() > 5000000)
m_Dev.Width(5000000);
if (m_Dev.Width() < 50)
m_Dev.Width(50);
m_Dev.Height( (double)m_Dev.Width() / ((double)m_Window.Width() / (double)m_Window.Height()) );
return ((double)m_Dev.Width() / (double)iWidth);
}
double View::Rotate(double a_dRotate)
{
MyRect m_Dev;
MyRect m_Form;
FRect m_Window;
int iWidth = m_Dev.Width();
QRect R = rect();
m_Form.Rect( R.left(), R.top(), R.right(), R.bottom() );
m_Dev.Width(m_Dev.Width() * a_dRotate);
if (m_Dev.Width() > 12000)
m_Dev.Width(12000);
if (m_Dev.Width() > 5000000)
m_Dev.Width(5000000);
if (m_Dev.Width() < 50)
m_Dev.Width(50);
m_Dev.Height( (double)m_Dev.Width() / ((double)m_Window.Width() / (double)m_Window.Height()) );
return ((double)m_Dev.Width() / (double)iWidth);
}
To copy to clipboard, switch view to plain text mode
Bookmarks