Hi,
I think I'm missing something easy. I have a slot that is called when a checkbox is checked. It makes the text in a textEdit become right justified. I want the text to be sent back to the left when I uncheck the box, How do I do that?

I have tried using all the different signals for qcheckbox

this is my code

Qt Code:
  1. connect(checkAxis, SIGNAL(pressed()), this, SLOT(setAxis()));
  2.  
  3. void MyWidget::setAxis(){
  4. QTextCursor cursorArea = textedit->textCursor();
  5. QTextBlockFormat textblock = cursorArea.blockFormat();
  6. textblock.setAlignment(Qt::AlignRight);
  7. cursorArea.setBlockFormat(textblock);
  8. }
To copy to clipboard, switch view to plain text mode 

I also tried making a second slot that is the same as setAxis, just it aligns left, and connect it with released, but that didn't work either.

Qt Code:
  1. connect(checkAxis, SIGNAL(released()), this, SLOT(setAxisBack()));
To copy to clipboard, switch view to plain text mode 

Thanks