単一の文字の QTextCharFormat を更新しようとしています。しかし、それは適用されません:
QTextCursor cursor(document());
cursor.setPosition(4);
QTextCharFormat format;
format.setFontPointSize(sizeString.toInt());
cursor.mergeCharFormat(format);
qDebug() << "SET POS " << cursor.position() << " TO " << sizeString.toInt();
QTextCursor cursor2(document());
cursor.setPosition(4);
QTextCharFormat charformat = cursor2.charFormat();
QFont font = charformat.font();
qDebug() << " LOADED FONTSIZE: " << font.pointSize();
出力:
SET POS 4 TO 16
LOADED FONTSIZE: 36
何が欠けているか分かりますか?