durbrak
15th April 2007, 13:52
Okay, I've been sitting on this issue for at least 4 hours now and just am exhausted.
I'm trying to simply rotate a QGraphicsPixmapItem by 45° around its own axis.
MyPixmap::MyPixmap() : QGraphicsPixmapItem()
{
this->setPixmap(QPixmap("wallpaper.jpg"));
QTransform t = this->transform();
t.translate(this->pixmap().width()/2, this->pixmap().height()/2);
t.rotate(45, Qt::XAxis);
t.translate(-this->pixmap().width()/2, -this->pixmap().height()/2);
this->setTransform(t);
}I tried alot of other options but the image is always moving around the whole screen and this is what comes out:
http://img292.imageshack.us/img292/5521/capturenm9.th.jpg (http://img292.imageshack.us/my.php?image=capturenm9.jpg)
Shouldn't the lower edge be large and the upper edge small, like a trapezoid? Anyway, that's what I want it to be but it seems like I'm missing something here :(
I'm trying to simply rotate a QGraphicsPixmapItem by 45° around its own axis.
MyPixmap::MyPixmap() : QGraphicsPixmapItem()
{
this->setPixmap(QPixmap("wallpaper.jpg"));
QTransform t = this->transform();
t.translate(this->pixmap().width()/2, this->pixmap().height()/2);
t.rotate(45, Qt::XAxis);
t.translate(-this->pixmap().width()/2, -this->pixmap().height()/2);
this->setTransform(t);
}I tried alot of other options but the image is always moving around the whole screen and this is what comes out:
http://img292.imageshack.us/img292/5521/capturenm9.th.jpg (http://img292.imageshack.us/my.php?image=capturenm9.jpg)
Shouldn't the lower edge be large and the upper edge small, like a trapezoid? Anyway, that's what I want it to be but it seems like I'm missing something here :(