VirtualBox

Ignore:
Timestamp:
Dec 13, 2017 8:53:52 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119646
Message:

FE/Qt: bugref:9072 Replace QTextEdit with QPlainTextEdit in logviewer

Location:
trunk/src/VBox/Frontends/VirtualBox/src/logviewer
Files:
5 edited

Legend:

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

    r70074 r70098  
    2929# include <QPushButton>
    3030# include <QScrollBar>
    31 # include <QTextEdit>
     31# include <QPlainTextEdit>
    3232# include <QVBoxLayout>
    3333
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp

    r70027 r70098  
    2727# endif
    2828# include <QLabel>
    29 # include <QTextEdit>
     29# include <QPlainTextEdit>
    3030# include <QTextCursor>
    3131
     
    5353{
    5454    Q_UNUSED(iCurrentIndex);
    55     QTextEdit *pCurrentPage = m_pViewer->currentLogPage();
     55    QPlainTextEdit *pCurrentPage = m_pViewer->currentLogPage();
    5656    AssertReturnVoid(pCurrentPage);
    5757    QString strInputText = m_pViewer->currentLog();
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp

    r70027 r70098  
    2828# include <QHBoxLayout>
    2929# include <QLabel>
    30 # include <QTextEdit>
     30# include <QPlainTextEdit>
    3131
    3232/* GUI includes: */
     
    8080    {
    8181        /* Get current log-page: */
    82         QTextEdit *pBrowser = m_pViewer->currentLogPage();
     82        QPlainTextEdit *pBrowser = m_pViewer->currentLogPage();
    8383        /* If current log-page is valid and cursor has selection: */
    8484        if (pBrowser && pBrowser->textCursor().hasSelection())
     
    371371{
    372372    /* Get current log-page: */
    373     QTextEdit *pBrowser = m_pViewer->currentLogPage();
     373    QPlainTextEdit *pBrowser = m_pViewer->currentLogPage();
    374374    if (!pBrowser) return;
    375375
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r70074 r70098  
    2727#  include <QFontDatabase>
    2828# endif
    29 # include <QTextEdit>
     29# include <QPlainTextEdit>
    3030
    3131/* GUI includes: */
     
    137137            {
    138138                /* Create a log viewer page and append the read text to it: */
    139                 QTextEdit *pLogViewer = createLogPage(QFileInfo(strFileName).fileName());
     139                QPlainTextEdit *pLogViewer = createLogPage(QFileInfo(strFileName).fileName());
    140140                pLogViewer->setPlainText(strText);
    141141                /* Move the cursor position to end: */
     
    143143                cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
    144144                pLogViewer->setTextCursor(cursor);
    145                 /* Add the actual file name and the QTextEdit containing the content to a list: */
     145                /* Add the actual file name and the QPlainTextEdit containing the content to a list: */
    146146                m_book << qMakePair(strFileName, pLogViewer);
    147147                /* Add the log-text to the map: */
     
    155155    if (!isAnyLogPresent)
    156156    {
    157         QTextEdit *pDummyLog = createLogPage("VBox.log");
     157        QPlainTextEdit *pDummyLog = createLogPage("VBox.log");
    158158        pDummyLog->setWordWrapMode(QTextOption::WordWrap);
    159         pDummyLog->setHtml(tr("<p>No log files found. Press the "
     159        pDummyLog->appendHtml(tr("<p>No log files found. Press the "
    160160                              "<b>Refresh</b> button to rescan the log folder "
    161161                              "<nobr><b>%1</b></nobr>.</p>")
     
    494494}
    495495
    496 QTextEdit* UIVMLogViewerWidget::currentLogPage() const
     496QPlainTextEdit* UIVMLogViewerWidget::currentLogPage() const
    497497{
    498498    /* If viewer-container is enabled: */
     
    501501        /* Get and return current log-page: */
    502502        QWidget *pContainer = m_pViewerContainer->currentWidget();
    503         QTextEdit *pBrowser = pContainer->findChild<QTextEdit*>();
     503        QPlainTextEdit *pBrowser = pContainer->findChild<QPlainTextEdit*>();
    504504        Assert(pBrowser);
    505505        return pBrowser ? pBrowser : 0;
     
    509509}
    510510
    511 QTextEdit* UIVMLogViewerWidget::createLogPage(const QString &strName)
     511QPlainTextEdit* UIVMLogViewerWidget::createLogPage(const QString &strName)
    512512{
    513513    /* Create page-container: */
     
    519519        AssertPtrReturn(pPageLayout, 0);
    520520        /* Create Log-Viewer: */
    521         QTextEdit *pLogViewer = new QTextEdit(pPageContainer);
     521        QPlainTextEdit *pLogViewer = new QPlainTextEdit(pPageContainer);
    522522        AssertPtrReturn(pLogViewer, 0);
    523523        {
     
    527527            QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont);
    528528#else
    529             QFont font = pLogViewer->currentFont();
     529            QFont font;
    530530            font.setFamily("Courier New,courier");
    531531#endif
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r70080 r70098  
    3434/* Forward declarations: */
    3535class QITabWidget;
    36 class QTextEdit;
     36class QPlainTextEdit;
    3737class QVBoxLayout;
    3838class UIToolBar;
     
    4141
    4242/* Type definitions: */
    43 typedef QPair<QString, QTextEdit*> LogPage;
     43typedef QPair<QString, QPlainTextEdit*> LogPage;
    4444typedef QList<LogPage> LogBook;
    45 typedef QMap<QTextEdit*, QString> VMLogMap;
     45typedef QMap<QPlainTextEdit*, QString> VMLogMap;
    4646
    4747/** QIMainWindow extension
     
    114114
    115115    /** Returns the current log-page. */
    116     QTextEdit* currentLogPage() const;
     116    QPlainTextEdit* currentLogPage() const;
    117117    /** Returns the newly created log-page using @a strPage filename. */
    118     QTextEdit* createLogPage(const QString &strPage);
     118    QPlainTextEdit* createLogPage(const QString &strPage);
    119119    /** Returns the content of current log-page. */
    120120    const QString& currentLog();
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