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:
parent
7ec54c972c
commit
5668606159
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user