VirtualBox

Changeset 86942 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 20, 2020 5:44:04 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
141461
Message:

FE/Qt: bugref:9831. Using correct char format during text highlighting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp

    r86921 r86942  
    13041304
    13051305    QTextCursor highlightCursor(pDocument);
    1306     QTextCharFormat colorFormat(highlightCursor.charFormat());
     1306
     1307
    13071308    QTextCursor cursor(pDocument);
    13081309    cursor.beginEditBlock();
    1309     colorFormat.setBackground(Qt::yellow);
    13101310    for (int i = 0; i < m_matchedCursorPosition.size(); ++i)
    13111311    {
    13121312        highlightCursor.setPosition(m_matchedCursorPosition[i]);
     1313
     1314        QTextCharFormat colorFormat(highlightCursor.charFormat());
     1315        colorFormat.setBackground(Qt::yellow);
     1316
    13131317        highlightCursor.setPosition(m_matchedCursorPosition[i] + iSearchTermLength, QTextCursor::KeepAnchor);
    13141318        if (!highlightCursor.isNull())
    1315             highlightCursor.mergeCharFormat(colorFormat);
     1319            highlightCursor.setCharFormat(colorFormat);
    13161320    }
    13171321    cursor.endEditBlock();
Note: See TracChangeset for help on using the changeset viewer.

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