I have a label with a pixmap on it Code looks like this:
Label = new QLabel (dialog, Qt::Widget);
Label -> setGeometry( xPosition, yPosition, 25, 87 );
QPixmap pixmap;
pixmap.load("/home/richter/Dokumente/QDevelop/AnimationTest/ScreenData/rightTire.png", 0, Qt::DiffuseAlphaDither);
Label -> setPixmap(pixmap);
Label -> se开发者_如何学PythontAlignment(Qt::AlignCenter);
Label -> show();
what I now want to have is a method like that:
void rotateLabel (int degrees)
I think it's clear what it should do. You enter the degrees and see it rotated by these degrees.
Run qtdemo
-> Demonstrations -> Embedded Dialogs
It shows how to map a whole dialog to a 3D surface. The same technique allows you to rotate a single label.
Source code is here: http://doc.qt.io/archives/qt-4.7/demos-embeddeddialogs.html
Checkout the examples in QMatrix.
You need to override paint event of your QLabel and draw similar to given example.
精彩评论