Didac Perez Parera
Didac Perez Parera

Reputation: 3824

Best widget for a chat session in Qt

I am implementing a Desktop Qt application which uses an XMPP library to chat. I am trying to find the best approach in terms of performance, easy to modify, add custom stuff (for instance, show a thumbnain if someone sends me an image)... I would like to know which approach do you think is the best: - Each element as a layout or widget and add them one by one (it seems to be slow) - ListWidget items overloading paint event (problem: don't know item height before painting) - Use a rich text widget and build the chat as a HTML page (didn't tried it yet) - ??

Best regards,

Upvotes: 2

Views: 635

Answers (2)

user1234567
user1234567

Reputation: 1842

QListView would be good for simple IRC chat. If you are planning to implement some advanced text styling (different fonts, etc.) or images (like you said) WebView is the way to go. Additionally, much simpler way than QListView.

There's even an example Qt Google Chat project which uses QtWebKit: http://harmattan-dev.nokia.com/docs/library/html/qt4/webkit-googlechat.html

Upvotes: 3

evilruff
evilruff

Reputation: 4085

I would go for QListView with model attached and custom delegates etc..

Upvotes: 0

Related Questions