QGraphicsItem disappeare during rotation around Qt::XAxis
Hi,
I can't find the reason, why my object disappearing during transformation around the XAxis.
I am showing here the short code which better expain what I mean.
When I use QTransform on the scene and rotate the view, then if i use high angle the QGraphicsRectItem disappeare.
Or if I make the view window height bigger, which anybody who would help me can try in this small app.
Code:
#include <QApplication>
#include <QGraphicsView>
int main(int argc, char **argv)
{
view.show();
QTransform transform;
transform.rotate(80, Qt::XAxis);
view.setTransform(transform);
return app.exec();
}
Re: QGraphicsItem disappeare during rotation around Qt::XAxis
I can see the item just fine. Bear in mind that graphics items are flat, if you rotate them 90 deg. they will disappear because their z size is 0.
Re: QGraphicsItem disappeare during rotation around Qt::XAxis
Hi,
did you try to change window size? if I make it vertically bigger the item disappear and again appear when i make the window smaller.
If you tried it and you still can see it then the problem will be somewhere else, but I have no idea where. I was trying on the different comps with kubuntu and and also on windows. The problem was on all of them.
Re: QGraphicsItem disappeare during rotation around Qt::XAxis
Hi, you should know what really you want to do. If you only want to rotate the rect, just use QGraphicsItem::rotate(). The transform will rotate the whole coordinate.
Re: QGraphicsItem disappeare during rotation around Qt::XAxis
Hi,
the code above is just simple example to demonstrate what I mean. I am doing chessboard, so there should be option to zoomin and out and to rotate it. But then is coming the problem which I described above.
Radek
Re: QGraphicsItem disappeare during rotation around Qt::XAxis
so looks like it was a bug, i have tried on qt 4.5 and the transformation is fine