diff options
-rw-r--r-- | client/pcpviewer/pcpdoc.cc | 22 | ||||
-rw-r--r-- | client/pcpviewer/pcpdoc.h | 1 | ||||
-rw-r--r-- | client/pcpviewer/pcpjournal.cc | 1 |
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(); } |