| 415 | } |
| 416 | |
| 417 | qint32 MergeResultWindow::getMaxTextWidth() |
| 418 | { |
| 419 | if(m_maxTextWidth < 0) |
| 420 | { |
| 421 | m_maxTextWidth = 0; |
| 422 | |
| 423 | for(const MergeBlock& mb: m_mergeBlockList) |
| 424 | { |
| 425 | for(const MergeEditLine& mel: mb.list()) |
| 426 | { |
| 427 | const QString s = mel.getString(m_pldA, m_pldB, m_pldC); |
| 428 | |
| 429 | QTextLayout textLayout(s, font(), this); |
| 430 | textLayout.beginLayout(); |
| 431 | textLayout.createLine(); |
| 432 | textLayout.endLayout(); |
| 433 | if(m_maxTextWidth < textLayout.maximumWidth()) |
| 434 | { |
| 435 | m_maxTextWidth = qCeil(textLayout.maximumWidth()); |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | m_maxTextWidth += 5; // cursorwidth |
| 440 | } |
| 441 | return m_maxTextWidth; |
| 442 | } |
| 443 | |
| 444 | LineType MergeResultWindow::getNofLines() const |
| 445 | { |