| 453 | } |
| 454 | |
| 455 | void TextEditor::addAnnotation(const QString &title, const QString &content, int line, int type) |
| 456 | { |
| 457 | QString typeStr; |
| 458 | switch (type) { |
| 459 | case dpfservice::Edit::TipAnnotation: |
| 460 | typeStr = "Tip"; |
| 461 | break; |
| 462 | case dpfservice::Edit::NoteAnnotation: |
| 463 | typeStr = "Note"; |
| 464 | break; |
| 465 | case dpfservice::Edit::ErrorAnnotation: |
| 466 | typeStr = "Error"; |
| 467 | break; |
| 468 | case dpfservice::Edit::FatalAnnotation: |
| 469 | typeStr = "Fatal"; |
| 470 | break; |
| 471 | case dpfservice::Edit::WarningAnnotation: |
| 472 | typeStr = "Warning"; |
| 473 | break; |
| 474 | } |
| 475 | |
| 476 | d->annotationRecords.insertMulti(title, line); |
| 477 | static QString formatText("%1:\n%2:\n%3"); |
| 478 | auto msg = formatText.arg(title, typeStr, content); |
| 479 | addAnnotation(msg, line, type); |
| 480 | } |
| 481 | |
| 482 | void TextEditor::addAnnotation(const QString &content, int line, int type) |
| 483 | { |
no test coverage detected