X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatview.cpp;h=ffd9e72a8782700e64f5426f540955875420d273;hb=65118437813c853cbcc52f0c1a061457e264ed1a;hp=5bc02c5758bc7ef5ad3714232ece98d30812e27f;hpb=9ce42695baef3bdd6f61aaff23c4b59061e46fe6;p=quassel.git diff --git a/src/qtui/chatview.cpp b/src/qtui/chatview.cpp index 5bc02c57..ffd9e72a 100644 --- a/src/qtui/chatview.cpp +++ b/src/qtui/chatview.cpp @@ -30,20 +30,27 @@ #include "quasselui.h" ChatView::ChatView(Buffer *buf, QWidget *parent) : QGraphicsView(parent), AbstractChatView() { - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setAlignment(Qt::AlignBottom); - setInteractive(true); - QList filterList; filterList.append(buf->bufferInfo().bufferId()); MessageFilter *filter = new MessageFilter(Client::messageModel(), filterList, this); + init(filter); + +} + +ChatView::ChatView(MessageFilter *filter, QWidget *parent) : QGraphicsView(parent), AbstractChatView() { + init(filter); +} + +void ChatView::init(MessageFilter *filter) { + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setAlignment(Qt::AlignBottom); + setInteractive(true); _scene = new ChatScene(filter, filter->idString(), this); connect(_scene, SIGNAL(heightChanged(qreal)), this, SLOT(sceneHeightChanged(qreal))); setScene(_scene); } - ChatView::~ChatView() { }