Hello all,
I am currently subclassing QTextEdit and dynamically creating what are (in effect) fancy labels that can be created and moved around the window, edited, etc. So far everything is working out beautifully.
I would now like to add the ability to rotate these labels. Here is what I have tried:
Each MyQTextEdit is created with the QMainWindow's centralwidget as parent. I have a QList of pointers to each of the MyQTextEdit objects. In the MyQTextEdit subclass, I have overridden the paintEvent, pass the event first to QTextEdit::paintEvent and then create a QPainter with MyQTextEdit::viewport() as its parent, call its rotate() and then continue on.
This runs without error, but does not have the desired effect. I have also tried transform() without success. The MyQTextEdit objects are painted normally, no rotation occurs.
To be clear, I wish to rotate the entire widget, not just the text in the widget.
I feel like perhaps I am reaching for the wrong viewport() to rotate here. Yet QMainWindow does not have a viewport().
Any ideas on how to accomplish this?
Bookmarks