summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/logviewform.cpp18
-rw-r--r--src/gui/logviewform.h6
-rw-r--r--src/gui/logviewform.ui9
3 files changed, 18 insertions, 15 deletions
diff --git a/src/gui/logviewform.cpp b/src/gui/logviewform.cpp
index 0b0c28b..fdf0f71 100644
--- a/src/gui/logviewform.cpp
+++ b/src/gui/logviewform.cpp
@@ -1,5 +1,6 @@
#include "logviewform.h"
+#include <QScrollBar>
#include "audits/memman.h"
#include "log.h"
@@ -24,6 +25,12 @@ LogViewForm::~LogViewForm()
// no need to delete child widgets, Qt does it all for us
}
+void LogViewForm::scrollToBottom()
+{
+ QScrollBar* vsb = logTextEdit->verticalScrollBar();
+ vsb->setValue(vsb->maximum());
+}
+
void LogViewForm::show()
{
if (isShown()) {
@@ -36,17 +43,14 @@ void LogViewForm::show()
MEMMAN_NEW(logfile);
logstream = NULL;
if (logfile->open(QIODevice::ReadOnly)) {
- logstream = new Q3TextStream(logfile);
+ logstream = new QTextStream(logfile);
MEMMAN_NEW(logstream);
- logTextEdit->setText(logstream->read());
-
- // Set cursor position at the end of text
- logTextEdit->scrollToBottom();
+ logTextEdit->setPlainText(logstream->read());
}
-
log_file->enable_inform_user(true);
QDialog::show();
+ scrollToBottom();
raise();
}
@@ -82,7 +86,7 @@ void LogViewForm::update(bool log_zapped)
if (logstream) {
QString s = logstream->read();
if (!s.isNull() && !s.isEmpty()) {
- logTextEdit->append(s);
+ logTextEdit->appendPlainText(s);
}
}
}
diff --git a/src/gui/logviewform.h b/src/gui/logviewform.h
index 821f15e..d91f7c6 100644
--- a/src/gui/logviewform.h
+++ b/src/gui/logviewform.h
@@ -3,7 +3,7 @@
#include <QDialog>
#include <QCloseEvent>
-#include <Q3TextStream>
+#include <QTextStream>
#include "ui_logviewform.h"
@@ -13,7 +13,9 @@ class LogViewForm : public QDialog, protected Ui::LogViewForm
private:
QFile* logfile;
- Q3TextStream* logstream;
+ QTextStream* logstream;
+
+ void scrollToBottom();
public:
LogViewForm(QWidget* parent = 0);
diff --git a/src/gui/logviewform.ui b/src/gui/logviewform.ui
index 496c529..ead6233 100644
--- a/src/gui/logviewform.ui
+++ b/src/gui/logviewform.ui
@@ -18,12 +18,9 @@
</property>
<layout class="QGridLayout">
<item row="0" column="0" rowspan="1" colspan="3">
- <widget class="Q3TextEdit" name="logTextEdit">
- <property name="textFormat">
- <enum>Qt::PlainText</enum>
- </property>
- <property name="wordWrap">
- <enum>Q3TextEdit::NoWrap</enum>
+ <widget class="QPlainTextEdit" name="logTextEdit">
+ <property name="lineWrapMode">
+ <enum>QPlainTextEdit::NoWrap</enum>
</property>
<property name="readOnly">
<bool>true</bool>