| 3312 | } |
| 3313 | |
| 3314 | void |
| 3315 | TextItem::setAlignment(Qt::Alignment alignment) |
| 3316 | { |
| 3317 | _alignement = alignment; |
| 3318 | QTextBlockFormat format; |
| 3319 | format.setAlignment(alignment); |
| 3320 | QTextCursor cursor = textCursor(); // save cursor position |
| 3321 | int position = textCursor().position(); |
| 3322 | cursor.select(QTextCursor::Document); |
| 3323 | cursor.mergeBlockFormat(format); |
| 3324 | cursor.clearSelection(); |
| 3325 | cursor.setPosition(position); // restore cursor position |
| 3326 | setTextCursor(cursor); |
| 3327 | } |
| 3328 | |
| 3329 | int |
| 3330 | TextItem::type() const |
no test coverage detected