nurupo / ProjectTox-Qt-GUI

A cross-platform front end for ProjectTox Core library, written in C++11 with use of Qt5
GNU General Public License v3.0
341 stars 116 forks source link

Reimplement Message Display widget #62

Closed nurupo closed 10 years ago

nurupo commented 10 years ago

Discussed in https://github.com/nurupo/ProjectTox-Qt-GUI/pull/60

In short, current implementation of the Message Display consumes too much memory and requires a lot of cpu time for processing, which freezes GUI for seconds, as number of messages grows. That's definitely something undesired, so we need to change the implementation of it. It was decided to use Quassel's QGraphicsView-based Message Display implementation which has better performance. Use of QTextEdit for Message Display was rejected in favor of benefits Quassel's solution has.

Schlumpf said that he will take a look into this after finishing working on new Friend Request widget.

Schlumpf commented 10 years ago

Short update from new messages widget: Basic Quassel-like chat works :) But now I have do change several things to implement smileys.

nurupo commented 10 years ago

Sounds great!

Could you explain how are you going to add smiley support, what will you change in original implementation?

Schlumpf commented 10 years ago

Currently the text rendering is done by hand. That's mean, Quassel calculetes the line braking and paints these lines by QTextLayout. This approach doesn't allow painting anything else than text, text with formatting is possible, but only text. The text selecting and rendering is done by hand, too.

Now I try to replace the manual text layouting by QTextDocument, which supports images. QTextDocument would do the line braking and layouting formated text and images. It's a bit tricky to paint a QTextDocument without using the QTextEdit widget, that's what I doing currently.

nurupo commented 10 years ago

Closing the issue, Quassel-like message view got merged in.