Hi guys,
I have a textEdit and I have set the wrapPolicy to Anywhere, Now If I'm trying to
Align the text to Right, or Left or Center, the text doesn't get aligned. Is this a bug in QTextEdit (Qt3.3.5) or Is there something that I'm doing wrong.

Here is the code snippet

void TextEdit::textAlign( QAction *a )
if ( !currentEditor() )

currentEditor()->setWrapPolicy( QTextEdit::Anywhere ); //If I remove this
//the text gets aligned

if ( a == actionAlignLeft )
currentEditor()->setAlignment( AlignLeft );
else if ( a == actionAlignCenter )
currentEditor()->setAlignment( AlignHCenter );
else if ( a == actionAlignRight )
currentEditor()->setAlignment( AlignRight );
else if ( a == actionAlignJustify )
currentEditor()->setAlignment( AlignJustify );

The snippet is a copy of Qt/3.3.5/examples/textedit.

Please help to rectify this problem