void ShapeSetting::updateItemRotation(qreal r)
{
Rectangle *vrect;
int typ;
QTransform transform;
qreal m_rotation_x;
qreal m_rotation_y;
qreal m_rotation_z;
QPointF center;
qreal old_rot_x = m_rotation_x;
qreal old_rot_y = m_rotation_y;
qreal old_rot_z = m_rotation_z;
m_rotation_x = ui->xSpin->value();
m_rotation_y = ui->ySpin->value();
m_rotation_z = ui->zSpin->value();
transform.translate(50,50);
transform.rotate(m_rotation_x - old_rot_x,Qt::XAxis);
transform.rotate(m_rotation_y - old_rot_y,Qt::YAxis);
transform.rotate(m_rotation_z - old_rot_z,Qt::ZAxis);
transform.translate(-50,-50);
switch(typ){
case 3:
vrect->transform().reset();
vrect->setTransform(transform,true);
break;
}
update();
}
void ShapeSetting:
n_xSlider_valueChanged(int value)
{
updateItemRotation(value);
}
void ShapeSetting:
n_ySlider_valueChanged(int value)
{
updateItemRotation(value);
}
void ShapeSetting:
n_zSlider_valueChanged(int value)
{
updateItemRotation(value);
}
Bookmarks