From 7697a688fc1fb1e8e56b80099707e4b2a944759e Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Thu, 30 Jul 2009 17:10:05 +0200 Subject: [PATCH] Revert "Introduce a timer for resizing the ChatView" We'll look into those issues again later. For now prevent performance degradation. This reverts commit 63d178b9ca67b7072a05f5afbd12b4eaedd1f17f. --- src/qtui/chatview.cpp | 10 +--------- src/qtui/chatview.h | 2 -- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/qtui/chatview.cpp b/src/qtui/chatview.cpp index e8a06f13..440cc4da 100644 --- a/src/qtui/chatview.cpp +++ b/src/qtui/chatview.cpp @@ -54,7 +54,7 @@ ChatView::ChatView(MessageFilter *filter, QWidget *parent) void ChatView::init(MessageFilter *filter) { setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setAlignment(Qt::AlignBottom|Qt::AlignLeft); + setAlignment(Qt::AlignBottom); setInteractive(true); //setOptimizationFlags(QGraphicsView::DontClipPainter | QGraphicsView::DontAdjustForAntialiasing); // setOptimizationFlags(QGraphicsView::DontAdjustForAntialiasing); @@ -66,10 +66,6 @@ void ChatView::init(MessageFilter *filter) { _scrollTimer.setSingleShot(true); connect(&_scrollTimer, SIGNAL(timeout()), SLOT(scrollTimerTimeout())); - _resizeTimer.setInterval(100); - _resizeTimer.setSingleShot(true); - connect(&_resizeTimer, SIGNAL(timeout()), SLOT(resizeTimerTimeout())); - _scene = new ChatScene(filter, filter->idString(), viewport()->width() - 4, this); // see below: resizeEvent() connect(_scene, SIGNAL(sceneRectChanged(const QRectF &)), this, SLOT(sceneRectChanged(const QRectF &))); connect(_scene, SIGNAL(lastLineChanged(QGraphicsItem *, qreal)), this, SLOT(lastLineChanged(QGraphicsItem *, qreal))); @@ -109,10 +105,6 @@ bool ChatView::event(QEvent *event) { void ChatView::resizeEvent(QResizeEvent *event) { QGraphicsView::resizeEvent(event); - _resizeTimer.start(); -} - -void ChatView::resizeTimerTimeout() { // we can reduce viewport updates if we scroll to the bottom allready at the beginning verticalScrollBar()->setValue(verticalScrollBar()->maximum()); diff --git a/src/qtui/chatview.h b/src/qtui/chatview.h index 8ebe3a57..6f385bb7 100644 --- a/src/qtui/chatview.h +++ b/src/qtui/chatview.h @@ -68,7 +68,6 @@ private slots: void lastLineChanged(QGraphicsItem *chatLine, qreal offset); void mouseMoveWhileSelecting(const QPointF &scenePos); void scrollTimerTimeout(); - void resizeTimerTimeout(); void styleChanged(); private: @@ -80,7 +79,6 @@ private: qreal _currentScaleFactor; QTimer _scrollTimer; int _scrollOffset; - QTimer _resizeTimer; }; -- 2.20.1