Qt富文本處理

點擊打開鏈接

點擊打開鏈接

textformat設置

// textEdit->moveCursor( QTextCursor::End );
QTextCursor cursor( textEdit->textCursor() );

QTextCharFormat format;
format.setFontWeight( QFont::DemiBold );
format.setForeground( QBrush( QColor( "black" ) ) );
cursor.setCharFormat( format );

cursor.insertText( "Hello world!" );

發佈了23 篇原創文章 · 獲贊 3 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章