10
10
#include < QVBoxLayout>
11
11
#include < QLineEdit>
12
12
#include < QLabel>
13
- #include < QTextEdit >
13
+ #include < QTextBrowser >
14
14
#include < QStatusBar>
15
15
#include < QProcess>
16
16
#include < QTimer>
31
31
32
32
const int messageTimeout = 5000 ; // !< status bar message timeout in milliseconds.
33
33
34
+ #define APPQT (x ) QString::fromLatin1(" <qt><pre>" ) + x + QString::fromLatin1(" </pre></qt>" )
35
+
36
+ static QString text1 = QString::fromLatin1(" " );
37
+
34
38
MainWindow &MainWindow::instance ()
35
39
{
36
40
static MainWindow *theInstance = new MainWindow;
@@ -101,7 +105,9 @@ MainWindow::MainWindow()
101
105
runTabLayout->addLayout (runLayout);
102
106
runTabLayout->addWidget (new QLabel (tr (" Output produced by doxygen" )));
103
107
QGridLayout *grid = new QGridLayout;
104
- m_outputLog = new QTextEdit;
108
+ // m_outputLog = new QTextEdit;
109
+ m_outputLog = new QTextBrowser;
110
+ // m_outputLog = new QPlainTextEdit;
105
111
m_outputLog->setReadOnly (true );
106
112
m_outputLog->setFontFamily (QString::fromLatin1 (" courier" ));
107
113
m_outputLog->setMinimumWidth (600 );
@@ -484,11 +490,12 @@ void MainWindow::runDoxygen()
484
490
args << QString::fromLatin1 (" -" ); // read config from stdin
485
491
486
492
m_outputLog->clear ();
493
+ text1 = QString::fromLatin1 (" " );
487
494
m_runProcess->start (doxygenPath + QString::fromLatin1 (" doxygen" ), args);
488
495
489
496
if (!m_runProcess->waitForStarted ())
490
497
{
491
- m_outputLog->append (QString::fromLatin1 (" *** Failed to run doxygen\n " ));
498
+ m_outputLog->append (APPQT ( QString::fromLatin1 (" *** Failed to run doxygen\n " ) ));
492
499
return ;
493
500
}
494
501
QTextStream t (m_runProcess);
@@ -497,7 +504,7 @@ void MainWindow::runDoxygen()
497
504
498
505
if (m_runProcess->state () == QProcess::NotRunning)
499
506
{
500
- m_outputLog->append (QString::fromLatin1 (" *** Failed to run doxygen\n " ));
507
+ m_outputLog->append (APPQT ( QString::fromLatin1 (" *** Failed to run doxygen\n " ) ));
501
508
}
502
509
else
503
510
{
@@ -527,7 +534,9 @@ void MainWindow::readStdout()
527
534
QString text = QString::fromUtf8 (data);
528
535
if (!text.isEmpty ())
529
536
{
530
- m_outputLog->append (text.trimmed ());
537
+ text1 += text;
538
+ m_outputLog->clear ();
539
+ m_outputLog->append (APPQT (text1.trimmed ()));
531
540
}
532
541
}
533
542
}
@@ -536,11 +545,11 @@ void MainWindow::runComplete()
536
545
{
537
546
if (m_running)
538
547
{
539
- m_outputLog->append (tr (" *** Doxygen has finished\n " ));
548
+ m_outputLog->append (APPQT ( tr (" *** Doxygen has finished\n " ) ));
540
549
}
541
550
else
542
551
{
543
- m_outputLog->append (tr (" *** Cancelled by user\n " ));
552
+ m_outputLog->append (APPQT ( tr (" *** Cancelled by user\n " ) ));
544
553
}
545
554
m_outputLog->ensureCursorVisible ();
546
555
m_run->setText (tr (" Run doxygen" ));
@@ -602,7 +611,7 @@ void MainWindow::showSettings()
602
611
QTextStream t (&text);
603
612
m_expert->writeConfig (t,true );
604
613
m_outputLog->clear ();
605
- m_outputLog->append (text);
614
+ m_outputLog->append (APPQT ( text) );
606
615
m_outputLog->ensureCursorVisible ();
607
616
m_saveLog->setEnabled (true );
608
617
}
0 commit comments