MCPcopy Create free account
hub / github.com/KDE/kdiff3 / getMaxTextWidth

Method getMaxTextWidth

src/mergeresultwindow.cpp:417–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417qint32 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
444LineType MergeResultWindow::getNofLines() const
445{

Callers

nothing calls this directly

Calls 1

getStringMethod · 0.45

Tested by

no test coverage detected