1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Speed-up rendering

This commit is contained in:
krepa098 2015-01-31 17:39:25 +01:00
parent 7ec54c972c
commit 5668606159
2 changed files with 6 additions and 2 deletions

View File

@ -42,7 +42,7 @@ ChatLog::ChatLog(QWidget* parent)
// Create the scene // Create the scene
busyScene = new QGraphicsScene(this); busyScene = new QGraphicsScene(this);
scene = new QGraphicsScene(this); scene = new QGraphicsScene(this);
scene->setItemIndexMethod(QGraphicsScene::NoIndex); //Bsp-Tree is actually slower in this case scene->setItemIndexMethod(QGraphicsScene::BspTreeIndex);
setScene(scene); setScene(scene);
// Cfg. // Cfg.
@ -380,6 +380,7 @@ void ChatLog::insertChatlineOnTop(const QList<ChatLine::Ptr>& newLines)
{ {
l->addToScene(scene); l->addToScene(scene);
l->setRow(--n); l->setRow(--n);
l->visibilityChanged(false);
lines.prepend(l); lines.prepend(l);
} }

View File

@ -17,6 +17,7 @@
#include "spinner.h" #include "spinner.h"
#include <QPainter> #include <QPainter>
#include <QGraphicsScene>
#include <QDebug> #include <QDebug>
Spinner::Spinner(const QString &img, QSize Size, qreal speed) Spinner::Spinner(const QString &img, QSize Size, qreal speed)
@ -79,5 +80,7 @@ qreal Spinner::getAscent() const
void Spinner::timeout() void Spinner::timeout()
{ {
rot += rotSpeed; rot += rotSpeed;
update();
if(scene())
scene()->invalidate(sceneBoundingRect());
} }