void editor::on_bold_clicked(void){ if(!(textarea->fontWeight()==75)) textarea->setFontWeight(75); // Bold else textarea->setFontWeight(0); // Remove Bold}void editor::on_italic_clicked(void){ if(!textarea->fontItalic()) textarea->setFontItalic(true); else textarea->setFontItalic(false);}
void QTextEdit::mergeCurrentCharFormat ( const QTextCharFormat & modifier )
void QTextEdit::selectionChanged () [signal]
void QTextEdit::cursorPositionChanged () [signal]
void QTextEdit::currentCharFormatChanged ( const QTextCharFormat & f ) [signal]
void TextEdit::cursorPositionChanged(){ QTextCursor cursor = textEdit->textCursor(); if (cursor.hasSelection()) { int position = cursor.position(); if (position < cursor.anchor()) cursor.setPosition(position + 1); } QTextCharFormat charFormat = cursor.charFormat(); fontChanged(charFormat.font()); colorChanged(charFormat.foreground().color()); alignmentChanged(textEdit->alignment());}