VirtualBox

Ignore:
Timestamp:
Jan 15, 2018 1:00:21 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9072: Further improvements to log viewer: A better handling of 'no log files' case and enabling line wrapping through the setting panel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.cpp

    r70581 r70589  
    190190#endif
    191191    setFont(font);
     192    setWordWrapMode(QTextOption::NoWrap);
    192193    setWordWrapMode(QTextOption::NoWrap);
    193194    setReadOnly(true);
     
    389390int  UIVMLogViewerTextEdit::lineNumberForPos(const QPoint &position)
    390391{
     392    QTextCursor cursor = cursorForPosition(position);
     393    QTextBlock block = cursor.block();
     394    return block.blockNumber() + 1;
     395}
     396
     397QPair<int, QString> UIVMLogViewerTextEdit::bookmarkForPos(const QPoint &position)
     398{
    391399    QTextBlock block = cursorForPosition(position).block();
    392     return block.firstLineNumber() + 1;
    393 }
    394 
    395 QPair<int, QString> UIVMLogViewerTextEdit::bookmarkForPos(const QPoint &position)
    396 {
    397     QTextBlock block = cursorForPosition(position).block();
    398     return QPair<int, QString>(block.firstLineNumber() + 1, block.text());
     400    return QPair<int, QString>(lineNumberForPos(position), block.text());
    399401}
    400402
     
    437439        return;
    438440    m_bWrapLines = bWrapLines;
     441    if(m_bWrapLines)
     442    {
     443        setLineWrapMode(QPlainTextEdit::WidgetWidth);
     444        setWordWrapMode(QTextOption::WordWrap);
     445    }
     446    else
     447    {
     448        setWordWrapMode(QTextOption::NoWrap);
     449        setWordWrapMode(QTextOption::NoWrap);
     450    }
     451
    439452    update();
    440453}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette