PDA

View Full Version : How to rotate a QMainWindow



viet
16th August 2010, 16:08
Hello guys,

I have a question: I have a QMainWindow inside a QMdiArea, and is there any way to rotate that QMainWindow inside that QMdiArea.

Thank a lots in advance for your help.

tbscope
17th August 2010, 06:24
Using QGraphicsView probably.

viet
18th August 2010, 01:27
Thank you tbscope,
But our situation is like that: we use Coin3D & QuarterWidget to draw 3D scene inside Qt QMainWindow. Let's say we have a 3D object, like a SoCone inside a QMainWindow, and we want to be able to rotate or transform the QMainWindow, while the SoCone object rotate by itself inside the window. We try to put the QMainWindow inside the QGraphicsScene, but we got this error: QPainter::begin: A paint device can only be painted by one painter at a time. And the window didn't appear in the QGraphicsScene.
Do you have any ideas? Thanks.

tbscope
18th August 2010, 06:38
I find your request extremely strange. Why do you want to rotate the main window?

Anyway, how did you add the main window to the graphics scene?

viet
19th August 2010, 01:31
Hi tbscope,
We want to be able to rotate or slant the QMainWindow, so that to have a special visual effect.
We add the QMainWindow directly to QGraphicsScene using addWidget().