summaryrefslogtreecommitdiff
path: root/client/pcpviewer
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2011-11-03 10:45:35 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2011-11-03 10:45:35 +0100
commit8910e356af01a11cf769b891c1aa51eed2cf960f (patch)
tree6715a3d0e00ab97c9bff3202b2fcfbbfabd76e6e /client/pcpviewer
parent82a2317dd87c0011717c0c29d3d171bb5ee81242 (diff)
Scroll journal to bottom.
Diffstat (limited to 'client/pcpviewer')
-rw-r--r--client/pcpviewer/pcpdoc.cc22
-rw-r--r--client/pcpviewer/pcpdoc.h1
-rw-r--r--client/pcpviewer/pcpjournal.cc1
3 files changed, 7 insertions, 17 deletions
diff --git a/client/pcpviewer/pcpdoc.cc b/client/pcpviewer/pcpdoc.cc
index 0d2aa41..33fbdd4 100644
--- a/client/pcpviewer/pcpdoc.cc
+++ b/client/pcpviewer/pcpdoc.cc
@@ -29,6 +29,7 @@
#include <QTextCodec>
#include <QByteArray>
+#include <QScrollBar>
PCPDoc::PCPDoc(QString codepage)
{
@@ -54,20 +55,7 @@ void PCPDoc::setText(QString text)
setPlainText(jstrip);
}
-#ifdef TEST_PCPDOC
-//Additional dependency files
-//deps:
-//Required cflags (autoconf vars may be used)
-//cflags:
-//Required link options (autoconf vars may be used)
-//libs:
-#include "test.h"
-
-TEST_BEGIN;
-
-// TODO: Put some testcode here (see test.h for usable macros).
-TEST_TRUE(false, "No tests yet!");
-
-TEST_END;
-
-#endif/*TEST_PCPDOC*/
+void PCPDoc::scrollToBottom()
+{
+ verticalScrollBar()->setSliderPosition(verticalScrollBar()->maximum());
+}
diff --git a/client/pcpviewer/pcpdoc.h b/client/pcpviewer/pcpdoc.h
index ad48a26..25cbe68 100644
--- a/client/pcpviewer/pcpdoc.h
+++ b/client/pcpviewer/pcpdoc.h
@@ -37,6 +37,7 @@ public:
PCPDoc(QString codepage);
void setText(QString text);
+ void scrollToBottom();
private:
QString codepage;
diff --git a/client/pcpviewer/pcpjournal.cc b/client/pcpviewer/pcpjournal.cc
index 0ebaf4b..ff5afad 100644
--- a/client/pcpviewer/pcpjournal.cc
+++ b/client/pcpviewer/pcpjournal.cc
@@ -39,4 +39,5 @@ PCPJournal::PCPJournal()
void PCPJournal::setData(QString data)
{
doc->setText(data);
+ doc->scrollToBottom();
}